LEFT | RIGHT |
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-2017 Apple Inc. All rights reserved. | 6 * Copyright (C) 2003-2017 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 class PlatformKeyboardEvent; | 51 class PlatformKeyboardEvent; |
52 class PlatformMouseEvent; | 52 class PlatformMouseEvent; |
53 class PlatformWheelEvent; | 53 class PlatformWheelEvent; |
54 class PseudoElement; | 54 class PseudoElement; |
55 class RenderTreePosition; | 55 class RenderTreePosition; |
56 class WebAnimation; | 56 class WebAnimation; |
57 struct ElementStyle; | 57 struct ElementStyle; |
58 | 58 |
59 #if ENABLE(INTERSECTION_OBSERVER) | 59 #if ENABLE(INTERSECTION_OBSERVER) |
60 class IntersectionObserver; | 60 class IntersectionObserver; |
61 struct IntersectionObserverRegistration; | 61 struct IntersectionObserverData; |
62 #endif | 62 #endif |
63 | 63 |
64 enum SpellcheckAttributeState { | 64 enum SpellcheckAttributeState { |
65 SpellcheckAttributeTrue, | 65 SpellcheckAttributeTrue, |
66 SpellcheckAttributeFalse, | 66 SpellcheckAttributeFalse, |
67 SpellcheckAttributeDefault | 67 SpellcheckAttributeDefault |
68 }; | 68 }; |
69 | 69 |
70 enum class SelectionRevealMode { | 70 enum class SelectionRevealMode { |
71 Reveal, | 71 Reveal, |
72 RevealUpToMainFrame, // Scroll overflow and iframes, but not the main frame. | 72 RevealUpToMainFrame, // Scroll overflow and iframes, but not the main frame. |
73 DoNotReveal | 73 DoNotReveal |
74 }; | 74 }; |
75 | 75 |
76 class Element : public ContainerNode { | 76 class Element : public ContainerNode { |
77 WTF_MAKE_ISO_ALLOCATED(Element); | 77 WTF_MAKE_ISO_ALLOCATED(Element); |
78 public: | 78 public: |
79 static Ref<Element> create(const QualifiedName&, Document&); | 79 static Ref<Element> create(const QualifiedName&, Document&); |
80 virtual ~Element(); | 80 virtual ~Element(); |
81 | 81 |
82 WEBCORE_EXPORT bool hasAttribute(const QualifiedName&) const; | 82 WEBCORE_EXPORT bool hasAttribute(const QualifiedName&) const; |
83 WEBCORE_EXPORT const AtomicString& getAttribute(const QualifiedName&) const; | 83 WEBCORE_EXPORT const AtomicString& getAttribute(const QualifiedName&) const; |
| 84 template<typename... QualifiedNames> |
| 85 const AtomicString& getAttribute(const QualifiedName&, const QualifiedNames&
...) const; |
84 WEBCORE_EXPORT void setAttribute(const QualifiedName&, const AtomicString& v
alue); | 86 WEBCORE_EXPORT void setAttribute(const QualifiedName&, const AtomicString& v
alue); |
85 WEBCORE_EXPORT void setAttributeWithoutSynchronization(const QualifiedName&,
const AtomicString& value); | 87 WEBCORE_EXPORT void setAttributeWithoutSynchronization(const QualifiedName&,
const AtomicString& value); |
86 void setSynchronizedLazyAttribute(const QualifiedName&, const AtomicString&
value); | 88 void setSynchronizedLazyAttribute(const QualifiedName&, const AtomicString&
value); |
87 bool removeAttribute(const QualifiedName&); | 89 bool removeAttribute(const QualifiedName&); |
88 Vector<String> getAttributeNames() const; | 90 Vector<String> getAttributeNames() const; |
89 | 91 |
90 // Typed getters and setters for language bindings. | 92 // Typed getters and setters for language bindings. |
91 WEBCORE_EXPORT int getIntegralAttribute(const QualifiedName& attributeName)
const; | 93 WEBCORE_EXPORT int getIntegralAttribute(const QualifiedName& attributeName)
const; |
92 WEBCORE_EXPORT void setIntegralAttribute(const QualifiedName& attributeName,
int value); | 94 WEBCORE_EXPORT void setIntegralAttribute(const QualifiedName& attributeName,
int value); |
93 WEBCORE_EXPORT unsigned getUnsignedIntegralAttribute(const QualifiedName& at
tributeName) const; | 95 WEBCORE_EXPORT unsigned getUnsignedIntegralAttribute(const QualifiedName& at
tributeName) const; |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 bool hasDisplayContents() const; | 573 bool hasDisplayContents() const; |
572 void storeDisplayContentsStyle(std::unique_ptr<RenderStyle>); | 574 void storeDisplayContentsStyle(std::unique_ptr<RenderStyle>); |
573 | 575 |
574 using ContainerNode::setAttributeEventListener; | 576 using ContainerNode::setAttributeEventListener; |
575 void setAttributeEventListener(const AtomicString& eventType, const Qualifie
dName& attributeName, const AtomicString& value); | 577 void setAttributeEventListener(const AtomicString& eventType, const Qualifie
dName& attributeName, const AtomicString& value); |
576 | 578 |
577 #if ENABLE(INTERSECTION_OBSERVER) | 579 #if ENABLE(INTERSECTION_OBSERVER) |
578 void startObservingIntersections(IntersectionObserver&); | 580 void startObservingIntersections(IntersectionObserver&); |
579 void endObservingIntersections(IntersectionObserver&); | 581 void endObservingIntersections(IntersectionObserver&); |
580 | 582 |
581 Vector<IntersectionObserverRegistration>* intersectionObserverRegistrations(
); | 583 IntersectionObserverData& ensureIntersectionObserverData(); |
| 584 IntersectionObserverData* intersectionObserverData(); |
582 #endif | 585 #endif |
583 | 586 |
584 Element* findAnchorElementForLink(String& outAnchorName); | 587 Element* findAnchorElementForLink(String& outAnchorName); |
585 | 588 |
586 ExceptionOr<Ref<WebAnimation>> animate(JSC::ExecState&, JSC::Strong<JSC::JSO
bject>&&, std::optional<Variant<double, KeyframeAnimationOptions>>&&); | 589 ExceptionOr<Ref<WebAnimation>> animate(JSC::ExecState&, JSC::Strong<JSC::JSO
bject>&&, std::optional<Variant<double, KeyframeAnimationOptions>>&&); |
587 Vector<RefPtr<WebAnimation>> getAnimations(); | 590 Vector<RefPtr<WebAnimation>> getAnimations(); |
588 | 591 |
589 protected: | 592 protected: |
590 Element(const QualifiedName&, Document&, ConstructionType); | 593 Element(const QualifiedName&, Document&, ConstructionType); |
591 | 594 |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 | 833 |
831 inline void Element::setHasFocusWithin(bool flag) | 834 inline void Element::setHasFocusWithin(bool flag) |
832 { | 835 { |
833 if (hasFocusWithin() == flag) | 836 if (hasFocusWithin() == flag) |
834 return; | 837 return; |
835 setFlag(flag, HasFocusWithin); | 838 setFlag(flag, HasFocusWithin); |
836 if (styleAffectedByFocusWithin()) | 839 if (styleAffectedByFocusWithin()) |
837 invalidateStyleForSubtree(); | 840 invalidateStyleForSubtree(); |
838 } | 841 } |
839 | 842 |
| 843 template<typename... QualifiedNames> |
| 844 inline const AtomicString& Element::getAttribute(const QualifiedName& name, cons
t QualifiedNames&... names) const |
| 845 { |
| 846 const AtomicString& value = getAttribute(name); |
| 847 if (!value.isEmpty()) |
| 848 return value; |
| 849 return getAttribute(names...); |
| 850 } |
| 851 |
840 } // namespace WebCore | 852 } // namespace WebCore |
841 | 853 |
842 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::Element) | 854 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::Element) |
843 static bool isType(const WebCore::Node& node) { return node.isElementNode();
} | 855 static bool isType(const WebCore::Node& node) { return node.isElementNode();
} |
844 static bool isType(const WebCore::EventTarget& target) { return is<WebCore::
Node>(target) && isType(downcast<WebCore::Node>(target)); } | 856 static bool isType(const WebCore::EventTarget& target) { return is<WebCore::
Node>(target) && isType(downcast<WebCore::Node>(target)); } |
845 SPECIALIZE_TYPE_TRAITS_END() | 857 SPECIALIZE_TYPE_TRAITS_END() |
LEFT | RIGHT |