Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8bac746b3a579d8bf79c0a702bb7ccc5be893b3c
      
https://github.com/WebKit/WebKit/commit/8bac746b3a579d8bf79c0a702bb7ccc5be893b3c
  Author: Antti Koivisto <[email protected]>
  Date:   2026-04-02 (Thu, 02 Apr 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    M Source/WebCore/Headers.cmake
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    A Source/WebCore/css/CSSNamespacePrefixMap.h
    M Source/WebCore/css/CSSSubstitutionValue.cpp
    M Source/WebCore/css/CSSSubstitutionValue.h
    M Source/WebCore/css/StyleSheetContents.cpp
    M Source/WebCore/css/StyleSheetContents.h
    M Source/WebCore/css/parser/CSSParser.cpp
    M Source/WebCore/css/parser/CSSPropertyParser.cpp
    M Source/WebCore/css/parser/CSSPropertyParser.h
    M Source/WebCore/css/parser/CSSSubstitutionParser.cpp
    M Source/WebCore/css/parser/CSSSubstitutionParser.h
    M Source/WebCore/css/typedom/CSSStyleValueFactory.cpp
    M Source/WebCore/css/typedom/CSSUnparsedValue.cpp
    M Source/WebCore/style/StyleSubstitutionResolver.cpp
    M Source/WebCore/style/StyleSubstitutionResolver.h

  Log Message:
  -----------
  [css-values-5 attr()] Resolve namespaces
https://bugs.webkit.org/show_bug.cgi?id=311331
rdar://173920192

Reviewed by Alan Baradlay.

@namespace foo "some_url";
div { color: attr(foo|bar) }

For this we need to pass the namespace prefix map from the originating 
stylesheet to SubstitutionResolver.

* LayoutTests/TestExpectations:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/css/CSSNamespacePrefixMap.h: Added.

Move the map to a header.
For simplicity we'll copy this map instead of say refcounting it as in practice
it is basically always empty and so just a nullptr.

* Source/WebCore/css/CSSSubstitutionValue.cpp:
(WebCore::CSSSubstitutionValue::CSSSubstitutionValue):
(WebCore::CSSSubstitutionValue::create):
* Source/WebCore/css/CSSSubstitutionValue.h:

Include the namespace map in subtitution value.

* Source/WebCore/css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::StyleSheetContents):
(WebCore::StyleSheetContents::parserAddNamespace):
(WebCore::StyleSheetContents::namespaceURIFromPrefix):
(WebCore::StyleSheetContents::namespacePrefixMap const):
* Source/WebCore/css/StyleSheetContents.h:
* Source/WebCore/css/parser/CSSParser.cpp:
(WebCore::CSSParser::consumeCustomPropertyValue):
(WebCore::CSSParser::consumeDeclarationValue):
* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::consumeStyleProperty):
(WebCore::CSSPropertyParser::parseValue):
* Source/WebCore/css/parser/CSSPropertyParser.h:
(WebCore::CSSPropertyParser::parseValue):
* Source/WebCore/css/parser/CSSSubstitutionParser.cpp:
(WebCore::CSSSubstitutionParser::parseDeclarationValue):
* Source/WebCore/css/parser/CSSSubstitutionParser.h:
(WebCore::CSSSubstitutionParser::parseDeclarationValue):
* Source/WebCore/css/typedom/CSSStyleValueFactory.cpp:
(WebCore::CSSStyleValueFactory::constructStyleValueForShorthandSerialization):
* Source/WebCore/css/typedom/CSSUnparsedValue.cpp:
(WebCore::CSSUnparsedValue::toCSSValue const):
* Source/WebCore/style/StyleSubstitutionResolver.cpp:
(WebCore::Style::SubstitutionResolver::substituteAttrFunction):

Look up the namespace URL from the prefix map.

(WebCore::Style::SubstitutionResolver::substitute):
* Source/WebCore/style/StyleSubstitutionResolver.h:

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



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

Reply via email to