| 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 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 { | 1018 { |
| 1019 if (styleChangeType() != NoStyleChange) | 1019 if (styleChangeType() != NoStyleChange) |
| 1020 return; | 1020 return; |
| 1021 | 1021 |
| 1022 setNeedsStyleRecalc(LocalStyleChange); | 1022 setNeedsStyleRecalc(LocalStyleChange); |
| 1023 setAnimationStyleChange(true); | 1023 setAnimationStyleChange(true); |
| 1024 } | 1024 } |
| 1025 | 1025 |
| 1026 void Element::setCustomElementDefinition(PassRefPtr<CustomElementDefinition> def
inition) | 1026 void Element::setCustomElementDefinition(PassRefPtr<CustomElementDefinition> def
inition) |
| 1027 { | 1027 { |
| 1028 if (!hasRareData() && !definition) | 1028 ASSERT(!m_customElementDefinition); |
| 1029 return; | 1029 m_customElementDefinition = definition; |
| 1030 ASSERT(!customElementDefinition()); | |
| 1031 ensureElementRareData().setCustomElementDefinition(definition); | |
| 1032 } | 1030 } |
| 1033 | 1031 |
| 1034 CustomElementDefinition* Element::customElementDefinition() const | 1032 CustomElementDefinition* Element::customElementDefinition() const |
| 1035 { | 1033 { |
| 1036 if (hasRareData()) | 1034 return m_customElementDefinition.get(); |
| 1037 return elementRareData()->customElementDefinition(); | |
| 1038 return 0; | |
| 1039 } | 1035 } |
| 1040 | 1036 |
| 1041 // TODO(esprehn): Implement the sky spec where shadow roots are a custom | 1037 // TODO(esprehn): Implement the sky spec where shadow roots are a custom |
| 1042 // element registration feature. | 1038 // element registration feature. |
| 1043 PassRefPtr<ShadowRoot> Element::ensureShadowRoot(ExceptionState& exceptionState) | 1039 PassRefPtr<ShadowRoot> Element::ensureShadowRoot(ExceptionState& exceptionState) |
| 1044 { | 1040 { |
| 1045 if (ShadowRoot* root = shadowRoot()) | 1041 if (ShadowRoot* root = shadowRoot()) |
| 1046 return root; | 1042 return root; |
| 1047 return PassRefPtr<ShadowRoot>(ensureShadow().addShadowRoot(*this)); | 1043 return PassRefPtr<ShadowRoot>(ensureShadow().addShadowRoot(*this)); |
| 1048 } | 1044 } |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1741 return false; | 1737 return false; |
| 1742 if (treeScope().scopedStyleResolver().hasSelectorForId(idValue)) | 1738 if (treeScope().scopedStyleResolver().hasSelectorForId(idValue)) |
| 1743 return true; | 1739 return true; |
| 1744 // Host rules could also have effects. | 1740 // Host rules could also have effects. |
| 1745 if (ShadowRoot* shadowRoot = this->shadowRoot()) | 1741 if (ShadowRoot* shadowRoot = this->shadowRoot()) |
| 1746 return shadowRoot->scopedStyleResolver().hasSelectorForId(idValue); | 1742 return shadowRoot->scopedStyleResolver().hasSelectorForId(idValue); |
| 1747 return false; | 1743 return false; |
| 1748 } | 1744 } |
| 1749 | 1745 |
| 1750 } // namespace blink | 1746 } // namespace blink |
| OLD | NEW |