Chromium Code Reviews| Index: third_party/WebKit/Source/core/dom/Node.cpp |
| diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp |
| index 49dbf9b8451b05d823c51a817960c9524f3005b2..a4d3370327286d3ab3f5f83be61315b2015751e1 100644 |
| --- a/third_party/WebKit/Source/core/dom/Node.cpp |
| +++ b/third_party/WebKit/Source/core/dom/Node.cpp |
| @@ -89,6 +89,8 @@ |
| #include "core/layout/LayoutBox.h" |
| #include "core/page/ContextMenuController.h" |
| #include "core/page/Page.h" |
| +#include "core/svg/SVGElement.h" |
| +#include "core/svg/SVGUseElement.h" |
| #include "core/svg/graphics/SVGImage.h" |
| #include "platform/EventDispatchForbiddenScope.h" |
| #include "platform/RuntimeEnabledFeatures.h" |
| @@ -700,11 +702,21 @@ void Node::setNeedsStyleRecalc(StyleChangeType changeType, const StyleChangeReas |
| if (changeType > existingChangeType) |
| setStyleChange(changeType); |
| - if (existingChangeType == NoStyleChange) |
| - markAncestorsWithChildNeedsStyleRecalc(); |
| - |
| if (isElementNode() && hasRareData()) |
| toElement(*this).setAnimationStyleChange(false); |
| + |
| + if (existingChangeType != NoStyleChange) |
| + return; |
| + markAncestorsWithChildNeedsStyleRecalc(); |
| + if (!isSVGElement()) |
| + return; |
|
rune
2016/08/18 21:15:28
I think I'd move the code below into a separate me
Eric Willigers
2016/08/18 22:27:00
Done.
|
| + const HeapHashSet<WeakMember<SVGElement>>& set = toSVGElement(this)->instancesForElement(); |
| + if (set.isEmpty()) |
| + return; |
| + for (SVGElement* instance : set) { |
| + if (SVGUseElement* element = instance->correspondingUseElement()) |
| + element->setNeedsStyleRecalc(SubtreeStyleChange, reason); |
|
rune
2016/08/18 21:09:07
So there's an 1:n relationship between each svg el
fs
2016/08/18 21:21:17
Yes.
Eric Willigers
2016/08/18 22:27:00
Done. All my tests still pass. I should have tried
|
| + } |
| } |
| void Node::clearNeedsStyleRecalc() |