Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(788)

Unified Diff: Source/core/dom/SiblingRuleHelper.cpp

Issue 208933003: Remove SiblingRuleHelper (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Tighten types to ContainerNode Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/SiblingRuleHelper.h ('k') | Source/core/dom/shadow/ShadowRoot.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/SiblingRuleHelper.cpp
diff --git a/Source/core/dom/SiblingRuleHelper.cpp b/Source/core/dom/SiblingRuleHelper.cpp
deleted file mode 100644
index baacc0fc018cbd1124be3d95a635fa41750e5392..0000000000000000000000000000000000000000
--- a/Source/core/dom/SiblingRuleHelper.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-// Copyright (c) 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "config.h"
-#include "core/dom/SiblingRuleHelper.h"
-
-#include "core/dom/Document.h"
-#include "core/dom/Element.h"
-#include "core/dom/StyleEngine.h"
-#include "core/dom/shadow/ShadowRoot.h"
-
-namespace WebCore {
-
-bool SiblingRuleHelper::isFinishedParsingChildren()
-{
- if (m_node->isElementNode())
- return toElement(m_node)->isFinishedParsingChildren();
-
- return toShadowRoot(m_node)->isFinishedParsingChildren();
-}
-
-void SiblingRuleHelper::setChildrenAffectedByDirectAdjacentRules()
-{
- if (m_node->isElementNode())
- toElement(m_node)->setChildrenAffectedByDirectAdjacentRules();
- else
- toShadowRoot(m_node)->setChildrenAffectedByDirectAdjacentRules();
-}
-
-void SiblingRuleHelper::setChildrenAffectedByIndirectAdjacentRules()
-{
- if (m_node->isElementNode())
- toElement(m_node)->setChildrenAffectedByIndirectAdjacentRules();
- else
- toShadowRoot(m_node)->setChildrenAffectedByIndirectAdjacentRules();
-}
-
-void SiblingRuleHelper::setChildrenAffectedByForwardPositionalRules()
-{
- if (m_node->isElementNode())
- toElement(m_node)->setChildrenAffectedByForwardPositionalRules();
- else
- toShadowRoot(m_node)->setChildrenAffectedByForwardPositionalRules();
-}
-
-void SiblingRuleHelper::setChildrenAffectedByBackwardPositionalRules()
-{
- if (m_node->isElementNode())
- toElement(m_node)->setChildrenAffectedByBackwardPositionalRules();
- else
- toShadowRoot(m_node)->setChildrenAffectedByBackwardPositionalRules();
-}
-
-void SiblingRuleHelper::setChildrenAffectedByFirstChildRules()
-{
- if (m_node->isElementNode())
- toElement(m_node)->setChildrenAffectedByFirstChildRules();
- else
- toShadowRoot(m_node)->setChildrenAffectedByFirstChildRules();
-}
-
-void SiblingRuleHelper::setChildrenAffectedByLastChildRules()
-{
- if (m_node->isElementNode())
- toElement(m_node)->setChildrenAffectedByLastChildRules();
- else
- toShadowRoot(m_node)->setChildrenAffectedByLastChildRules();
-}
-
-bool SiblingRuleHelper::childrenAffectedByPositionalRules() const
-{
- return m_node->isElementNode() ? toElement(m_node)->childrenAffectedByPositionalRules() : toShadowRoot(m_node)->childrenAffectedByPositionalRules();
-}
-
-bool SiblingRuleHelper::childrenAffectedByFirstChildRules() const
-{
- return m_node->isElementNode() ? toElement(m_node)->childrenAffectedByFirstChildRules() : toShadowRoot(m_node)->childrenAffectedByFirstChildRules();
-}
-
-bool SiblingRuleHelper::childrenAffectedByLastChildRules() const
-{
- return m_node->isElementNode() ? toElement(m_node)->childrenAffectedByLastChildRules() : toShadowRoot(m_node)->childrenAffectedByLastChildRules();
-}
-
-bool SiblingRuleHelper::childrenAffectedByDirectAdjacentRules() const
-{
- return m_node->isElementNode() ? toElement(m_node)->childrenAffectedByDirectAdjacentRules() : toShadowRoot(m_node)->childrenAffectedByDirectAdjacentRules();
-}
-
-bool SiblingRuleHelper::childrenAffectedByIndirectAdjacentRules() const
-{
- return m_node->isElementNode() ? toElement(m_node)->childrenAffectedByIndirectAdjacentRules() : toShadowRoot(m_node)->childrenAffectedByIndirectAdjacentRules();
-}
-
-bool SiblingRuleHelper::childrenAffectedByForwardPositionalRules() const
-{
- return m_node->isElementNode() ? toElement(m_node)->childrenAffectedByForwardPositionalRules() : toShadowRoot(m_node)->childrenAffectedByForwardPositionalRules();
-}
-
-bool SiblingRuleHelper::childrenAffectedByBackwardPositionalRules() const
-{
- return m_node->isElementNode() ? toElement(m_node)->childrenAffectedByBackwardPositionalRules() : toShadowRoot(m_node)->childrenAffectedByBackwardPositionalRules();
-}
-
-void SiblingRuleHelper::checkForChildrenAdjacentRuleChanges()
-{
- bool hasDirectAdjacentRules = childrenAffectedByDirectAdjacentRules();
- bool hasIndirectAdjacentRules = childrenAffectedByIndirectAdjacentRules();
-
- if (!hasDirectAdjacentRules && !hasIndirectAdjacentRules)
- return;
-
- unsigned forceCheckOfNextElementCount = 0;
- bool forceCheckOfAnyElementSibling = false;
- Document& document = m_node->document();
-
- for (Node* child = m_node->firstChild(); child; child = child->nextSibling()) {
- if (!child->isElementNode())
- continue;
- Element* element = toElement(child);
- bool childRulesChanged = element->needsStyleRecalc() && element->styleChangeType() >= SubtreeStyleChange;
-
- if (forceCheckOfNextElementCount || forceCheckOfAnyElementSibling)
- element->setNeedsStyleRecalc(SubtreeStyleChange);
-
- if (forceCheckOfNextElementCount)
- forceCheckOfNextElementCount--;
-
- if (childRulesChanged && hasDirectAdjacentRules)
- forceCheckOfNextElementCount = document.styleEngine()->maxDirectAdjacentSelectors();
-
- forceCheckOfAnyElementSibling = forceCheckOfAnyElementSibling || (childRulesChanged && hasIndirectAdjacentRules);
- }
-}
-
-bool SiblingRuleHelper::childrenSupportStyleSharing()
-{
- return m_node->isElementNode() ? toElement(m_node)->childrenSupportStyleSharing() : toShadowRoot(m_node)->childrenSupportStyleSharing();
-}
-
-} // namespace WebCore
-
« no previous file with comments | « Source/core/dom/SiblingRuleHelper.h ('k') | Source/core/dom/shadow/ShadowRoot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698