[webkit-changes] [WebKit/WebKit] f49785: [CSS typed OM] CSSStyleValue.parse only accepts pr...

Antti Koivisto noreply at github.com
Wed Apr 26 08:46:03 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f49785eb803f8aed5467030e895fe5047f7613b3
      https://github.com/WebKit/WebKit/commit/f49785eb803f8aed5467030e895fe5047f7613b3
  Author: Antti Koivisto <antti at apple.com>
  Date:   2023-04-26 (Wed, 26 Apr 2023)

  Changed paths:
    A LayoutTests/fast/css/css-typed-om/style-property-map-clip-path-crash-expected.txt
    A LayoutTests/fast/css/css-typed-om/style-property-map-clip-path-crash.html
    M Source/WebCore/css/typedom/CSSStyleValue.cpp
    M Source/WebCore/css/typedom/CSSStyleValue.h
    M Source/WebCore/css/typedom/CSSStyleValue.idl
    M Source/WebCore/css/typedom/CSSStyleValueFactory.cpp
    M Source/WebCore/css/typedom/CSSStyleValueFactory.h
    M Source/WebCore/css/typedom/MainThreadStylePropertyMapReadOnly.cpp
    M Source/WebCore/css/typedom/StylePropertyMap.cpp

  Log Message:
  -----------
  [CSS typed OM] CSSStyleValue.parse only accepts properties that are enabled in strictCSSParserContext
https://bugs.webkit.org/show_bug.cgi?id=255979
rdar://108249093

Reviewed by Chris Dumez.

We currently pass strictCSSParserContext() to the CSSParser which does not respect any per-document settings.
This creates a discrepancy between which properties are allowed by which API.

Fix by passing a document-derived context to the parsing functions.

* LayoutTests/fast/css/css-typed-om/style-property-map-clip-path-crash-expected.txt: Added.
* LayoutTests/fast/css/css-typed-om/style-property-map-clip-path-crash.html: Added.
* Source/WebCore/css/typedom/CSSStyleValue.cpp:
(WebCore::CSSStyleValue::parse):
(WebCore::CSSStyleValue::parseAll):
* Source/WebCore/css/typedom/CSSStyleValue.h:
* Source/WebCore/css/typedom/CSSStyleValue.idl:

Pass the document.

* Source/WebCore/css/typedom/CSSStyleValueFactory.cpp:
(WebCore::CSSStyleValueFactory::constructStyleValueForShorthandSerialization):
(WebCore::CSSStyleValueFactory::extractCSSValue):
(WebCore::CSSStyleValueFactory::extractShorthandCSSValues):
(WebCore::CSSStyleValueFactory::parseStyleValue):
(WebCore::CSSStyleValueFactory::vectorFromStyleValuesOrStrings):
* Source/WebCore/css/typedom/CSSStyleValueFactory.h:
* Source/WebCore/css/typedom/MainThreadStylePropertyMapReadOnly.cpp:
(WebCore::MainThreadStylePropertyMapReadOnly::get const):
(WebCore::MainThreadStylePropertyMapReadOnly::getAll const):
* Source/WebCore/css/typedom/StylePropertyMap.cpp:
(WebCore::StylePropertyMap::set):
(WebCore::StylePropertyMap::append):

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




More information about the webkit-changes mailing list