Opened 8 years ago

Closed 8 years ago

#4527 closed Bug (fixed)

Checkbox command generates invalid HTML

Reported by: Wiktor Walc Owned by: Garry Yao
Priority: Normal Milestone: CKEditor 3.1
Component: UI : Dialogs Version: SVN (CKEditor) - OLD
Keywords: Confirmed Review+ Cc:

Description

According to W3 spec: http://www.w3.org/TR/html4/interact/forms.html#edef-INPUT (value of attribute "checked" cannot be "true"; must be one of "checked"), the following code is wrong:

<input checked="true" name="sdfs" type="checkbox" value="sdf" />

Instead of checked="true" we should generate checked="checked".

Attachments (2)

4527.patch (2.3 KB) - added by Garry Yao 8 years ago.
4527_2.patch (4.7 KB) - added by Garry Yao 8 years ago.

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by Garry Yao

Attachment: 4527.patch added

comment:1 Changed 8 years ago by Garry Yao

Keywords: Review? added
Owner: set to Garry Yao
Status: newassigned

comment:2 Changed 8 years ago by Garry Yao

Component: GeneralUI : Dialogs
Version: SVN (CKEditor)

comment:3 Changed 8 years ago by Frederico Caldeira Knabben

Keywords: Review- added; Review? removed

Is the "default IE values" cleanup really needed? It looks more like a bug in the dialog code. It's strange that the defaults are not there when creating a new checkbox, just when editing it.

Changed 8 years ago by Garry Yao

Attachment: 4527_2.patch added

comment:4 Changed 8 years ago by Garry Yao

Keywords: Review? added; Review- removed

Is the "default IE values" cleanup really needed?

  1. It turns out that the cleanup for 'value' is needed, IE's nodeValue for 'value' attr is always 'on', even worse we'll find it on html output as well.
  2. It's proved that 'checked' value cleanup is the right place to fix, it's was not long after I read the nodeName Hell article then it landed in our editor, but with a different scene that in our case is the nodeName of a AttrNode that hurt, instead of a Element - IE always return upper-case for 'CHECKED'.

Ticket Test added at :
http://ckeditor.t/tt/4527/1.html. http://ckeditor.t/tt/4527/2.html.

comment:5 Changed 8 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed

comment:6 Changed 8 years ago by Garry Yao

Resolution: fixed
Status: assignedclosed

Fixed with [4547].

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy