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

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

Issue 2692473003: Modify HTMLLabelElement::control to check if label is in tree scope (Closed)
Patch Set: Created 3 years, 10 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 | « third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-label-element/label-attributes-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp b/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
index 191e9c178e957426f41061892417ab03a85f7cd1..546d8a5c743d9a119096aff2623967e4fe71cd76 100644
--- a/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
@@ -69,6 +69,9 @@ LabelableElement* HTMLLabelElement::control() const {
return nullptr;
}
+ if (!isInTreeScope())
+ return nullptr;
+
if (Element* element = treeScope().getElementById(controlId)) {
if (isLabelableElement(*element) &&
toLabelableElement(*element).supportLabels()) {
« no previous file with comments | « third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-label-element/label-attributes-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698