Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. |
| 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 #include "core/frame/LocalDOMWindow.h" | 82 #include "core/frame/LocalDOMWindow.h" |
| 83 #include "core/frame/LocalFrame.h" | 83 #include "core/frame/LocalFrame.h" |
| 84 #include "core/html/HTMLDialogElement.h" | 84 #include "core/html/HTMLDialogElement.h" |
| 85 #include "core/html/HTMLFrameOwnerElement.h" | 85 #include "core/html/HTMLFrameOwnerElement.h" |
| 86 #include "core/html/HTMLSlotElement.h" | 86 #include "core/html/HTMLSlotElement.h" |
| 87 #include "core/input/EventHandler.h" | 87 #include "core/input/EventHandler.h" |
| 88 #include "core/inspector/InstanceCounters.h" | 88 #include "core/inspector/InstanceCounters.h" |
| 89 #include "core/layout/LayoutBox.h" | 89 #include "core/layout/LayoutBox.h" |
| 90 #include "core/page/ContextMenuController.h" | 90 #include "core/page/ContextMenuController.h" |
| 91 #include "core/page/Page.h" | 91 #include "core/page/Page.h" |
| 92 #include "core/svg/SVGElement.h" | |
| 93 #include "core/svg/SVGUseElement.h" | |
| 92 #include "core/svg/graphics/SVGImage.h" | 94 #include "core/svg/graphics/SVGImage.h" |
| 93 #include "platform/EventDispatchForbiddenScope.h" | 95 #include "platform/EventDispatchForbiddenScope.h" |
| 94 #include "platform/RuntimeEnabledFeatures.h" | 96 #include "platform/RuntimeEnabledFeatures.h" |
| 95 #include "platform/TraceEvent.h" | 97 #include "platform/TraceEvent.h" |
| 96 #include "platform/TracedValue.h" | 98 #include "platform/TracedValue.h" |
| 97 #include "wtf/HashSet.h" | 99 #include "wtf/HashSet.h" |
| 98 #include "wtf/Vector.h" | 100 #include "wtf/Vector.h" |
| 99 #include "wtf/allocator/Partitions.h" | 101 #include "wtf/allocator/Partitions.h" |
| 100 #include "wtf/text/CString.h" | 102 #include "wtf/text/CString.h" |
| 101 #include "wtf/text/StringBuilder.h" | 103 #include "wtf/text/StringBuilder.h" |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 693 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidationTracking"), | 695 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidationTracking"), |
| 694 "StyleRecalcInvalidationTracking", | 696 "StyleRecalcInvalidationTracking", |
| 695 TRACE_EVENT_SCOPE_THREAD, | 697 TRACE_EVENT_SCOPE_THREAD, |
| 696 "data", | 698 "data", |
| 697 InspectorStyleRecalcInvalidationTrackingEvent::data(this, reason)); | 699 InspectorStyleRecalcInvalidationTrackingEvent::data(this, reason)); |
| 698 | 700 |
| 699 StyleChangeType existingChangeType = getStyleChangeType(); | 701 StyleChangeType existingChangeType = getStyleChangeType(); |
| 700 if (changeType > existingChangeType) | 702 if (changeType > existingChangeType) |
| 701 setStyleChange(changeType); | 703 setStyleChange(changeType); |
| 702 | 704 |
| 703 if (existingChangeType == NoStyleChange) | |
| 704 markAncestorsWithChildNeedsStyleRecalc(); | |
| 705 | |
| 706 if (isElementNode() && hasRareData()) | 705 if (isElementNode() && hasRareData()) |
| 707 toElement(*this).setAnimationStyleChange(false); | 706 toElement(*this).setAnimationStyleChange(false); |
| 707 | |
| 708 if (existingChangeType != NoStyleChange) | |
| 709 return; | |
| 710 markAncestorsWithChildNeedsStyleRecalc(); | |
| 711 if (!isSVGElement()) | |
| 712 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.
| |
| 713 const HeapHashSet<WeakMember<SVGElement>>& set = toSVGElement(this)->instanc esForElement(); | |
| 714 if (set.isEmpty()) | |
| 715 return; | |
| 716 for (SVGElement* instance : set) { | |
| 717 if (SVGUseElement* element = instance->correspondingUseElement()) | |
| 718 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
| |
| 719 } | |
| 708 } | 720 } |
| 709 | 721 |
| 710 void Node::clearNeedsStyleRecalc() | 722 void Node::clearNeedsStyleRecalc() |
| 711 { | 723 { |
| 712 m_nodeFlags &= ~StyleChangeMask; | 724 m_nodeFlags &= ~StyleChangeMask; |
| 713 | 725 |
| 714 clearSVGFilterNeedsLayerUpdate(); | 726 clearSVGFilterNeedsLayerUpdate(); |
| 715 | 727 |
| 716 if (isElementNode() && hasRareData()) | 728 if (isElementNode() && hasRareData()) |
| 717 toElement(*this).setAnimationStyleChange(false); | 729 toElement(*this).setAnimationStyleChange(false); |
| (...skipping 1678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2396 | 2408 |
| 2397 void showNodePath(const blink::Node* node) | 2409 void showNodePath(const blink::Node* node) |
| 2398 { | 2410 { |
| 2399 if (node) | 2411 if (node) |
| 2400 node->showNodePathForThis(); | 2412 node->showNodePathForThis(); |
| 2401 else | 2413 else |
| 2402 fprintf(stderr, "Cannot showNodePath for (nil)\n"); | 2414 fprintf(stderr, "Cannot showNodePath for (nil)\n"); |
| 2403 } | 2415 } |
| 2404 | 2416 |
| 2405 #endif | 2417 #endif |
| OLD | NEW |