[CSS Shadow Parts] Parse 'part' attribute
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Oct 2019 22:47:57 +0000 (22:47 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Oct 2019 22:47:57 +0000 (22:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=202409

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-shadow-parts/invalidation-change-part-name-idl-domtokenlist-expected.txt:
* web-platform-tests/css/css-shadow-parts/part-name-idl-expected.txt:

Source/WebCore:

Add parsing for Element 'part' attribute and the IDL interface.
Also add a feature flag for CSS Shadow Parts.

* dom/Element.cpp:
(WebCore::Element::attributeChanged):
(WebCore::isNonEmptyTokenList):
(WebCore::Element::classAttributeChanged):
(WebCore::Element::partAttributeChanged):
(WebCore::Element::partNames const):
(WebCore::Element::part):
(WebCore::classStringHasClassName): Deleted.
* dom/Element.h:
* dom/Element.idl:
* dom/ElementRareData.cpp:
* dom/ElementRareData.h:
(WebCore::ElementRareData::partList const):
(WebCore::ElementRareData::setPartList):
(WebCore::ElementRareData::partNames const):
(WebCore::ElementRareData::setPartNames):
* html/HTMLAttributeNames.in:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCSSShadowPartsEnabled):
(WebCore::RuntimeEnabledFeatures::cssShadowPartsEnabled const):

Source/WebKit:

* Shared/WebPreferences.yaml:

Add experimental feature, default to disabled for now.

Source/WebKitLegacy/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences cssShadowPartsEnabled]):
(-[WebPreferences setCSSShadowPartsEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250584 268f45cc-cd09-0410-ab3c-d52691b4dbfc

22 files changed:
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/css/css-shadow-parts/invalidation-change-part-name-idl-domtokenlist-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-shadow-parts/part-name-idl-expected.txt
LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt
LayoutTests/platform/mac-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/Element.idl
Source/WebCore/dom/ElementRareData.cpp
Source/WebCore/dom/ElementRareData.h
Source/WebCore/html/HTMLAttributeNames.in
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKitLegacy/mac/WebView/WebPreferences.mm
Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h
Source/WebKitLegacy/mac/WebView/WebView.mm
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm

index a00dba2..ae15c33 100644 (file)
@@ -1,3 +1,13 @@
+2019-10-01  Antti Koivisto  <antti@apple.com>
+
+        [CSS Shadow Parts] Parse 'part' attribute
+        https://bugs.webkit.org/show_bug.cgi?id=202409
+
+        Reviewed by Ryosuke Niwa.
+
+        * web-platform-tests/css/css-shadow-parts/invalidation-change-part-name-idl-domtokenlist-expected.txt:
+        * web-platform-tests/css/css-shadow-parts/part-name-idl-expected.txt:
+
 2019-10-01  Rob Buis  <rbuis@igalia.com>
 
         [Mac] Layout Test imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location.any.html fails
 2019-10-01  Rob Buis  <rbuis@igalia.com>
 
         [Mac] Layout Test imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location.any.html fails
index 65a0721..6ff7c60 100644 (file)
@@ -1,4 +1,4 @@
 The following text should be green:
 
 The following text should be green:
 
-FAIL Part in selected host changed color via part IDL DOMTokenList attribute. undefined is not an object (evaluating 'el.part.remove')
+FAIL Part in selected host changed color via part IDL DOMTokenList attribute. assert_equals: expected "rgb(0, 128, 0)" but got "rgb(0, 0, 255)"
 
 
index fab896b..afbc30c 100644 (file)
@@ -1,6 +1,6 @@
 
 
-FAIL Access to .part returns an empty DOMTokenList. undefined is not an object (evaluating 'parts.length')
-FAIL Multiple names give a DOMTokenList with multiple entries. undefined is not an object (evaluating 'parts.length')
-FAIL DOMTokenList created by access is persisted. undefined is not an object (evaluating 'parts.length')
-FAIL Changes in DOMTokenList are refected in attribute. undefined is not an object (evaluating 'parts.length')
+PASS Access to .part returns an empty DOMTokenList. 
+PASS Multiple names give a DOMTokenList with multiple entries. 
+PASS DOMTokenList created by access is persisted. 
+PASS Changes in DOMTokenList are refected in attribute. 
 
 
index a51a6ad..eec5227 100644 (file)
@@ -137,6 +137,7 @@ PASS a["id"] is foo
 PASS a["className"] is 
 PASS a["classList"] is 
 PASS a["slot"] is 
 PASS a["className"] is 
 PASS a["classList"] is 
 PASS a["slot"] is 
+PASS a["part"] is 
 PASS a["attributes"] is [object NamedNodeMap]
 PASS a["shadowRoot"] is null
 PASS a["scrollTop"] is 0
 PASS a["attributes"] is [object NamedNodeMap]
 PASS a["shadowRoot"] is null
 PASS a["scrollTop"] is 0
index 4111741..a08e35b 100644 (file)
@@ -140,6 +140,7 @@ PASS a["id"] is foo
 PASS a["className"] is 
 PASS a["classList"] is 
 PASS a["slot"] is 
 PASS a["className"] is 
 PASS a["classList"] is 
 PASS a["slot"] is 
+PASS a["part"] is 
 PASS a["attributes"] is [object NamedNodeMap]
 PASS a["shadowRoot"] is null
 PASS a["scrollTop"] is 0
 PASS a["attributes"] is [object NamedNodeMap]
 PASS a["shadowRoot"] is null
 PASS a["scrollTop"] is 0
index ac2c1ef..8fdaab0 100644 (file)
@@ -1,3 +1,34 @@
+2019-10-01  Antti Koivisto  <antti@apple.com>
+
+        [CSS Shadow Parts] Parse 'part' attribute
+        https://bugs.webkit.org/show_bug.cgi?id=202409
+
+        Reviewed by Ryosuke Niwa.
+
+        Add parsing for Element 'part' attribute and the IDL interface.
+        Also add a feature flag for CSS Shadow Parts.
+
+        * dom/Element.cpp:
+        (WebCore::Element::attributeChanged):
+        (WebCore::isNonEmptyTokenList):
+        (WebCore::Element::classAttributeChanged):
+        (WebCore::Element::partAttributeChanged):
+        (WebCore::Element::partNames const):
+        (WebCore::Element::part):
+        (WebCore::classStringHasClassName): Deleted.
+        * dom/Element.h:
+        * dom/Element.idl:
+        * dom/ElementRareData.cpp:
+        * dom/ElementRareData.h:
+        (WebCore::ElementRareData::partList const):
+        (WebCore::ElementRareData::setPartList):
+        (WebCore::ElementRareData::partNames const):
+        (WebCore::ElementRareData::setPartNames):
+        * html/HTMLAttributeNames.in:
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setCSSShadowPartsEnabled):
+        (WebCore::RuntimeEnabledFeatures::cssShadowPartsEnabled const):
+
 2019-10-01  Yusuke Suzuki  <ysuzuki@apple.com>
 
         [JSC] Place VM* in TLS
 2019-10-01  Yusuke Suzuki  <ysuzuki@apple.com>
 
         [JSC] Place VM* in TLS
index 615b05b..50144a9 100644 (file)
@@ -1719,6 +1719,8 @@ void Element::attributeChanged(const QualifiedName& name, const AtomString& oldV
             document().invalidateAccessKeyCache();
         else if (name == HTMLNames::classAttr)
             classAttributeChanged(newValue);
             document().invalidateAccessKeyCache();
         else if (name == HTMLNames::classAttr)
             classAttributeChanged(newValue);
+        else if (name == HTMLNames::partAttr)
+            partAttributeChanged(newValue);
         else if (name == HTMLNames::idAttr) {
             AtomString oldId = elementData()->idForStyleResolution();
             AtomString newId = makeIdForStyleResolution(newValue, document().inQuirksMode());
         else if (name == HTMLNames::idAttr) {
             AtomString oldId = elementData()->idForStyleResolution();
             AtomString newId = makeIdForStyleResolution(newValue, document().inQuirksMode());
@@ -1761,7 +1763,7 @@ void Element::attributeChanged(const QualifiedName& name, const AtomString& oldV
 }
 
 template <typename CharacterType>
 }
 
 template <typename CharacterType>
-static inline bool classStringHasClassName(const CharacterType* characters, unsigned length)
+static inline bool isNonEmptyTokenList(const CharacterType* characters, unsigned length)
 {
     ASSERT(length > 0);
 
 {
     ASSERT(length > 0);
 
@@ -1775,16 +1777,16 @@ static inline bool classStringHasClassName(const CharacterType* characters, unsi
     return i < length;
 }
 
     return i < length;
 }
 
-static inline bool classStringHasClassName(const AtomString& newClassString)
+static inline bool isNonEmptyTokenList(const AtomString& stringValue)
 {
 {
-    unsigned length = newClassString.length();
+    unsigned length = stringValue.length();
 
     if (!length)
         return false;
 
 
     if (!length)
         return false;
 
-    if (newClassString.is8Bit())
-        return classStringHasClassName(newClassString.characters8(), length);
-    return classStringHasClassName(newClassString.characters16(), length);
+    if (stringValue.is8Bit())
+        return isNonEmptyTokenList(stringValue.characters8(), length);
+    return isNonEmptyTokenList(stringValue.characters16(), length);
 }
 
 void Element::classAttributeChanged(const AtomString& newClassString)
 }
 
 void Element::classAttributeChanged(const AtomString& newClassString)
@@ -1794,7 +1796,7 @@ void Element::classAttributeChanged(const AtomString& newClassString)
         ensureUniqueElementData();
 
     bool shouldFoldCase = document().inQuirksMode();
         ensureUniqueElementData();
 
     bool shouldFoldCase = document().inQuirksMode();
-    bool newStringHasClasses = classStringHasClassName(newClassString);
+    bool newStringHasClasses = isNonEmptyTokenList(newClassString);
 
     auto oldClassNames = elementData()->classNames();
     auto newClassNames = newStringHasClasses ? SpaceSplitString(newClassString, shouldFoldCase) : SpaceSplitString();
 
     auto oldClassNames = elementData()->classNames();
     auto newClassNames = newStringHasClasses ? SpaceSplitString(newClassString, shouldFoldCase) : SpaceSplitString();
@@ -1809,6 +1811,23 @@ void Element::classAttributeChanged(const AtomString& newClassString)
     }
 }
 
     }
 }
 
