[webkit-changes] [WebKit/WebKit] dcf5f3: Add initial support for StylePropertyMap

Chris Dumez noreply at github.com
Tue Oct 25 09:14:34 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: dcf5f3833e1e5ec71762095a6ce457638e96b8a9
      https://github.com/WebKit/WebKit/commit/dcf5f3833e1e5ec71762095a6ce457638e96b8a9
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2022-10-25 (Tue, 25 Oct 2022)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-typed-om-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/typedom-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/declared-styleMap-accepts-inherit-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/idlharness-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/set-var-reference-thcrash-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/stylevalue-serialization/cssStyleValue-cssom-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/append.tentative-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/clear-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/declared.tentative-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/delete-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/delete-shorthand-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/get-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/get-shorthand-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/getAll-shorthand-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/getAll.tentative-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/has.tentative-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/iterable.tentative-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/set-shorthand-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/set.tentative-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/append.tentative-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/clear-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/delete-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/delete-shorthand-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/get-invalid-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/get-shorthand-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/getAll-shorthand-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/getAll.tentative-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/has.tentative-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/iterable.tentative-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/set-shorthand-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/set.tentative-expected.txt
    M Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.h
    M Source/WebCore/Modules/fetch/FetchHeaders.h
    M Source/WebCore/Modules/filesystemaccess/FileSystemDirectoryHandle.cpp
    M Source/WebCore/Modules/filesystemaccess/FileSystemDirectoryHandle.h
    M Source/WebCore/Modules/webxr/WebXRHand.h
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/bindings/js/JSDOMAsyncIterator.h
    M Source/WebCore/bindings/js/JSDOMIterator.h
    M Source/WebCore/css/CSSPendingSubstitutionValue.h
    M Source/WebCore/css/CSSStyleRule.cpp
    M Source/WebCore/css/CSSStyleRule.h
    M Source/WebCore/css/CSSStyleRule.idl
    M Source/WebCore/css/FontFaceSet.h
    M Source/WebCore/css/typedom/ComputedStylePropertyMapReadOnly.cpp
    M Source/WebCore/css/typedom/ComputedStylePropertyMapReadOnly.h
    A Source/WebCore/css/typedom/DeclaredStylePropertyMap.cpp
    A Source/WebCore/css/typedom/DeclaredStylePropertyMap.h
    A Source/WebCore/css/typedom/StylePropertyMap.cpp
    M Source/WebCore/css/typedom/StylePropertyMap.h
    M Source/WebCore/css/typedom/StylePropertyMap.idl
    M Source/WebCore/css/typedom/StylePropertyMapReadOnly.cpp
    M Source/WebCore/css/typedom/StylePropertyMapReadOnly.h
    M Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl
    M Source/WebCore/dom/NodeList.h
    M Source/WebCore/dom/StyledElement.cpp
    M Source/WebCore/dom/StyledElement.h
    M Source/WebCore/html/CustomPaintImage.cpp
    M Source/WebCore/html/DOMFormData.h
    M Source/WebCore/html/URLSearchParams.h

  Log Message:
  -----------
  Add initial support for StylePropertyMap
https://bugs.webkit.org/show_bug.cgi?id=246828

Reviewed by Youenn Fablet.

Add initial support for StylePropertyMap:
- https://drafts.css-houdini.org/css-typed-om/#stylepropertymap

This patch introduces the CSSStyleRule.styleMap property, which returns a declared StylePropertyMap:
- https://drafts.css-houdini.org/css-typed-om/#declared-stylepropertymap-objects

For now, we have decent support for get() / has() / clear() / delete().
set() and append() and not yet supported and throw for now.

* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/declared-styleMap-accepts-inherit-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/idlharness-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/set-var-reference-thcrash-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/append.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/clear-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/declared.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/delete-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/delete-shorthand-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/get-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/get-shorthand-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/getAll-shorthand-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/getAll.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/has.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/iterable.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/set-shorthand-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/declared/set.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/append.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/clear-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/delete-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/delete-shorthand-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/getAll-shorthand-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/getAll.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/has.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/iterable.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/set-shorthand-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/inline/set.tentative-expected.txt:
* Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.h:
(WebCore::MediaKeyStatusMap::createIterator):
* Source/WebCore/Modules/fetch/FetchHeaders.h:
(WebCore::FetchHeaders::createIterator):
* Source/WebCore/Modules/filesystemaccess/FileSystemDirectoryHandle.cpp:
(WebCore::FileSystemDirectoryHandle::createIterator):
* Source/WebCore/Modules/filesystemaccess/FileSystemDirectoryHandle.h:
* Source/WebCore/Modules/webxr/WebXRHand.h:
(WebCore::WebXRHand::createIterator):
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/bindings/js/JSDOMAsyncIterator.h:
(WebCore::JSDOMAsyncIteratorBase::JSDOMAsyncIteratorBase):
* Source/WebCore/bindings/js/JSDOMIterator.h:
(WebCore::JSDOMIteratorBase::JSDOMIteratorBase):
(WebCore::iteratorForEach):
* Source/WebCore/css/CSSStyleRule.cpp:
(WebCore::CSSStyleRule::CSSStyleRule):
(WebCore::CSSStyleRule::styleMap):
* Source/WebCore/css/CSSStyleRule.h:
* Source/WebCore/css/CSSStyleRule.idl:
* Source/WebCore/css/FontFaceSet.h:
* Source/WebCore/css/typedom/ComputedStylePropertyMapReadOnly.cpp:
(WebCore::ComputedStylePropertyMapReadOnly::get const):
(WebCore::ComputedStylePropertyMapReadOnly::getAll const):
(WebCore::ComputedStylePropertyMapReadOnly::has const):
(WebCore::ComputedStylePropertyMapReadOnly::entries const):
* Source/WebCore/css/typedom/ComputedStylePropertyMapReadOnly.h:
* Source/WebCore/css/typedom/DeclaredStylePropertyMap.cpp: Added.
(WebCore::DeclaredStylePropertyMap::create):
(WebCore::DeclaredStylePropertyMap::DeclaredStylePropertyMap):
(WebCore::DeclaredStylePropertyMap::size const):
(WebCore::DeclaredStylePropertyMap::entries const):
(WebCore::DeclaredStylePropertyMap::propertyValue const):
(WebCore::DeclaredStylePropertyMap::customPropertyValue const):
(WebCore::DeclaredStylePropertyMap::removeProperty):
(WebCore::DeclaredStylePropertyMap::removeCustomProperty):
(WebCore::DeclaredStylePropertyMap::styleRule const):
(WebCore::DeclaredStylePropertyMap::clear):
* Source/WebCore/css/typedom/DeclaredStylePropertyMap.h: Copied from Source/WebCore/css/typedom/ComputedStylePropertyMapReadOnly.h.
* Source/WebCore/css/typedom/StylePropertyMap.cpp: Added.
(WebCore::StylePropertyMap::get const):
(WebCore::StylePropertyMap::getAll const):
(WebCore::StylePropertyMap::has const):
(WebCore::StylePropertyMap::set):
(WebCore::StylePropertyMap::append):
(WebCore::StylePropertyMap::remove):
* Source/WebCore/css/typedom/StylePropertyMap.h:
(WebCore::StylePropertyMap::clearElement):
* Source/WebCore/css/typedom/StylePropertyMap.idl:
* Source/WebCore/css/typedom/StylePropertyMapReadOnly.cpp:
(WebCore::StylePropertyMapReadOnly::reifyValue):
(WebCore::StylePropertyMapReadOnly::customPropertyValueOrDefault):
(WebCore::StylePropertyMapReadOnly::reifyValueToVector):
(WebCore::StylePropertyMapReadOnly::Iterator::Iterator):
* Source/WebCore/css/typedom/StylePropertyMapReadOnly.h:
(WebCore::StylePropertyMapReadOnly::createIterator):
* Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl:
* Source/WebCore/dom/NodeList.h:
(WebCore::NodeList::createIterator):
* Source/WebCore/dom/StyledElement.cpp:
(WebCore::StyledElement::removeInlineStyleProperty):
(WebCore::StyledElement::removeInlineStyleCustomProperty):
* Source/WebCore/dom/StyledElement.h:
* Source/WebCore/html/CustomPaintImage.cpp:
(WebCore::extractComputedProperty):
* Source/WebCore/html/DOMFormData.h:
(WebCore::DOMFormData::createIterator):
* Source/WebCore/html/URLSearchParams.h:
(WebCore::URLSearchParams::createIterator):

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




More information about the webkit-changes mailing list