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

Unified Diff: Source/core/html/FormAssociatedElement.cpp

Issue 569993002: <label> should support form association by parser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated Created 6 years, 3 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
« no previous file with comments | « Source/core/html/FormAssociatedElement.h ('k') | Source/core/html/HTMLLabelElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/FormAssociatedElement.cpp
diff --git a/Source/core/html/FormAssociatedElement.cpp b/Source/core/html/FormAssociatedElement.cpp
index ee8aec034badb08126e33d8244cd7c6839b652a0..c11f0ecb5cbdb41da5a5dae724fdcf5564f93f95 100644
--- a/Source/core/html/FormAssociatedElement.cpp
+++ b/Source/core/html/FormAssociatedElement.cpp
@@ -30,6 +30,7 @@
#include "core/dom/NodeTraversal.h"
#include "core/html/HTMLFormControlElement.h"
#include "core/html/HTMLFormElement.h"
+#include "core/html/HTMLLabelElement.h"
#include "core/html/HTMLObjectElement.h"
#include "core/html/ValidityState.h"
@@ -307,8 +308,10 @@ const HTMLElement& toHTMLElement(const FormAssociatedElement& associatedElement)
{
if (associatedElement.isFormControlElement())
return toHTMLFormControlElement(associatedElement);
- // Assumes the element is an HTMLObjectElement
- return toHTMLObjectElement(associatedElement);
+ else if (associatedElement.isLabelElement())
+ return toHTMLLabelElement(associatedElement);
+ else
+ return toHTMLObjectElement(associatedElement);
}
const HTMLElement* toHTMLElement(const FormAssociatedElement* associatedElement)
« no previous file with comments | « Source/core/html/FormAssociatedElement.h ('k') | Source/core/html/HTMLLabelElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698