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