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

Side by Side Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 1751953003: Remove the support of multiple shadow roots with a user agent shadow root (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix failing tests Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/dom/custom-elements-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1884 matching lines...) Expand 10 before | Expand all | Expand 10 after
1895 CustomElementDefinition* Element::customElementDefinition() const 1895 CustomElementDefinition* Element::customElementDefinition() const
1896 { 1896 {
1897 if (hasRareData()) 1897 if (hasRareData())
1898 return elementRareData()->customElementDefinition(); 1898 return elementRareData()->customElementDefinition();
1899 return nullptr; 1899 return nullptr;
1900 } 1900 }
1901 1901
1902 PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(const ScriptState* scriptState, ExceptionState& exceptionState) 1902 PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(const ScriptState* scriptState, ExceptionState& exceptionState)
1903 { 1903 {
1904 OriginsUsingFeatures::countMainWorldOnly(scriptState, document(), OriginsUsi ngFeatures::Feature::ElementCreateShadowRoot); 1904 OriginsUsingFeatures::countMainWorldOnly(scriptState, document(), OriginsUsi ngFeatures::Feature::ElementCreateShadowRoot);
1905 ShadowRoot* root = shadowRoot(); 1905 if (ShadowRoot* root = shadowRoot()) {
1906 if (root && (root->type() == ShadowRootType::Open || root->type() == ShadowR ootType::Closed)) { 1906 if (root->isV1()) {
1907 exceptionState.throwDOMException(InvalidStateError, "Shadow root cannot be created on a host which already hosts this type of shadow tree."); 1907 exceptionState.throwDOMException(InvalidStateError, "Shadow root can not be created on a host which already hosts a v1 shadow tree.");
1908 return nullptr; 1908 return nullptr;
1909 }
1910 if (root->type() == ShadowRootType::UserAgent) {
1911 exceptionState.throwDOMException(InvalidStateError, "Shadow root can not be created on a host which already hosts an user-agent shadow tree.");
1912 return nullptr;
1913 }
1909 } 1914 }
1910 return createShadowRootInternal(ShadowRootType::V0, exceptionState); 1915 return createShadowRootInternal(ShadowRootType::V0, exceptionState);
1911 } 1916 }
1912 1917
1913 PassRefPtrWillBeRawPtr<ShadowRoot> Element::attachShadow(const ScriptState* scri ptState, const ShadowRootInit& shadowRootInitDict, ExceptionState& exceptionStat e) 1918 PassRefPtrWillBeRawPtr<ShadowRoot> Element::attachShadow(const ScriptState* scri ptState, const ShadowRootInit& shadowRootInitDict, ExceptionState& exceptionStat e)
1914 { 1919 {
1915 ASSERT(RuntimeEnabledFeatures::shadowDOMV1Enabled()); 1920 ASSERT(RuntimeEnabledFeatures::shadowDOMV1Enabled());
1916 1921
1917 OriginsUsingFeatures::countMainWorldOnly(scriptState, document(), OriginsUsi ngFeatures::Feature::ElementAttachShadow); 1922 OriginsUsingFeatures::countMainWorldOnly(scriptState, document(), OriginsUsi ngFeatures::Feature::ElementAttachShadow);
1918 1923
(...skipping 1723 matching lines...) Expand 10 before | Expand all | Expand 10 after
3642 { 3647 {
3643 #if ENABLE(OILPAN) 3648 #if ENABLE(OILPAN)
3644 if (hasRareData()) 3649 if (hasRareData())
3645 visitor->trace(elementRareData()); 3650 visitor->trace(elementRareData());
3646 visitor->trace(m_elementData); 3651 visitor->trace(m_elementData);
3647 #endif 3652 #endif
3648 ContainerNode::trace(visitor); 3653 ContainerNode::trace(visitor);
3649 } 3654 }
3650 3655
3651 } // namespace blink 3656 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/dom/custom-elements-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698