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

Unified Diff: third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp

Issue 1901403002: Remove UserAgent ShadowRoot + Author ShadowRoot code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Element::createShadowRoot, update some tests Created 4 years, 8 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: third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp
diff --git a/third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp b/third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp
index aa11696e48e513f271c11440900cbd4e7b20a427..b4e93ba31e21a2d560841d0c6c4d0367a5f4cac1 100644
--- a/third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp
+++ b/third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp
@@ -149,17 +149,9 @@ ShadowRoot& ElementShadow::addShadowRoot(Element& shadowHost, ShadowRootType typ
EventDispatchForbiddenScope assertNoEventDispatch;
ScriptForbiddenScope forbidScript;
- if (type == ShadowRootType::V0) {
- if (m_shadowRoots.isEmpty()) {
- shadowHost.willAddFirstAuthorShadowRoot();
- } else if (m_shadowRoots.head()->type() == ShadowRootType::UserAgent) {
- shadowHost.willAddFirstAuthorShadowRoot();
- Deprecation::countDeprecation(shadowHost.document(), UseCounter::ElementCreateShadowRootMultipleWithUserAgentShadowRoot);
- } else {
- Deprecation::countDeprecation(shadowHost.document(), UseCounter::ElementCreateShadowRootMultiple);
- }
- } else if (type == ShadowRootType::Open || type == ShadowRootType::Closed) {
- shadowHost.willAddFirstAuthorShadowRoot();
+ if (type == ShadowRootType::V0 && !m_shadowRoots.isEmpty()) {
+ DCHECK_NE(ShadowRootType::UserAgent, m_shadowRoots.head()->type());
+ Deprecation::countDeprecation(shadowHost.document(), UseCounter::ElementCreateShadowRootMultiple);
}
for (ShadowRoot* root = m_shadowRoots.head(); root; root = root->olderShadowRoot())
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | third_party/WebKit/Source/core/dom/shadow/ShadowRoot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698