Remove "document has no sibling rules" optimization.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Nov 2014 08:43:25 +0000 (08:43 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Nov 2014 08:43:25 +0000 (08:43 +0000)
<https://webkit.org/b/138902>

Reviewed by Antti Koivisto.

We were keeping a document-level flag to track whether there are any
sibling rules in any active style sheets.

This information was used to do.. nothing.

* css/StyleResolver.h:
(WebCore::StyleResolver::usesSiblingRules): Deleted.
* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection):
(WebCore::DocumentStyleSheetCollection::combineCSSFeatureFlags):
(WebCore::DocumentStyleSheetCollection::resetCSSFeatureFlags):
* dom/DocumentStyleSheetCollection.h:
(WebCore::DocumentStyleSheetCollection::usesSiblingRules): Deleted.
(WebCore::DocumentStyleSheetCollection::setUsesSiblingRulesOverride): Deleted.
* mathml/MathMLMathElement.cpp:
(WebCore::MathMLMathElement::insertedInto): Deleted.
* mathml/MathMLMathElement.h:

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

Source/WebCore/ChangeLog
Source/WebCore/css/StyleResolver.h
Source/WebCore/dom/DocumentStyleSheetCollection.cpp
Source/WebCore/dom/DocumentStyleSheetCollection.h
Source/WebCore/mathml/MathMLMathElement.cpp
Source/WebCore/mathml/MathMLMathElement.h

index af5d620..155c4a7 100644 (file)
@@ -1,5 +1,30 @@
 2014-11-20  Andreas Kling  <akling@apple.com>
 
+        Remove "document has no sibling rules" optimization.
+        <https://webkit.org/b/138902>
+
+        Reviewed by Antti Koivisto.
+
+        We were keeping a document-level flag to track whether there are any
+        sibling rules in any active style sheets.
+
+        This information was used to do.. nothing.
+
+        * css/StyleResolver.h:
+        (WebCore::StyleResolver::usesSiblingRules): Deleted.
+        * dom/DocumentStyleSheetCollection.cpp:
+        (WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection):
+        (WebCore::DocumentStyleSheetCollection::combineCSSFeatureFlags):
+        (WebCore::DocumentStyleSheetCollection::resetCSSFeatureFlags):
+        * dom/DocumentStyleSheetCollection.h:
+        (WebCore::DocumentStyleSheetCollection::usesSiblingRules): Deleted.
+        (WebCore::DocumentStyleSheetCollection::setUsesSiblingRulesOverride): Deleted.
+        * mathml/MathMLMathElement.cpp:
+        (WebCore::MathMLMathElement::insertedInto): Deleted.
+        * mathml/MathMLMathElement.h:
+
+2014-11-20  Andreas Kling  <akling@apple.com>
+
         Caret renderer is always a RenderBlock.
         <https://webkit.org/b/138912>
 
index a7a5ac2..c9958f9 100644 (file)
@@ -229,7 +229,6 @@ public:
 
     bool checkRegionStyle(Element* regionElement);
 
-    bool usesSiblingRules() const { return !m_ruleSets.features().siblingRules.isEmpty(); }
     bool usesFirstLineRules() const { return m_ruleSets.features().usesFirstLineRules; }
     bool usesFirstLetterRules() const { return m_ruleSets.features().usesFirstLetterRules; }
     
index 2448a3e..0662484 100644 (file)
@@ -56,8 +56,6 @@ DocumentStyleSheetCollection::DocumentStyleSheetCollection(Document& document)
     , m_injectedStyleSheetCacheValid(false)
     , m_hadActiveLoadingStylesheet(false)
     , m_pendingUpdateType(NoUpdate)
-    , m_usesSiblingRules(false)
-    , m_usesSiblingRulesOverride(false)
     , m_usesFirstLineRules(false)
     , m_usesFirstLetterRules(false)
     , m_usesRemUnits(false)
@@ -68,7 +66,6 @@ void DocumentStyleSheetCollection::combineCSSFeatureFlags()
 {
     // Delay resetting the flags until after next style recalc since unapplying the style may not work without these set (this is true at least with before/after).
     const StyleResolver& styleResolver = m_document.ensureStyleResolver();
-    m_usesSiblingRules = m_usesSiblingRules || styleResolver.usesSiblingRules();
     m_usesFirstLineRules = m_usesFirstLineRules || styleResolver.usesFirstLineRules();
     m_usesFirstLetterRules = m_usesFirstLetterRules || styleResolver.usesFirstLetterRules();
 }
@@ -76,7 +73,6 @@ void DocumentStyleSheetCollection::combineCSSFeatureFlags()
 void DocumentStyleSheetCollection::resetCSSFeatureFlags()
 {
     const StyleResolver& styleResolver = m_document.ensureStyleResolver();
-    m_usesSiblingRules = styleResolver.usesSiblingRules();
     m_usesFirstLineRules = styleResolver.usesFirstLineRules();
     m_usesFirstLetterRules = styleResolver.usesFirstLetterRules();
 }
index 586d4e7..3d2326d 100644 (file)
@@ -101,8 +101,6 @@ public:
 
     bool hasPendingSheets() const { return m_pendingStylesheets > 0; }
 
-    bool usesSiblingRules() const { return m_usesSiblingRules || m_usesSiblingRulesOverride; }
-    void setUsesSiblingRulesOverride(bool b) { m_usesSiblingRulesOverride = b; }
     bool usesFirstLineRules() const { return m_usesFirstLineRules; }
     bool usesFirstLetterRules() const { return m_usesFirstLetterRules; }
     bool usesRemUnits() const { return m_usesRemUnits; }
@@ -156,8 +154,6 @@ private:
     String m_preferredStylesheetSetName;
     String m_selectedStylesheetSetName;
 
-    bool m_usesSiblingRules;
-    bool m_usesSiblingRulesOverride;
     bool m_usesFirstLineRules;
     bool m_usesFirstLetterRules;
     bool m_usesRemUnits;
index 82b3cfd..379a2ff 100644 (file)
@@ -43,14 +43,6 @@ PassRefPtr<MathMLMathElement> MathMLMathElement::create(const QualifiedName& tag
     return adoptRef(new MathMLMathElement(tagName, document));
 }
 
-Node::InsertionNotificationRequest MathMLMathElement::insertedInto(ContainerNode& insertionPoint)
-{
-    // There are sibling rules in the MathML default style.
-    if (insertionPoint.inDocument())
-        document().styleSheetCollection().setUsesSiblingRulesOverride(true);
-    return MathMLInlineContainerElement::insertedInto(insertionPoint);
-}
-
 RenderPtr<RenderElement> MathMLMathElement::createElementRenderer(PassRef<RenderStyle> style)
 {
     return createRenderer<RenderMathMLMath>(*this, WTF::move(style));
index 23873e9..2b12943 100644 (file)
@@ -39,7 +39,6 @@ public:
 private:
     MathMLMathElement(const QualifiedName& tagName, Document&);
 
-    virtual InsertionNotificationRequest insertedInto(ContainerNode&) override;
     virtual RenderPtr<RenderElement> createElementRenderer(PassRef<RenderStyle>) override;
 };