Bug 43128 - Self Closing Tags Parsed with Attributes
Summary: Self Closing Tags Parsed with Attributes
Status: RESOLVED DUPLICATE of bug 21076
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P5 Minor
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-28 10:48 PDT by stanaland
Modified: 2010-09-13 18:18 PDT (History)
2 users (show)

See Also:


Attachments
Example HTML File (1.45 KB, text/html)
2010-07-28 10:48 PDT, stanaland
no flags Details
Updated Example HTML File (1.45 KB, text/html)
2010-08-02 15:14 PDT, stanaland
no flags Details
Updated Example HTML File (Corrected) (1.31 KB, text/html)
2010-08-02 15:20 PDT, stanaland
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description stanaland 2010-07-28 10:48:52 PDT
Created attachment 62847 [details]
Example HTML File

I have found that when attributes do not have quotes, a self closing tag can cause a minor parse problem.  For Example:

<input type="button" type=button tabindex=1 value=Test/>
<input name="title" type="text" id="title"  maxLength=255 value="" tabindex=1/>

The forward slash is counted as part of the last attribute.  Quotes on the attribute or a space before the forward slash fixes this.  I have attached an HTML file that shows this behavior.  In the example, the button text shows the forward slash and the tabindexes like the above are skipped when tabbing through the fields.

Note: I am not arguing whether the above HTML is valid, but it would help with compatibility with other browsers.
Comment 1 Adam Barth 2010-08-02 14:04:34 PDT
Thanks for the report.  Believe our behavior now matches Internet Explorer, Firefox, and the HTML5 specification.  For example, I loaded you example file in Firefox 3.6, Firefox 4.0b, and IE8.  In all these browsers the button at the bottom right reads "Test/".

Am I misunderstanding your test case?  Your report asks for better compatibility with other browsers, but my understanding is that we're achieving that with this change.
Comment 2 stanaland 2010-08-02 15:14:27 PDT
Created attachment 63265 [details]
Updated Example HTML File

Interesting.  I noticed the behavior in regards to the tabindex attribute, where Chrome & Safari *are* behaving differently from IE and Firefox.  But you are right that the button example displays the same on all the browsers I tested (my mistake...bad example).  Try using the tab key to go through the inputs to see the issue that I am talking about.

After further testing, it seems that all the browsers I tested, including Webkit browsers, generally ignore trailing symbols at the end of most numerical attributes (tabindex, size, etc).  However, Webkit browsers seems to be the only browsers that do not tolerate a symbol at the end of the tabindex attribute.

I have attached an updated example showing how size=3# is accepted by all tested browsers, but tabindex=1# is only ignored by Chrome & Safari.
Comment 3 stanaland 2010-08-02 15:20:22 PDT
Created attachment 63267 [details]
 Updated Example HTML File (Corrected)

Ooops, here is the correct updated attachment.
Comment 4 Adam Barth 2010-08-02 15:56:53 PDT
Does the same issue occur if you use quotes around the attribute value?  It sounds like we need to loosen up our parsing of tabindex (and possibly other numerical attributes) to tolerate trailing non-digits.
Comment 5 Adam Barth 2010-09-13 18:18:25 PDT

*** This bug has been marked as a duplicate of bug 21076 ***