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

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

Issue 1939303002: Enable accessible name of a control to include multiple <label> elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp b/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
index 3e22538abda6aa9e686beee758233357f53f6624..95ba9c4aac1220e66e9f2e68fb1e5415de63e33d 100644
--- a/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
@@ -243,29 +243,10 @@ void HTMLLabelElement::accessKeyAction(bool sendMouseEvents)
HTMLElement::accessKeyAction(sendMouseEvents);
}
-void HTMLLabelElement::updateLabel(TreeScope& scope, const AtomicString& oldForAttributeValue, const AtomicString& newForAttributeValue)
-{
- if (!inShadowIncludingDocument())
- return;
-
- if (oldForAttributeValue == newForAttributeValue)
- return;
-
- if (!oldForAttributeValue.isEmpty())
- scope.removeLabel(oldForAttributeValue, this);
- if (!newForAttributeValue.isEmpty())
- scope.addLabel(newForAttributeValue, this);
-}
-
Node::InsertionNotificationRequest HTMLLabelElement::insertedInto(ContainerNode* insertionPoint)
{
InsertionNotificationRequest result = HTMLElement::insertedInto(insertionPoint);
FormAssociatedElement::insertedInto(insertionPoint);
- if (insertionPoint->isInTreeScope()) {
- TreeScope& scope = insertionPoint->treeScope();
- if (scope == treeScope() && scope.shouldCacheLabelsByForAttribute())
- updateLabel(scope, nullAtom, fastGetAttribute(forAttr));
- }
// Trigger for elements outside of forms.
if (!formOwner() && insertionPoint->inShadowIncludingDocument())
@@ -276,11 +257,6 @@ Node::InsertionNotificationRequest HTMLLabelElement::insertedInto(ContainerNode*
void HTMLLabelElement::removedFrom(ContainerNode* insertionPoint)
{
- if (insertionPoint->isInTreeScope() && treeScope() == document()) {
- TreeScope& treeScope = insertionPoint->treeScope();
- if (treeScope.shouldCacheLabelsByForAttribute())
- updateLabel(treeScope, fastGetAttribute(forAttr), nullAtom);
- }
HTMLElement::removedFrom(insertionPoint);
FormAssociatedElement::removedFrom(insertionPoint);
document().removeFormAssociation(this);
@@ -298,11 +274,6 @@ void HTMLLabelElement::parseAttribute(const QualifiedName& attributeName, const
formAttributeChanged();
UseCounter::count(document(), UseCounter::HTMLLabelElementFormContentAttribute);
} else {
- if (attributeName == forAttr) {
- TreeScope& scope = treeScope();
- if (scope.shouldCacheLabelsByForAttribute())
- updateLabel(scope, oldValue, attributeValue);
- }
HTMLElement::parseAttribute(attributeName, oldValue, attributeValue);
}
}

Powered by Google App Engine
This is Rietveld 408576698