Closed Bug 590416 Opened 15 years ago Closed 15 years ago

[HTML5]misnested tag parsing problem

Categories

(Core :: DOM: HTML Parser, defect)

x86
Windows XP
defect
Not set
minor

Tracking

()

RESOLVED INVALID

People

(Reporter: masa141421356, Unassigned)

Details

Attachments

(1 file)

Attached file testcase
Mozilla/5.0 (Windows NT 5.1; rv:2.0b4pre) Gecko/20100809 Minefield/4.0b4pre When html5parser is enabled, Misnested html <p><code id="c">foo</p><p id="p2">bar</code></p> is parsed as <p><code id="c">foo</code></p><p id="p2"><code id="c">bar</code></p> (parent node of "bar" has id "c") Is this correct behavior ? I think it should be parsed as <p><code id="c">foo</code></p><p id="p2"><code>bar</code></p> Steps to reproduce: 1.enable html5 parser 2.open testcase Expected result: color of "bar" is green Actual result: color of "bar" is red. FYI: When html5 parser is disabled, color of "bar" is orange because it is parsed as <p><code id="c">foo</code></p><p id="p2">bar</p>
> color of "bar" is red. Also red in Webkit, note. And the HTML5 spec parser's handling of this sort of markup was largely modeled on webkit. > Is this correct behavior ? Per the HTML5 spec, yes. See http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#adoptionAgency item 6 sub-item 4. Note that a "token" in this case includes all the attributes of the element (e.g. see http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#before-attribute-name-state the "Anything else" case).
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: