Title: [137417] trunk/Source/WebCore
Revision
137417
Author
[email protected]
Date
2012-12-11 22:20:38 -0800 (Tue, 11 Dec 2012)

Log Message

Hide HOST_RULE behind SHADOW_DOM flag.
https://bugs.webkit.org/show_bug.cgi?id=102321

Reviewed by Dimitri Glazkov.

@host @-rules are only available when the rules are declared in styles
in shadow dom trees. So if SHADOW_DOM is disabled, we don't need
@host @-rules.

No new tests. Just hide HOST_RULE behind SHADOW_DOM flag.

* css/StyleResolver.h:
Hide "class ShadowRuleHost".
* css/StyleRule.cpp:
(WebCore::StyleRuleBase::reportMemoryUsage):
(WebCore::StyleRuleBase::destroy):
(WebCore::StyleRuleBase::copy):
(WebCore::StyleRuleBase::createCSSOMWrapper):
* css/StyleRule.h:
(StyleRuleBase):
Hide "Host" type and isHostRule.
(StyleRuleHost):
Hide "class StyleRuleHost".
* css/StyleSheetContents.cpp:
(WebCore::childRulesHaveFailedOrCanceledSubresources):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (137416 => 137417)


--- trunk/Source/WebCore/ChangeLog	2012-12-12 06:04:13 UTC (rev 137416)
+++ trunk/Source/WebCore/ChangeLog	2012-12-12 06:20:38 UTC (rev 137417)
@@ -1,3 +1,31 @@
+2012-12-11  Takashi Sakamoto  <[email protected]>
+
+        Hide HOST_RULE behind SHADOW_DOM flag.
+        https://bugs.webkit.org/show_bug.cgi?id=102321
+
+        Reviewed by Dimitri Glazkov.
+
+        @host @-rules are only available when the rules are declared in styles
+        in shadow dom trees. So if SHADOW_DOM is disabled, we don't need
+        @host @-rules.
+
+        No new tests. Just hide HOST_RULE behind SHADOW_DOM flag.
+
+        * css/StyleResolver.h:
+        Hide "class ShadowRuleHost".
+        * css/StyleRule.cpp:
+        (WebCore::StyleRuleBase::reportMemoryUsage):
+        (WebCore::StyleRuleBase::destroy):
+        (WebCore::StyleRuleBase::copy):
+        (WebCore::StyleRuleBase::createCSSOMWrapper):
+        * css/StyleRule.h:
+        (StyleRuleBase):
+        Hide "Host" type and isHostRule.
+        (StyleRuleHost):
+        Hide "class StyleRuleHost".
+        * css/StyleSheetContents.cpp:
+        (WebCore::childRulesHaveFailedOrCanceledSubresources):
+
 2012-12-11  Dominic Mazzoni  <[email protected]>
 
         AX: accessibilityIsIgnored should avoid computing textUnderElement

Modified: trunk/Source/WebCore/css/StyleResolver.h (137416 => 137417)


--- trunk/Source/WebCore/css/StyleResolver.h	2012-12-12 06:04:13 UTC (rev 137416)
+++ trunk/Source/WebCore/css/StyleResolver.h	2012-12-12 06:20:38 UTC (rev 137417)
@@ -85,7 +85,9 @@
 class StylePendingImage;
 class StylePropertySet;
 class StyleRule;
+#if ENABLE(SHADOW_DOM)
 class StyleRuleHost;
+#endif
 class StyleRuleKeyframes;
 class StyleRulePage;
 class StyleRuleRegion;

Modified: trunk/Source/WebCore/css/StyleRule.cpp (137416 => 137417)


--- trunk/Source/WebCore/css/StyleRule.cpp	2012-12-12 06:04:13 UTC (rev 137416)
+++ trunk/Source/WebCore/css/StyleRule.cpp	2012-12-12 06:20:38 UTC (rev 137417)
@@ -81,9 +81,11 @@
     case Keyframes:
         static_cast<const StyleRuleKeyframes*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
         return;
+#if ENABLE(SHADOW_DOM)
     case Host:
         static_cast<const StyleRuleBlock*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
         return;
+#endif
 #if ENABLE(CSS_DEVICE_ADAPTATION)
     case Viewport:
         static_cast<const StyleRuleViewport*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
