Title: [149628] trunk/Source
Revision
149628
Author
an...@apple.com
Date
2013-05-06 12:37:44 -0700 (Mon, 06 May 2013)

Log Message

Remove more code that was only needed for younger/older shadow trees
https://bugs.webkit.org/show_bug.cgi?id=115662

Reviewed by Andreas Kling.

This is dead code.

* WebCore.exp.in:
* dom/ComposedShadowTreeWalker.cpp:
(WebCore::nodeCanBeDistributed):
(WebCore::ComposedShadowTreeWalker::traverseParentBackToShadowRootOrHost):
* dom/EventPathWalker.cpp:
(WebCore::EventPathWalker::moveToParent):
* html/shadow/ContentDistributor.cpp:
(WebCore::ScopeContentDistribution::ScopeContentDistribution):
(WebCore::ScopeContentDistribution::registerInsertionPoint):
(WebCore::ScopeContentDistribution::unregisterInsertionPoint):
(WebCore):
(WebCore::ScopeContentDistribution::hasInsertionPoint):
(WebCore::ContentDistributor::invalidate):
* html/shadow/ContentDistributor.h:
(ScopeContentDistribution):
* html/shadow/InsertionPoint.cpp:
(WebCore::InsertionPoint::contains):
(WebCore::resolveReprojection):
(WebCore::collectInsertionPointsWhereNodeIsDistributed):
* html/shadow/InsertionPoint.h:
* testing/Internals.cpp:
(WebCore):
* testing/Internals.h:
(Internals):
* testing/Internals.idl:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (149627 => 149628)


--- trunk/Source/WebCore/ChangeLog	2013-05-06 19:36:29 UTC (rev 149627)
+++ trunk/Source/WebCore/ChangeLog	2013-05-06 19:37:44 UTC (rev 149628)
@@ -1,3 +1,38 @@
+2013-05-06  Antti Koivisto  <an...@apple.com>
+
+        Remove more code that was only needed for younger/older shadow trees
+        https://bugs.webkit.org/show_bug.cgi?id=115662
+
+        Reviewed by Andreas Kling.
+
+        This is dead code.
+
+        * WebCore.exp.in:
+        * dom/ComposedShadowTreeWalker.cpp:
+        (WebCore::nodeCanBeDistributed):
+        (WebCore::ComposedShadowTreeWalker::traverseParentBackToShadowRootOrHost):
+        * dom/EventPathWalker.cpp:
+        (WebCore::EventPathWalker::moveToParent):
+        * html/shadow/ContentDistributor.cpp:
+        (WebCore::ScopeContentDistribution::ScopeContentDistribution):
+        (WebCore::ScopeContentDistribution::registerInsertionPoint):
+        (WebCore::ScopeContentDistribution::unregisterInsertionPoint):
+        (WebCore):
+        (WebCore::ScopeContentDistribution::hasInsertionPoint):
+        (WebCore::ContentDistributor::invalidate):
+        * html/shadow/ContentDistributor.h:
+        (ScopeContentDistribution):
+        * html/shadow/InsertionPoint.cpp:
+        (WebCore::InsertionPoint::contains):
+        (WebCore::resolveReprojection):
+        (WebCore::collectInsertionPointsWhereNodeIsDistributed):
+        * html/shadow/InsertionPoint.h:
+        * testing/Internals.cpp:
+        (WebCore):
+        * testing/Internals.h:
+        (Internals):
+        * testing/Internals.idl:
+
 2013-05-06  Tiancheng Jiang  <tiji...@rim.com>
 
         [BlackBerry] Update HTML5 progress bar UX.

Modified: trunk/Source/WebCore/WebCore.exp.in (149627 => 149628)


--- trunk/Source/WebCore/WebCore.exp.in	2013-05-06 19:36:29 UTC (rev 149627)
+++ trunk/Source/WebCore/WebCore.exp.in	2013-05-06 19:37:44 UTC (rev 149628)
@@ -764,7 +764,6 @@
 __ZN7WebCore24FrameDestructionObserver14willDetachPageEv
 __ZN7WebCore24FrameDestructionObserverC2EPNS_5FrameE
 __ZN7WebCore24FrameDestructionObserverD2Ev
-__ZN7WebCore24ScopeContentDistribution16hasShadowElementEPKNS_10ShadowRootE
 __ZN7WebCore24ScopeContentDistribution17hasContentElementEPKNS_10ShadowRootE
 __ZN7WebCore24ScopeContentDistribution18countElementShadowEPKNS_10ShadowRootE
 __ZN7WebCore24createFragmentFromMarkupEPNS_8DocumentERKN3WTF6StringES5_NS_19ParserContentPolicyE

