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

Unified Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp
index d7ca9bd4e47967f2706be861927210e7c595504e..a0f5c30489158f95ce0ec2baa1797fdd7415b470 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp
@@ -26,17 +26,17 @@
#include "core/layout/svg/SVGResources.h"
#include "core/layout/svg/SVGResourcesCache.h"
#include "core/paint/PaintLayer.h"
-
+#include "core/svg/SVGDocumentExtensions.h"
+#include "core/svg/SVGTreeScopeResources.h"
#include "wtf/TemporaryChange.h"
namespace blink {
-static inline SVGDocumentExtensions& svgExtensionsFromElement(Element* element)
+static inline SVGTreeScopeResources& svgTreeScopeResourcesFromElement(Element* element)
{
ASSERT(element);
- return element->document().accessSVGExtensions();
+ return element->treeScope().accessSVGTreeScopedResources();
}
-
LayoutSVGResourceContainer::LayoutSVGResourceContainer(SVGElement* node)
: LayoutSVGHiddenContainer(node)
, m_isInLayout(false)
@@ -79,7 +79,7 @@ void LayoutSVGResourceContainer::willBeDestroyed()
LayoutSVGHiddenContainer::willBeDestroyed();
if (m_registered)
- svgExtensionsFromElement(element()).removeResource(m_id);
+ svgTreeScopeResourcesFromElement(element()).removeResource(m_id);
}
void LayoutSVGResourceContainer::styleDidChange(StyleDifference diff, const ComputedStyle* oldStyle)
@@ -103,7 +103,7 @@ void LayoutSVGResourceContainer::detachAllClients()
// Add a pending resolution based on the id of the old resource.
Element* clientElement = toElement(client->node());
- svgExtensionsFromElement(clientElement).addPendingResource(m_id, clientElement);
+ svgTreeScopeResourcesFromElement(clientElement).addPendingResource(m_id, clientElement);
}
removeAllClientsFromCache();
@@ -115,8 +115,8 @@ void LayoutSVGResourceContainer::idChanged()
removeAllClientsFromCache();
// Remove old id, that is guaranteed to be present in cache.
- SVGDocumentExtensions& extensions = svgExtensionsFromElement(element());
- extensions.removeResource(m_id);
+ SVGTreeScopeResources& treeScopeResources = svgTreeScopeResourcesFromElement(element());
+ treeScopeResources.removeResource(m_id);
m_id = element()->getIdAttribute();
registerResource();
@@ -221,21 +221,21 @@ void LayoutSVGResourceContainer::invalidateCacheAndMarkForLayout(SubtreeLayoutSc
void LayoutSVGResourceContainer::registerResource()
{
- SVGDocumentExtensions& extensions = svgExtensionsFromElement(element());
- if (!extensions.hasPendingResource(m_id)) {
- extensions.addResource(m_id, this);
+ SVGTreeScopeResources& treeScopeResources = svgTreeScopeResourcesFromElement(element());
+
+ if (!treeScopeResources.hasPendingResource(m_id)) {
+ treeScopeResources.addResource(m_id, this);
return;
}
-
- SVGDocumentExtensions::SVGPendingElements* clients(extensions.removePendingResource(m_id));
+ SVGTreeScopeResources::SVGPendingElements* clients(treeScopeResources.removePendingResource(m_id));
// Cache us with the new id.
- extensions.addResource(m_id, this);
+ treeScopeResources.addResource(m_id, this);
// Update cached resources of pending clients.
for (const auto& pendingClient : *clients) {
ASSERT(pendingClient->hasPendingResources());
- extensions.clearHasPendingResourcesIfPossible(pendingClient);
+ treeScopeResources.clearHasPendingResourcesIfPossible(pendingClient);
LayoutObject* layoutObject = pendingClient->layoutObject();
if (!layoutObject)
continue;

Powered by Google App Engine
This is Rietveld 408576698