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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 class ClientRect; | 49 class ClientRect; |
50 class ClientRectList; | 50 class ClientRectList; |
51 class CustomElementDefinition; | 51 class CustomElementDefinition; |
52 class DOMStringMap; | 52 class DOMStringMap; |
53 class DOMTokenList; | 53 class DOMTokenList; |
54 class Dictionary; | 54 class Dictionary; |
55 class ElementRareData; | 55 class ElementRareData; |
56 class ElementShadow; | 56 class ElementShadow; |
57 class ExceptionState; | 57 class ExceptionState; |
58 class Image; | 58 class Image; |
| 59 class IntersectionObserver; |
59 class IntSize; | 60 class IntSize; |
60 class Locale; | 61 class Locale; |
61 class MutableStylePropertySet; | 62 class MutableStylePropertySet; |
62 class PropertySetCSSStyleDeclaration; | 63 class PropertySetCSSStyleDeclaration; |
63 class PseudoElement; | 64 class PseudoElement; |
64 class ScrollState; | 65 class ScrollState; |
65 class ScrollToOptions; | 66 class ScrollToOptions; |
66 class ShadowRoot; | 67 class ShadowRoot; |
67 class ShadowRootInit; | 68 class ShadowRootInit; |
68 class StylePropertySet; | 69 class StylePropertySet; |
(...skipping 11 matching lines...) Expand all Loading... |
80 ContainsFullScreenElement = 1 << 3, | 81 ContainsFullScreenElement = 1 << 3, |
81 IsInTopLayer = 1 << 4, | 82 IsInTopLayer = 1 << 4, |
82 HasPendingResources = 1 << 5, | 83 HasPendingResources = 1 << 5, |
83 | 84 |
84 NumberOfElementFlags = 6, // Required size of bitfield used to store the fla
gs. | 85 NumberOfElementFlags = 6, // Required size of bitfield used to store the fla
gs. |
85 }; | 86 }; |
86 | 87 |
87 enum class ShadowRootType; | 88 enum class ShadowRootType; |
88 | 89 |
89 typedef WillBeHeapVector<RefPtrWillBeMember<Attr>> AttrNodeList; | 90 typedef WillBeHeapVector<RefPtrWillBeMember<Attr>> AttrNodeList; |
| 91 typedef WillBeHeapVector<RawPtrWillBeMember<IntersectionObserver>> IntersectionO
bserverList; |
90 | 92 |
91 class CORE_EXPORT Element : public ContainerNode { | 93 class CORE_EXPORT Element : public ContainerNode { |
92 DEFINE_WRAPPERTYPEINFO(); | 94 DEFINE_WRAPPERTYPEINFO(); |
93 public: | 95 public: |
94 static PassRefPtrWillBeRawPtr<Element> create(const QualifiedName&, Document
*); | 96 static PassRefPtrWillBeRawPtr<Element> create(const QualifiedName&, Document
*); |
95 ~Element() override; | 97 ~Element() override; |
96 | 98 |
97 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecopy); | 99 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecopy); |
98 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecut); | 100 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecut); |
99 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforepaste); | 101 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforepaste); |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 void setTabIndex(int); | 510 void setTabIndex(int); |
509 short tabIndex() const override; | 511 short tabIndex() const override; |
510 | 512 |
511 void incrementProxyCount(); | 513 void incrementProxyCount(); |
512 void decrementProxyCount(); | 514 void decrementProxyCount(); |
513 | 515 |
514 DECLARE_VIRTUAL_TRACE(); | 516 DECLARE_VIRTUAL_TRACE(); |
515 | 517 |
516 SpellcheckAttributeState spellcheckAttributeState() const; | 518 SpellcheckAttributeState spellcheckAttributeState() const; |
517 | 519 |
| 520 void registerIntersectionObserver(IntersectionObserver*); |
| 521 void unregisterIntersectionObserver(IntersectionObserver*); |
| 522 bool hasIntersectionObserver() const override { return m_intersectionObserve
rs.size() > 0; } |
| 523 IntersectionObserverList& intersectionObservers() { return m_intersectionObs
ervers; } |
| 524 |
518 protected: | 525 protected: |
519 Element(const QualifiedName& tagName, Document*, ConstructionType); | 526 Element(const QualifiedName& tagName, Document*, ConstructionType); |
520 | 527 |
521 const ElementData* elementData() const { return m_elementData.get(); } | 528 const ElementData* elementData() const { return m_elementData.get(); } |
522 UniqueElementData& ensureUniqueElementData(); | 529 UniqueElementData& ensureUniqueElementData(); |
523 | 530 |
524 void addPropertyToPresentationAttributeStyle(MutableStylePropertySet*, CSSPr
opertyID, CSSValueID identifier); | 531 void addPropertyToPresentationAttributeStyle(MutableStylePropertySet*, CSSPr
opertyID, CSSValueID identifier); |
525 void addPropertyToPresentationAttributeStyle(MutableStylePropertySet*, CSSPr
opertyID, double value, CSSPrimitiveValue::UnitType); | 532 void addPropertyToPresentationAttributeStyle(MutableStylePropertySet*, CSSPr
opertyID, double value, CSSPrimitiveValue::UnitType); |
526 void addPropertyToPresentationAttributeStyle(MutableStylePropertySet*, CSSPr
opertyID, const String& value); | 533 void addPropertyToPresentationAttributeStyle(MutableStylePropertySet*, CSSPr
opertyID, const String& value); |
527 | 534 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 | 661 |
655 AttrNodeList& ensureAttrNodeList(); | 662 AttrNodeList& ensureAttrNodeList(); |
656 void removeAttrNodeList(); | 663 void removeAttrNodeList(); |
657 void detachAllAttrNodesFromElement(); | 664 void detachAllAttrNodesFromElement(); |
658 void detachAttrNodeFromElementWithValue(Attr*, const AtomicString& value); | 665 void detachAttrNodeFromElementWithValue(Attr*, const AtomicString& value); |
659 void detachAttrNodeAtIndex(Attr*, size_t index); | 666 void detachAttrNodeAtIndex(Attr*, size_t index); |
660 | 667 |
661 v8::Local<v8::Object> wrapCustomElement(v8::Isolate*, v8::Local<v8::Object>
creationContext); | 668 v8::Local<v8::Object> wrapCustomElement(v8::Isolate*, v8::Local<v8::Object>
creationContext); |
662 | 669 |
663 RefPtrWillBeMember<ElementData> m_elementData; | 670 RefPtrWillBeMember<ElementData> m_elementData; |
| 671 IntersectionObserverList m_intersectionObservers; |
664 }; | 672 }; |
665 | 673 |
666 DEFINE_NODE_TYPE_CASTS(Element, isElementNode()); | 674 DEFINE_NODE_TYPE_CASTS(Element, isElementNode()); |
667 template <typename T> bool isElementOfType(const Node&); | 675 template <typename T> bool isElementOfType(const Node&); |
668 template <> inline bool isElementOfType<const Element>(const Node& node) { retur
n node.isElementNode(); } | 676 template <> inline bool isElementOfType<const Element>(const Node& node) { retur
n node.isElementNode(); } |
669 template <typename T> inline bool isElementOfType(const Element& element) { retu
rn isElementOfType<T>(static_cast<const Node&>(element)); } | 677 template <typename T> inline bool isElementOfType(const Element& element) { retu
rn isElementOfType<T>(static_cast<const Node&>(element)); } |
670 template <> inline bool isElementOfType<const Element>(const Element&) { return
true; } | 678 template <> inline bool isElementOfType<const Element>(const Element&) { return
true; } |
671 | 679 |
672 // Type casting. | 680 // Type casting. |
673 template<typename T> inline T& toElement(Node& node) | 681 template<typename T> inline T& toElement(Node& node) |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 static PassRefPtrWillBeRawPtr<T> create(const QualifiedName&, Document&) | 904 static PassRefPtrWillBeRawPtr<T> create(const QualifiedName&, Document&) |
897 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ | 905 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ |
898 PassRefPtrWillBeRawPtr<T> T::create(const QualifiedName& tagName, Document&
document) \ | 906 PassRefPtrWillBeRawPtr<T> T::create(const QualifiedName& tagName, Document&
document) \ |
899 { \ | 907 { \ |
900 return adoptRefWillBeNoop(new T(tagName, document)); \ | 908 return adoptRefWillBeNoop(new T(tagName, document)); \ |
901 } | 909 } |
902 | 910 |
903 } // namespace | 911 } // namespace |
904 | 912 |
905 #endif // Element_h | 913 #endif // Element_h |
OLD | NEW |