@@ -127,9 +129,11 @@
     case Keyframes:
         delete static_cast<StyleRuleKeyframes*>(this);
         return;
+#if ENABLE(SHADOW_DOM)
     case Host:
         delete static_cast<StyleRuleHost*>(this);
         return;
+#endif
 #if ENABLE(CSS_DEVICE_ADAPTATION)
     case Viewport:
         delete static_cast<StyleRuleViewport*>(this);
@@ -168,8 +172,10 @@
         return 0;
     case Keyframes:
         return static_cast<const StyleRuleKeyframes*>(this)->copy();
+#if ENABLE(SHADOW_DOM)
     case Host:
         return static_cast<const StyleRuleHost*>(this)->copy();
+#endif
 #if ENABLE(CSS_DEVICE_ADAPTATION)
     case Viewport:
         return static_cast<const StyleRuleViewport*>(this)->copy();
@@ -220,10 +226,12 @@
         rule = WebKitCSSViewportRule::create(static_cast<StyleRuleViewport*>(self), parentSheet);
         break;
 #endif
+#if ENABLE(SHADOW_DOM)
     case Host:
         // FIXME: The current CSSOM editor's draft (http://dev.w3.org/csswg/cssom/) does not handle @host rules (see bug 102344).
         rule = adoptRef(new CSSUnknownRule());
         break;
+#endif
     case Unknown:
     case Charset:
     case Keyframe:

Modified: trunk/Source/WebCore/css/StyleRule.h (137416 => 137417)


--- trunk/Source/WebCore/css/StyleRule.h	2012-12-12 06:04:13 UTC (rev 137416)
+++ trunk/Source/WebCore/css/StyleRule.h	2012-12-12 06:20:38 UTC (rev 137417)
@@ -46,7 +46,9 @@
         Page,
         Keyframes,
         Keyframe, // Not used. These are internally non-rule StyleKeyframe objects.
+#if ENABLE(SHADOW_DOM)
         Host,
+#endif
 #if ENABLE(CSS_DEVICE_ADAPTATION)
         Viewport = 15,
 #endif
@@ -65,7 +67,9 @@
     bool isViewportRule() const { return type() == Viewport; }
 #endif
     bool isImportRule() const { return type() == Import; }
+#if ENABLE(SHADOW_DOM)
     bool isHostRule() const { return type() == Host; }
+#endif
 
     PassRefPtr<StyleRuleBase> copy() const;
 
@@ -231,6 +235,7 @@
     CSSSelectorList m_selectorList;
 };
 
+#if ENABLE(SHADOW_DOM)
 class StyleRuleHost : public StyleRuleBlock {
 public:
     static PassRefPtr<StyleRuleHost> create(Vector<RefPtr<StyleRuleBase> >& adoptRules)
@@ -244,6 +249,7 @@
     StyleRuleHost(Vector<RefPtr<StyleRuleBase> >& adoptRules) : StyleRuleBlock(Host, adoptRules) { }
     StyleRuleHost(const StyleRuleHost& o) : StyleRuleBlock(o) { }
 };
+#endif
 
 #if ENABLE(CSS_DEVICE_ADAPTATION)
 class StyleRuleViewport : public StyleRuleBase {

Modified: trunk/Source/WebCore/css/StyleSheetContents.cpp (137416 => 137417)


--- trunk/Source/WebCore/css/StyleSheetContents.cpp	2012-12-12 06:04:13 UTC (rev 137416)
+++ trunk/Source/WebCore/css/StyleSheetContents.cpp	2012-12-12 06:20:38 UTC (rev 137417)
@@ -443,10 +443,12 @@
             if (childRulesHaveFailedOrCanceledSubresources(static_cast<const StyleRuleRegion*>(rule)->childRules()))
                 return true;
             break;
+#if ENABLE(SHADOW_DOM)
         case StyleRuleBase::Host:
             if (childRulesHaveFailedOrCanceledSubresources(static_cast<const StyleRuleHost*>(rule)->childRules()))
                 return true;
             break;
+#endif
         case StyleRuleBase::Import:
             ASSERT_NOT_REACHED();
         case StyleRuleBase::Page:
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to