Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cc88e187434c925bf02197e657aca51d212963ef
      
https://github.com/WebKit/WebKit/commit/cc88e187434c925bf02197e657aca51d212963ef
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-10-08 (Thu, 08 Oct 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/cssom/insertRule-page-detached-grouping-rule-crash.html
    M Source/WebCore/css/parser/CSSParser.cpp

  Log Message:
  -----------
  Null dereference in CSSParser::parsePageSelector() when inserting an @page 
rule into a detached CSSGroupingRule
https://bugs.webkit.org/show_bug.cgi?id=326788
rdar://189494639

Reviewed by Tim Nguyen.

When a CSSGroupingRule has been removed from its style sheet, insertRule() 
passes a null
StyleSheetContents to CSSParser::parseRule(). @page is allowed at that level, so
parsePageSelector() runs, and for any @page prelude that has a type selector
(e.g. "@page foo {}") it dereferences styleSheet->defaultNamespace(), crashing.

Fall back to starAtom() when there is no style sheet, which is what
CSSSelectorParser::defaultNamespace() does and the default namespace of a
StyleSheetContents with no @namespace rule.

Test: 
imported/w3c/web-platform-tests/css/cssom/insertRule-page-detached-grouping-rule-crash.html

* 
LayoutTests/imported/w3c/web-platform-tests/css/cssom/insertRule-page-detached-grouping-rule-crash.html:
 Added.
* Source/WebCore/css/parser/CSSParser.cpp:
(WebCore::CSSParser::parsePageSelector):

Canonical link: https://commits.webkit.org/323133@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to