Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLElement.h

Issue 1898403002: [WIP] Implement :dir() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase... other changes too probably Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 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 void cacheDirectionalityForDirAuto() 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 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);
(...skipping 17 matching lines...) Expand all
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 void parseAttribute(const QualifiedName&, const AtomicString&, const AtomicS tring&) override; 115 void parseAttribute(const QualifiedName&, const AtomicString&, const AtomicS tring&) override;
116 bool isPresentationAttribute(const QualifiedName&) const override; 116 bool isPresentationAttribute(const QualifiedName&) const override;
117 void collectStyleForPresentationAttribute(const QualifiedName&, const Atomic String&, 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 void childrenChanged(const ChildrenChange&) override; 120 void childrenChanged(const ChildrenChange&) override;
121 void calculateAndAdjustDirectionality(); 121 void updateForDirAuto();
122 122
123 private: 123 private:
124 String debugNodeName() const final; 124 String debugNodeName() const final;
125 String nodeName() const final; 125 String nodeName() const final;
126 126
127 bool isHTMLElement() const = delete; // This will catch anyone doing an unne cessary check. 127 bool isHTMLElement() const = delete; // This will catch anyone doing an unne cessary check.
128 bool isStyledElement() const = delete; // This will catch anyone doing an un necessary check. 128 bool isStyledElement() const = delete; // This will catch anyone doing an un necessary check.
129 129
130 void mapLanguageAttributeToLocale(const AtomicString&, MutableStylePropertyS et*); 130 void mapLanguageAttributeToLocale(const AtomicString&, MutableStylePropertyS et*);
131 131
132 DocumentFragment* textToFragment(const String&, ExceptionState&); 132 DocumentFragment* textToFragment(const String&, ExceptionState&);
133 133
134 bool selfOrAncestorHasDirAutoAttribute() const; 134 bool selfOrAncestorHasDirAutoAttribute() const;
135 void dirAttributeChanged(const AtomicString&); 135 void dirAttributeChanged(const AtomicString&);
136 void adjustDirectionalityIfNeededAfterChildAttributeChanged(Element* child); 136 void updateSelfOrAncestorForDirAuto();
137 void adjustDirectionalityIfNeededAfterChildrenChanged(const ChildrenChange&) ; 137 void adjustDirectionalityIfNeededAfterChildrenChanged(const ChildrenChange&) ;
138 TextDirection directionality(Node** strongDirectionalityTextNode= 0) const; 138 TextDirection computeDirectionality(Node** strongDirectionalityTextNode = 0) const;
139 139
140 TranslateAttributeMode translateAttributeMode() const; 140 TranslateAttributeMode translateAttributeMode() const;
141 141
142 void handleKeypressEvent(KeyboardEvent*); 142 void handleKeypressEvent(KeyboardEvent*);
143 }; 143 };
144 144
145 DEFINE_ELEMENT_TYPE_CASTS(HTMLElement, isHTMLElement()); 145 DEFINE_ELEMENT_TYPE_CASTS(HTMLElement, isHTMLElement());
146 146
147 template <typename T> bool isElementOfType(const HTMLElement&); 147 template <typename T> bool isElementOfType(const HTMLElement&);
148 template <> inline bool isElementOfType<const HTMLElement>(const HTMLElement&) { return true; } 148 template <> inline bool isElementOfType<const HTMLElement>(const HTMLElement&) { return true; }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 template<typename T> inline bool is##thisType(const PassRefPtr<T>& node) { r eturn is##thisType(node.get()); } \ 180 template<typename T> inline bool is##thisType(const PassRefPtr<T>& node) { r eturn is##thisType(node.get()); } \
181 template<typename T> inline bool is##thisType(const RefPtr<T>& node) { retur n is##thisType(node.get()); } \ 181 template<typename T> inline bool is##thisType(const RefPtr<T>& node) { retur n is##thisType(node.get()); } \
182 template <> inline bool isElementOfType<const thisType>(const HTMLElement& e lement) { return is##thisType(element); } \ 182 template <> inline bool isElementOfType<const thisType>(const HTMLElement& e lement) { return is##thisType(element); } \
183 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) 183 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType)
184 184
185 } // namespace blink 185 } // namespace blink
186 186
187 #include "core/HTMLElementTypeHelpers.h" 187 #include "core/HTMLElementTypeHelpers.h"
188 188
189 #endif // HTMLElement_h 189 #endif // HTMLElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698