2009-04-30 Simon Fraser <simon.fraser@apple.com>

        Reviewed by Darin Adler

        <rdar://problem/6839338> VoiceOver does not take into account transforms when drawing outlines

        Use transform-aware quad methods when computing the boundingBoxRect for
        an AccessibilityRenderObject. The code follows RenderObject::absoluteBoundingBoxRect().

        Test: accessibility/transformed-element.html

        * page/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::boundingBoxRect):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43085 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent fdaaee68
2009-04-30 Simon Fraser <simon.fraser@apple.com>
Reviewed by Darin Adler
<rdar://problem/6839338> VoiceOver does not take into account transforms when drawing outlines
Test accessibility bounding box with CSS transforms.
* accessibility/transformed-element-expected.txt: Added.
* accessibility/transformed-element.html: Added.
2009-04-30 Darin Adler <darin@apple.com>
Reviewed by Sam Weinig.
hello
AXRole: AXGroup
AXSubrole: (null)
AXRoleDescription: group
AXChildren: <array of size 1>
AXHelp:
AXParent: <AXGroup>
AXSize: NSSize: {291, 123}
AXTitle:
AXDescription:
AXValue:
AXFocused: 0
AXEnabled: 1
AXWindow: <AXGroup>
AXSelectedTextMarkerRange: (null)
AXStartTextMarker: <AXGroup>
AXEndTextMarker: <AXGroup>
AXVisited: 0
AXLinkedUIElements: (null)
AXSelected: 0
AXBlockQuoteLevel: 0
AXTopLevelUIElement: <AXGroup>
AXTitleUIElement: (null)
<html>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
</script>
<body id="body">
<!-- This test ensures that AX rectangles take transforms into account-->
<div id="hiddenDiv" style="-webkit-transform: rotate(20deg); -webkit-transform-origin: left bottom; padding-left: 100px; width: 200px; border: 1px solid black;">
<a href="#b">hello</a>
</div>
<div id="result"></div>
<script>
if (window.accessibilityController) {
var result = document.getElementById("result");
var body = document.getElementById("body");
body.focus();
var div = accessibilityController.focusedElement.childAtIndex(0);
result.innerText += div.allAttributes();
}
</script>
</body>
</html>
2009-04-30 Simon Fraser <simon.fraser@apple.com>
Reviewed by Darin Adler
<rdar://problem/6839338> VoiceOver does not take into account transforms when drawing outlines
Use transform-aware quad methods when computing the boundingBoxRect for
an AccessibilityRenderObject. The code follows RenderObject::absoluteBoundingBoxRect().
Test: accessibility/transformed-element.html
* page/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::boundingBoxRect):
2009-04-30 Dimitri Glazkov <dglazkov@chromium.org>
Unreviewed, Chromium build fix.
......@@ -983,7 +983,6 @@ String AccessibilityRenderObject::accessibilityDescription() const
IntRect AccessibilityRenderObject::boundingBoxRect() const
{
IntRect rect;
RenderObject* obj = m_renderer;
if (!obj)
......@@ -992,20 +991,22 @@ IntRect AccessibilityRenderObject::boundingBoxRect() const
if (obj->node()) // If we are a continuation, we want to make sure to use the primary renderer.
obj = obj->node()->renderer();
// FIXME: This doesn't work correctly with transforms.
Vector<IntRect> rects;
FloatPoint absPos = obj->localToAbsolute();
obj->absoluteRects(rects, absPos.x(), absPos.y());
const size_t n = rects.size();
Vector<FloatQuad> quads;
obj->absoluteQuads(quads);
const size_t n = quads.size();
if (!n)
return IntRect();
IntRect result;
for (size_t i = 0; i < n; ++i) {
IntRect r = rects[i];
IntRect r = quads[i].enclosingBoundingBox();
if (!r.isEmpty()) {
if (obj->style()->hasAppearance())
theme()->adjustRepaintRect(obj, r);
rect.unite(r);
result.unite(r);
}
}
return rect;
return result;
}
IntRect AccessibilityRenderObject::checkboxOrRadioRect() const
......
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