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

Unified Diff: Source/core/dom/ContainerNode.h

Issue 768533004: Make getComputedStyle optimization work for adjacent combinators. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Redistribution might change computed style. Created 6 years 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
Index: Source/core/dom/ContainerNode.h
diff --git a/Source/core/dom/ContainerNode.h b/Source/core/dom/ContainerNode.h
index b883311724178a50c25cfdc1429627498a362f0e..1389bbec7af92eb1e41f8b7529746aec18ddaa63 100644
--- a/Source/core/dom/ContainerNode.h
+++ b/Source/core/dom/ContainerNode.h
@@ -155,6 +155,8 @@ public:
bool affectedByLastChildRules() const { return hasRestyleFlag(AffectedByLastChildRules); }
void setAffectedByLastChildRules() { setRestyleFlag(AffectedByLastChildRules); }
+ bool needsAdjacentStyleRecalc() const;
+
// FIXME: These methods should all be renamed to something better than "check",
// since it's not clear that they alter the style bits of siblings and children.
void checkForChildrenAdjacentRuleChanges();
@@ -313,6 +315,13 @@ inline void ContainerNode::detachChildren(const AttachContext& context)
child->detach(childrenContext);
}
+inline bool ContainerNode::needsAdjacentStyleRecalc() const
+{
+ if (!childrenAffectedByDirectAdjacentRules() && !childrenAffectedByIndirectAdjacentRules())
+ return false;
+ return childNeedsStyleRecalc() || childNeedsStyleInvalidation();
+}
+
inline unsigned Node::countChildren() const
{
if (!isContainerNode())
« no previous file with comments | « LayoutTests/fast/css/getComputedStyle/computed-style-recalc-expected.txt ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698