Bug 162418

Summary: Fix serialization of HTML void elements when they have children
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, cdumez, commit-queue, darin, rniwa, sam
Priority: P2 Keywords: WebExposed
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Chris Dumez 2016-09-22 10:52:30 PDT
Fix serialization of HTML void elements when they have children.

Void elements (such as <hr>) cannot have a closing tag. When encountering them, we properly do not serialize the void element's children, however, we incorrectly append an end tag (because the element technically has children).

Relevant specification:
- https://html.spec.whatwg.org/#html-fragment-serialisation-algorithm
""
If current node is an area, base, basefont, bgsound, br, col, embed, frame, hr, img, input, keygen, link, meta, param, source, track or wbr element, then continue on to the next child node at this point.
""

Firefox matches the specification.
Comment 1 Chris Dumez 2016-09-22 11:03:24 PDT
Created attachment 289579 [details]
Patch
Comment 2 WebKit Commit Bot 2016-09-22 11:49:50 PDT
Comment on attachment 289579 [details]
Patch

Clearing flags on attachment: 289579

Committed r206266: <http://trac.webkit.org/changeset/206266>
Comment 3 WebKit Commit Bot 2016-09-22 11:49:56 PDT
All reviewed patches have been landed.  Closing bug.