+void Element::partAttributeChanged(const AtomString& newValue)
+{
+    if (!RuntimeEnabledFeatures::sharedFeatures().cssShadowPartsEnabled())
+        return;
+
+    bool hasParts = isNonEmptyTokenList(newValue);
+    if (hasParts || !partNames().isEmpty()) {
+        auto newParts = hasParts ? SpaceSplitString(newValue, false) : SpaceSplitString();
+        ensureElementRareData().setPartNames(WTFMove(newParts));
+    }
+
+    if (hasRareData()) {
+        if (auto* partList = elementRareData()->partList())
+            partList->associatedAttributeValueChanged(newValue);
+    }
+}
+
 URL Element::absoluteLinkURL() const
 {
     if (!isLink())
 URL Element::absoluteLinkURL() const
 {
     if (!isLink())
@@ -3414,6 +3433,19 @@ DOMTokenList& Element::classList()
     return *data.classList();
 }
 
     return *data.classList();
 }
 
+inline SpaceSplitString Element::partNames() const
+{
+    return elementRareData() ? elementRareData()->partNames() : SpaceSplitString();
+}
+
+DOMTokenList& Element::part()
+{
+    auto& data = ensureElementRareData();
+    if (!data.partList())
+        data.setPartList(makeUnique<DOMTokenList>(*this, HTMLNames::partAttr));
+    return *data.partList();
+}
+
 DatasetDOMStringMap& Element::dataset()
 {
     ElementRareData& data = ensureElementRareData();
 DatasetDOMStringMap& Element::dataset()
 {
     ElementRareData& data = ensureElementRareData();
index b29a076..c34b57e 100644 (file)
@@ -451,6 +451,9 @@ public:
 
     WEBCORE_EXPORT DOMTokenList& classList();
 
 
     WEBCORE_EXPORT DOMTokenList& classList();
 
+    SpaceSplitString partNames() const;
+    DOMTokenList& part();
+
     DatasetDOMStringMap& dataset();
 
 #if ENABLE(VIDEO)
     DatasetDOMStringMap& dataset();
 
 #if ENABLE(VIDEO)
@@ -613,10 +616,8 @@ protected:
     void clearTabIndexExplicitlyIfNeeded();
     void setTabIndexExplicitly(int);
 
     void clearTabIndexExplicitlyIfNeeded();
     void setTabIndexExplicitly(int);
 
-    // classAttributeChanged() exists to share code between
-    // parseAttribute (called via setAttribute()) and
-    // svgAttributeChanged (called when element.className.baseValue is set)
     void classAttributeChanged(const AtomString& newClassString);
     void classAttributeChanged(const AtomString& newClassString);
+    void partAttributeChanged(const AtomString& newValue);
 
     void addShadowRoot(Ref<ShadowRoot>&&);
 
 
     void addShadowRoot(Ref<ShadowRoot>&&);
 
index 4c5550a..4c51d0a 100644 (file)
@@ -34,6 +34,7 @@
     [CEReactions, Reflect=class] attribute DOMString className;
     [PutForwards=value] readonly attribute DOMTokenList classList; // FIXME: Should be [SameObject].
     [CEReactions, EnabledAtRuntime=ShadowDOM, Reflect, Unscopable] attribute DOMString slot;
     [CEReactions, Reflect=class] attribute DOMString className;
     [PutForwards=value] readonly attribute DOMTokenList classList; // FIXME: Should be [SameObject].
     [CEReactions, EnabledAtRuntime=ShadowDOM, Reflect, Unscopable] attribute DOMString slot;
+    [EnabledAtRuntime=CSSShadowParts, SameObject, PutForwards=value] readonly attribute DOMTokenList part;
 
     [DOMJIT=ReadDOM] boolean hasAttributes();
     readonly attribute NamedNodeMap attributes; // FIXME: Should be [SameObject].
 
     [DOMJIT=ReadDOM] boolean hasAttributes();
     readonly attribute NamedNodeMap attributes; // FIXME: Should be [SameObject].
index 1cb5058..b04ed8a 100644 (file)
@@ -43,7 +43,7 @@ struct SameSizeAsElementRareData : NodeRareData {
 #endif
     LayoutSize sizeForResizing;
     IntPoint savedLayerScrollPosition;
 #endif
     LayoutSize sizeForResizing;
     IntPoint savedLayerScrollPosition;
-    void* pointers[8];
+    void* pointers[10];
 #if ENABLE(INTERSECTION_OBSERVER)
     void* intersectionObserverData;
 #endif
 #if ENABLE(INTERSECTION_OBSERVER)
     void* intersectionObserverData;
 #endif
index ce8b48e..b8469a0 100644 (file)
@@ -31,6 +31,7 @@
 #include "RenderElement.h"
 #include "ResizeObserver.h"
 #include "ShadowRoot.h"
 #include "RenderElement.h"
 #include "ResizeObserver.h"
 #include "ShadowRoot.h"
+#include "SpaceSplitString.h"
 #include "StylePropertyMap.h"
 
 namespace WebCore {
 #include "StylePropertyMap.h"
 
 namespace WebCore {
@@ -102,6 +103,12 @@ public:
     bool hasElementIdentifier() const { return m_hasElementIdentifier; }
     void setHasElementIdentifier(bool value) { m_hasElementIdentifier = value; }
 
     bool hasElementIdentifier() const { return m_hasElementIdentifier; }
     void setHasElementIdentifier(bool value) { m_hasElementIdentifier = value; }
 
+    DOMTokenList* partList() const { return m_partList.get(); }
+    void setPartList(std::unique_ptr<DOMTokenList> partList) { m_partList = WTFMove(partList); }
+
+    const SpaceSplitString& partNames() const { return m_partNames; }
+    void setPartNames(SpaceSplitString&& partNames) { m_partNames = WTFMove(partNames); }
+
 #if ENABLE(INTERSECTION_OBSERVER)
     IntersectionObserverData* intersectionObserverData() { return m_intersectionObserverData.get(); }
     void setIntersectionObserverData(std::unique_ptr<IntersectionObserverData>&& data) { m_intersectionObserverData = WTFMove(data); }
 #if ENABLE(INTERSECTION_OBSERVER)
     IntersectionObserverData* intersectionObserverData() { return m_intersectionObserverData.get(); }
     void setIntersectionObserverData(std::unique_ptr<IntersectionObserverData>&& data) { m_intersectionObserverData = WTFMove(data); }
@@ -186,6 +193,9 @@ private:
     RefPtr<StylePropertyMap> m_attributeStyleMap;
 #endif
 
     RefPtr<StylePropertyMap> m_attributeStyleMap;
 #endif
 
+    std::unique_ptr<DOMTokenList> m_partList;
+    SpaceSplitString m_partNames;
+
     void releasePseudoElement(PseudoElement*);
 };
 
     void releasePseudoElement(PseudoElement*);
 };
 
index f80d5d6..fb26db7 100644 (file)
@@ -333,6 +333,7 @@ onwebkitwillrevealright
 onwebkitwillrevealtop
 open
 optimum
 onwebkitwillrevealtop
 open
 optimum
+part
 pattern
 placeholder
 playsinline
 pattern
 placeholder
 playsinline
index cf33a00..b99dff6 100644 (file)
@@ -373,6 +373,9 @@ public:
     void setLazyImageLoadingEnabled(bool areEnabled) { m_lazyImageLoadingEnabled = areEnabled; }
     bool lazyImageLoadingEnabled() const { return m_lazyImageLoadingEnabled; }
 
     void setLazyImageLoadingEnabled(bool areEnabled) { m_lazyImageLoadingEnabled = areEnabled; }
     bool lazyImageLoadingEnabled() const { return m_lazyImageLoadingEnabled; }
 
+    void setCSSShadowPartsEnabled(bool isEnabled) { m_isCSSShadowPartsEnabled = isEnabled; }
+    bool cssShadowPartsEnabled() const { return m_isCSSShadowPartsEnabled; }
+
     WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures();
 
 #if HAVE(NSURLSESSION_WEBSOCKET)
     WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures();
 
 #if HAVE(NSURLSESSION_WEBSOCKET)
@@ -574,6 +577,7 @@ private:
 
     bool m_lazyImageLoadingEnabled { false };
     bool m_secureContextChecksEnabled { true };
 
     bool m_lazyImageLoadingEnabled { false };
     bool m_secureContextChecksEnabled { true };
+    bool m_isCSSShadowPartsEnabled { false };
 
     friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>;
 };
 
     friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>;
 };
index 7c4fa76..bd9d45b 100644 (file)
@@ -1,3 +1,14 @@
+2019-10-01  Antti Koivisto  <antti@apple.com>
+
+        [CSS Shadow Parts] Parse 'part' attribute
+        https://bugs.webkit.org/show_bug.cgi?id=202409
+
+        Reviewed by Ryosuke Niwa.
+
+        * Shared/WebPreferences.yaml:
+
+        Add experimental feature, default to disabled for now.
+
 2019-10-01  Alex Christensen  <achristensen@webkit.org>
 
         Progress towards successful CMake build on Mac
 2019-10-01  Alex Christensen  <achristensen@webkit.org>
 
         Progress towards successful CMake build on Mac
index 366a0ed..17e14cc 100644 (file)
@@ -1441,6 +1441,14 @@ FetchAPIKeepAliveEnabled:
   webcoreBinding: RuntimeEnabledFeatures
   webcoreName: fetchAPIKeepAliveEnabled
 
   webcoreBinding: RuntimeEnabledFeatures
   webcoreName: fetchAPIKeepAliveEnabled
 
+CSSShadowPartsEnabled:
+  type: bool
+  defaultValue: false
+  humanReadableName: "CSS Shadow Parts"
+  humanReadableDescription: "Enable CSS Shadow Parts"
+  category: experimental
+  webcoreBinding: RuntimeEnabledFeatures
+
 # For internal features:
 # The type should be boolean.
 # You must provide a humanReadableName and humanReadableDescription for all debug features. They
 # For internal features:
 # The type should be boolean.
 # You must provide a humanReadableName and humanReadableDescription for all debug features. They
index fb25f31..36680a4 100644 (file)
@@ -1,3 +1,19 @@
+2019-10-01  Antti Koivisto  <antti@apple.com>
+
+        [CSS Shadow Parts] Parse 'part' attribute
+        https://bugs.webkit.org/show_bug.cgi?id=202409
+
+        Reviewed by Ryosuke Niwa.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences cssShadowPartsEnabled]):
+        (-[WebPreferences setCSSShadowPartsEnabled:]):
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2019-10-01  Alex Christensen  <achristensen@webkit.org>
 
         Progress towards successful CMake build on Mac
 2019-10-01  Alex Christensen  <achristensen@webkit.org>
 
         Progress towards successful CMake build on Mac