Modified: trunk/Source/WebCore/dom/ComposedShadowTreeWalker.cpp (149627 => 149628)


--- trunk/Source/WebCore/dom/ComposedShadowTreeWalker.cpp	2013-05-06 19:36:29 UTC (rev 149627)
+++ trunk/Source/WebCore/dom/ComposedShadowTreeWalker.cpp	2013-05-06 19:37:44 UTC (rev 149628)
@@ -51,8 +51,8 @@
     if (!parent)
         return false;
 
-    if (ShadowRoot* shadowRoot = parent->isShadowRoot() ? toShadowRoot(parent) : 0)
-        return ScopeContentDistribution::assignedTo(shadowRoot);
+    if (parent->isShadowRoot())
+        return false;
 
     if (parent->isElementNode() && toElement(parent)->shadow())
         return true;
@@ -238,7 +238,6 @@
 Node* ComposedShadowTreeWalker::traverseParentBackToShadowRootOrHost(const ShadowRoot* shadowRoot, ParentTraversalDetails* details) const
 {
     ASSERT(shadowRoot);
-    ASSERT(!ScopeContentDistribution::assignedTo(shadowRoot));
 
     if (canCrossUpperBoundary()) {
         if (details)

Modified: trunk/Source/WebCore/dom/EventPathWalker.cpp (149627 => 149628)


--- trunk/Source/WebCore/dom/EventPathWalker.cpp	2013-05-06 19:36:29 UTC (rev 149627)
+++ trunk/Source/WebCore/dom/EventPathWalker.cpp	2013-05-06 19:37:44 UTC (rev 149628)
@@ -61,19 +61,10 @@
     }
     if (!m_node->isShadowRoot()) {
         m_node = m_node->parentNode();
-        if (!(m_node && m_node->isShadowRoot() && ScopeContentDistribution::assignedTo(toShadowRoot(m_node))))
-            m_distributedNode = m_node;
         m_isVisitingInsertionPointInReprojection = false;
         return;
     }
-
-    const ShadowRoot* shadowRoot = toShadowRoot(m_node);
-    if (InsertionPoint* insertionPoint = ScopeContentDistribution::assignedTo(shadowRoot)) {
-        m_node = insertionPoint;
-        m_isVisitingInsertionPointInReprojection = true;
-        return;
-    }
-    m_node = shadowRoot->host();
+    m_node = toShadowRoot(m_node)->host();
     m_distributedNode = m_node;
     m_isVisitingInsertionPointInReprojection = false;
 }

Modified: trunk/Source/WebCore/html/shadow/ContentDistributor.cpp (149627 => 149628)


--- trunk/Source/WebCore/html/shadow/ContentDistributor.cpp	2013-05-06 19:36:29 UTC (rev 149627)
+++ trunk/Source/WebCore/html/shadow/ContentDistributor.cpp	2013-05-06 19:37:44 UTC (rev 149628)
@@ -75,9 +75,7 @@
 
 
 ScopeContentDistribution::ScopeContentDistribution()
