| Index: Source/core/dom/Element.cpp
|
| diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
|
| index df7cfc8d14fcaeeffc9cf1d8ac3a0cde8982f163..a6b1b85232e3b8038577ec7f9c3ea8d490df99d1 100644
|
| --- a/Source/core/dom/Element.cpp
|
| +++ b/Source/core/dom/Element.cpp
|
| @@ -74,6 +74,7 @@
|
| #include "core/dom/custom/CustomElementRegistrationContext.h"
|
| #include "core/dom/shadow/InsertionPoint.h"
|
| #include "core/dom/shadow/ShadowRoot.h"
|
| +#include "core/dom/shadow/ShadowRootInit.h"
|
| #include "core/editing/FrameSelection.h"
|
| #include "core/editing/htmlediting.h"
|
| #include "core/editing/iterators/TextIterator.h"
|
| @@ -1809,6 +1810,21 @@ PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(ScriptState* script
|
| return createShadowRoot(exceptionState);
|
| }
|
|
|
| +PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(ScriptState* scriptState, ShadowRootInit& shadowRootInitDict, ExceptionState& exceptionState)
|
| +{
|
| + ASSERT(RuntimeEnabledFeatures::createShadowRootWithParameterEnabled());
|
| + UseCounter::count(document(), UseCounter::ElementCreateShadowRootWithParameter);
|
| +
|
| + OriginsUsingFeatures::count(scriptState, document(), OriginsUsingFeatures::Feature::ElementCreateShadowRoot);
|
| + // TODO(kochi): Add support for closed shadow root. crbug.com/459136
|
| + if (shadowRootInitDict.hasMode() && shadowRootInitDict.mode() == "closed") {
|
| + exceptionState.throwDOMException(NotSupportedError, "Closed shadow root is not implemented yet.");
|
| + return nullptr;
|
| + }
|
| +
|
| + return createShadowRoot(exceptionState);
|
| +}
|
| +
|
| PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(ExceptionState& exceptionState)
|
| {
|
| if (alwaysCreateUserAgentShadowRoot())
|
|
|