Index: Source/core/dom/Node.cpp |
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp |
index 66bbfbc6ed3a15a48c01fb584c3860fdf2c6ef0b..13739bd163f897423cb4ffb19d9f4c00b8de5365 100644 |
--- a/Source/core/dom/Node.cpp |
+++ b/Source/core/dom/Node.cpp |
@@ -639,6 +639,21 @@ void Node::setIsLink(bool isLink) |
setFlag(isLink && !SVGImage::isInSVGImage(toElement(this)), IsLinkFlag); |
} |
+void Node::setNeedsStyleInvalidation() |
+{ |
+ setFlag(NeedsStyleInvalidation); |
+ markAncestorsWithChildNeedsStyleInvalidation(); |
+} |
+ |
+ |
+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()) |