Commit 99abb088 authored by cfleizach@apple.com's avatar cfleizach@apple.com
Browse files

REGRESSION: A problem with Voiceover and finding links

https://bugs.webkit.org/show_bug.cgi?id=52324

Reviewed by Darin Adler.

Source/WebCore: 

Fallout from recent change to make WebCore return its own scroll view.
   1) There were two scroll views in the hierarchy, one which no needed to be ignored.
   2) Hit tests for sub frames needed to be offset.
   3) The check for whether an attachment is ignored must happen earlier than using
      the helpText to determine if an element should be ignored.

Test: platform/mac/accessibility/iframe-with-title-correct-hierarchy.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::elementAccessibilityHitTest):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
* accessibility/mac/AccessibilityObjectWrapper.mm:
(-[AccessibilityObjectWrapper scrollViewParent]):

Source/WebKit/mac: 

* WebView/WebDynamicScrollBarsView.mm:
(-[WebDynamicScrollBarsView accessibilityIsIgnored]):

LayoutTests: 

* platform/mac/accessibility/iframe-with-title-correct-hierarchy-expected.txt: Added.
* platform/mac/accessibility/iframe-with-title-correct-hierarchy.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76044 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b6d7b24d
2011-01-18 Chris Fleizach <cfleizach@apple.com>
Reviewed by Darin Adler.
REGRESSION: A problem with Voiceover and finding links
https://bugs.webkit.org/show_bug.cgi?id=52324
* platform/mac/accessibility/iframe-with-title-correct-hierarchy-expected.txt: Added.
* platform/mac/accessibility/iframe-with-title-correct-hierarchy.html: Added.
2011-01-18 Martin Robinson <mrobinson@igalia.com>
 
Reviewed by Eric Seidel.
......
test
This makes sure that if an iframe has a title attribute, it will still show up in the hierarchy correctly.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS iframeScroll.role is 'AXRole: AXScrollArea'
PASS iframeScroll.parentElement().role is 'AXRole: AXGroup'
PASS iframeScroll.parentElement().parentElement().role is 'AXRole: AXWebArea'
PASS iframeScroll.parentElement().parentElement().isEqual(bodyElement) is true
PASS iframeWeb.parentElement().isEqual(iframeScroll) is true
PASS hitTest.isEqual(iframeWeb) is true
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
<script>
var successfullyParsed = false;
</script>
<script src="../../../fast/js/resources/js-test-pre.js"></script>
</head>
<body id="body">
<div role="button">test</div>
<div style="position: relative; left: 100px">
<iframe id="frame" scrolling=YES width=100 height=100 border=1 title="iframe" src="resources/cake.png"></iframe>
</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This makes sure that if an iframe has a title attribute, it will still show up in the hierarchy correctly.");
if (window.accessibilityController) {
document.getElementById("body").focus();
var bodyElement = accessibilityController.focusedElement;
document.getElementById("frame").focus();
// scroll area -> web area -> group -> iframe (scroll area)
var iframeScroll = accessibilityController.rootElement.childAtIndex(0).childAtIndex(1).childAtIndex(0);
shouldBe("iframeScroll.role", "'AXRole: AXScrollArea'");
shouldBe("iframeScroll.parentElement().role", "'AXRole: AXGroup'");
shouldBe("iframeScroll.parentElement().parentElement().role", "'AXRole: AXWebArea'");
shouldBeTrue("iframeScroll.parentElement().parentElement().isEqual(bodyElement)");
// web area (of scroll area)
var iframeWeb = iframeScroll.childAtIndex(0);
shouldBeTrue("iframeWeb.parentElement().isEqual(iframeScroll)");
var x = iframeWeb.x + 5;
var y = iframeWeb.y + 5;
var hitTest = accessibilityController.elementAtPoint(x, y);
shouldBeTrue("hitTest.isEqual(iframeWeb)");
}
successfullyParsed = true;
</script>
<script src="../../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
2011-01-18 Chris Fleizach <cfleizach@apple.com>
Reviewed by Darin Adler.
REGRESSION: A problem with Voiceover and finding links
https://bugs.webkit.org/show_bug.cgi?id=52324
Fallout from recent change to make WebCore return its own scroll view.
1) There were two scroll views in the hierarchy, one which no needed to be ignored.
2) Hit tests for sub frames needed to be offset.
3) The check for whether an attachment is ignored must happen earlier than using
the helpText to determine if an element should be ignored.
Test: platform/mac/accessibility/iframe-with-title-correct-hierarchy.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::elementAccessibilityHitTest):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
* accessibility/mac/AccessibilityObjectWrapper.mm:
(-[AccessibilityObjectWrapper scrollViewParent]):
2011-01-18 Adam Roben <aroben@apple.com>
 
