Changeset 208001 in webkit


Ignore:
Timestamp:
Oct 27, 2016, 1:23:06 PM (9 years ago)
Author:
Chris Dumez
Message:

Merge Element::ShadowRootMode and ShadowRoot::Mode enumerations
https://bugs.webkit.org/show_bug.cgi?id=164063

Reviewed by Sam Weinig.

Merge Element::ShadowRootMode and ShadowRoot::Mode enumerations now
that we support having IDL string enumerations in their own IDL file.

No new tests, no Web-exposed behavior change.

  • CMakeLists.txt:
  • DerivedSources.cpp:
  • DerivedSources.make:
  • WebCore.xcodeproj/project.pbxproj:
  • css/ElementRuleCollector.cpp:

(WebCore::ElementRuleCollector::collectMatchingRules):
(WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
(WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):

  • css/SelectorChecker.cpp:

(WebCore::SelectorChecker::matchRecursively):

  • dom/CustomElementRegistry.cpp:

(WebCore::enqueueUpgradeInShadowIncludingTreeOrder):

  • dom/Element.cpp:

(WebCore::Element::bindingsOffsetParent):
(WebCore::Element::addShadowRoot):
(WebCore::Element::attachShadow):
(WebCore::Element::shadowRootForBindings):
(WebCore::Element::userAgentShadowRoot):
(WebCore::Element::ensureUserAgentShadowRoot):

  • dom/Element.h:
  • dom/Element.idl:
  • dom/InlineStyleSheetOwner.cpp:

(WebCore::parserContextForElement):

  • dom/Node.cpp:

(WebCore::Node::isUnclosedNode):
(WebCore::Node::assignedSlotForBindings):
(WebCore::Node::isInUserAgentShadowTree):

  • dom/ShadowRoot.cpp:

(WebCore::ShadowRoot::ShadowRoot):

  • dom/ShadowRoot.h:
  • dom/ShadowRoot.idl:
  • dom/ShadowRootMode.h: Added.
  • dom/ShadowRootMode.idl: Copied from Source/WebCore/dom/ShadowRoot.idl.
  • dom/SlotAssignment.cpp:

(WebCore::SlotAssignment::didChangeSlot):

  • html/HTMLSummaryElement.cpp:

(WebCore::HTMLSummaryElement::create):

  • inspector/InspectorDOMAgent.cpp:

(WebCore::shadowRootType):

  • rendering/HitTestResult.cpp:

(WebCore::moveOutOfUserAgentShadowTree):

  • rendering/RenderElement.cpp:

(WebCore::RenderElement::selectionPseudoStyle):

  • rendering/RenderLayer.cpp:

(WebCore::rendererForScrollbar):

  • style/StyleScope.cpp:

(WebCore::Style::Scope::shouldUseSharedUserAgentShadowTreeStyleResolver):
(WebCore::Style::Scope::didChangeStyleSheetEnvironment):

  • svg/SVGElement.cpp:

(WebCore::SVGElement::correspondingUseElement):

  • testing/Internals.cpp:

(WebCore::Internals::shadowRootType):

Location:
trunk/Source/WebCore
Files:
1 added
25 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r207937 r208001  
    446446    dom/SecurityPolicyViolationEvent.idl
    447447    dom/ShadowRoot.idl
     448    dom/ShadowRootMode.idl
    448449    dom/Slotable.idl
    449450    dom/StaticRange.idl
  • trunk/Source/WebCore/ChangeLog

    r208000 r208001  
     12016-10-27  Chris Dumez  <cdumez@apple.com>
     2
     3        Merge Element::ShadowRootMode and ShadowRoot::Mode enumerations
     4        https://bugs.webkit.org/show_bug.cgi?id=164063
     5
     6        Reviewed by Sam Weinig.
     7
     8        Merge Element::ShadowRootMode and ShadowRoot::Mode enumerations now
     9        that we support having IDL string enumerations in their own IDL file.
     10
     11        No new tests, no Web-exposed behavior change.
     12
     13        * CMakeLists.txt:
     14        * DerivedSources.cpp:
     15        * DerivedSources.make:
     16        * WebCore.xcodeproj/project.pbxproj:
     17        * css/ElementRuleCollector.cpp:
     18        (WebCore::ElementRuleCollector::collectMatchingRules):
     19        (WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
     20        (WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
     21        * css/SelectorChecker.cpp:
     22        (WebCore::SelectorChecker::matchRecursively):
     23        * dom/CustomElementRegistry.cpp:
     24        (WebCore::enqueueUpgradeInShadowIncludingTreeOrder):
     25        * dom/Element.cpp:
     26        (WebCore::Element::bindingsOffsetParent):
     27        (WebCore::Element::addShadowRoot):
     28        (WebCore::Element::attachShadow):
     29        (WebCore::Element::shadowRootForBindings):
     30        (WebCore::Element::userAgentShadowRoot):
     31        (WebCore::Element::ensureUserAgentShadowRoot):
     32        * dom/Element.h:
     33        * dom/Element.idl:
     34        * dom/InlineStyleSheetOwner.cpp:
     35        (WebCore::parserContextForElement):
     36        * dom/Node.cpp:
     37        (WebCore::Node::isUnclosedNode):
     38        (WebCore::Node::assignedSlotForBindings):
     39        (WebCore::Node::isInUserAgentShadowTree):
     40        * dom/ShadowRoot.cpp:
     41        (WebCore::ShadowRoot::ShadowRoot):
     42        * dom/ShadowRoot.h:
     43        * dom/ShadowRoot.idl:
     44        * dom/ShadowRootMode.h: Added.
     45        * dom/ShadowRootMode.idl: Copied from Source/WebCore/dom/ShadowRoot.idl.
     46        * dom/SlotAssignment.cpp:
     47        (WebCore::SlotAssignment::didChangeSlot):
     48        * html/HTMLSummaryElement.cpp:
     49        (WebCore::HTMLSummaryElement::create):
     50        * inspector/InspectorDOMAgent.cpp:
     51        (WebCore::shadowRootType):
     52        * rendering/HitTestResult.cpp:
     53        (WebCore::moveOutOfUserAgentShadowTree):
     54        * rendering/RenderElement.cpp:
     55        (WebCore::RenderElement::selectionPseudoStyle):
     56        * rendering/RenderLayer.cpp:
     57        (WebCore::rendererForScrollbar):
     58        * style/StyleScope.cpp:
     59        (WebCore::Style::Scope::shouldUseSharedUserAgentShadowTreeStyleResolver):
     60        (WebCore::Style::Scope::didChangeStyleSheetEnvironment):
     61        * svg/SVGElement.cpp:
     62        (WebCore::SVGElement::correspondingUseElement):
     63        * testing/Internals.cpp:
     64        (WebCore::Internals::shadowRootType):
     65
    1662016-10-27  Chris Dumez  <cdumez@apple.com>
    267
  • trunk/Source/WebCore/DerivedSources.cpp

    r207937 r208001  
    582582#include "JSSVGZoomEvent.cpp"
    583583#include "JSShadowRoot.cpp"
     584#include "JSShadowRootMode.cpp"
    584585#include "JSStorage.cpp"
    585586#if ENABLE(QUOTA)
  • trunk/Source/WebCore/DerivedSources.make

    r207937 r208001  
    357357    $(WebCore)/dom/SecurityPolicyViolationEvent.idl \
    358358    $(WebCore)/dom/ShadowRoot.idl \
     359    $(WebCore)/dom/ShadowRootMode.idl \
    359360    $(WebCore)/dom/Slotable.idl \
    360361    $(WebCore)/dom/StaticRange.idl \
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r207937 r208001  
    17661766                46DB7D571B20FE46005651B2 /* VNodeTrackerCocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46DB7D561B20FE3C005651B2 /* VNodeTrackerCocoa.cpp */; };
    17671767                46DBB6501AB8C96F00D9A813 /* PowerObserverMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 46DBB64E1AB8C96F00D9A813 /* PowerObserverMac.h */; };
     1768                46DFF4981DC2603100B80B48 /* ShadowRootMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 46DFF4961DC2601300B80B48 /* ShadowRootMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1769                46DFF49B1DC2620B00B80B48 /* JSShadowRootMode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46DFF4991DC261F900B80B48 /* JSShadowRootMode.cpp */; };
     1770                46DFF49C1DC2620B00B80B48 /* JSShadowRootMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 46DFF49A1DC261F900B80B48 /* JSShadowRootMode.h */; };
    17681771                46EBEA021B7D4D6500BE4941 /* CollectionTraversal.h in Headers */ = {isa = PBXBuildFile; fileRef = 46EBEA011B7D4D5D00BE4941 /* CollectionTraversal.h */; settings = {ATTRIBUTES = (Private, ); }; };
    17691772                46F3E3F91B2109000087ED13 /* VNodeTracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46DB7D581B20FE58005651B2 /* VNodeTracker.cpp */; };
     
    88368839                46DB7D591B20FE58005651B2 /* VNodeTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VNodeTracker.h; sourceTree = "<group>"; };
    88378840                46DBB64E1AB8C96F00D9A813 /* PowerObserverMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PowerObserverMac.h; sourceTree = "<group>"; };
     8841                46DFF4961DC2601300B80B48 /* ShadowRootMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowRootMode.h; sourceTree = "<group>"; };
     8842                46DFF4971DC2601300B80B48 /* ShadowRootMode.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ShadowRootMode.idl; sourceTree = "<group>"; };
     8843                46DFF4991DC261F900B80B48 /* JSShadowRootMode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSShadowRootMode.cpp; sourceTree = "<group>"; };
     8844                46DFF49A1DC261F900B80B48 /* JSShadowRootMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSShadowRootMode.h; sourceTree = "<group>"; };
    88388845                46EBEA011B7D4D5D00BE4941 /* CollectionTraversal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CollectionTraversal.h; sourceTree = "<group>"; };
    88398846                46F2768E1B85297F005C2556 /* JSDOMNamedFlowCollectionCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMNamedFlowCollectionCustom.cpp; sourceTree = "<group>"; };
     
    2011620123                                9B6BC9601B975966005AE1F0 /* JSShadowRoot.cpp */,
    2011720124                                9B6BC9611B975966005AE1F0 /* JSShadowRoot.h */,
     20125                                46DFF4991DC261F900B80B48 /* JSShadowRootMode.cpp */,
     20126                                46DFF49A1DC261F900B80B48 /* JSShadowRootMode.h */,
    2011820127                                65DF31EF09D1CC60000BE325 /* JSText.cpp */,
    2011920128                                65DF31F009D1CC60000BE325 /* JSText.h */,
     
    2380123810                                A6D169631346B4C1000EB770 /* ShadowRoot.h */,
    2380223811                                9B19B67E1B964E5200348745 /* ShadowRoot.idl */,
     23812                                46DFF4961DC2601300B80B48 /* ShadowRootMode.h */,
     23813                                46DFF4971DC2601300B80B48 /* ShadowRootMode.idl */,
    2380323814                                572A7F221C6E5A66009C6149 /* SimulatedClick.cpp */,
    2380423815                                572A7F201C6E5719009C6149 /* SimulatedClick.h */,
     
    2474324754                                9393E600151A99F200066F06 /* CSSImageSetValue.h in Headers */,
    2474424755                                A80E6CFA0A1989CA007FB8C5 /* CSSImageValue.h in Headers */,
     24756                                46DFF4981DC2603100B80B48 /* ShadowRootMode.h in Headers */,
    2474524757                                A80E6CF60A1989CA007FB8C5 /* CSSImportRule.h in Headers */,
    2474624758                                A80E6D010A1989CA007FB8C5 /* CSSInheritedValue.h in Headers */,
     
    2595925971                                B2FA3D970AB75A6F000E5AC4 /* JSSVGFilterElement.h in Headers */,
    2596025972                                B27B28260CEF0C0700D39D54 /* JSSVGFontElement.h in Headers */,
     25973                                46DFF49C1DC2620B00B80B48 /* JSShadowRootMode.h in Headers */,
    2596125974                                A83B79050CCAFF15000B0825 /* JSSVGFontFaceElement.h in Headers */,
    2596225975                                A83B79000CCAFF15000B0825 /* JSSVGFontFaceFormatElement.h in Headers */,
     
    3061730630                                C5A1EA7C152BCF04004D00B6 /* SimplifyMarkupCommand.cpp in Sources */,
    3061830631                                572A7F231C6E5A66009C6149 /* SimulatedClick.cpp in Sources */,
     30632                                46DFF49B1DC2620B00B80B48 /* JSShadowRootMode.cpp in Sources */,
    3061930633                                FD00D7A414A3F61900734011 /* SincResampler.cpp in Sources */,
    3062030634                                51327D6111A33A2B004F9D65 /* SinkDocument.cpp in Sources */,
  • trunk/Source/WebCore/css/ElementRuleCollector.cpp

    r207280 r208001  
    145145
    146146    auto* shadowRoot = m_element.containingShadowRoot();
    147     if (shadowRoot && shadowRoot->mode() == ShadowRoot::Mode::UserAgent)
     147    if (shadowRoot && shadowRoot->mode() == ShadowRootMode::UserAgent)
    148148        collectMatchingShadowPseudoElementRules(matchRequest, ruleRange);
    149149
     
    229229    ASSERT(m_element.isInShadowTree());
    230230    auto& shadowRoot = *m_element.containingShadowRoot();
    231     if (shadowRoot.mode() != ShadowRoot::Mode::UserAgent)
     231    if (shadowRoot.mode() != ShadowRootMode::UserAgent)
    232232        return;
    233233    // Look up shadow pseudo elements also from the host scope author style as they are web-exposed.
     
    295295{
    296296    ASSERT(matchRequest.ruleSet);
    297     ASSERT(m_element.containingShadowRoot()->mode() == ShadowRoot::Mode::UserAgent);
     297    ASSERT(m_element.containingShadowRoot()->mode() == ShadowRootMode::UserAgent);
    298298
    299299    auto& rules = *matchRequest.ruleSet;
  • trunk/Source/WebCore/css/SelectorChecker.cpp

    r207536 r208001  
    293293                    return MatchResult::fails(Match::SelectorFailsLocally);
    294294
    295                 if (context.selector->isWebKitCustomPseudoElement() && root->mode() != ShadowRoot::Mode::UserAgent)
     295                if (context.selector->isWebKitCustomPseudoElement() && root->mode() != ShadowRootMode::UserAgent)
    296296                    return MatchResult::fails(Match::SelectorFailsLocally);
    297297            } else
  • trunk/Source/WebCore/dom/CustomElementRegistry.cpp

    r207810 r208001  
    6363            element->enqueueToUpgrade(elementInterface);
    6464        if (auto* shadowRoot = element->shadowRoot()) {
    65             if (shadowRoot->mode() != ShadowRoot::Mode::UserAgent)
     65            if (shadowRoot->mode() != ShadowRootMode::UserAgent)
    6666                enqueueUpgradeInShadowIncludingTreeOrder(*shadowRoot, elementInterface);
    6767        }
  • trunk/Source/WebCore/dom/Element.cpp

    r207810 r208001  
    853853    if (!element || !element->isInShadowTree())
    854854        return element;
    855     return element->containingShadowRoot()->mode() == ShadowRoot::Mode::UserAgent ? nullptr : element;
     855    return element->containingShadowRoot()->mode() == ShadowRootMode::UserAgent ? nullptr : element;
    856856}
    857857
     
    17791779    InspectorInstrumentation::didPushShadowRoot(*this, shadowRoot);
    17801780
    1781     if (shadowRoot.mode() == ShadowRoot::Mode::UserAgent)
     1781    if (shadowRoot.mode() == ShadowRootMode::UserAgent)
    17821782        didAddUserAgentShadowRoot(&shadowRoot);
    17831783}
     
    18581858    }
    18591859
    1860     auto shadow = ShadowRoot::create(document(), init.mode == ShadowRootMode::Open ? ShadowRoot::Mode::Open : ShadowRoot::Mode::Closed);
     1860    if (init.mode == ShadowRootMode::UserAgent) {
     1861        ec = TypeError;
     1862        return nullptr;
     1863    }
     1864
     1865    auto shadow = ShadowRoot::create(document(), init.mode);
    18611866    addShadowRoot(shadow.copyRef());
    18621867    return WTFMove(shadow);
     
    18691874        return nullptr;
    18701875
    1871     if (root->mode() != ShadowRoot::Mode::Open) {
     1876    if (root->mode() != ShadowRootMode::Open) {
    18721877        if (!JSC::jsCast<JSDOMGlobalObject*>(state.lexicalGlobalObject())->world().shadowRootIsAlwaysOpen())
    18731878            return nullptr;
     
    18801885{
    18811886    if (ShadowRoot* shadowRoot = this->shadowRoot()) {
    1882         ASSERT(shadowRoot->mode() == ShadowRoot::Mode::UserAgent);
     1887        ASSERT(shadowRoot->mode() == ShadowRootMode::UserAgent);
    18831888        return shadowRoot;
    18841889    }
     
    18901895    ShadowRoot* shadowRoot = userAgentShadowRoot();
    18911896    if (!shadowRoot) {
    1892         addShadowRoot(ShadowRoot::create(document(), ShadowRoot::Mode::UserAgent));
     1897        addShadowRoot(ShadowRoot::create(document(), ShadowRootMode::UserAgent));
    18931898        shadowRoot = userAgentShadowRoot();
    18941899    }
  • trunk/Source/WebCore/dom/Element.h

    r207810 r208001  
    3333#include "ScrollToOptions.h"
    3434#include "ScrollTypes.h"
     35#include "ShadowRootMode.h"
    3536#include "SimulatedClickOptions.h"
    3637#include "StyleChange.h"
     
    271272    WEBCORE_EXPORT ShadowRoot* createShadowRoot(ExceptionCode&);
    272273
    273     enum class ShadowRootMode { Open, Closed };
    274274    struct ShadowRootInit {
    275275        ShadowRootMode mode;
  • trunk/Source/WebCore/dom/Element.idl

    r207571 r208001  
    181181};
    182182
    183 enum ShadowRootMode { "open", "closed" };
    184 
    185183dictionary ShadowRootInit {
    186184    required ShadowRootMode mode;
  • trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp

    r207695 r208001  
    4949    auto* shadowRoot = element.containingShadowRoot();
    5050    // User agent shadow trees can't contain document-relative URLs. Use blank URL as base allowing cross-document sharing.
    51     auto& baseURL = shadowRoot && shadowRoot->mode() == ShadowRoot::Mode::UserAgent ? blankURL() : element.document().baseURL();
     51    auto& baseURL = shadowRoot && shadowRoot->mode() == ShadowRootMode::UserAgent ? blankURL() : element.document().baseURL();
    5252
    5353    CSSParserContext result = CSSParserContext { element.document(), baseURL, element.document().encoding() };
    54     if (shadowRoot && shadowRoot->mode() == ShadowRoot::Mode::UserAgent)
     54    if (shadowRoot && shadowRoot->mode() == ShadowRootMode::UserAgent)
    5555        result.mode = UASheetMode;
    5656    return result;
  • trunk/Source/WebCore/dom/Node.cpp

    r207864 r208001  
    10871087        }
    10881088        auto& root = treeScopeThatCanAccessOtherNode->rootNode();
    1089         if (is<ShadowRoot>(root) && downcast<ShadowRoot>(root).mode() != ShadowRoot::Mode::Open)
     1089        if (is<ShadowRoot>(root) && downcast<ShadowRoot>(root).mode() != ShadowRootMode::Open)
    10901090            break;
    10911091    }
     
    11111111{
    11121112    auto* shadowRoot = parentShadowRoot(*this);
    1113     if (shadowRoot && shadowRoot->mode() == ShadowRoot::Mode::Open)
     1113    if (shadowRoot && shadowRoot->mode() == ShadowRootMode::Open)
    11141114        return shadowRoot->findAssignedSlot(*this);
    11151115    return nullptr;
     
    11291129{
    11301130    auto* shadowRoot = containingShadowRoot();
    1131     return shadowRoot && shadowRoot->mode() == ShadowRoot::Mode::UserAgent;
     1131    return shadowRoot && shadowRoot->mode() == ShadowRootMode::UserAgent;
    11321132}
    11331133
  • trunk/Source/WebCore/dom/ShadowRoot.cpp

    r207669 r208001  
    4949COMPILE_ASSERT(sizeof(ShadowRoot) == sizeof(SameSizeAsShadowRoot), shadowroot_should_stay_small);
    5050
    51 ShadowRoot::ShadowRoot(Document& document, Mode type)
     51ShadowRoot::ShadowRoot(Document& document, ShadowRootMode type)
    5252    : DocumentFragment(document, CreateShadowRoot)
    5353    , TreeScope(*this, document)
     
    6161    : DocumentFragment(document, CreateShadowRoot)
    6262    , TreeScope(*this, document)
    63     , m_type(Mode::UserAgent)
     63    , m_type(ShadowRootMode::UserAgent)
    6464    , m_styleScope(std::make_unique<Style::Scope>(*this))
    6565    , m_slotAssignment(WTFMove(slotAssignment))
  • trunk/Source/WebCore/dom/ShadowRoot.h

    r207669 r208001  
    3333#include "Element.h"
    3434#include "ExceptionCode.h"
     35#include "ShadowRootMode.h"
    3536#include "TreeScope.h"
    3637
     
    4243class ShadowRoot final : public DocumentFragment, public TreeScope {
    4344public:
    44     enum class Mode : uint8_t {
    45         UserAgent = 0,
    46         Closed,
    47         Open,
    48     };
    49 
    50     static Ref<ShadowRoot> create(Document& document, Mode type)
     45    static Ref<ShadowRoot> create(Document& document, ShadowRootMode type)
    5146    {
    5247        return adoptRef(*new ShadowRoot(document, type));
     
    7570    Element* activeElement() const;
    7671
    77     Mode mode() const { return m_type; }
     72    ShadowRootMode mode() const { return m_type; }
    7873
    7974    void removeAllEventListeners() override;
     
    9388
    9489protected:
    95     ShadowRoot(Document&, Mode);
     90    ShadowRoot(Document&, ShadowRootMode);
    9691
    9792    ShadowRoot(Document&, std::unique_ptr<SlotAssignment>&&);
     
    109104
    110105    bool m_resetStyleInheritance { false };
    111     Mode m_type { Mode::UserAgent };
     106    ShadowRootMode m_type { ShadowRootMode::UserAgent };
    112107
    113108    Element* m_host { nullptr };
  • trunk/Source/WebCore/dom/ShadowRoot.idl

    r206795 r208001  
    3434};
    3535
    36 // "user-agent" is a WebKit extension that is not exposed to the Web.
    37 enum ShadowRootMode { "user-agent", "closed", "open" };
    38 
    3936ShadowRoot implements DocumentOrShadowRoot;
  • trunk/Source/WebCore/dom/ShadowRootMode.idl

    r208000 r208001  
    11/*
    2 * Copyright (C) 2015 Apple Inc. All rights reserved.
     2* Copyright (C) 2016 Apple Inc. All rights reserved.
    33*
    44* Redistribution and use in source and binary forms, with or without
     
    2424*/
    2525
    26 [
    27     EnabledAtRuntime=ShadowDOM,
    28     JSGenerateToJSObject
    29 ] interface ShadowRoot : DocumentFragment {
    30     readonly attribute ShadowRootMode   mode;
    31     readonly attribute Element          host;
    32 
    33     [TreatNullAs=EmptyString, SetterMayThrowLegacyException] attribute DOMString innerHTML;
     26// "user-agent" is a WebKit extension that is not exposed to the Web.
     27enum ShadowRootMode {
     28    "user-agent",
     29    "closed",
     30    "open"
    3431};
    35 
    36 // "user-agent" is a WebKit extension that is not exposed to the Web.
    37 enum ShadowRootMode { "user-agent", "closed", "open" };
    38 
    39 ShadowRoot implements DocumentOrShadowRoot;
  • trunk/Source/WebCore/dom/SlotAssignment.cpp

    r207458 r208001  
    159159    }
    160160
    161     if (shadowRoot.mode() == ShadowRoot::Mode::UserAgent)
     161    if (shadowRoot.mode() == ShadowRootMode::UserAgent)
    162162        return;
    163163
  • trunk/Source/WebCore/html/HTMLSummaryElement.cpp

    r205249 r208001  
    4141{
    4242    Ref<HTMLSummaryElement> summary = adoptRef(*new HTMLSummaryElement(tagName, document));
    43     summary->addShadowRoot(ShadowRoot::create(document, ShadowRoot::Mode::UserAgent));
     43    summary->addShadowRoot(ShadowRoot::create(document, ShadowRootMode::UserAgent));
    4444    return summary;
    4545}
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp

    r207553 r208001  
    12901290}
    12911291
    1292 static Inspector::Protocol::DOM::ShadowRootType shadowRootType(ShadowRoot::Mode mode)
     1292static Inspector::Protocol::DOM::ShadowRootType shadowRootType(ShadowRootMode mode)
    12931293{
    12941294    switch (mode) {
    1295     case ShadowRoot::Mode::UserAgent:
     1295    case ShadowRootMode::UserAgent:
    12961296        return Inspector::Protocol::DOM::ShadowRootType::UserAgent;
    1297     case ShadowRoot::Mode::Closed:
     1297    case ShadowRootMode::Closed:
    12981298        return Inspector::Protocol::DOM::ShadowRootType::Closed;
    1299     case ShadowRoot::Mode::Open:
     1299    case ShadowRootMode::Open:
    13001300        return Inspector::Protocol::DOM::ShadowRootType::Open;
    13011301    }
  • trunk/Source/WebCore/rendering/HitTestResult.cpp

    r207648 r208001  
    128128    if (node.isInShadowTree()) {
    129129        if (ShadowRoot* root = node.containingShadowRoot()) {
    130             if (root->mode() == ShadowRoot::Mode::UserAgent)
     130            if (root->mode() == ShadowRootMode::UserAgent)
    131131                return root->host();
    132132        }
  • trunk/Source/WebCore/rendering/RenderElement.cpp

    r207499 r208001  
    16201620
    16211621    if (ShadowRoot* root = element()->containingShadowRoot()) {
    1622         if (root->mode() == ShadowRoot::Mode::UserAgent) {
     1622        if (root->mode() == ShadowRootMode::UserAgent) {
    16231623            if (Element* shadowHost = element()->shadowHost())
    16241624                return shadowHost->renderer()->getUncachedPseudoStyle(PseudoStyleRequest(SELECTION));
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r207814 r208001  
    30983098    if (Element* element = renderer.element()) {
    30993099        if (ShadowRoot* shadowRoot = element->containingShadowRoot()) {
    3100             if (shadowRoot->mode() == ShadowRoot::Mode::UserAgent)
     3100            if (shadowRoot->mode() == ShadowRootMode::UserAgent)
    31013101                return shadowRoot->host()->renderer();
    31023102        }
  • trunk/Source/WebCore/style/StyleScope.cpp

    r207717 r208001  
    8080    if (!m_shadowRoot)
    8181        return false;
    82     if (m_shadowRoot->mode() != ShadowRoot::Mode::UserAgent)
     82    if (m_shadowRoot->mode() != ShadowRootMode::UserAgent)
    8383        return false;
    8484    // If we have stylesheets in the user agent shadow tree use per-scope resolver.
     
    521521        for (auto* descendantShadowRoot : m_document.inDocumentShadowRoots()) {
    522522            // Stylesheets is author shadow roots are are potentially affected.
    523             if (descendantShadowRoot->mode() != ShadowRoot::Mode::UserAgent)
     523            if (descendantShadowRoot->mode() != ShadowRootMode::UserAgent)
    524524                descendantShadowRoot->styleScope().scheduleUpdate(UpdateType::ContentsOrInterpretation);
    525525        }
  • trunk/Source/WebCore/svg/SVGElement.cpp

    r207458 r208001  
    433433    if (!root)
    434434        return nullptr;
    435     if (root->mode() != ShadowRoot::Mode::UserAgent)
     435    if (root->mode() != ShadowRootMode::UserAgent)
    436436        return nullptr;
    437437    auto* host = root->host();
  • trunk/Source/WebCore/testing/Internals.cpp

    r207928 r208001  
    818818
    819819    switch (downcast<ShadowRoot>(root).mode()) {
    820     case ShadowRoot::Mode::UserAgent:
     820    case ShadowRootMode::UserAgent:
    821821        return String("UserAgentShadowRoot");
    822     case ShadowRoot::Mode::Closed:
     822    case ShadowRootMode::Closed:
    823823        return String("ClosedShadowRoot");
    824     case ShadowRoot::Mode::Open:
     824    case ShadowRootMode::Open:
    825825        return String("OpenShadowRoot");
    826826    default:
Note: See TracChangeset for help on using the changeset viewer.