This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing 4 changed files with 174 additions and 131 deletions.