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

Unified Diff: third_party/WebKit/Source/core/html/HTMLLabelElement.h

Issue 2000423006: Drop LABEL element from form-associated elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLLabelElement.h
diff --git a/third_party/WebKit/Source/core/html/HTMLLabelElement.h b/third_party/WebKit/Source/core/html/HTMLLabelElement.h
index 533fd1ef4d35a911f53c975d35759d41fd8d92f7..4eea330524d09ea84cce3ee0aeb4ab35d92aad10 100644
--- a/third_party/WebKit/Source/core/html/HTMLLabelElement.h
+++ b/third_party/WebKit/Source/core/html/HTMLLabelElement.h
@@ -25,28 +25,23 @@
#define HTMLLabelElement_h
#include "core/CoreExport.h"
-#include "core/html/FormAssociatedElement.h"
#include "core/html/HTMLElement.h"
-#include "core/html/LabelableElement.h"
namespace blink {
-class CORE_EXPORT HTMLLabelElement final : public HTMLElement, public FormAssociatedElement {
+class LabelableElement;
+
+class CORE_EXPORT HTMLLabelElement final : public HTMLElement {
DEFINE_WRAPPERTYPEINFO();
- USING_GARBAGE_COLLECTED_MIXIN(HTMLLabelElement);
public:
- static HTMLLabelElement* create(Document&, HTMLFormElement*);
+ static HTMLLabelElement* create(Document&);
LabelableElement* control() const;
+ HTMLFormElement* form() const;
bool willRespondToMouseClickEvents() override;
- DECLARE_VIRTUAL_TRACE();
-
- HTMLFormElement* formOwner() const override;
- HTMLFormElement* formForBinding() const;
-
private:
- explicit HTMLLabelElement(Document&, HTMLFormElement*);
+ explicit HTMLLabelElement(Document&);
bool isInInteractiveContent(Node*) const;
bool isInteractiveContent() const override;
@@ -64,11 +59,6 @@ private:
void focus(const FocusParams&) override;
- // FormAssociatedElement methods
- bool isFormControlElement() const override { return false; }
- bool isEnumeratable() const override { return false; }
- bool isLabelElement() const override { return true; }
-
void parseAttribute(const QualifiedName&, const AtomicString&, const AtomicString&) override;
void updateLabel(TreeScope&, const AtomicString& oldForAttributeValue, const AtomicString& newForAttributeValue);
@@ -76,26 +66,6 @@ private:
bool m_processingClick;
};
-
-template<typename T> inline const T& toElement(const FormAssociatedElement&);
-template<typename T> inline const T* toElement(const FormAssociatedElement*);
-// Make toHTMLLabelElement() accept a FormAssociatedElement as input instead of a Node.
-template<> inline const HTMLLabelElement* toElement<HTMLLabelElement>(const FormAssociatedElement* element)
-{
- const HTMLLabelElement* labelElement = static_cast<const HTMLLabelElement*>(element);
- // FormAssociatedElement doesn't have hasTagName, hence check for assert.
- ASSERT_WITH_SECURITY_IMPLICATION(!labelElement || labelElement->hasTagName(HTMLNames::labelTag));
- return labelElement;
-}
-
-template<> inline const HTMLLabelElement& toElement<HTMLLabelElement>(const FormAssociatedElement& element)
-{
- const HTMLLabelElement& labelElement = static_cast<const HTMLLabelElement&>(element);
- // FormAssociatedElement doesn't have hasTagName, hence check for assert.
- ASSERT_WITH_SECURITY_IMPLICATION(labelElement.hasTagName(HTMLNames::labelTag));
- return labelElement;
-}
-
} // namespace blink
#endif // HTMLLabelElement_h

Powered by Google App Engine
This is Rietveld 408576698