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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGElement.cpp

Issue 2107153002: SVG object with same idrefs get conflicted even they are under different shadow root Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename the method in TreeScope class Created 4 years, 5 months 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde .org> 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde .org>
3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org>
4 * Copyright (C) 2008 Apple Inc. All rights reserved. 4 * Copyright (C) 2008 Apple Inc. All rights reserved.
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> 6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "core/html/HTMLElement.h" 42 #include "core/html/HTMLElement.h"
43 #include "core/layout/LayoutObject.h" 43 #include "core/layout/LayoutObject.h"
44 #include "core/layout/svg/LayoutSVGResourceContainer.h" 44 #include "core/layout/svg/LayoutSVGResourceContainer.h"
45 #include "core/svg/SVGAnimateElement.h" 45 #include "core/svg/SVGAnimateElement.h"
46 #include "core/svg/SVGCursorElement.h" 46 #include "core/svg/SVGCursorElement.h"
47 #include "core/svg/SVGDocumentExtensions.h" 47 #include "core/svg/SVGDocumentExtensions.h"
48 #include "core/svg/SVGElementRareData.h" 48 #include "core/svg/SVGElementRareData.h"
49 #include "core/svg/SVGGraphicsElement.h" 49 #include "core/svg/SVGGraphicsElement.h"
50 #include "core/svg/SVGSVGElement.h" 50 #include "core/svg/SVGSVGElement.h"
51 #include "core/svg/SVGTitleElement.h" 51 #include "core/svg/SVGTitleElement.h"
52 #include "core/svg/SVGTreeScopeResources.h"
52 #include "core/svg/SVGUseElement.h" 53 #include "core/svg/SVGUseElement.h"
53 #include "core/svg/properties/SVGProperty.h" 54 #include "core/svg/properties/SVGProperty.h"
54 #include "wtf/TemporaryChange.h" 55 #include "wtf/TemporaryChange.h"
55 #include "wtf/Threading.h" 56 #include "wtf/Threading.h"
56 57
57 namespace blink { 58 namespace blink {
58 59
59 using namespace HTMLNames; 60 using namespace HTMLNames;
60 using namespace SVGNames; 61 using namespace SVGNames;
61 62
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 if (!hasSVGRareData()) 103 if (!hasSVGRareData())
103 return; 104 return;
104 // If the style changes because of a regular property change (not induced by SMIL animations themselves) 105 // If the style changes because of a regular property change (not induced by SMIL animations themselves)
105 // reset the "computed style without SMIL style properties", so the base val ue change gets reflected. 106 // reset the "computed style without SMIL style properties", so the base val ue change gets reflected.
106 if (change > NoChange || needsStyleRecalc()) 107 if (change > NoChange || needsStyleRecalc())
107 svgRareData()->setNeedsOverrideComputedStyleUpdate(); 108 svgRareData()->setNeedsOverrideComputedStyleUpdate();
108 } 109 }
109 110
110 void SVGElement::buildPendingResourcesIfNeeded() 111 void SVGElement::buildPendingResourcesIfNeeded()
111 { 112 {
112 Document& document = this->document();
113 if (!needsPendingResourceHandling() || !inShadowIncludingDocument() || inUse ShadowTree()) 113 if (!needsPendingResourceHandling() || !inShadowIncludingDocument() || inUse ShadowTree())
114 return; 114 return;
115 115
116 SVGDocumentExtensions& extensions = document.accessSVGExtensions(); 116 SVGTreeScopeResources& treeScopeResources = this->treeScope().accessSVGTreeS copedResources();
117 AtomicString resourceId = getIdAttribute(); 117 AtomicString resourceId = getIdAttribute();
118 if (!extensions.hasPendingResource(resourceId)) 118 if (!treeScopeResources.hasPendingResource(resourceId))
119 return; 119 return;
120 120
121 // Mark pending resources as pending for removal. 121 // Mark pending resources as pending for removal.
122 extensions.markPendingResourcesForRemoval(resourceId); 122 treeScopeResources.markPendingResourcesForRemoval(resourceId);
123 123
124 // Rebuild pending resources for each client of a pending resource that is b eing removed. 124 // Rebuild pending resources for each client of a pending resource that is b eing removed.
125 while (Element* clientElement = extensions.removeElementFromPendingResources ForRemoval(resourceId)) { 125 while (Element* clientElement = treeScopeResources.removeElementFromPendingR esourcesForRemoval(resourceId)) {
126 ASSERT(clientElement->hasPendingResources()); 126 ASSERT(clientElement->hasPendingResources());
127 if (clientElement->hasPendingResources()) { 127 if (clientElement->hasPendingResources()) {
128 // FIXME: Ideally we'd always resolve pending resources async instea d of inside 128 // FIXME: Ideally we'd always resolve pending resources async instea d of inside
129 // insertedInto and svgAttributeChanged. For now we only do it for < use> since 129 // insertedInto and svgAttributeChanged. For now we only do it for < use> since
130 // that would stamp out DOM. 130 // that would stamp out DOM.
131 if (isSVGUseElement(clientElement)) 131 if (isSVGUseElement(clientElement))
132 toSVGUseElement(clientElement)->invalidateShadowTree(); 132 toSVGUseElement(clientElement)->invalidateShadowTree();
133 else 133 else
134 clientElement->buildPendingResource(); 134 clientElement->buildPendingResource();
135 extensions.clearHasPendingResourcesIfPossible(clientElement); 135 treeScopeResources.clearHasPendingResourcesIfPossible(clientElement) ;
136 } 136 }
137 } 137 }
138 } 138 }
139 139
140 SVGElementRareData* SVGElement::ensureSVGRareData() 140 SVGElementRareData* SVGElement::ensureSVGRareData()
141 { 141 {
142 if (hasSVGRareData()) 142 if (hasSVGRareData())
143 return svgRareData(); 143 return svgRareData();
144 144
145 m_SVGRareData = new SVGElementRareData(this); 145 m_SVGRareData = new SVGElementRareData(this);
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 Element::trace(visitor); 1175 Element::trace(visitor);
1176 } 1176 }
1177 1177
1178 const AtomicString& SVGElement::eventParameterName() 1178 const AtomicString& SVGElement::eventParameterName()
1179 { 1179 {
1180 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt")); 1180 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt"));
1181 return evtString; 1181 return evtString;
1182 } 1182 }
1183 1183
1184 } // namespace blink 1184 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp ('k') | third_party/WebKit/Source/core/svg/SVGFEImageElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698