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 1884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |