| Index: Source/core/dom/shadow/ElementShadow.cpp
|
| diff --git a/Source/core/dom/shadow/ElementShadow.cpp b/Source/core/dom/shadow/ElementShadow.cpp
|
| index ad449159c82d820e2b629b0609037e6acb4b7aa4..9276974aa453970fc9e0959331060577a6012e98 100644
|
| --- a/Source/core/dom/shadow/ElementShadow.cpp
|
| +++ b/Source/core/dom/shadow/ElementShadow.cpp
|
| @@ -31,6 +31,7 @@
|
| #include "core/dom/ElementTraversal.h"
|
| #include "core/dom/NodeTraversal.h"
|
| #include "core/dom/shadow/DistributedNodes.h"
|
| +#include "core/frame/UseCounter.h"
|
| #include "core/html/HTMLContentElement.h"
|
| #include "core/html/HTMLShadowElement.h"
|
| #include "core/inspector/InspectorInstrumentation.h"
|
| @@ -147,8 +148,12 @@ ShadowRoot& ElementShadow::addShadowRoot(Element& shadowHost, ShadowRoot::Shadow
|
| EventDispatchForbiddenScope assertNoEventDispatch;
|
| ScriptForbiddenScope forbidScript;
|
|
|
| - if (type == ShadowRoot::OpenShadowRoot && (!youngestShadowRoot() || youngestShadowRoot()->type() == ShadowRoot::UserAgentShadowRoot))
|
| - shadowHost.willAddFirstOpenShadowRoot();
|
| + if (type == ShadowRoot::OpenShadowRoot) {
|
| + if (!youngestShadowRoot() || youngestShadowRoot()->type() == ShadowRoot::UserAgentShadowRoot)
|
| + shadowHost.willAddFirstOpenShadowRoot();
|
| + else
|
| + UseCounter::count(shadowHost.document(), UseCounter::ElementCreateShadowRootMultiple);
|
| + }
|
|
|
| for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot())
|
| root->lazyReattachIfAttached();
|
|
|