Title: [152464] trunk/Source/WebCore
Revision
152464
Author
[email protected]
Date
2013-07-08 14:03:54 -0700 (Mon, 08 Jul 2013)

Log Message

AX: iOS: SVG paths are not offset by the parent bounding box
https://bugs.webkit.org/show_bug.cgi?id=118433

The path for SVG shapes is in terms of its parent's view space. We need to offset
the path by that amount so that it's in the right location.

Reviewed by Tim Horton.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::elementPath):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (152463 => 152464)


--- trunk/Source/WebCore/ChangeLog	2013-07-08 20:02:27 UTC (rev 152463)
+++ trunk/Source/WebCore/ChangeLog	2013-07-08 21:03:54 UTC (rev 152464)
@@ -1,3 +1,16 @@
+2013-07-08  Chris Fleizach  <[email protected]>
+
+        AX: iOS: SVG paths are not offset by the parent bounding box
+        https://bugs.webkit.org/show_bug.cgi?id=118433
+
+        The path for SVG shapes is in terms of its parent's view space. We need to offset
+        the path by that amount so that it's in the right location.
+
+        Reviewed by Tim Horton.
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::elementPath):
+
 2013-07-08  Carlos Garcia Campos  <[email protected]>
 
         Unreviewed. Fix make distcheck.

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (152463 => 152464)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2013-07-08 20:02:27 UTC (rev 152463)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2013-07-08 21:03:54 UTC (rev 152464)
@@ -852,12 +852,24 @@
     
     return false;
 }
-    
+
 Path AccessibilityRenderObject::elementPath() const
 {
 #if ENABLE(SVG)
-    if (m_renderer && m_renderer->isSVGShape() && toRenderSVGShape(m_renderer)->hasPath())
-        return toRenderSVGShape(m_renderer)->path();
+    if (m_renderer && m_renderer->isSVGShape() && toRenderSVGShape(m_renderer)->hasPath()) {
+        Path path = toRenderSVGShape(m_renderer)->path();
+        
+        // The SVG path is in terms of the parent's bounding box. The path needs to be offset to frame coordinates.
+        for (RenderObject* parent = m_renderer->parent(); parent; parent = parent->parent()) {
+            if (parent->isSVGRoot()) {
+                LayoutPoint parentOffset = axObjectCache()->getOrCreate(parent)->elementRect().location();
+                path.transform(AffineTransform().translate(parentOffset.x(), parentOffset.y()));
+                break;
+            }
+        }
+        
+        return path;
+    }
 #endif
     
     return Path();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to