| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 FocusParams(SelectionBehaviorOnFocus selection, WebFocusType focusType, Inpu
tDeviceCapabilities* capabilities) | 101 FocusParams(SelectionBehaviorOnFocus selection, WebFocusType focusType, Inpu
tDeviceCapabilities* capabilities) |
| 102 : selectionBehavior(selection) | 102 : selectionBehavior(selection) |
| 103 , type(focusType) | 103 , type(focusType) |
| 104 , sourceCapabilities(capabilities) {} | 104 , sourceCapabilities(capabilities) {} |
| 105 | 105 |
| 106 SelectionBehaviorOnFocus selectionBehavior = SelectionBehaviorOnFocus::Resto
re; | 106 SelectionBehaviorOnFocus selectionBehavior = SelectionBehaviorOnFocus::Resto
re; |
| 107 WebFocusType type = WebFocusTypeNone; | 107 WebFocusType type = WebFocusTypeNone; |
| 108 Member<InputDeviceCapabilities> sourceCapabilities = nullptr; | 108 Member<InputDeviceCapabilities> sourceCapabilities = nullptr; |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 typedef WillBeHeapVector<RefPtrWillBeMember<Attr>> AttrNodeList; | 111 typedef HeapVector<Member<Attr>> AttrNodeList; |
| 112 | 112 |
| 113 class CORE_EXPORT Element : public ContainerNode { | 113 class CORE_EXPORT Element : public ContainerNode { |
| 114 DEFINE_WRAPPERTYPEINFO(); | 114 DEFINE_WRAPPERTYPEINFO(); |
| 115 public: | 115 public: |
| 116 static PassRefPtrWillBeRawPtr<Element> create(const QualifiedName&, Document
*); | 116 static RawPtr<Element> create(const QualifiedName&, Document*); |
| 117 ~Element() override; | 117 ~Element() override; |
| 118 | 118 |
| 119 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecopy); | 119 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecopy); |
| 120 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecut); | 120 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecut); |
| 121 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforepaste); | 121 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforepaste); |
| 122 DEFINE_ATTRIBUTE_EVENT_LISTENER(copy); | 122 DEFINE_ATTRIBUTE_EVENT_LISTENER(copy); |
| 123 DEFINE_ATTRIBUTE_EVENT_LISTENER(cut); | 123 DEFINE_ATTRIBUTE_EVENT_LISTENER(cut); |
| 124 DEFINE_ATTRIBUTE_EVENT_LISTENER(gotpointercapture); | 124 DEFINE_ATTRIBUTE_EVENT_LISTENER(gotpointercapture); |
| 125 DEFINE_ATTRIBUTE_EVENT_LISTENER(lostpointercapture); | 125 DEFINE_ATTRIBUTE_EVENT_LISTENER(lostpointercapture); |
| 126 DEFINE_ATTRIBUTE_EVENT_LISTENER(paste); | 126 DEFINE_ATTRIBUTE_EVENT_LISTENER(paste); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 bool hasNonEmptyLayoutSize() const; | 222 bool hasNonEmptyLayoutSize() const; |
| 223 | 223 |
| 224 const AtomicString& computedRole(); | 224 const AtomicString& computedRole(); |
| 225 String computedName(); | 225 String computedName(); |
| 226 | 226 |
| 227 void didMoveToNewDocument(Document&) override; | 227 void didMoveToNewDocument(Document&) override; |
| 228 | 228 |
| 229 void removeAttribute(const AtomicString& name); | 229 void removeAttribute(const AtomicString& name); |
| 230 void removeAttributeNS(const AtomicString& namespaceURI, const AtomicString&
localName); | 230 void removeAttributeNS(const AtomicString& namespaceURI, const AtomicString&
localName); |
| 231 | 231 |
| 232 PassRefPtrWillBeRawPtr<Attr> detachAttribute(size_t index); | 232 RawPtr<Attr> detachAttribute(size_t index); |
| 233 | 233 |
| 234 PassRefPtrWillBeRawPtr<Attr> getAttributeNode(const AtomicString& name); | 234 RawPtr<Attr> getAttributeNode(const AtomicString& name); |
| 235 PassRefPtrWillBeRawPtr<Attr> getAttributeNodeNS(const AtomicString& namespac
eURI, const AtomicString& localName); | 235 RawPtr<Attr> getAttributeNodeNS(const AtomicString& namespaceURI, const Atom
icString& localName); |
| 236 PassRefPtrWillBeRawPtr<Attr> setAttributeNode(Attr*, ExceptionState&); | 236 RawPtr<Attr> setAttributeNode(Attr*, ExceptionState&); |
| 237 PassRefPtrWillBeRawPtr<Attr> setAttributeNodeNS(Attr*, ExceptionState&); | 237 RawPtr<Attr> setAttributeNodeNS(Attr*, ExceptionState&); |
| 238 PassRefPtrWillBeRawPtr<Attr> removeAttributeNode(Attr*, ExceptionState&); | 238 RawPtr<Attr> removeAttributeNode(Attr*, ExceptionState&); |
| 239 | 239 |
| 240 PassRefPtrWillBeRawPtr<Attr> attrIfExists(const QualifiedName&); | 240 RawPtr<Attr> attrIfExists(const QualifiedName&); |
| 241 PassRefPtrWillBeRawPtr<Attr> ensureAttr(const QualifiedName&); | 241 RawPtr<Attr> ensureAttr(const QualifiedName&); |
| 242 | 242 |
| 243 AttrNodeList* attrNodeList(); | 243 AttrNodeList* attrNodeList(); |
| 244 | 244 |
| 245 CSSStyleDeclaration* style(); | 245 CSSStyleDeclaration* style(); |
| 246 | 246 |
| 247 const QualifiedName& tagQName() const { return m_tagName; } | 247 const QualifiedName& tagQName() const { return m_tagName; } |
| 248 String tagName() const { return nodeName(); } | 248 String tagName() const { return nodeName(); } |
| 249 | 249 |
| 250 bool hasTagName(const QualifiedName& tagName) const { return m_tagName.match
es(tagName); } | 250 bool hasTagName(const QualifiedName& tagName) const { return m_tagName.match
es(tagName); } |
| 251 bool hasTagName(const HTMLQualifiedName& tagName) const { return ContainerNo
de::hasTagName(tagName); } | 251 bool hasTagName(const HTMLQualifiedName& tagName) const { return ContainerNo
de::hasTagName(tagName); } |
| 252 bool hasTagName(const SVGQualifiedName& tagName) const { return ContainerNod
e::hasTagName(tagName); } | 252 bool hasTagName(const SVGQualifiedName& tagName) const { return ContainerNod
e::hasTagName(tagName); } |
| 253 | 253 |
| 254 // Should be called only by Document::createElementNS to fix up m_tagName im
mediately after construction. | 254 // Should be called only by Document::createElementNS to fix up m_tagName im
mediately after construction. |
| 255 void setTagNameForCreateElementNS(const QualifiedName&); | 255 void setTagNameForCreateElementNS(const QualifiedName&); |
| 256 | 256 |
| 257 // A fast function for checking the local name against another atomic string
. | 257 // A fast function for checking the local name against another atomic string
. |
| 258 bool hasLocalName(const AtomicString& other) const { return m_tagName.localN
ame() == other; } | 258 bool hasLocalName(const AtomicString& other) const { return m_tagName.localN
ame() == other; } |
| 259 | 259 |
| 260 const AtomicString& localName() const { return m_tagName.localName(); } | 260 const AtomicString& localName() const { return m_tagName.localName(); } |
| 261 AtomicString localNameForSelectorMatching() const; | 261 AtomicString localNameForSelectorMatching() const; |
| 262 const AtomicString& prefix() const { return m_tagName.prefix(); } | 262 const AtomicString& prefix() const { return m_tagName.prefix(); } |
| 263 const AtomicString& namespaceURI() const { return m_tagName.namespaceURI();
} | 263 const AtomicString& namespaceURI() const { return m_tagName.namespaceURI();
} |
| 264 | 264 |
| 265 const AtomicString& locateNamespacePrefix(const AtomicString& namespaceURI)
const; | 265 const AtomicString& locateNamespacePrefix(const AtomicString& namespaceURI)
const; |
| 266 | 266 |
| 267 String nodeName() const override; | 267 String nodeName() const override; |
| 268 | 268 |
| 269 PassRefPtrWillBeRawPtr<Element> cloneElementWithChildren(); | 269 RawPtr<Element> cloneElementWithChildren(); |
| 270 PassRefPtrWillBeRawPtr<Element> cloneElementWithoutChildren(); | 270 RawPtr<Element> cloneElementWithoutChildren(); |
| 271 | 271 |
| 272 void scheduleSVGFilterLayerUpdateHack(); | 272 void scheduleSVGFilterLayerUpdateHack(); |
| 273 | 273 |
| 274 void setBooleanAttribute(const QualifiedName&, bool); | 274 void setBooleanAttribute(const QualifiedName&, bool); |
| 275 | 275 |
| 276 virtual const StylePropertySet* additionalPresentationAttributeStyle() { ret
urn nullptr; } | 276 virtual const StylePropertySet* additionalPresentationAttributeStyle() { ret
urn nullptr; } |
| 277 void invalidateStyleAttribute(); | 277 void invalidateStyleAttribute(); |
| 278 | 278 |
| 279 const StylePropertySet* inlineStyle() const { return elementData() ? element
Data()->m_inlineStyle.get() : nullptr; } | 279 const StylePropertySet* inlineStyle() const { return elementData() ? element
Data()->m_inlineStyle.get() : nullptr; } |
| 280 | 280 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 336 |
| 337 void setNeedsCompositingUpdate(); | 337 void setNeedsCompositingUpdate(); |
| 338 | 338 |
| 339 bool supportsStyleSharing() const; | 339 bool supportsStyleSharing() const; |
| 340 | 340 |
| 341 ElementShadow* shadow() const; | 341 ElementShadow* shadow() const; |
| 342 ElementShadow& ensureShadow(); | 342 ElementShadow& ensureShadow(); |
| 343 // If type of ShadowRoot (either closed or open) is explicitly specified, cr
eation of multiple | 343 // If type of ShadowRoot (either closed or open) is explicitly specified, cr
eation of multiple |
| 344 // shadow roots is prohibited in any combination and throws an exception. Mu
ltiple shadow roots | 344 // shadow roots is prohibited in any combination and throws an exception. Mu
ltiple shadow roots |
| 345 // are allowed only when createShadowRoot() is used without any parameters f
rom JavaScript. | 345 // are allowed only when createShadowRoot() is used without any parameters f
rom JavaScript. |
| 346 PassRefPtrWillBeRawPtr<ShadowRoot> createShadowRoot(const ScriptState*, Exce
ptionState&); | 346 RawPtr<ShadowRoot> createShadowRoot(const ScriptState*, ExceptionState&); |
| 347 PassRefPtrWillBeRawPtr<ShadowRoot> attachShadow(const ScriptState*, const Sh
adowRootInit&, ExceptionState&); | 347 RawPtr<ShadowRoot> attachShadow(const ScriptState*, const ShadowRootInit&, E
xceptionState&); |
| 348 PassRefPtrWillBeRawPtr<ShadowRoot> createShadowRootInternal(ShadowRootType,
ExceptionState&); | 348 RawPtr<ShadowRoot> createShadowRootInternal(ShadowRootType, ExceptionState&)
; |
| 349 | 349 |
| 350 ShadowRoot* openShadowRoot() const; | 350 ShadowRoot* openShadowRoot() const; |
| 351 ShadowRoot* closedShadowRoot() const; | 351 ShadowRoot* closedShadowRoot() const; |
| 352 ShadowRoot* authorShadowRoot() const; | 352 ShadowRoot* authorShadowRoot() const; |
| 353 ShadowRoot* userAgentShadowRoot() const; | 353 ShadowRoot* userAgentShadowRoot() const; |
| 354 | 354 |
| 355 ShadowRoot* youngestShadowRoot() const; | 355 ShadowRoot* youngestShadowRoot() const; |
| 356 | 356 |
| 357 ShadowRoot* shadowRootIfV1() const; | 357 ShadowRoot* shadowRootIfV1() const; |
| 358 | 358 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 | 497 |
| 498 // Used for disabled form elements; if true, prevents mouse events from bein
g dispatched | 498 // Used for disabled form elements; if true, prevents mouse events from bein
g dispatched |
| 499 // to event listeners, and prevents DOMActivate events from being sent at al
l. | 499 // to event listeners, and prevents DOMActivate events from being sent at al
l. |
| 500 virtual bool isDisabledFormControl() const { return false; } | 500 virtual bool isDisabledFormControl() const { return false; } |
| 501 | 501 |
| 502 bool hasPendingResources() const { return hasElementFlag(HasPendingResources
); } | 502 bool hasPendingResources() const { return hasElementFlag(HasPendingResources
); } |
| 503 void setHasPendingResources() { setElementFlag(HasPendingResources); } | 503 void setHasPendingResources() { setElementFlag(HasPendingResources); } |
| 504 void clearHasPendingResources() { clearElementFlag(HasPendingResources); } | 504 void clearHasPendingResources() { clearElementFlag(HasPendingResources); } |
| 505 virtual void buildPendingResource() { } | 505 virtual void buildPendingResource() { } |
| 506 | 506 |
| 507 void setCustomElementDefinition(PassRefPtrWillBeRawPtr<CustomElementDefiniti
on>); | 507 void setCustomElementDefinition(RawPtr<CustomElementDefinition>); |
| 508 CustomElementDefinition* customElementDefinition() const; | 508 CustomElementDefinition* customElementDefinition() const; |
| 509 | 509 |
| 510 bool containsFullScreenElement() const { return hasElementFlag(ContainsFullS
creenElement); } | 510 bool containsFullScreenElement() const { return hasElementFlag(ContainsFullS
creenElement); } |
| 511 void setContainsFullScreenElement(bool); | 511 void setContainsFullScreenElement(bool); |
| 512 void setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(bool); | 512 void setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(bool); |
| 513 | 513 |
| 514 bool isInTopLayer() const { return hasElementFlag(IsInTopLayer); } | 514 bool isInTopLayer() const { return hasElementFlag(IsInTopLayer); } |
| 515 void setIsInTopLayer(bool); | 515 void setIsInTopLayer(bool); |
| 516 | 516 |
| 517 void requestPointerLock(); | 517 void requestPointerLock(); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 | 566 |
| 567 protected: | 567 protected: |
| 568 Element(const QualifiedName& tagName, Document*, ConstructionType); | 568 Element(const QualifiedName& tagName, Document*, ConstructionType); |
| 569 | 569 |
| 570 const ElementData* elementData() const { return m_elementData.get(); } | 570 const ElementData* elementData() const { return m_elementData.get(); } |
| 571 UniqueElementData& ensureUniqueElementData(); | 571 UniqueElementData& ensureUniqueElementData(); |
| 572 | 572 |
| 573 void addPropertyToPresentationAttributeStyle(MutableStylePropertySet*, CSSPr
opertyID, CSSValueID identifier); | 573 void addPropertyToPresentationAttributeStyle(MutableStylePropertySet*, CSSPr
opertyID, CSSValueID identifier); |
| 574 void addPropertyToPresentationAttributeStyle(MutableStylePropertySet*, CSSPr
opertyID, double value, CSSPrimitiveValue::UnitType); | 574 void addPropertyToPresentationAttributeStyle(MutableStylePropertySet*, CSSPr
opertyID, double value, CSSPrimitiveValue::UnitType); |
| 575 void addPropertyToPresentationAttributeStyle(MutableStylePropertySet*, CSSPr
opertyID, const String& value); | 575 void addPropertyToPresentationAttributeStyle(MutableStylePropertySet*, CSSPr
opertyID, const String& value); |
| 576 void addPropertyToPresentationAttributeStyle(MutableStylePropertySet*, CSSPr
opertyID, PassRefPtrWillBeRawPtr<CSSValue>); | 576 void addPropertyToPresentationAttributeStyle(MutableStylePropertySet*, CSSPr
opertyID, RawPtr<CSSValue>); |
| 577 | 577 |
| 578 InsertionNotificationRequest insertedInto(ContainerNode*) override; | 578 InsertionNotificationRequest insertedInto(ContainerNode*) override; |
| 579 void removedFrom(ContainerNode*) override; | 579 void removedFrom(ContainerNode*) override; |
| 580 void childrenChanged(const ChildrenChange&) override; | 580 void childrenChanged(const ChildrenChange&) override; |
| 581 | 581 |
| 582 virtual void willRecalcStyle(StyleRecalcChange); | 582 virtual void willRecalcStyle(StyleRecalcChange); |
| 583 virtual void didRecalcStyle(StyleRecalcChange); | 583 virtual void didRecalcStyle(StyleRecalcChange); |
| 584 virtual PassRefPtr<ComputedStyle> customStyleForLayoutObject(); | 584 virtual PassRefPtr<ComputedStyle> customStyleForLayoutObject(); |
| 585 | 585 |
| 586 virtual bool shouldRegisterAsNamedItem() const { return false; } | 586 virtual bool shouldRegisterAsNamedItem() const { return false; } |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 void cancelFocusAppearanceUpdate(); | 682 void cancelFocusAppearanceUpdate(); |
| 683 | 683 |
| 684 const ComputedStyle* virtualEnsureComputedStyle(PseudoId pseudoElementSpecif
ier = PseudoIdNone) override { return ensureComputedStyle(pseudoElementSpecifier
); } | 684 const ComputedStyle* virtualEnsureComputedStyle(PseudoId pseudoElementSpecif
ier = PseudoIdNone) override { return ensureComputedStyle(pseudoElementSpecifier
); } |
| 685 | 685 |
| 686 inline void updateCallbackSelectors(const ComputedStyle* oldStyle, const Com
putedStyle* newStyle); | 686 inline void updateCallbackSelectors(const ComputedStyle* oldStyle, const Com
putedStyle* newStyle); |
| 687 inline void removeCallbackSelectors(); | 687 inline void removeCallbackSelectors(); |
| 688 inline void addCallbackSelectors(); | 688 inline void addCallbackSelectors(); |
| 689 | 689 |
| 690 // cloneNode is private so that non-virtual cloneElementWithChildren and clo
neElementWithoutChildren | 690 // cloneNode is private so that non-virtual cloneElementWithChildren and clo
neElementWithoutChildren |
| 691 // are used instead. | 691 // are used instead. |
| 692 PassRefPtrWillBeRawPtr<Node> cloneNode(bool deep) override; | 692 RawPtr<Node> cloneNode(bool deep) override; |
| 693 virtual PassRefPtrWillBeRawPtr<Element> cloneElementWithoutAttributesAndChil
dren(); | 693 virtual RawPtr<Element> cloneElementWithoutAttributesAndChildren(); |
| 694 | 694 |
| 695 QualifiedName m_tagName; | 695 QualifiedName m_tagName; |
| 696 | 696 |
| 697 void updateNamedItemRegistration(const AtomicString& oldName, const AtomicSt
ring& newName); | 697 void updateNamedItemRegistration(const AtomicString& oldName, const AtomicSt
ring& newName); |
| 698 void updateExtraNamedItemRegistration(const AtomicString& oldName, const Ato
micString& newName); | 698 void updateExtraNamedItemRegistration(const AtomicString& oldName, const Ato
micString& newName); |
| 699 | 699 |
| 700 void createUniqueElementData(); | 700 void createUniqueElementData(); |
| 701 | 701 |
| 702 bool shouldInvalidateDistributionWhenAttributeChanged(ElementShadow*, const
QualifiedName&, const AtomicString&); | 702 bool shouldInvalidateDistributionWhenAttributeChanged(ElementShadow*, const
QualifiedName&, const AtomicString&); |
| 703 | 703 |
| 704 ElementRareData* elementRareData() const; | 704 ElementRareData* elementRareData() const; |
| 705 ElementRareData& ensureElementRareData(); | 705 ElementRareData& ensureElementRareData(); |
| 706 | 706 |
| 707 AttrNodeList& ensureAttrNodeList(); | 707 AttrNodeList& ensureAttrNodeList(); |
| 708 void removeAttrNodeList(); | 708 void removeAttrNodeList(); |
| 709 void detachAllAttrNodesFromElement(); | 709 void detachAllAttrNodesFromElement(); |
| 710 void detachAttrNodeFromElementWithValue(Attr*, const AtomicString& value); | 710 void detachAttrNodeFromElementWithValue(Attr*, const AtomicString& value); |
| 711 void detachAttrNodeAtIndex(Attr*, size_t index); | 711 void detachAttrNodeAtIndex(Attr*, size_t index); |
| 712 | 712 |
| 713 v8::Local<v8::Object> wrapCustomElement(v8::Isolate*, v8::Local<v8::Object>
creationContext); | 713 v8::Local<v8::Object> wrapCustomElement(v8::Isolate*, v8::Local<v8::Object>
creationContext); |
| 714 | 714 |
| 715 RefPtrWillBeMember<ElementData> m_elementData; | 715 Member<ElementData> m_elementData; |
| 716 }; | 716 }; |
| 717 | 717 |
| 718 DEFINE_NODE_TYPE_CASTS(Element, isElementNode()); | 718 DEFINE_NODE_TYPE_CASTS(Element, isElementNode()); |
| 719 template <typename T> bool isElementOfType(const Node&); | 719 template <typename T> bool isElementOfType(const Node&); |
| 720 template <> inline bool isElementOfType<const Element>(const Node& node) { retur
n node.isElementNode(); } | 720 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)); } | 721 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; } | 722 template <> inline bool isElementOfType<const Element>(const Element&) { return
true; } |
| 723 | 723 |
| 724 // Type casting. | 724 // Type casting. |
| 725 template<typename T> inline T& toElement(Node& node) | 725 template<typename T> inline T& toElement(Node& node) |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 // for isElementOfType<>() so that the Traversal<> API works for these Element t
ypes. | 938 // for isElementOfType<>() so that the Traversal<> API works for these Element t
ypes. |
| 939 #define DEFINE_ELEMENT_TYPE_CASTS(thisType, predicate) \ | 939 #define DEFINE_ELEMENT_TYPE_CASTS(thisType, predicate) \ |
| 940 template <> inline bool isElementOfType<const thisType>(const Node& node) {
return node.predicate; } \ | 940 template <> inline bool isElementOfType<const thisType>(const Node& node) {
return node.predicate; } \ |
| 941 DEFINE_NODE_TYPE_CASTS(thisType, predicate) | 941 DEFINE_NODE_TYPE_CASTS(thisType, predicate) |
| 942 | 942 |
| 943 #define DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) \ | 943 #define DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) \ |
| 944 template <> inline bool isElementOfType<const thisType>(const Node& node) {
return is##thisType(node); } \ | 944 template <> inline bool isElementOfType<const thisType>(const Node& node) {
return is##thisType(node); } \ |
| 945 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(thisType) | 945 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(thisType) |
| 946 | 946 |
| 947 #define DECLARE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ | 947 #define DECLARE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ |
| 948 static PassRefPtrWillBeRawPtr<T> create(const QualifiedName&, Document&) | 948 static RawPtr<T> create(const QualifiedName&, Document&) |
| 949 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ | 949 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ |
| 950 PassRefPtrWillBeRawPtr<T> T::create(const QualifiedName& tagName, Document&
document) \ | 950 RawPtr<T> T::create(const QualifiedName& tagName, Document& document) \ |
| 951 { \ | 951 { \ |
| 952 return adoptRefWillBeNoop(new T(tagName, document)); \ | 952 return new T(tagName, document); \ |
| 953 } | 953 } |
| 954 | 954 |
| 955 } // namespace blink | 955 } // namespace blink |
| 956 | 956 |
| 957 #endif // Element_h | 957 #endif // Element_h |
| OLD | NEW |