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

Unified Diff: Source/core/accessibility/AXListBox.cpp

Issue 347773002: Implement select listbox using shadow DOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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/accessibility/AXListBox.h ('k') | Source/core/accessibility/AXListBoxOption.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/accessibility/AXListBox.cpp
diff --git a/Source/core/accessibility/AXListBox.cpp b/Source/core/accessibility/AXListBox.cpp
index 432302b6c8c5f40d578fad7690b343ce762e8c1a..4b32c57447cffae0b3bfb8908b701053d8271698 100644
--- a/Source/core/accessibility/AXListBox.cpp
+++ b/Source/core/accessibility/AXListBox.cpp
@@ -53,66 +53,4 @@ PassRefPtr<AXListBox> AXListBox::create(RenderObject* renderer)
return adoptRef(new AXListBox(renderer));
}
-void AXListBox::addChildren()
-{
- Node* selectNode = m_renderer->node();
- if (!selectNode)
- return;
-
- m_haveChildren = true;
-
- const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = toHTMLSelectElement(selectNode)->listItems();
- unsigned length = listItems.size();
- for (unsigned i = 0; i < length; i++) {
- // The cast to HTMLElement below is safe because the only other possible listItem type
- // would be a WMLElement, but WML builds don't use accessibility features at all.
- AXObject* listOption = listBoxOptionAXObject(listItems[i]);
- if (listOption && !listOption->accessibilityIsIgnored())
- m_children.append(listOption);
- }
-}
-
-AXObject* AXListBox::listBoxOptionAXObject(HTMLElement* element) const
-{
- // skip hr elements
- if (!element || isHTMLHRElement(*element))
- return 0;
-
- AXObject* listBoxObject = m_renderer->document().axObjectCache()->getOrCreate(ListBoxOptionRole);
- toAXListBoxOption(listBoxObject)->setHTMLElement(element);
-
- return listBoxObject;
-}
-
-AXObject* AXListBox::elementAccessibilityHitTest(const IntPoint& point) const
-{
- // the internal HTMLSelectElement methods for returning a listbox option at a point
- // ignore optgroup elements.
- if (!m_renderer)
- return 0;
-
- Node* node = m_renderer->node();
- if (!node)
- return 0;
-
- LayoutRect parentRect = elementRect();
-
- AXObject* listBoxOption = 0;
- unsigned length = m_children.size();
- for (unsigned i = 0; i < length; i++) {
- LayoutRect rect = toRenderListBox(m_renderer)->itemBoundingBoxRect(parentRect.location(), i);
- // The cast to HTMLElement below is safe because the only other possible listItem type
- // would be a WMLElement, but WML builds don't use accessibility features at all.
- if (rect.contains(point)) {
- listBoxOption = m_children[i].get();
- break;
- }
- }
-
- if (listBoxOption && !listBoxOption->accessibilityIsIgnored())
- return listBoxOption;
-
- return axObjectCache()->getOrCreate(m_renderer);
-}
-
} // namespace WebCore
« no previous file with comments | « Source/core/accessibility/AXListBox.h ('k') | Source/core/accessibility/AXListBoxOption.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698