Bug 162418 - Fix serialization of HTML void elements when they have children
Summary: Fix serialization of HTML void elements when they have children
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: WebExposed
Depends on:
Blocks:
 
Reported: 2016-09-22 10:52 PDT by Chris Dumez
Modified: 2016-09-22 11:49 PDT (History)
6 users (show)

See Also:


Attachments
Patch (33.52 KB, patch)
2016-09-22 11:03 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.