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

Unified Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 1408443003: Add Element.attachShadow under the ShadowDOMV1 runtime flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rewrite a test Created 5 years, 2 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 | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/Element.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index 68af23e2104623ab7161b1d3d3d92e123197ecf8..210306d7686e42846e3dcf10033eee127f2baccd 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -1918,12 +1918,11 @@ PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(const ScriptState*
return createShadowRootInternal(ShadowRootType::OpenByDefault, exceptionState);
}
-PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(const ScriptState* scriptState, const ShadowRootInit& shadowRootInitDict, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<ShadowRoot> Element::attachShadow(const ScriptState* scriptState, const ShadowRootInit& shadowRootInitDict, ExceptionState& exceptionState)
{
ASSERT(RuntimeEnabledFeatures::shadowDOMV1Enabled());
- UseCounter::count(document(), UseCounter::ElementCreateShadowRootWithParameter);
- OriginsUsingFeatures::countMainWorldOnly(scriptState, document(), OriginsUsingFeatures::Feature::ElementCreateShadowRoot);
+ OriginsUsingFeatures::countMainWorldOnly(scriptState, document(), OriginsUsingFeatures::Feature::ElementAttachShadow);
if (shadowRootInitDict.hasMode() && shadowRoot()) {
exceptionState.throwDOMException(InvalidStateError, "Shadow root cannot be created on a host which already hosts a shadow tree.");
@@ -1939,9 +1938,9 @@ PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(const ScriptState*
exceptionState.throwDOMException(NotSupportedError, "Closed shadow root is not supported yet.");
return nullptr;
}
- UseCounter::count(document(), UseCounter::ElementCreateShadowRootClosed);
+ UseCounter::count(document(), UseCounter::ElementAttachShadowClosed);
} else if (type == ShadowRootType::Open) {
- UseCounter::count(document(), UseCounter::ElementCreateShadowRootOpen);
+ UseCounter::count(document(), UseCounter::ElementAttachShadowOpen);
}
RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = createShadowRootInternal(type, exceptionState);
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/Element.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698