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

Unified Diff: Source/core/dom/ContainerNode.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/ContainerNode.h ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ContainerNode.cpp
diff --git a/Source/core/dom/ContainerNode.cpp b/Source/core/dom/ContainerNode.cpp
index a722ab5ee5042a9a611a74c242468ba0813eb1a9..4748df0bc1fc0c68a67c02df938b4032bad003c8 100644
--- a/Source/core/dom/ContainerNode.cpp
+++ b/Source/core/dom/ContainerNode.cpp
@@ -997,6 +997,53 @@ void ContainerNode::updateTreeAfterInsertion(Node& child)
dispatchChildInsertionEvents(child);
}
+bool ContainerNode::hasRestyleFlagInternal(DynamicRestyleFlags mask) const
+{
+ return rareData()->hasRestyleFlag(mask);
+}
+
+bool ContainerNode::hasRestyleFlagsInternal() const
+{
+ return rareData()->hasRestyleFlags();
+}
+
+void ContainerNode::setRestyleFlag(DynamicRestyleFlags mask)
+{
+ ASSERT(isElementNode() || isShadowRoot());
+ ensureRareData().setRestyleFlag(mask);
+}
+
+void ContainerNode::checkForChildrenAdjacentRuleChanges()
+{
+ bool hasDirectAdjacentRules = childrenAffectedByDirectAdjacentRules();
+ bool hasIndirectAdjacentRules = childrenAffectedByIndirectAdjacentRules();
+
+ if (!hasDirectAdjacentRules && !hasIndirectAdjacentRules)
+ return;
+
+ unsigned forceCheckOfNextElementCount = 0;
+ bool forceCheckOfAnyElementSibling = false;
+ Document& document = this->document();
+
+ for (Node* child = 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);
+ }
+}
+
PassRefPtr<HTMLCollection> ContainerNode::getElementsByTagName(const AtomicString& localName)
{
if (localName.isNull())
« no previous file with comments | « Source/core/dom/ContainerNode.h ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698