Call alternate CFHTTPCookie functions if available
......@@ -1013,8 +1013,9 @@ AccessibilityObject* AccessibilityObject::elementAccessibilityHitTest(const IntP
// Send the hit test back into the sub-frame if necessary.
if (isAttachment()) {
Widget* widget = widgetForAttachmentView();
// Normalize the point for the widget's bounds.
if (widget && widget->isFrameView())
return axObjectCache()->getOrCreate(static_cast<ScrollView*>(widget))->accessibilityHitTest(point);
return axObjectCache()->getOrCreate(widget)->accessibilityHitTest(IntPoint(point - widget->frameRect().location()));
}
return const_cast<AccessibilityObject*>(this);
......
......@@ -1772,6 +1772,10 @@ bool AccessibilityRenderObject::accessibilityIsIgnored() const
if (!isAllowedChildOfTree())
return true;
// Allow the platform to decide if the attachment is ignored or not.
if (isAttachment())
return accessibilityIgnoreAttachment();
// ignore popup menu items because AppKit does
for (RenderObject* parent = m_renderer->parent(); parent; parent = parent->parent()) {
if (parent->isBoxModelObject() && toRenderBoxModelObject(parent)->isMenuList())
......@@ -1817,9 +1821,6 @@ bool AccessibilityRenderObject::accessibilityIsIgnored() const
if (ariaRoleAttribute() != UnknownRole)
return false;
if (!helpText().isEmpty())
return false;
// don't ignore labels, because they serve as TitleUIElements
Node* node = m_renderer->node();
if (node && node->hasTagName(labelTag))
......@@ -1877,11 +1878,17 @@ bool AccessibilityRenderObject::accessibilityIsIgnored() const
return false;
}
// make a platform-specific decision
if (isAttachment())
return accessibilityIgnoreAttachment();
if (isWebArea() || m_renderer->isListMarker())
return false;
// Using the help text to decide an element's visibility is not as definitive
// as previous checks, so this should remain as one of the last.
if (!helpText().isEmpty())
return false;
return !m_renderer->isListMarker() && !isWebArea();
// By default, objects should be ignored so that the AX hierarchy is not
// filled with unnecessary items.
return true;
}
bool AccessibilityRenderObject::isLoaded() const
......
......@@ -1455,7 +1455,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
return nil;
if (scroll->platformWidget())
return scroll->platformWidget();
return NSAccessibilityUnignoredAncestor(scroll->platformWidget());
return [self remoteAccessibilityParentObject];
}
......
2011-01-18 Chris Fleizach <cfleizach@apple.com>
Reviewed by Darin Adler.
REGRESSION: A problem with Voiceover and finding links
https://bugs.webkit.org/show_bug.cgi?id=52324
* WebView/WebDynamicScrollBarsView.mm:
(-[WebDynamicScrollBarsView accessibilityIsIgnored]):
2011-01-17 David Kilzer <ddkilzer@apple.com>
<http://webkit.org/b/52596> Add missing DOMDocument/DOMDocumentFragment headers to Xcode project
......
......@@ -565,11 +565,7 @@ static const unsigned cMaxUpdateScrollbarsPass = 2;
- (BOOL)accessibilityIsIgnored
{
id docView = [self documentView];
if ([docView isKindOfClass:[WebFrameView class]] && ![(WebFrameView *)docView allowsScrolling])
return YES;
return [super accessibilityIsIgnored];
return YES;
}
- (void)setScrollOrigin:(NSPoint)scrollOrigin updatePosition:(BOOL)updatePosition
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment