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

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

Issue 1158163004: Add ShadowRootInit dictionary. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 33e363250550cde42777781a8a60cb984a27d45b..77cdcf9e400f6b33ba56454926f09664b12a67bc 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -67,6 +67,7 @@
#include "core/dom/PseudoElement.h"
#include "core/dom/ScriptableDocumentParser.h"
#include "core/dom/SelectorQuery.h"
+#include "core/dom/ShadowRootInit.h"
#include "core/dom/StyleChangeReason.h"
#include "core/dom/StyleEngine.h"
#include "core/dom/Text.h"
@@ -1803,9 +1804,15 @@ CustomElementDefinition* Element::customElementDefinition() const
return nullptr;
}
-PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(ScriptState* scriptState, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(ScriptState* scriptState, ShadowRootInit& shadowRootInitDict, ExceptionState& exceptionState)
{
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);
}

Powered by Google App Engine
This is Rietveld 408576698