Changeset 94134 in webkit
- Timestamp:
- Aug 30, 2011 5:21:18 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r94132 r94134 1 2011-08-30 Alice Boxhall <aboxhall@chromium.org> 2 3 Correctly report selected text range for accessibility APIs for role=textbox 4 https://bugs.webkit.org/show_bug.cgi?id=65900 5 6 Reviewed by Chris Fleizach. 7 8 * accessibility/textbox-role-reports-selection-expected.txt: Added. 9 * accessibility/textbox-role-reports-selection.html: Added. 10 1 11 2011-08-30 Rachel Blum <groby@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r94132 r94134 1 2011-08-30 Alice Boxhall <aboxhall@chromium.org> 2 3 Correctly report selected text range for accessibility APIs for role=textbox 4 https://bugs.webkit.org/show_bug.cgi?id=65900 5 6 Reviewed by Chris Fleizach. 7 8 Test: accessibility/textbox-role-reports-selection.html 9 10 * accessibility/AccessibilityRenderObject.cpp: 11 (WebCore::AccessibilityRenderObject::indexForVisiblePosition): 12 (WebCore::AccessibilityRenderObject::rootEditableElementForPosition): 13 (WebCore::AccessibilityRenderObject::nodeIsTextControl): 14 (WebCore::AccessibilityRenderObject::determineAriaRoleAttribute): 15 * accessibility/AccessibilityRenderObject.h: 16 1 17 2011-08-30 Rachel Blum <groby@chromium.org> 2 18 -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r93578 r94134 2519 2519 2520 2520 Position indexPosition = pos.deepEquivalent(); 2521 if (indexPosition.isNull() || pos.rootEditableElement() != node)2521 if (indexPosition.isNull() || rootEditableElementForPosition(indexPosition) != node) 2522 2522 return 0; 2523 2523 … … 2534 2534 return TextIterator::rangeLength(range.get()); 2535 2535 #endif 2536 } 2537 2538 Element* AccessibilityRenderObject::rootEditableElementForPosition(const Position& position) const 2539 { 2540 // Find the root editable or pseudo-editable (i.e. having an editable ARIA role) element. 2541 Element* result = 0; 2542 2543 Element* rootEditableElement = position.rootEditableElement(); 2544 2545 for (Element* e = position.element(); e && e != rootEditableElement; e = e->parentElement()) { 2546 if (nodeIsTextControl(e)) 2547 result = e; 2548 if (e->hasTagName(bodyTag)) 2549 break; 2550 } 2551 2552 if (result) 2553 return result; 2554 2555 return rootEditableElement; 2556 } 2557 2558 bool AccessibilityRenderObject::nodeIsTextControl(const Node* node) const 2559 { 2560 if (!node) 2561 return false; 2562 2563 const AccessibilityObject* axObjectForNode = axObjectCache()->getOrCreate(node->renderer()); 2564 if (!axObjectForNode) 2565 return false; 2566 2567 return axObjectForNode->isTextControl(); 2536 2568 } 2537 2569 … … 3027 3059 if (role) 3028 3060 return role; 3029 3061 3030 3062 return UnknownRole; 3031 3063 } -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h
r93578 r94134 1 2 1 /* 3 2 * Copyright (C) 2008 Apple Inc. All rights reserved. … … 248 247 virtual VisiblePosition visiblePositionForIndex(int) const; 249 248 virtual int indexForVisiblePosition(const VisiblePosition&) const; 250 249 251 250 virtual PlainTextRange doAXRangeForLine(unsigned) const; 252 251 virtual PlainTextRange doAXRangeForIndex(unsigned) const; … … 281 280 String positionalDescriptionForMSAA() const; 282 281 PlainTextRange ariaSelectedTextRange() const; 282 Element* rootEditableElementForPosition(const Position&) const; 283 bool nodeIsTextControl(const Node*) const; 283 284 284 285 Element* menuElementForMenuButton() const; … … 287 288 AccessibilityRole determineAriaRoleAttribute() const; 288 289 AccessibilityRole remapAriaRoleDueToParent(AccessibilityRole) const; 289 290 290 291 bool isTabItemSelected() const; 291 292 void alterSliderValue(bool increase);
Note: See TracChangeset
for help on using the changeset viewer.