OLD | NEW |
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 1883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1894 OriginsUsingFeatures::countMainWorldOnly(scriptState, document(), OriginsUsi
ngFeatures::Feature::ElementCreateShadowRoot); | 1894 OriginsUsingFeatures::countMainWorldOnly(scriptState, document(), OriginsUsi
ngFeatures::Feature::ElementCreateShadowRoot); |
1895 if (ShadowRoot* root = shadowRoot()) { | 1895 if (ShadowRoot* root = shadowRoot()) { |
1896 if (root->isV1()) { | 1896 if (root->isV1()) { |
1897 exceptionState.throwDOMException(InvalidStateError, "Shadow root can
not be created on a host which already hosts a v1 shadow tree."); | 1897 exceptionState.throwDOMException(InvalidStateError, "Shadow root can
not be created on a host which already hosts a v1 shadow tree."); |
1898 return nullptr; | 1898 return nullptr; |
1899 } | 1899 } |
1900 if (root->type() == ShadowRootType::UserAgent) { | 1900 if (root->type() == ShadowRootType::UserAgent) { |
1901 exceptionState.throwDOMException(InvalidStateError, "Shadow root can
not be created on a host which already hosts an user-agent shadow tree."); | 1901 exceptionState.throwDOMException(InvalidStateError, "Shadow root can
not be created on a host which already hosts an user-agent shadow tree."); |
1902 return nullptr; | 1902 return nullptr; |
1903 } | 1903 } |
| 1904 } else if (alwaysCreateUserAgentShadowRoot()) { |
| 1905 exceptionState.throwDOMException(InvalidStateError, "Shadow root cannot
be created on a host which already hosts an user-agent shadow tree."); |
| 1906 return nullptr; |
1904 } | 1907 } |
1905 document().setShadowCascadeOrder(ShadowCascadeOrder::ShadowCascadeV0); | 1908 document().setShadowCascadeOrder(ShadowCascadeOrder::ShadowCascadeV0); |
1906 | 1909 |
1907 return createShadowRootInternal(ShadowRootType::V0, exceptionState); | 1910 return createShadowRootInternal(ShadowRootType::V0, exceptionState); |
1908 } | 1911 } |
1909 | 1912 |
1910 ShadowRoot* Element::attachShadow(const ScriptState* scriptState, const ShadowRo
otInit& shadowRootInitDict, ExceptionState& exceptionState) | 1913 ShadowRoot* Element::attachShadow(const ScriptState* scriptState, const ShadowRo
otInit& shadowRootInitDict, ExceptionState& exceptionState) |
1911 { | 1914 { |
1912 DCHECK(RuntimeEnabledFeatures::shadowDOMV1Enabled()); | 1915 DCHECK(RuntimeEnabledFeatures::shadowDOMV1Enabled()); |
1913 | 1916 |
(...skipping 1762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3676 | 3679 |
3677 DEFINE_TRACE(Element) | 3680 DEFINE_TRACE(Element) |
3678 { | 3681 { |
3679 if (hasRareData()) | 3682 if (hasRareData()) |
3680 visitor->trace(elementRareData()); | 3683 visitor->trace(elementRareData()); |
3681 visitor->trace(m_elementData); | 3684 visitor->trace(m_elementData); |
3682 ContainerNode::trace(visitor); | 3685 ContainerNode::trace(visitor); |
3683 } | 3686 } |
3684 | 3687 |
3685 } // namespace blink | 3688 } // namespace blink |
OLD | NEW |