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

Unified Diff: third_party/WebKit/Source/core/svg/SVGUseElement.cpp

Issue 2197533002: Use an open shadow root in <use> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/svg/SVGUseElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
index fe8395d9c685a788366f03faa7439430b2ec6fff..d03b93b53fe1738e41f619eb46a1454e02b114c8 100644
--- a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
@@ -74,9 +74,9 @@ inline SVGUseElement::SVGUseElement(Document& document)
SVGUseElement* SVGUseElement::create(Document& document)
{
- // Always build a user agent #shadow-root for SVGUseElement.
+ // Always build a closed #shadow-root for SVGUseElement.
SVGUseElement* use = new SVGUseElement(document);
- use->ensureUserAgentShadowRoot();
+ use->ensureShadow().addShadowRoot(*use, ShadowRootType::Open);
return use;
}
@@ -302,7 +302,7 @@ void SVGUseElement::clearShadowTree()
clearInstanceRoot();
// FIXME: We should try to optimize this, to at least allow partial reclones.
- if (ShadowRoot* shadowTreeRootElement = userAgentShadowRoot())
+ if (ShadowRoot* shadowTreeRootElement = openShadowRoot())
shadowTreeRootElement->removeChildren(OmitSubtreeModifiedEvent);
removeAllOutgoingReferences();
@@ -437,7 +437,7 @@ void SVGUseElement::buildShadowAndInstanceTree(SVGElement& target)
// Clone the target subtree into the shadow tree, not handling <use> and <symbol> yet.
Element* instanceRoot = createInstanceTree(target);
m_targetElementInstance = toSVGElement(instanceRoot);
- ShadowRoot* shadowTreeRootElement = userAgentShadowRoot();
+ ShadowRoot* shadowTreeRootElement = openShadowRoot();
shadowTreeRootElement->appendChild(instanceRoot);
addReferencesToFirstDegreeNestedUseElements(target);
@@ -506,7 +506,7 @@ void SVGUseElement::toClipPath(Path& path) const
SVGGraphicsElement* SVGUseElement::visibleTargetGraphicsElementForClipping() const
{
- Node* n = userAgentShadowRoot()->firstChild();
+ Node* n = openShadowRoot()->firstChild();
if (!n || !n->isSVGElement())
return nullptr;
@@ -550,7 +550,7 @@ void SVGUseElement::addReferencesToFirstDegreeNestedUseElements(SVGElement& targ
void SVGUseElement::cloneNonMarkupEventListeners()
{
- for (SVGElement& element : Traversal<SVGElement>::descendantsOf(*userAgentShadowRoot())) {
+ for (SVGElement& element : Traversal<SVGElement>::descendantsOf(*openShadowRoot())) {
if (EventTargetData* data = element.correspondingElement()->eventTargetData())
data->eventListenerMap.copyEventListenersNotCreatedFromMarkupToTarget(&element);
}
@@ -604,7 +604,7 @@ bool SVGUseElement::expandUseElementsInShadowTree()
// contains <use> tags, we'd miss them. So once we're done with setting up the
// actual shadow tree (after the special case modification for svg/symbol) we have
// to walk it completely and expand all <use> elements.
- ShadowRoot* shadowRoot = userAgentShadowRoot();
+ ShadowRoot* shadowRoot = openShadowRoot();
for (SVGUseElement* use = Traversal<SVGUseElement>::firstWithin(*shadowRoot); use; ) {
ASSERT(!use->resourceIsStillLoading());
@@ -742,7 +742,7 @@ bool SVGUseElement::resourceIsValid() const
bool SVGUseElement::instanceTreeIsLoading() const
{
- for (const SVGUseElement& useElement : Traversal<SVGUseElement>::descendantsOf(*userAgentShadowRoot())) {
+ for (const SVGUseElement& useElement : Traversal<SVGUseElement>::descendantsOf(*openShadowRoot())) {
if (useElement.resourceIsStillLoading())
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698