index 1002d72..fe356c9 100644 (file)
 #define WebKitPunchOutWhiteBackgroundsInDarkModePreferenceKey @"WebKitPunchOutWhiteBackgroundsInDarkMode"
 #define WebKitFetchAPIKeepAliveEnabledPreferenceKey @"WebKitFetchAPIKeepAliveEnabled"
 #define WebKitWebAnimationsCSSIntegrationEnabledPreferenceKey @"WebKitWebAnimationsCSSIntegrationEnabled"
 #define WebKitPunchOutWhiteBackgroundsInDarkModePreferenceKey @"WebKitPunchOutWhiteBackgroundsInDarkMode"
 #define WebKitFetchAPIKeepAliveEnabledPreferenceKey @"WebKitFetchAPIKeepAliveEnabled"
 #define WebKitWebAnimationsCSSIntegrationEnabledPreferenceKey @"WebKitWebAnimationsCSSIntegrationEnabled"
+#define WebKitCSSShadowPartsEnabledPreferenceKey @"WebKitCSSShadowPartsEnabled"
 
 #if !TARGET_OS_IPHONE
 // These are private both because callers should be using the cover methods and because the
 
 #if !TARGET_OS_IPHONE
 // These are private both because callers should be using the cover methods and because the
index c68549d..04a6f36 100644 (file)
@@ -691,6 +691,7 @@ public:
 #endif
         @NO, WebKitCoreMathMLEnabledPreferenceKey,
         @NO, WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey,
 #endif
         @NO, WebKitCoreMathMLEnabledPreferenceKey,
         @NO, WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey,
