Index: Source/core/dom/Node.cpp |
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp |
index 3757bdbb483f401f43f900089622b6a4584ce8b2..4e29e5e282da5c60222cece23af4b72cc0946aef 100644 |
--- a/Source/core/dom/Node.cpp |
+++ b/Source/core/dom/Node.cpp |
@@ -638,6 +638,21 @@ void Node::setIsLink(bool isLink) |
setFlag(isLink && !SVGImage::isInSVGImage(toElement(this)), IsLinkFlag); |
} |
+void Node::setNeedsStyleInvalidation() |
+{ |
+ setFlag(NeedsStyleInvalidation); |
+ markAncestorsWithChildNeedsStyleInvalidation(); |
+} |
+ |
ojan
2014/01/30 19:08:39
extra line break
chrishtr
2014/01/30 19:25:48
Done.
|
+ |
+void Node::markAncestorsWithChildNeedsStyleInvalidation() |
+{ |
+ for (Node* node = this; node && !node->childNeedsStyleInvalidation(); node = node->parentOrShadowHostNode()) |
+ node->setChildNeedsStyleInvalidation(); |
+ if (document().childNeedsStyleInvalidation()) |
+ document().scheduleStyleRecalc(); |
+} |
+ |
void Node::markAncestorsWithChildNeedsDistributionRecalc() |
{ |
for (Node* node = this; node && !node->childNeedsDistributionRecalc(); node = node->parentOrShadowHostNode()) |