diff options
author | Ben Murdoch <benm@google.com> | 2010-10-22 13:02:20 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-10-26 15:21:41 +0100 |
commit | a94275402997c11dd2e778633dacf4b7e630a35d (patch) | |
tree | e66f56c67e3b01f22c9c23cd932271ee9ac558ed /WebCore/accessibility/AccessibilityRenderObject.cpp | |
parent | 09e26c78506587b3f5d930d7bc72a23287ffbec0 (diff) | |
download | external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.zip external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.gz external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.bz2 |
Merge WebKit at r70209: Initial merge by Git
Change-Id: Id23a68efa36e9d1126bcce0b137872db00892c8e
Diffstat (limited to 'WebCore/accessibility/AccessibilityRenderObject.cpp')
-rw-r--r-- | WebCore/accessibility/AccessibilityRenderObject.cpp | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp index 5ca78ca..0b82c67 100644 --- a/WebCore/accessibility/AccessibilityRenderObject.cpp +++ b/WebCore/accessibility/AccessibilityRenderObject.cpp @@ -1487,6 +1487,14 @@ AccessibilityObject* AccessibilityRenderObject::internalLinkElement() const return firstAccessibleObjectFromNode(linkedNode); } +ESpeak AccessibilityRenderObject::speakProperty() const +{ + if (!m_renderer) + return AccessibilityObject::speakProperty(); + + return m_renderer->style()->speak(); +} + void AccessibilityRenderObject::addRadioButtonGroupMembers(AccessibilityChildrenVector& linkedUIElements) const { if (!m_renderer || roleValue() != RadioButtonRole) @@ -2638,20 +2646,11 @@ PlainTextRange AccessibilityRenderObject::doAXRangeForLine(unsigned lineNumber) if (visiblePos.isNull() || visiblePos == savedVisiblePos) return PlainTextRange(); } - - // make a caret selection for the marker position, then extend it to the line - // NOTE: ignores results of selection.modify because it returns false when - // starting at an empty line. The resulting selection in that case - // will be a caret at visiblePos. - SelectionController selection; - selection.setSelection(VisibleSelection(visiblePos)); - selection.modify(SelectionController::AlterationExtend, SelectionController::DirectionLeft, LineBoundary); - selection.modify(SelectionController::AlterationExtend, SelectionController::DirectionRight, LineBoundary); - - // calculate the indices for the selection start and end - VisiblePosition startPosition = selection.selection().visibleStart(); - VisiblePosition endPosition = selection.selection().visibleEnd(); - int index1 = indexForVisiblePosition(startPosition); + + // Get the end of the line based on the starting position. + VisiblePosition endPosition = endOfLine(visiblePos); + + int index1 = indexForVisiblePosition(visiblePos); int index2 = indexForVisiblePosition(endPosition); // add one to the end index for a line break not caused by soft line wrap (to match AppKit) @@ -3089,6 +3088,10 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole() if (m_renderer->isBlockFlow() || (node && node->hasTagName(labelTag))) return GroupRole; + // If the element does not have role, but it has ARIA attributes, accessibility should fallback to exposing it as a group. + if (supportsARIAAttributes()) + return GroupRole; + return UnknownRole; } @@ -3388,6 +3391,7 @@ const AtomicString& AccessibilityRenderObject::ariaLiveRegionStatus() const case ApplicationStatusRole: return liveRegionStatusPolite; case ApplicationTimerRole: + case ApplicationMarqueeRole: return liveRegionStatusOff; default: break; |