| 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 * Copyright (C) 2004-2007, 2009, 2014 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004-2007, 2009, 2014 Apple Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 TranslateAttributeInherit | 39 TranslateAttributeInherit |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 class CORE_EXPORT HTMLElement : public Element { | 42 class CORE_EXPORT HTMLElement : public Element { |
| 43 DEFINE_WRAPPERTYPEINFO(); | 43 DEFINE_WRAPPERTYPEINFO(); |
| 44 public: | 44 public: |
| 45 DECLARE_ELEMENT_FACTORY_WITH_TAGNAME(HTMLElement); | 45 DECLARE_ELEMENT_FACTORY_WITH_TAGNAME(HTMLElement); |
| 46 | 46 |
| 47 bool hasTagName(const HTMLQualifiedName& name) const { return hasLocalName(n
ame.localName()); } | 47 bool hasTagName(const HTMLQualifiedName& name) const { return hasLocalName(n
ame.localName()); } |
| 48 | 48 |
| 49 virtual String title() const override final; | 49 String title() const final; |
| 50 virtual short tabIndex() const override; | 50 short tabIndex() const override; |
| 51 | 51 |
| 52 void setInnerText(const String&, ExceptionState&); | 52 void setInnerText(const String&, ExceptionState&); |
| 53 void setOuterText(const String&, ExceptionState&); | 53 void setOuterText(const String&, ExceptionState&); |
| 54 | 54 |
| 55 virtual bool hasCustomFocusLogic() const; | 55 virtual bool hasCustomFocusLogic() const; |
| 56 | 56 |
| 57 String contentEditable() const; | 57 String contentEditable() const; |
| 58 void setContentEditable(const String&, ExceptionState&); | 58 void setContentEditable(const String&, ExceptionState&); |
| 59 | 59 |
| 60 virtual bool draggable() const; | 60 virtual bool draggable() const; |
| 61 void setDraggable(bool); | 61 void setDraggable(bool); |
| 62 | 62 |
| 63 bool spellcheck() const; | 63 bool spellcheck() const; |
| 64 void setSpellcheck(bool); | 64 void setSpellcheck(bool); |
| 65 | 65 |
| 66 bool translate() const; | 66 bool translate() const; |
| 67 void setTranslate(bool); | 67 void setTranslate(bool); |
| 68 | 68 |
| 69 const AtomicString& dir(); | 69 const AtomicString& dir(); |
| 70 void setDir(const AtomicString&); | 70 void setDir(const AtomicString&); |
| 71 | 71 |
| 72 void click(); | 72 void click(); |
| 73 | 73 |
| 74 virtual void accessKeyAction(bool sendMouseEvents) override; | 74 void accessKeyAction(bool sendMouseEvents) override; |
| 75 | 75 |
| 76 bool ieForbidsInsertHTML() const; | 76 bool ieForbidsInsertHTML() const; |
| 77 | 77 |
| 78 virtual HTMLFormElement* formOwner() const { return nullptr; } | 78 virtual HTMLFormElement* formOwner() const { return nullptr; } |
| 79 | 79 |
| 80 HTMLFormElement* findFormAncestor() const; | 80 HTMLFormElement* findFormAncestor() const; |
| 81 | 81 |
| 82 bool hasDirectionAuto() const; | 82 bool hasDirectionAuto() const; |
| 83 TextDirection directionalityIfhasDirAutoAttribute(bool& isAuto) const; | 83 TextDirection directionalityIfhasDirAutoAttribute(bool& isAuto) const; |
| 84 | 84 |
| 85 virtual bool isHTMLUnknownElement() const { return false; } | 85 virtual bool isHTMLUnknownElement() const { return false; } |
| 86 virtual bool isPluginElement() const { return false; } | 86 virtual bool isPluginElement() const { return false; } |
| 87 | 87 |
| 88 virtual bool isLabelable() const { return false; } | 88 virtual bool isLabelable() const { return false; } |
| 89 // http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html
#interactive-content | 89 // http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html
#interactive-content |
| 90 virtual bool isInteractiveContent() const; | 90 virtual bool isInteractiveContent() const; |
| 91 virtual void defaultEventHandler(Event*) override; | 91 void defaultEventHandler(Event*) override; |
| 92 | 92 |
| 93 static const AtomicString& eventNameForAttributeName(const QualifiedName& at
trName); | 93 static const AtomicString& eventNameForAttributeName(const QualifiedName& at
trName); |
| 94 | 94 |
| 95 virtual bool matchesReadOnlyPseudoClass() const override; | 95 bool matchesReadOnlyPseudoClass() const override; |
| 96 virtual bool matchesReadWritePseudoClass() const override; | 96 bool matchesReadWritePseudoClass() const override; |
| 97 | 97 |
| 98 static const AtomicString& eventParameterName(); | 98 static const AtomicString& eventParameterName(); |
| 99 | 99 |
| 100 HTMLMenuElement* assignedContextMenu() const; | 100 HTMLMenuElement* assignedContextMenu() const; |
| 101 HTMLMenuElement* contextMenu() const; | 101 HTMLMenuElement* contextMenu() const; |
| 102 void setContextMenu(HTMLMenuElement*); | 102 void setContextMenu(HTMLMenuElement*); |
| 103 | 103 |
| 104 virtual String altText() const { return String(); } | 104 virtual String altText() const { return String(); } |
| 105 | 105 |
| 106 protected: | 106 protected: |
| 107 HTMLElement(const QualifiedName& tagName, Document&, ConstructionType); | 107 HTMLElement(const QualifiedName& tagName, Document&, ConstructionType); |
| 108 | 108 |
| 109 void addHTMLLengthToStyle(MutableStylePropertySet*, CSSPropertyID, const Str
ing& value); | 109 void addHTMLLengthToStyle(MutableStylePropertySet*, CSSPropertyID, const Str
ing& value); |
| 110 void addHTMLColorToStyle(MutableStylePropertySet*, CSSPropertyID, const Stri
ng& color); | 110 void addHTMLColorToStyle(MutableStylePropertySet*, CSSPropertyID, const Stri
ng& color); |
| 111 | 111 |
| 112 void applyAlignmentAttributeToStyle(const AtomicString&, MutableStylePropert
ySet*); | 112 void applyAlignmentAttributeToStyle(const AtomicString&, MutableStylePropert
ySet*); |
| 113 void applyBorderAttributeToStyle(const AtomicString&, MutableStylePropertySe
t*); | 113 void applyBorderAttributeToStyle(const AtomicString&, MutableStylePropertySe
t*); |
| 114 | 114 |
| 115 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; | 115 void parseAttribute(const QualifiedName&, const AtomicString&) override; |
| 116 virtual bool isPresentationAttribute(const QualifiedName&) const override; | 116 bool isPresentationAttribute(const QualifiedName&) const override; |
| 117 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons
t AtomicString&, MutableStylePropertySet*) override; | 117 void collectStyleForPresentationAttribute(const QualifiedName&, const Atomic
String&, MutableStylePropertySet*) override; |
| 118 unsigned parseBorderWidthAttribute(const AtomicString&) const; | 118 unsigned parseBorderWidthAttribute(const AtomicString&) const; |
| 119 | 119 |
| 120 virtual void childrenChanged(const ChildrenChange&) override; | 120 void childrenChanged(const ChildrenChange&) override; |
| 121 void calculateAndAdjustDirectionality(); | 121 void calculateAndAdjustDirectionality(); |
| 122 | 122 |
| 123 private: | 123 private: |
| 124 virtual String nodeName() const override final; | 124 String nodeName() const final; |
| 125 | 125 |
| 126 bool isHTMLElement() const = delete; // This will catch anyone doing an unne
cessary check. | 126 bool isHTMLElement() const = delete; // This will catch anyone doing an unne
cessary check. |
| 127 bool isStyledElement() const = delete; // This will catch anyone doing an un
necessary check. | 127 bool isStyledElement() const = delete; // This will catch anyone doing an un
necessary check. |
| 128 | 128 |
| 129 void mapLanguageAttributeToLocale(const AtomicString&, MutableStylePropertyS
et*); | 129 void mapLanguageAttributeToLocale(const AtomicString&, MutableStylePropertyS
et*); |
| 130 | 130 |
| 131 PassRefPtrWillBeRawPtr<DocumentFragment> textToFragment(const String&, Excep
tionState&); | 131 PassRefPtrWillBeRawPtr<DocumentFragment> textToFragment(const String&, Excep
tionState&); |
| 132 | 132 |
| 133 bool selfOrAncestorHasDirAutoAttribute() const; | 133 bool selfOrAncestorHasDirAutoAttribute() const; |
| 134 void dirAttributeChanged(const AtomicString&); | 134 void dirAttributeChanged(const AtomicString&); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 template<typename T> inline bool is##thisType(const PassRefPtr<T>& node) { r
eturn is##thisType(node.get()); } \ | 178 template<typename T> inline bool is##thisType(const PassRefPtr<T>& node) { r
eturn is##thisType(node.get()); } \ |
| 179 template<typename T> inline bool is##thisType(const RefPtr<T>& node) { retur
n is##thisType(node.get()); } \ | 179 template<typename T> inline bool is##thisType(const RefPtr<T>& node) { retur
n is##thisType(node.get()); } \ |
| 180 template <> inline bool isElementOfType<const thisType>(const HTMLElement& e
lement) { return is##thisType(element); } \ | 180 template <> inline bool isElementOfType<const thisType>(const HTMLElement& e
lement) { return is##thisType(element); } \ |
| 181 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) | 181 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) |
| 182 | 182 |
| 183 } // namespace blink | 183 } // namespace blink |
| 184 | 184 |
| 185 #include "core/HTMLElementTypeHelpers.h" | 185 #include "core/HTMLElementTypeHelpers.h" |
| 186 | 186 |
| 187 #endif // HTMLElement_h | 187 #endif // HTMLElement_h |
| OLD | NEW |