Closed Bug 568800 Opened 9 years ago Closed 9 years ago

[HTML5] Equals sign (=) should not finish a named character reference in attribute values

Categories

(Core :: HTML: Parser, defect, P2)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: abarth-mozilla, Assigned: hsivonen)

Details

Attachments

(1 file, 1 obsolete file)

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.3a5pre) Gecko/20100524 Minefield/3.7a5pre

Test 5 of 13 in resources/entities02.dat failed. Input:
<div bar="ZZ&gt=YY"></div>
Got:
| <html>
|   <head>
|   <body>
|     <div>
|       bar="ZZ>=YY"
Expected:
| <html>
|   <head>
|   <body>
|     <div>
|       bar="ZZ&gt=YY"

http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#consume-a-character-reference says:
[[
If the character reference is being consumed as part of an attribute, and the last character matched is not a U+003B SEMICOLON character (;), and the next character is either a U+003D EQUALS SIGN character (=) or in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), U+0041 LATIN CAPITAL LETTER A to U+005A LATIN CAPITAL LETTER Z, or U+0061 LATIN SMALL LETTER A to U+007A LATIN SMALL LETTER Z, then, for historical reasons, all the characters that were matched after the U+0026 AMPERSAND character (&) must be unconsumed, and nothing is returned.
]]
Yeah, this is a recent spec change that hasn't made its way to code yet.
Priority: -- → P2
Summary: HTML entities in attributes not parsed correctly by HTML5 parser → [HTML5] HTML entities in attributes not parsed correctly by HTML5 parser
Spec rev:
http://html5.org/tools/web-apps-tracker?from=4958&to=4959

I pushed a test case to the html5lib repo:
http://code.google.com/p/html5lib/source/diff?spec=svn9400c96b0f8fe2810350fd65df739a40e9daee9e&r=9400c96b0f8fe2810350fd65df739a40e9daee9e&format=side&path=/testdata/tokenizer/entities.test

We are supposed to pull the html5lib tests into m-c eventually, but that has been in a limbo for quite some time now.
Assignee: nobody → hsivonen
Status: NEW → ASSIGNED
Attachment #448364 - Flags: review?(jonas)
Summary: [HTML5] HTML entities in attributes not parsed correctly by HTML5 parser → [HTML5] Equals sign (=) should not finish a named character reference in attribute values
Forgot to update the WHATWG copyright year in all relevant places.
Attachment #448364 - Attachment is obsolete: true
Attachment #448467 - Flags: review?(jonas)
Attachment #448364 - Flags: review?(jonas)
Thanks. Landed.
http://hg.mozilla.org/mozilla-central/rev/1643049fe4d3
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.