| 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 * Copyright (C) 2003-2011, 2013, 2014 Apple Inc. All rights reserved. | 6 * Copyright (C) 2003-2011, 2013, 2014 Apple Inc. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 class MutableStylePropertySet; | 61 class MutableStylePropertySet; |
| 62 class NodeIntersectionObserverData; | 62 class NodeIntersectionObserverData; |
| 63 class PropertySetCSSStyleDeclaration; | 63 class PropertySetCSSStyleDeclaration; |
| 64 class PseudoElement; | 64 class PseudoElement; |
| 65 class ScrollState; | 65 class ScrollState; |
| 66 class ScrollStateCallback; | 66 class ScrollStateCallback; |
| 67 class ScrollToOptions; | 67 class ScrollToOptions; |
| 68 class ShadowRoot; | 68 class ShadowRoot; |
| 69 class ShadowRootInit; | 69 class ShadowRootInit; |
| 70 class StylePropertySet; | 70 class StylePropertySet; |
| 71 class StylePropertyMap; |
| 71 | 72 |
| 72 enum SpellcheckAttributeState { | 73 enum SpellcheckAttributeState { |
| 73 SpellcheckAttributeTrue, | 74 SpellcheckAttributeTrue, |
| 74 SpellcheckAttributeFalse, | 75 SpellcheckAttributeFalse, |
| 75 SpellcheckAttributeDefault | 76 SpellcheckAttributeDefault |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 enum ElementFlags { | 79 enum ElementFlags { |
| 79 TabIndexWasSetExplicitly = 1 << 0, | 80 TabIndexWasSetExplicitly = 1 << 0, |
| 80 StyleAffectedByEmpty = 1 << 1, | 81 StyleAffectedByEmpty = 1 << 1, |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 PassRefPtrWillBeRawPtr<Attr> setAttributeNode(Attr*, ExceptionState&); | 237 PassRefPtrWillBeRawPtr<Attr> setAttributeNode(Attr*, ExceptionState&); |
| 237 PassRefPtrWillBeRawPtr<Attr> setAttributeNodeNS(Attr*, ExceptionState&); | 238 PassRefPtrWillBeRawPtr<Attr> setAttributeNodeNS(Attr*, ExceptionState&); |
| 238 PassRefPtrWillBeRawPtr<Attr> removeAttributeNode(Attr*, ExceptionState&); | 239 PassRefPtrWillBeRawPtr<Attr> removeAttributeNode(Attr*, ExceptionState&); |
| 239 | 240 |
| 240 PassRefPtrWillBeRawPtr<Attr> attrIfExists(const QualifiedName&); | 241 PassRefPtrWillBeRawPtr<Attr> attrIfExists(const QualifiedName&); |
| 241 PassRefPtrWillBeRawPtr<Attr> ensureAttr(const QualifiedName&); | 242 PassRefPtrWillBeRawPtr<Attr> ensureAttr(const QualifiedName&); |
| 242 | 243 |
| 243 AttrNodeList* attrNodeList(); | 244 AttrNodeList* attrNodeList(); |
| 244 | 245 |
| 245 CSSStyleDeclaration* style(); | 246 CSSStyleDeclaration* style(); |
| 247 StylePropertyMap* styleMap(); |
| 246 | 248 |
| 247 const QualifiedName& tagQName() const { return m_tagName; } | 249 const QualifiedName& tagQName() const { return m_tagName; } |
| 248 String tagName() const { return nodeName(); } | 250 String tagName() const { return nodeName(); } |
| 249 | 251 |
| 250 bool hasTagName(const QualifiedName& tagName) const { return m_tagName.match
es(tagName); } | 252 bool hasTagName(const QualifiedName& tagName) const { return m_tagName.match
es(tagName); } |
| 251 bool hasTagName(const HTMLQualifiedName& tagName) const { return ContainerNo
de::hasTagName(tagName); } | 253 bool hasTagName(const HTMLQualifiedName& tagName) const { return ContainerNo
de::hasTagName(tagName); } |
| 252 bool hasTagName(const SVGQualifiedName& tagName) const { return ContainerNod
e::hasTagName(tagName); } | 254 bool hasTagName(const SVGQualifiedName& tagName) const { return ContainerNod
e::hasTagName(tagName); } |
| 253 | 255 |
| 254 // Should be called only by Document::createElementNS to fix up m_tagName im
mediately after construction. | 256 // Should be called only by Document::createElementNS to fix up m_tagName im
mediately after construction. |
| 255 void setTagNameForCreateElementNS(const QualifiedName&); | 257 void setTagNameForCreateElementNS(const QualifiedName&); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 274 void setBooleanAttribute(const QualifiedName&, bool); | 276 void setBooleanAttribute(const QualifiedName&, bool); |
| 275 | 277 |
| 276 virtual const StylePropertySet* additionalPresentationAttributeStyle() { ret
urn nullptr; } | 278 virtual const StylePropertySet* additionalPresentationAttributeStyle() { ret
urn nullptr; } |
| 277 void invalidateStyleAttribute(); | 279 void invalidateStyleAttribute(); |
| 278 | 280 |
| 279 const StylePropertySet* inlineStyle() const { return elementData() ? element
Data()->m_inlineStyle.get() : nullptr; } | 281 const StylePropertySet* inlineStyle() const { return elementData() ? element
Data()->m_inlineStyle.get() : nullptr; } |
| 280 | 282 |
| 281 bool setInlineStyleProperty(CSSPropertyID, CSSValueID identifier, bool impor
tant = false); | 283 bool setInlineStyleProperty(CSSPropertyID, CSSValueID identifier, bool impor
tant = false); |
| 282 bool setInlineStyleProperty(CSSPropertyID, double value, CSSPrimitiveValue::
UnitType, bool important = false); | 284 bool setInlineStyleProperty(CSSPropertyID, double value, CSSPrimitiveValue::
UnitType, bool important = false); |
| 283 bool setInlineStyleProperty(CSSPropertyID, const String& value, bool importa
nt = false); | 285 bool setInlineStyleProperty(CSSPropertyID, const String& value, bool importa
nt = false); |
| 286 bool setInlineStyleProperty(CSSPropertyID, const PassRefPtrWillBeRawPtr<CSSV
alue>, bool important = false); |
| 287 |
| 284 bool removeInlineStyleProperty(CSSPropertyID); | 288 bool removeInlineStyleProperty(CSSPropertyID); |
| 285 void removeAllInlineStyleProperties(); | 289 void removeAllInlineStyleProperties(); |
| 286 | 290 |
| 287 void synchronizeStyleAttributeInternal() const; | 291 void synchronizeStyleAttributeInternal() const; |
| 288 | 292 |
| 289 const StylePropertySet* presentationAttributeStyle(); | 293 const StylePropertySet* presentationAttributeStyle(); |
| 290 virtual bool isPresentationAttribute(const QualifiedName&) const { return fa
lse; } | 294 virtual bool isPresentationAttribute(const QualifiedName&) const { return fa
lse; } |
| 291 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons
t AtomicString&, MutableStylePropertySet*) { } | 295 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons
t AtomicString&, MutableStylePropertySet*) { } |
| 292 | 296 |
| 293 // For exposing to DOM only. | 297 // For exposing to DOM only. |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 ElementRareData& ensureElementRareData(); | 709 ElementRareData& ensureElementRareData(); |
| 706 | 710 |
| 707 AttrNodeList& ensureAttrNodeList(); | 711 AttrNodeList& ensureAttrNodeList(); |
| 708 void removeAttrNodeList(); | 712 void removeAttrNodeList(); |
| 709 void detachAllAttrNodesFromElement(); | 713 void detachAllAttrNodesFromElement(); |
| 710 void detachAttrNodeFromElementWithValue(Attr*, const AtomicString& value); | 714 void detachAttrNodeFromElementWithValue(Attr*, const AtomicString& value); |
| 711 void detachAttrNodeAtIndex(Attr*, size_t index); | 715 void detachAttrNodeAtIndex(Attr*, size_t index); |
| 712 | 716 |
| 713 v8::Local<v8::Object> wrapCustomElement(v8::Isolate*, v8::Local<v8::Object>
creationContext); | 717 v8::Local<v8::Object> wrapCustomElement(v8::Isolate*, v8::Local<v8::Object>
creationContext); |
| 714 | 718 |
| 719 void invalidateInlineStylePropertyMap(); |
| 720 |
| 715 RefPtrWillBeMember<ElementData> m_elementData; | 721 RefPtrWillBeMember<ElementData> m_elementData; |
| 716 }; | 722 }; |
| 717 | 723 |
| 718 DEFINE_NODE_TYPE_CASTS(Element, isElementNode()); | 724 DEFINE_NODE_TYPE_CASTS(Element, isElementNode()); |
| 719 template <typename T> bool isElementOfType(const Node&); | 725 template <typename T> bool isElementOfType(const Node&); |
| 720 template <> inline bool isElementOfType<const Element>(const Node& node) { retur
n node.isElementNode(); } | 726 template <> inline bool isElementOfType<const Element>(const Node& node) { retur
n node.isElementNode(); } |
| 721 template <typename T> inline bool isElementOfType(const Element& element) { retu
rn isElementOfType<T>(static_cast<const Node&>(element)); } | 727 template <typename T> inline bool isElementOfType(const Element& element) { retu
rn isElementOfType<T>(static_cast<const Node&>(element)); } |
| 722 template <> inline bool isElementOfType<const Element>(const Element&) { return
true; } | 728 template <> inline bool isElementOfType<const Element>(const Element&) { return
true; } |
| 723 | 729 |
| 724 // Type casting. | 730 // Type casting. |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 if (isInShadowTree() && !treeScope().rootNode().isShadowRoot()) | 877 if (isInShadowTree() && !treeScope().rootNode().isShadowRoot()) |
| 872 clearFlag(IsInShadowTreeFlag); | 878 clearFlag(IsInShadowTreeFlag); |
| 873 if (AXObjectCache* cache = document().existingAXObjectCache()) | 879 if (AXObjectCache* cache = document().existingAXObjectCache()) |
| 874 cache->remove(this); | 880 cache->remove(this); |
| 875 } | 881 } |
| 876 | 882 |
| 877 inline void Element::invalidateStyleAttribute() | 883 inline void Element::invalidateStyleAttribute() |
| 878 { | 884 { |
| 879 ASSERT(elementData()); | 885 ASSERT(elementData()); |
| 880 elementData()->m_styleAttributeIsDirty = true; | 886 elementData()->m_styleAttributeIsDirty = true; |
| 887 invalidateInlineStylePropertyMap(); |
| 881 } | 888 } |
| 882 | 889 |
| 883 inline const StylePropertySet* Element::presentationAttributeStyle() | 890 inline const StylePropertySet* Element::presentationAttributeStyle() |
| 884 { | 891 { |
| 885 if (!elementData()) | 892 if (!elementData()) |
| 886 return nullptr; | 893 return nullptr; |
| 887 if (elementData()->m_presentationAttributeStyleIsDirty) | 894 if (elementData()->m_presentationAttributeStyleIsDirty) |
| 888 updatePresentationAttributeStyle(); | 895 updatePresentationAttributeStyle(); |
| 889 // Need to call elementData() again since updatePresentationAttributeStyle() | 896 // Need to call elementData() again since updatePresentationAttributeStyle() |
| 890 // might swap it with a UniqueElementData. | 897 // might swap it with a UniqueElementData. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 948 static PassRefPtrWillBeRawPtr<T> create(const QualifiedName&, Document&) | 955 static PassRefPtrWillBeRawPtr<T> create(const QualifiedName&, Document&) |
| 949 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ | 956 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ |
| 950 PassRefPtrWillBeRawPtr<T> T::create(const QualifiedName& tagName, Document&
document) \ | 957 PassRefPtrWillBeRawPtr<T> T::create(const QualifiedName& tagName, Document&
document) \ |
| 951 { \ | 958 { \ |
| 952 return adoptRefWillBeNoop(new T(tagName, document)); \ | 959 return adoptRefWillBeNoop(new T(tagName, document)); \ |
| 953 } | 960 } |
| 954 | 961 |
| 955 } // namespace blink | 962 } // namespace blink |
| 956 | 963 |
| 957 #endif // Element_h | 964 #endif // Element_h |
| OLD | NEW |