+        @NO, WebKitCSSShadowPartsEnabledPreferenceKey,
         nil];
 
 #if !PLATFORM(IOS_FAMILY)
         nil];
 
 #if !PLATFORM(IOS_FAMILY)
@@ -3507,6 +3508,16 @@ static NSString *classIBCreatorID = nil;
     [self _setBoolValue:flag forKey:WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey];
 }
 
     [self _setBoolValue:flag forKey:WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey];
 }
 
+- (BOOL)cssShadowPartsEnabled
+{
+    return [self _boolValueForKey:WebKitCSSShadowPartsEnabledPreferenceKey];
+}
+
+- (void)setCSSShadowPartsEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitCSSShadowPartsEnabledPreferenceKey];
+}
+
 @end
 
 @implementation WebPreferences (WebInternal)
 @end
 
 @implementation WebPreferences (WebInternal)
index def0251..cdaf7c2 100644 (file)
@@ -615,6 +615,9 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR
 - (void)setLinkPreloadResponsiveImagesEnabled:(BOOL)flag;
 - (BOOL)linkPreloadResponsiveImagesEnabled;
 
 - (void)setLinkPreloadResponsiveImagesEnabled:(BOOL)flag;
 - (BOOL)linkPreloadResponsiveImagesEnabled;
 
