Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ad0df6b5fc559495186c05e36ba8978a84501356
https://github.com/WebKit/WebKit/commit/ad0df6b5fc559495186c05e36ba8978a84501356
Author: Charlie Wolfe <[email protected]>
Date: 2026-09-28 (Mon, 28 Sep 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-and-script-in-style-expected.txt
M Source/WebCore/dom/InlineStyleSheetOwner.cpp
Log Message:
-----------
<style> sheet should be built from child text content, not descendant text
https://bugs.webkit.org/show_bug.cgi?id=324778
rdar://188047912
Reviewed by Anne van Kesteren.
InlineStyleSheetOwner::createSheetFromTextContents() used
TextNodeTraversal::contentsAsString(),
which concatenates the text of all descendants. Text belonging to a nested
element child, such as a
<script>, was therefore parsed as part of the stylesheet, and CSS error
recovery swallowed the rules
that followed it.
The HTML spec builds the sheet from the style element's child text content, so
use
TextNodeTraversal::childTextContent() instead.
*
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/insertion-removing-steps/Node-appendChild-text-and-script-in-style-expected.txt:
* Source/WebCore/dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheetFromTextContents):
Canonical link: https://commits.webkit.org/322128@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications