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

Unified Diff: third_party/WebKit/Source/core/dom/TreeScope.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/dom/TreeScope.cpp
diff --git a/third_party/WebKit/Source/core/dom/TreeScope.cpp b/third_party/WebKit/Source/core/dom/TreeScope.cpp
index 8cd9b55c0c6594d1f5f6431034aad64b078585bc..fdea83b380fc9ff57a3dc8783132d9474952136d 100644
--- a/third_party/WebKit/Source/core/dom/TreeScope.cpp
+++ b/third_party/WebKit/Source/core/dom/TreeScope.cpp
@@ -44,7 +44,6 @@
#include "core/frame/LocalFrame.h"
#include "core/html/HTMLAnchorElement.h"
#include "core/html/HTMLFrameOwnerElement.h"
-#include "core/html/HTMLLabelElement.h"
#include "core/html/HTMLMapElement.h"
#include "core/layout/HitTestResult.h"
#include "core/layout/api/LayoutViewItem.h"
@@ -303,36 +302,6 @@ HeapVector<Member<Element>> TreeScope::elementsFromPoint(int x, int y) const
return elementsFromHitTestResult(result);
}
-void TreeScope::addLabel(const AtomicString& forAttributeValue, HTMLLabelElement* element)
-{
- DCHECK(m_labelsByForAttribute);
- m_labelsByForAttribute->add(forAttributeValue, element);
-}
-
-void TreeScope::removeLabel(const AtomicString& forAttributeValue, HTMLLabelElement* element)
-{
- DCHECK(m_labelsByForAttribute);
- m_labelsByForAttribute->remove(forAttributeValue, element);
-}
-
-HTMLLabelElement* TreeScope::labelElementForId(const AtomicString& forAttributeValue)
-{
- if (forAttributeValue.isEmpty())
- return nullptr;
-
- if (!m_labelsByForAttribute) {
- // Populate the map on first access.
- m_labelsByForAttribute = DocumentOrderedMap::create();
- for (HTMLLabelElement& label : Traversal<HTMLLabelElement>::startsAfter(rootNode())) {
- const AtomicString& forValue = label.fastGetAttribute(forAttr);
- if (!forValue.isEmpty())
- addLabel(forValue, &label);
- }
- }
-
- return toHTMLLabelElement(m_labelsByForAttribute->getElementByLabelForAttribute(forAttributeValue, this));
-}
-
DOMSelection* TreeScope::getSelection() const
{
if (!rootNode().document().frame())
@@ -534,7 +503,6 @@ DEFINE_TRACE(TreeScope)
visitor->trace(m_selection);
visitor->trace(m_elementsById);
visitor->trace(m_imageMapsByName);
- visitor->trace(m_labelsByForAttribute);
visitor->trace(m_scopedStyleResolver);
visitor->trace(m_radioButtonGroupScope);
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/TreeScope.h ('k') | third_party/WebKit/Source/core/html/HTMLLabelElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698