+- (void)setCSSShadowPartsEnabled:(BOOL)flag;
+- (BOOL)cssShadowPartsEnabled;
+
 @property (nonatomic) BOOL visualViewportAPIEnabled;
 @property (nonatomic) BOOL CSSOMViewScrollingAPIEnabled;
 @property (nonatomic) BOOL largeImageAsyncDecodingEnabled;
 @property (nonatomic) BOOL visualViewportAPIEnabled;
 @property (nonatomic) BOOL CSSOMViewScrollingAPIEnabled;
 @property (nonatomic) BOOL largeImageAsyncDecodingEnabled;
index 1e92585..c91229c 100644 (file)
@@ -3187,6 +3187,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
     RuntimeEnabledFeatures::sharedFeatures().setLinkPreloadResponsiveImagesEnabled([preferences linkPreloadResponsiveImagesEnabled]);
     RuntimeEnabledFeatures::sharedFeatures().setDialogElementEnabled([preferences dialogElementEnabled]);
     RuntimeEnabledFeatures::sharedFeatures().setKeygenElementEnabled([preferences keygenElementEnabled]);
     RuntimeEnabledFeatures::sharedFeatures().setLinkPreloadResponsiveImagesEnabled([preferences linkPreloadResponsiveImagesEnabled]);
     RuntimeEnabledFeatures::sharedFeatures().setDialogElementEnabled([preferences dialogElementEnabled]);
     RuntimeEnabledFeatures::sharedFeatures().setKeygenElementEnabled([preferences keygenElementEnabled]);
+    RuntimeEnabledFeatures::sharedFeatures().setCSSShadowPartsEnabled([preferences cssShadowPartsEnabled]);
 
 #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
     RuntimeEnabledFeatures::sharedFeatures().setLegacyEncryptedMediaAPIEnabled(preferences.legacyEncryptedMediaAPIEnabled);
 
 #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
     RuntimeEnabledFeatures::sharedFeatures().setLegacyEncryptedMediaAPIEnabled(preferences.legacyEncryptedMediaAPIEnabled);
index 11eb10d..9dca087 100644 (file)
@@ -1,3 +1,13 @@
+2019-10-01  Antti Koivisto  <antti@apple.com>
+
+        [CSS Shadow Parts] Parse 'part' attribute
+        https://bugs.webkit.org/show_bug.cgi?id=202409
+
+        Reviewed by Ryosuke Niwa.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (enableExperimentalFeatures):
+
 2019-10-01  Aakash Jain  <aakash_jain@apple.com>
 
         Follow-up fix to r250572 to fix a typo.
 2019-10-01  Aakash Jain  <aakash_jain@apple.com>
 
         Follow-up fix to r250572 to fix a typo.
index ba29f55..8295a3b 100644 (file)
@@ -880,6 +880,7 @@ static void enableExperimentalFeatures(WebPreferences* preferences)
     [preferences setMediaRecorderEnabled:YES];
     [preferences setReferrerPolicyAttributeEnabled:YES];
     [preferences setLinkPreloadResponsiveImagesEnabled:YES];
     [preferences setMediaRecorderEnabled:YES];
     [preferences setReferrerPolicyAttributeEnabled:YES];
     [preferences setLinkPreloadResponsiveImagesEnabled:YES];
+    [preferences setCSSShadowPartsEnabled:YES];
 }
 
 // Called before each test.
 }
 
 // Called before each test.