Opened 9 years ago

Closed 8 years ago

#11571 closed defect (fixed)

XHTML validation of dijit components

Reported by: Inarus Owned by: bill
Priority: high Milestone: 1.7
Component: Dijit Version: 1.5
Keywords: Cc:
Blocked By: Blocking:

Description

In dijit/form/ComboBox.js:
Two errors that have come up, first we have two cases of readOnly not having their attribute values' set, i.e. they should be readonly="readonly". XHTML also demands that these attributes be purely lowercase, not camel cased. Reading other bug reports here though, I see that this may cause problems in IE. The other problem in this class is value=\"Χ \" which is not a valid XML charachter entity, this can be corrected by replacing with it's NCR i.e. Χ.

In dijit/form/ValidationTextBox.js
Same with the readonly and Chi as above. Additionally there are unclosed hidden inputs, change required as below line 153. Note additional closing /.

this.valueNode=dojo.place("<input type='hidden'"+(this.name?" name='"+this.name+"'":"")+"/>",this.textbox,"after");

In dijit/form/_Spinner.js
Another readOnly (this was done by pure text search, not used this)

dijit/_editor/plugins/FontChoice.js
Attribute values not quoted, see

<input dojoType='dijit.form.FilteringSelect' required=false labelType=html labelAttr=label searchAttr=name

should be

<input dojoType='dijit.form.FilteringSelect' required='false' labelType='html' labelAttr='label' searchAttr='name'

Or perhaps even with double quotes ;). This looks like a copy-paste out of dijit/dijit-all.js

dijit/_editor/plugins/LinkDialog.js
Three inputs have missing closing tags, these are added to the end, i.e. '>' to '/>'.

dijit/Menu.js
cellspacing=0 missing quotes, this again seems to be a copy/paste error from dijit/dijit-all.js.

I am willing to commit these changes (and any new ones I find), but I can't find any info as to how to do this. If someone can point me in the right direction, it would be much appreciated.

Attachments (1)

ValidationTextBox[1].diff (7.4 KB) - added by mctom987 9 years ago.
Unified diff file for dijit/form/templates/ValidationTextBox.html

Download all attachments as: .zip

Change History (10)

comment:1 Changed 9 years ago by bill

Milestone: 1.5.11.6
Priority: highnormal
severity: criticalnormal

Hi Inarus, thanks for the report!

XHTML also demands that these attributes be purely lowercase, not camel cased. Reading other bug reports here though, I see that this may cause problems in IE.

Right, we can't make them lowercase, the best we can do is to start using the data-dojo-type thing introduced into #11490 but that's not working yet for widgetsInTemplate.

This looks like a copy-paste out of dijit/dijit-all.js

Actually dijit-all.js is a generated file.

I am willing to commit these changes (and any new ones I find), but I can't find any info as to how to do this. If someone can point me in the right direction, it would be much appreciated.

Please file a CLA and then attach (attach file) an SVN patch file here. (You need to have a history of contributions before we make you a committer to the project.)

comment:2 Changed 9 years ago by bill

Owner: set to bill
Status: newassigned

No response from reporter, so I'll just check in these changes. Turns out the readonly flags aren't used for widgets, but on plain DOMNodes, so I can fix the case.

PS: I don't see a problem in _Spinner.js.

Changed 9 years ago by mctom987

Attachment: ValidationTextBox[1].diff added

Unified diff file for dijit/form/templates/ValidationTextBox.html

comment:3 Changed 9 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [22769]) Make templates etc. XHTML friendly, fixes #11571 !strict

comment:4 Changed 9 years ago by bill

Milestone: 1.61.6.1
Resolution: fixed
Status: closedreopened

Missed one in ScrollingTabController.

comment:5 Changed 9 years ago by bill

Resolution: fixed
Status: reopenedclosed

(In [24413]) fix missing quotes around attribute value, fixes #11571 and hopefully fixes #2332.

comment:6 Changed 9 years ago by bill

(In [24414]) merging from trunk/ to 1.6/: fix missing quotes around attribute value, fixes #11571 and hopefully fixes #2332.

comment:7 Changed 8 years ago by Inarus

Resolution: fixed
Status: closedreopened

Just playing around with the lovely 1.7b5 released with my sites. Everything ran absolutely perfectly until I started using the dijitTimeTextBox. Whereby I receive javascript errors over the use of &nbsp; doing a quick search through the code, I see quite a few of these blighters have managed to [remain | be reintroduced].

For reference, it is "&#160;" that should be used instead. This should also further fix #2332 as this causes the same error with regards an illegal string.

Did you figure out how to set a mime type of application/xhtml+xml btw? It is fairly easy to do with php for example:

<?php header('Content-type: application/xhtml+xml; charset=UTF-8') ?>
Last edited 8 years ago by Inarus (previous) (diff)

comment:8 Changed 8 years ago by bill

Milestone: 1.6.11.7

OK, I guess I can change those occurrences, although I'm reluctant to spend time supporting such a rare format as XHTML. I'm not going to actually run and test in XHTML; note that the dojo tests are in HTML, not PHP.

comment:9 Changed 8 years ago by bill

Resolution: fixed
Status: reopenedclosed

In [26523]:

Use &#160; rather than &nbsp; for XHTML support, fixes #11571 again, !strict.

Note: See TracTickets for help on using tickets.