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

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: Don't modify visited set when computing aria-labelledby Created 4 years, 6 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 e958b1e2edb5c8987bf5fdf64f0203c98dcc6c26..bc0863b04b428eaf86f7f9eb0f39c14eb253ba50 100644
--- a/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
@@ -228,28 +228,9 @@ 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);
- 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())
@@ -260,23 +241,8 @@ 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);
document().removeFormAssociation(this);
}
-void HTMLLabelElement::parseAttribute(const QualifiedName& attributeName, const AtomicString& oldValue, const AtomicString& attributeValue)
-{
- if (attributeName == forAttr) {
- TreeScope& scope = treeScope();
- if (scope.shouldCacheLabelsByForAttribute())
- updateLabel(scope, oldValue, attributeValue);
- }
- HTMLElement::parseAttribute(attributeName, oldValue, attributeValue);
-}
-
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698