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 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1731 ensureElementRareData().setCustomElementDefinition(definition); | 1731 ensureElementRareData().setCustomElementDefinition(definition); |
1732 } | 1732 } |
1733 | 1733 |
1734 CustomElementDefinition* Element::customElementDefinition() const | 1734 CustomElementDefinition* Element::customElementDefinition() const |
1735 { | 1735 { |
1736 if (hasRareData()) | 1736 if (hasRareData()) |
1737 return elementRareData()->customElementDefinition(); | 1737 return elementRareData()->customElementDefinition(); |
1738 return 0; | 1738 return 0; |
1739 } | 1739 } |
1740 | 1740 |
1741 PassRefPtr<ShadowRoot> Element::createShadowRoot(ExceptionState& exceptionState) | 1741 PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(ExceptionState& exc
eptionState) |
1742 { | 1742 { |
1743 if (alwaysCreateUserAgentShadowRoot()) | 1743 if (alwaysCreateUserAgentShadowRoot()) |
1744 ensureUserAgentShadowRoot(); | 1744 ensureUserAgentShadowRoot(); |
1745 | 1745 |
1746 // Some elements make assumptions about what kind of renderers they allow | 1746 // Some elements make assumptions about what kind of renderers they allow |
1747 // as children so we can't allow author shadows on them for now. An override | 1747 // as children so we can't allow author shadows on them for now. An override |
1748 // flag is provided for testing how author shadows interact on these element
s. | 1748 // flag is provided for testing how author shadows interact on these element
s. |
1749 if (!areAuthorShadowsAllowed() && !RuntimeEnabledFeatures::authorShadowDOMFo
rAnyElementEnabled()) { | 1749 if (!areAuthorShadowsAllowed() && !RuntimeEnabledFeatures::authorShadowDOMFo
rAnyElementEnabled()) { |
1750 exceptionState.throwDOMException(HierarchyRequestError, "Author-created
shadow roots are disabled for this element."); | 1750 exceptionState.throwDOMException(HierarchyRequestError, "Author-created
shadow roots are disabled for this element."); |
1751 return nullptr; | 1751 return nullptr; |
1752 } | 1752 } |
1753 | 1753 |
1754 return PassRefPtr<ShadowRoot>(ensureShadow().addShadowRoot(*this, ShadowRoot
::AuthorShadowRoot)); | 1754 return PassRefPtrWillBeRawPtr<ShadowRoot>(ensureShadow().addShadowRoot(*this
, ShadowRoot::AuthorShadowRoot)); |
1755 } | 1755 } |
1756 | 1756 |
1757 ShadowRoot* Element::shadowRoot() const | 1757 ShadowRoot* Element::shadowRoot() const |
1758 { | 1758 { |
1759 ElementShadow* elementShadow = shadow(); | 1759 ElementShadow* elementShadow = shadow(); |
1760 if (!elementShadow) | 1760 if (!elementShadow) |
1761 return 0; | 1761 return 0; |
1762 ShadowRoot* shadowRoot = elementShadow->youngestShadowRoot(); | 1762 ShadowRoot* shadowRoot = elementShadow->youngestShadowRoot(); |
1763 if (shadowRoot->type() == ShadowRoot::AuthorShadowRoot) | 1763 if (shadowRoot->type() == ShadowRoot::AuthorShadowRoot) |
1764 return shadowRoot; | 1764 return shadowRoot; |
(...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3301 | 3301 |
3302 void Element::trace(Visitor* visitor) | 3302 void Element::trace(Visitor* visitor) |
3303 { | 3303 { |
3304 if (hasRareData()) | 3304 if (hasRareData()) |
3305 visitor->trace(elementRareData()); | 3305 visitor->trace(elementRareData()); |
3306 | 3306 |
3307 ContainerNode::trace(visitor); | 3307 ContainerNode::trace(visitor); |
3308 } | 3308 } |
3309 | 3309 |
3310 } // namespace WebCore | 3310 } // namespace WebCore |
OLD | NEW |