-    : m_insertionPointAssignedTo(0)
-    , m_numberOfShadowElementChildren(0)
-    , m_numberOfContentElementChildren(0)
+    : m_numberOfContentElementChildren(0)
     , m_numberOfElementShadowChildren(0)
     , m_insertionPointListIsValid(false)
 {
@@ -111,9 +109,6 @@
 void ScopeContentDistribution::registerInsertionPoint(InsertionPoint* point)
 {
     switch (point->insertionPointType()) {
-    case InsertionPoint::ShadowInsertionPoint:
-        ++m_numberOfShadowElementChildren;
-        break;
     case InsertionPoint::ContentInsertionPoint:
         ++m_numberOfContentElementChildren;
         break;
@@ -125,10 +120,6 @@
 void ScopeContentDistribution::unregisterInsertionPoint(InsertionPoint* point)
 {
     switch (point->insertionPointType()) {
-    case InsertionPoint::ShadowInsertionPoint:
-        ASSERT(m_numberOfShadowElementChildren > 0);
-        --m_numberOfShadowElementChildren;
-        break;
     case InsertionPoint::ContentInsertionPoint:
         ASSERT(m_numberOfContentElementChildren > 0);
         --m_numberOfContentElementChildren;
@@ -138,14 +129,6 @@
     invalidateInsertionPointList();
 }
 
-bool ScopeContentDistribution::hasShadowElement(const ShadowRoot* holder)
-{
-    if (!holder->scopeDistribution())
-        return false;
-
-    return holder->scopeDistribution()->hasShadowElementChildren();
-}
-
 bool ScopeContentDistribution::hasContentElement(const ShadowRoot* holder)
 {
     if (!holder->scopeDistribution())
@@ -164,17 +147,9 @@
 
 bool ScopeContentDistribution::hasInsertionPoint(const ShadowRoot* holder)
 {
-    return hasShadowElement(holder) || hasContentElement(holder);
+    return hasContentElement(holder);
 }
 
-InsertionPoint* ScopeContentDistribution::assignedTo(const ShadowRoot* holder)
-{
-    if (!holder->scopeDistribution())
-        return 0;
-
-    return holder->scopeDistribution()->insertionPointAssignedTo();
-}
-
 ContentDistributor::ContentDistributor()
     : m_needsSelectFeatureSet(false)
     , m_validity(Undetermined)
@@ -245,7 +220,6 @@
 
     if (ShadowRoot* root = host->shadowRoot()) {
         if (ScopeContentDistribution* scope = root->scopeDistribution()) {
-            scope->setInsertionPointAssignedTo(0);
             const Vector<RefPtr<InsertionPoint> >& insertionPoints = scope->ensureInsertionPointList(root);
             for (size_t i = 0; i < insertionPoints.size(); ++i) {
                 needsReattach = needsReattach || true;

Modified: trunk/Source/WebCore/html/shadow/ContentDistributor.h (149627 => 149628)


--- trunk/Source/WebCore/html/shadow/ContentDistributor.h	2013-05-06 19:36:29 UTC (rev 149627)
+++ trunk/Source/WebCore/html/shadow/ContentDistributor.h	2013-05-06 19:37:44 UTC (rev 149628)
@@ -75,12 +75,8 @@
 public:
     ScopeContentDistribution();
 
-    InsertionPoint* insertionPointAssignedTo() const { return m_insertionPointAssignedTo; }
-    void setInsertionPointAssignedTo(InsertionPoint* insertionPoint) { m_insertionPointAssignedTo = insertionPoint; }
-
     void registerInsertionPoint(InsertionPoint*);
     void unregisterInsertionPoint(InsertionPoint*);
-    bool hasShadowElementChildren() const { return m_numberOfShadowElementChildren > 0; }
     bool hasContentElementChildren() const { return m_numberOfContentElementChildren > 0; }
 
     void registerElementShadow() { ++m_numberOfElementShadowChildren; }
@@ -93,16 +89,12 @@
 
     bool isUsedForRendering() const;
 
-    static bool hasShadowElement(const ShadowRoot*);
     static bool hasContentElement(const ShadowRoot*);
     static bool hasInsertionPoint(const ShadowRoot*);
     static bool hasElementShadow(const ShadowRoot* holder) { return countElementShadow(holder); }
     static unsigned countElementShadow(const ShadowRoot*);
-    static InsertionPoint* assignedTo(const ShadowRoot*);
 
 private:
-    InsertionPoint* m_insertionPointAssignedTo;
-    unsigned m_numberOfShadowElementChildren;
     unsigned m_numberOfContentElementChildren;
     unsigned m_numberOfElementShadowChildren;
     bool m_insertionPointListIsValid;

Modified: trunk/Source/WebCore/html/shadow/InsertionPoint.cpp (149627 => 149628)


--- trunk/Source/WebCore/html/shadow/InsertionPoint.cpp	2013-05-06 19:36:29 UTC (rev 149627)
+++ trunk/Source/WebCore/html/shadow/InsertionPoint.cpp	2013-05-06 19:37:44 UTC (rev 149628)
@@ -190,7 +190,7 @@
 
 bool InsertionPoint::contains(const Node* node) const
 {
-    return m_distribution.contains(const_cast<Node*>(node)) || (node->isShadowRoot() && ScopeContentDistribution::assignedTo(toShadowRoot(node)) == this);
+    return m_distribution.contains(const_cast<Node*>(node));
 }
 
 const CSSSelectorList& InsertionPoint::emptySelectorList()
@@ -214,15 +214,6 @@
                 continue;
             }
         }
-
-        if (Node* parent = parentNodeForDistribution(current)) {
-            if (InsertionPoint* insertedTo = parent->isShadowRoot() ? ScopeContentDistribution::assignedTo(toShadowRoot(parent)) : 0) {
-                current = insertedTo;
-                insertionPoint = insertedTo;
-                continue;
-            }
-        }
-
         break;
     }
 
@@ -242,13 +233,6 @@
                 continue;
             }
         }
-        if (Node* parent = parentNodeForDistribution(current)) {
-            if (InsertionPoint* insertedTo = parent->isShadowRoot() ? ScopeContentDistribution::assignedTo(toShadowRoot(parent)) : 0) {
-                current = insertedTo;
-                results.append(insertedTo);
-                continue;
-            }
-        }
         return;
     }
 }

Modified: trunk/Source/WebCore/html/shadow/InsertionPoint.h (149627 => 149628)


--- trunk/Source/WebCore/html/shadow/InsertionPoint.h	2013-05-06 19:36:29 UTC (rev 149627)
+++ trunk/Source/WebCore/html/shadow/InsertionPoint.h	2013-05-06 19:37:44 UTC (rev 149628)
@@ -44,7 +44,6 @@
 class InsertionPoint : public HTMLElement {
 public:
     enum Type {
-        ShadowInsertionPoint,
         ContentInsertionPoint
     };
 

Modified: trunk/Source/WebCore/testing/Internals.cpp (149627 => 149628)


--- trunk/Source/WebCore/testing/Internals.cpp	2013-05-06 19:36:29 UTC (rev 149627)
+++ trunk/Source/WebCore/testing/Internals.cpp	2013-05-06 19:37:44 UTC (rev 149628)
@@ -571,15 +571,6 @@
     return frame()->animation()->pauseTransitionAtTime(pseudoElement->renderer(), property, pauseTime);
 }
 
-bool Internals::hasShadowInsertionPoint(const Node* root, ExceptionCode& ec) const
-{
-    if (root && root->isShadowRoot())
-        return ScopeContentDistribution::hasShadowElement(toShadowRoot(root));
-
-    ec = INVALID_ACCESS_ERR;
-    return 0;
-}
-
 bool Internals::hasContentElement(const Node* root, ExceptionCode& ec) const
 {
     if (root && root->isShadowRoot())

Modified: trunk/Source/WebCore/testing/Internals.h (149627 => 149628)


--- trunk/Source/WebCore/testing/Internals.h	2013-05-06 19:36:29 UTC (rev 149627)
+++ trunk/Source/WebCore/testing/Internals.h	2013-05-06 19:37:44 UTC (rev 149628)
@@ -90,7 +90,6 @@
     ShadowRootIfShadowDOMEnabledOrNode* createShadowRoot(Element* host, ExceptionCode&);
     ShadowRootIfShadowDOMEnabledOrNode* shadowRoot(Element* host, ExceptionCode&);
     String shadowRootType(const Node*, ExceptionCode&) const;
-    bool hasShadowInsertionPoint(const Node*, ExceptionCode&) const;
     bool hasContentElement(const Node*, ExceptionCode&) const;
     size_t countElementShadow(const Node*, ExceptionCode&) const;
     Element* includerFor(Node*, ExceptionCode&);

Modified: trunk/Source/WebCore/testing/Internals.idl (149627 => 149628)


--- trunk/Source/WebCore/testing/Internals.idl	2013-05-06 19:36:29 UTC (rev 149627)
+++ trunk/Source/WebCore/testing/Internals.idl	2013-05-06 19:37:44 UTC (rev 149628)
@@ -46,7 +46,6 @@
     Node shadowRoot(Element host) raises (DOMException);
 #endif
     DOMString shadowRootType(Node root) raises (DOMException);
-    boolean hasShadowInsertionPoint(Node root) raises (DOMException);
     boolean hasContentElement(Node root) raises (DOMException);
     unsigned long countElementShadow(Node Root) raises (DOMException);
     Element includerFor(Node node) raises (DOMException);

Modified: trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in (149627 => 149628)


--- trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in	2013-05-06 19:36:29 UTC (rev 149627)
+++ trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in	2013-05-06 19:37:44 UTC (rev 149628)
@@ -395,7 +395,6 @@
         ?pauseTransitionAtTime@AnimationController@WebCore@@QAE_NPAVRenderObject@2@ABVString@WTF@@N@Z
         ?addFromLiteralData@AtomicString@WTF@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@2@PBDI@Z
         ?ensureSelectFeatureSet@ContentDistributor@WebCore@@QAEABVSelectRuleFeatureSet@2@PAVElementShadow@2@@Z
-        ?hasShadowElement@ScopeContentDistribution@WebCore@@SA_NPBVShadowRoot@2@@Z
         ?hasContentElement@ScopeContentDistribution@WebCore@@SA_NPBVShadowRoot@2@@Z
         ?countElementShadow@ScopeContentDistribution@WebCore@@SAIPBVShadowRoot@2@@Z
         ?memoryCache@WebCore@@YAPAVMemoryCache@1@XZ
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to