Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix serialization of HTML void elements when they have children
https://bugs.webkit.org/show_bug.cgi?id=162418

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/html/syntax/serializing-html-fragments/serializing-expected.txt:

Source/WebCore:

Fix serialization of HTML void elements when they have children.

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

Relevant specification:
- https://html.spec.whatwg.org/#html-fragment-serialisation-algorithm

In particular, this part:
""
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.

No new tests, rebaselined existing test.

* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::serializeNodesWithNamespaces):


Canonical link: https://commits.webkit.org/180410@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206266 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
cdumez committed Sep 22, 2016
1 parent 6878fa6 commit bfba854
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 131 deletions.
11 changes: 11 additions & 0 deletions LayoutTests/imported/w3c/ChangeLog
@@ -1,3 +1,14 @@
2016-09-22 Chris Dumez <cdumez@apple.com>

Fix serialization of HTML void elements when they have children
https://bugs.webkit.org/show_bug.cgi?id=162418

Reviewed by Darin Adler.

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/html/syntax/serializing-html-fragments/serializing-expected.txt:

2016-09-22 Youenn Fablet <youenn@apple.com>

Sync web-platform-tests up to revision 3801ab5
Expand Down

0 comments on commit bfba854

Please sign in to comment.