Title: [126972] trunk
Revision
126972
Author
dmazz...@google.com
Date
2012-08-29 01:05:25 -0700 (Wed, 29 Aug 2012)

Log Message

AX: Canvas should have a distinct role
https://bugs.webkit.org/show_bug.cgi?id=95248

Reviewed by Chris Fleizach.

Source/WebCore:

Add new role for a canvas element, and a method to determine if
a canvas has fallback content, so each platform can decide on the
appropriate role mapping to use.

Test: accessibility/canvas-description-and-role.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canvasHasFallbackContent):
(WebCore):
* accessibility/AccessibilityNodeObject.h:
(AccessibilityNodeObject):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isCanvas):
(WebCore::AccessibilityObject::canvasHasFallbackContent):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
(WebCore::AccessibilityRenderObject::canHaveChildren):
* accessibility/gtk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):
* accessibility/mac/WebAccessibilityObjectWrapper.mm:
(createAccessibilityRoleMap):
(-[WebAccessibilityObjectWrapper role]):

Source/WebKit/chromium:

Add support for canvas accessibility role.

* public/WebAccessibilityRole.h:
* src/AssertMatchingEnums.cpp:

Source/WebKit/win:

Map new CanvasRole to the same as ImageRole.

* AccessibleBase.cpp:
(MSAARole):

Tools:

Add support for canvas accessibility role.

* DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp:
(roleToString):

LayoutTests:

Add new tests for canvas role.

* accessibility/canvas.html: Deleted.
* accessibility/canvas-expected.txt: Deleted.
* accessibility/canvas-description-and-role.html: Added.
* platform/chromium/accessibility/canvas-description-and-role-expected.txt: Added.
* platform/gtk/TestExpectations:
* platform/mac/accessibility/canvas.html: Added.
* platform/mac/accessibility/canvas-expected.txt: Added.
* platform/mac/accessibility/canvas-description-and-role-expected.txt: Added.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (126971 => 126972)


--- trunk/LayoutTests/ChangeLog	2012-08-29 08:02:53 UTC (rev 126971)
+++ trunk/LayoutTests/ChangeLog	2012-08-29 08:05:25 UTC (rev 126972)
@@ -1,3 +1,21 @@
+2012-08-29  Dominic Mazzoni  <dmazz...@google.com>
+
+        AX: Canvas should have a distinct role
+        https://bugs.webkit.org/show_bug.cgi?id=95248
+
+        Reviewed by Chris Fleizach.
+
+        Add new tests for canvas role.
+
+        * accessibility/canvas.html: Deleted.
+        * accessibility/canvas-expected.txt: Deleted.
+        * accessibility/canvas-description-and-role.html: Added.
+        * platform/chromium/accessibility/canvas-description-and-role-expected.txt: Added.
+        * platform/gtk/TestExpectations:
+        * platform/mac/accessibility/canvas.html: Added.
+        * platform/mac/accessibility/canvas-expected.txt: Added.
+        * platform/mac/accessibility/canvas-description-and-role-expected.txt: Added.
+
 2012-08-28  Dominic Mazzoni  <dmazz...@google.com>
 
         AX: Focusable elements without a role should not be ignored

Added: trunk/LayoutTests/accessibility/canvas-description-and-role.html (0 => 126972)


--- trunk/LayoutTests/accessibility/canvas-description-and-role.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/canvas-description-and-role.html	2012-08-29 08:05:25 UTC (rev 126972)
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+<script src=""
+
+    <!-- No whitespace between canvases on purpose, so there's the same
+         number of children of the container element on all platforms. -->
+    <div id="container" tabIndex=0><canvas id="canvas1" width="100" height="100" aria-label="Canvas label">Fallback text</canvas><canvas id="canvas2" width="100" height="100"><button>Inner button</button></canvas><canvas id="canvas3-skipped" width="100" height="100"></canvas></div>
+
+<div id="console"></div>
+<script>
+description("This test makes sure that a canvas with and without fallback content each has the right role and description.")
+
+if (window.testRunner && window.accessibilityController) {
+    window.testRunner.dumpAsText();
+
+    document.getElementById('container').focus();
+    var axContainer = accessibilityController.focusedElement;
+
+    shouldBe("axContainer.childrenCount", "2");
+
+    var axCanvas1 = axContainer.childAtIndex(0);
+    debug('Canvas 1 description: ' + axCanvas1.description);
+    debug('Canvas 1 role: ' + axCanvas1.role);
+
+    var axCanvas2 = axContainer.childAtIndex(1);
+    debug('Canvas 2 description: ' + axCanvas2.description);
+    debug('Canvas 2 role: ' + axCanvas2.role);
+}
+
+</script>
+
+<script src=""
+</body>
+</html>

Deleted: trunk/LayoutTests/accessibility/canvas-expected.txt (126971 => 126972)


--- trunk/LayoutTests/accessibility/canvas-expected.txt	2012-08-29 08:02:53 UTC (rev 126971)
+++ trunk/LayoutTests/accessibility/canvas-expected.txt	2012-08-29 08:05:25 UTC (rev 126972)
@@ -1,2 +0,0 @@
-Test passed
-

Deleted: trunk/LayoutTests/accessibility/canvas.html (126971 => 126972)


--- trunk/LayoutTests/accessibility/canvas.html	2012-08-29 08:02:53 UTC (rev 126971)
+++ trunk/LayoutTests/accessibility/canvas.html	2012-08-29 08:05:25 UTC (rev 126972)
@@ -1,63 +0,0 @@
-<html>
-<script type="text/_javascript_">
-
-    function drawCanvas(context) {
-        context.lineWidth = 10.0;
-        context.lineCap = "round";
-
-        context.beginPath();
-
-        // Draw a bounds rect (default color is black)
-        context.strokeRect(0, 0, 300, 300);
-
-        context.strokeStyle = "#808080";
-
-        // Draw a vertical line
-        context.moveTo(150, 100);
-        context.lineTo(150, 200);
-        context.stroke();
-
-        // Draw a horizontal line
-        context.moveTo(100, 150);
-        context.lineTo(200, 150);
-        context.stroke();
-    }
-
-    function _onload() {
-        var context = document.getElementById("myCanvas").getContext("2d");
-        drawCanvas(context);
-    }
-</script>
-<script>
-    if (window.testRunner)
-        testRunner.dumpAsText();
-</script>
-<body id="body" _onload_="_onload()">
-
-<html>
- 
-    <!-- This test makes sure that a canvas element shows up as an image -->
- 
-    <canvas id="myCanvas" style="width:300px;height:300px;"  width='300' height='300' alt="canvas 1"></canvas>
-
-    <div id="result"></div>
-     
-    <script>
-        if (window.accessibilityController) {
-            var result = document.getElementById("result");
-
-            var body = document.getElementById("body");
-            body.focus();
-            var canvasElement = accessibilityController.focusedElement.childAtIndex(0).childAtIndex(0);
-            
-            var pattern = "AXRole: AXImage";
-            if (canvasElement.allAttributes().indexOf(pattern) != -1) {
-                result.innerText += "Test passed\n";
-            }
-            else {
-                 result.innerText += "Test failed\n" + canvasElement.allAttributes();
-            }
-        }
-    </script>
-</body>
-</html>

Added: trunk/LayoutTests/platform/chromium/accessibility/canvas-description-and-role-expected.txt (0 => 126972)


--- trunk/LayoutTests/platform/chromium/accessibility/canvas-description-and-role-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/accessibility/canvas-description-and-role-expected.txt	2012-08-29 08:05:25 UTC (rev 126972)
@@ -0,0 +1,14 @@
+This test makes sure that a canvas with and without fallback content each has the right role and description.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS axContainer.childrenCount is 2
+Canvas 1 description: AXDescription: Canvas label
+Canvas 1 role: AXRole: AXCanvas
+Canvas 2 description: AXDescription: 
+Canvas 2 role: AXRole: AXCanvas
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (126971 => 126972)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2012-08-29 08:02:53 UTC (rev 126971)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2012-08-29 08:05:25 UTC (rev 126972)
@@ -623,7 +623,7 @@
 BUGWKGTK : accessibility/aria-text-role.html = TEXT
 BUGWKGTK : accessibility/aria-used-on-image-maps.html = TEXT
 BUGWKGTK : accessibility/button-press-action.html = TEXT
-BUGWKGTK : accessibility/canvas.html = TEXT
+BUGWKGTK : accessibility/canvas-description-and-role.html = TEXT
 BUGWKGTK : accessibility/canvas-fallback-content.html = TEXT
 BUGWKGTK : accessibility/editable-webarea-context-menu-point.html = TEXT
 BUGWKGTK : accessibility/ellipsis-text.html = TEXT

Added: trunk/LayoutTests/platform/mac/accessibility/canvas-description-and-role-expected.txt (0 => 126972)


--- trunk/LayoutTests/platform/mac/accessibility/canvas-description-and-role-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/canvas-description-and-role-expected.txt	2012-08-29 08:05:25 UTC (rev 126972)
@@ -0,0 +1,14 @@
+This test makes sure that a canvas with and without fallback content each has the right role and description.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS axContainer.childrenCount is 2
+Canvas 1 description: AXDescription: Canvas label
+Canvas 1 role: AXRole: AXImage
+Canvas 2 description: AXDescription: 
+Canvas 2 role: AXRole: AXGroup
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: trunk/LayoutTests/platform/mac/accessibility/canvas-expected.txt (from rev 126971, trunk/LayoutTests/accessibility/canvas-expected.txt) (0 => 126972)


--- trunk/LayoutTests/platform/mac/accessibility/canvas-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/canvas-expected.txt	2012-08-29 08:05:25 UTC (rev 126972)
@@ -0,0 +1,2 @@
+Test passed
+

Copied: trunk/LayoutTests/platform/mac/accessibility/canvas.html (from rev 126971, trunk/LayoutTests/accessibility/canvas.html) (0 => 126972)


--- trunk/LayoutTests/platform/mac/accessibility/canvas.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/canvas.html	2012-08-29 08:05:25 UTC (rev 126972)
@@ -0,0 +1,63 @@
+<html>
+<script type="text/_javascript_">
+
+    function drawCanvas(context) {
+        context.lineWidth = 10.0;
+        context.lineCap = "round";
+
+        context.beginPath();
+
+        // Draw a bounds rect (default color is black)
+        context.strokeRect(0, 0, 300, 300);
+
+        context.strokeStyle = "#808080";
+
+        // Draw a vertical line
+        context.moveTo(150, 100);
+        context.lineTo(150, 200);
+        context.stroke();
+
+        // Draw a horizontal line
+        context.moveTo(100, 150);
+        context.lineTo(200, 150);
+        context.stroke();
+    }
+
+    function _onload() {
+        var context = document.getElementById("myCanvas").getContext("2d");
+        drawCanvas(context);
+    }
+</script>
+<script>
+    if (window.testRunner)
+        testRunner.dumpAsText();
+</script>
+<body id="body" _onload_="_onload()">
+
+<html>
+ 
+    <!-- This test makes sure that a canvas element shows up as an image -->
+ 
+    <canvas id="myCanvas" style="width:300px;height:300px;"  width='300' height='300' alt="canvas 1"></canvas>
+
+    <div id="result"></div>
+     
+    <script>
+        if (window.accessibilityController) {
+            var result = document.getElementById("result");
+
+            var body = document.getElementById("body");
+            body.focus();
+            var canvasElement = accessibilityController.focusedElement.childAtIndex(0).childAtIndex(0);
+            
+            var pattern = "AXRole: AXImage";
+            if (canvasElement.allAttributes().indexOf(pattern) != -1) {
+                result.innerText += "Test passed\n";
+            }
+            else {
+                 result.innerText += "Test failed\n" + canvasElement.allAttributes();
+            }
+        }
+    </script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (126971 => 126972)


--- trunk/Source/WebCore/ChangeLog	2012-08-29 08:02:53 UTC (rev 126971)
+++ trunk/Source/WebCore/ChangeLog	2012-08-29 08:05:25 UTC (rev 126972)
@@ -1,3 +1,34 @@
+2012-08-29  Dominic Mazzoni  <dmazz...@google.com>
+
+        AX: Canvas should have a distinct role
+        https://bugs.webkit.org/show_bug.cgi?id=95248
+
+        Reviewed by Chris Fleizach.
+
+        Add new role for a canvas element, and a method to determine if
+        a canvas has fallback content, so each platform can decide on the
+        appropriate role mapping to use.
+
+        Test: accessibility/canvas-description-and-role.html
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::canvasHasFallbackContent):
+        (WebCore):
+        * accessibility/AccessibilityNodeObject.h:
+        (AccessibilityNodeObject):
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilityObject::isCanvas):
+        (WebCore::AccessibilityObject::canvasHasFallbackContent):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
+        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
+        (WebCore::AccessibilityRenderObject::canHaveChildren):
+        * accessibility/gtk/WebKitAccessibleWrapperAtk.cpp:
+        (atkRole):
+        * accessibility/mac/WebAccessibilityObjectWrapper.mm:
+        (createAccessibilityRoleMap):
+        (-[WebAccessibilityObjectWrapper role]):
+
 2012-08-29  Ryuan Choi  <ryuan.c...@samsung.com>
 
         [EFL] Move several files to remove webkit1 dependency from WebCore.

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (126971 => 126972)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2012-08-29 08:02:53 UTC (rev 126971)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2012-08-29 08:05:25 UTC (rev 126972)
@@ -306,6 +306,23 @@
     return m_role == UnknownRole;
 }
 
+bool AccessibilityNodeObject::canvasHasFallbackContent() const
+{
+    Node* node = this->node();
+    if (!node || !node->hasTagName(canvasTag))
+        return false;
+
+    // If it has any children that are elements, we'll assume it might be fallback
+    // content. If it has no children or its only children are not elements
+    // (e.g. just text nodes), it doesn't have fallback content.
+    for (Node* child = node->firstChild(); child; child = child->nextSibling()) {
+        if (child->isElementNode())
+            return true;
+    }
+
+    return false;
+}
+
 bool AccessibilityNodeObject::canSetFocusAttribute() const
 {
     Node* node = this->node();

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h (126971 => 126972)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h	2012-08-29 08:02:53 UTC (rev 126971)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h	2012-08-29 08:05:25 UTC (rev 126972)
@@ -66,6 +66,8 @@
     
     virtual bool isAccessibilityNodeObject() const { return true; }
 
+    virtual bool canvasHasFallbackContent() const;
+
     virtual bool canSetFocusAttribute() const;
     
     virtual AccessibilityObject* firstChild() const;

Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (126971 => 126972)


--- trunk/Source/WebCore/accessibility/AccessibilityObject.h	2012-08-29 08:02:53 UTC (rev 126971)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h	2012-08-29 08:05:25 UTC (rev 126972)
@@ -104,6 +104,7 @@
     BrowserRole,
     BusyIndicatorRole,
     ButtonRole,
+    CanvasRole,
     CellRole, 
     CheckBoxRole,
     ColorWellRole,
@@ -381,6 +382,7 @@
     bool isListItem() const { return roleValue() == ListItemRole; }
     bool isCheckboxOrRadio() const { return isCheckbox() || isRadioButton(); }
     bool isScrollView() const { return roleValue() == ScrollAreaRole; }
+    bool isCanvas() const { return roleValue() == CanvasRole; }
     bool isBlockquote() const;
     bool isLandmark() const;
     
@@ -458,6 +460,7 @@
     virtual const AtomicString& invalidStatus() const;
     bool supportsARIAExpanded() const;
     AccessibilitySortDirection sortDirection() const;
+    virtual bool canvasHasFallbackContent() const { return false; }
     
     // ARIA drag and drop
     virtual bool supportsARIADropping() const { return false; }

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (126971 => 126972)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2012-08-29 08:02:53 UTC (rev 126971)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2012-08-29 08:05:25 UTC (rev 126972)
@@ -1492,7 +1492,7 @@
         return ariaDescription;
     
     Node* node = m_renderer->node();
-    if (isImage() || isInputImage() || isNativeImage()) {
+    if (isImage() || isInputImage() || isNativeImage() || isCanvas()) {
         if (node && node->isHTMLElement()) {
             const AtomicString& alt = toHTMLElement(node)->getAttribute(altAttr);
             if (alt.isEmpty())
@@ -1975,13 +1975,6 @@
                 return true;
         }
         
-        if (node && node->hasTagName(canvasTag)) {
-            RenderHTMLCanvas* canvas = toRenderHTMLCanvas(m_renderer);
-            if (canvas->height() <= 1 || canvas->width() <= 1)
-                return true;
-            return false;
-        }
-        
         if (isNativeImage()) {
             // check for one-dimensional image
             RenderImage* image = toRenderImage(m_renderer);
@@ -1996,7 +1989,16 @@
         }
         return false;
     }
-    
+
+    if (isCanvas()) {
+        if (canvasHasFallbackContent())
+            return false;
+        RenderHTMLCanvas* canvas = toRenderHTMLCanvas(m_renderer);
+        if (canvas->height() <= 1 || canvas->width() <= 1)
+            return true;
+        // Otherwise fall through; use presence of help text, title, or description to decide.
+    }
+
     if (isWebArea() || m_renderer->isListMarker())
         return false;
     
@@ -3178,7 +3180,7 @@
         return ImageRole;
     }
     if (node && node->hasTagName(canvasTag))
-        return ImageRole;
+        return CanvasRole;
 
     if (cssBox && cssBox->isRenderView())
         return WebAreaRole;
@@ -3423,10 +3425,6 @@
     if (!m_renderer)
         return false;
     
-    // Canvas is a special case; its role is ImageRole but it is allowed to have children.
-    if (node() && node()->hasTagName(canvasTag))
-        return true;
-
     // Elements that should not have children
     switch (roleValue()) {
     case ImageRole:

Modified: trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp (126971 => 126972)


--- trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp	2012-08-29 08:02:53 UTC (rev 126971)
+++ trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp	2012-08-29 08:05:25 UTC (rev 126972)
@@ -501,6 +501,7 @@
     case WebCoreLinkRole:
     case ImageMapLinkRole:
         return ATK_ROLE_LINK;
+    case CanvasRole:
     case ImageMapRole:
     case ImageRole:
         return ATK_ROLE_IMAGE;

Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm (126971 => 126972)


--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm	2012-08-29 08:02:53 UTC (rev 126971)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm	2012-08-29 08:05:25 UTC (rev 126972)
@@ -1578,7 +1578,8 @@
         { FormRole, NSAccessibilityGroupRole },
         { SpinButtonRole, NSAccessibilityIncrementorRole },
         { FooterRole, NSAccessibilityGroupRole },
-        { ToggleButtonRole, NSAccessibilityButtonRole }
+        { ToggleButtonRole, NSAccessibilityButtonRole },
+        { CanvasRole, NSAccessibilityImageRole }
     };
     AccessibilityRoleMap& roleMap = *new AccessibilityRoleMap;
     
@@ -1599,7 +1600,10 @@
 {
     if (m_object->isAttachment())
         return [[self attachmentView] accessibilityAttributeValue:NSAccessibilityRoleAttribute];
-    NSString* string = roleValueToNSString(m_object->roleValue());
+    AccessibilityRole role = m_object->roleValue();
+    if (role == CanvasRole && m_object->canvasHasFallbackContent())
+        role = GroupRole;
+    NSString* string = roleValueToNSString(role);
     if (string != nil)
         return string;
     return NSAccessibilityUnknownRole;

Modified: trunk/Source/WebKit/chromium/ChangeLog (126971 => 126972)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-08-29 08:02:53 UTC (rev 126971)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-08-29 08:05:25 UTC (rev 126972)
@@ -1,3 +1,15 @@
+2012-08-29  Dominic Mazzoni  <dmazz...@google.com>
+
+        AX: Canvas should have a distinct role
+        https://bugs.webkit.org/show_bug.cgi?id=95248
+
+        Reviewed by Chris Fleizach.
+
+        Add support for canvas accessibility role.
+
+        * public/WebAccessibilityRole.h:
+        * src/AssertMatchingEnums.cpp:
+
 2012-08-28  David Reveman  <reve...@chromium.org>
 
         [Chromium] Scheduler will never process a commit until it receives a vsync tick.

Modified: trunk/Source/WebKit/chromium/public/WebAccessibilityRole.h (126971 => 126972)


--- trunk/Source/WebKit/chromium/public/WebAccessibilityRole.h	2012-08-29 08:02:53 UTC (rev 126971)
+++ trunk/Source/WebKit/chromium/public/WebAccessibilityRole.h	2012-08-29 08:05:25 UTC (rev 126972)
@@ -49,6 +49,7 @@
     WebAccessibilityRoleBrowser,
     WebAccessibilityRoleBusyIndicator,
     WebAccessibilityRoleButton,
+    WebAccessibilityRoleCanvas,
     WebAccessibilityRoleCell, 
     WebAccessibilityRoleCheckBox,
     WebAccessibilityRoleColorWell,

Modified: trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp (126971 => 126972)


--- trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp	2012-08-29 08:02:53 UTC (rev 126971)
+++ trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp	2012-08-29 08:05:25 UTC (rev 126972)
@@ -261,6 +261,7 @@
 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleDocumentRegion, DocumentRegionRole);
 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleUserInterfaceTooltip, UserInterfaceTooltipRole);
 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleToggleButton, ToggleButtonRole);
+COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleCanvas, CanvasRole);
 
 COMPILE_ASSERT_MATCHING_ENUM(WebApplicationCacheHost::Uncached, ApplicationCacheHost::UNCACHED);
 COMPILE_ASSERT_MATCHING_ENUM(WebApplicationCacheHost::Idle, ApplicationCacheHost::IDLE);

Modified: trunk/Source/WebKit/win/AccessibleBase.cpp (126971 => 126972)


--- trunk/Source/WebKit/win/AccessibleBase.cpp	2012-08-29 08:02:53 UTC (rev 126971)
+++ trunk/Source/WebKit/win/AccessibleBase.cpp	2012-08-29 08:05:25 UTC (rev 126972)
@@ -657,6 +657,7 @@
         case WebCore::LinkRole:
         case WebCore::WebCoreLinkRole:
             return ROLE_SYSTEM_LINK;
+        case WebCore::CanvasRole:
         case WebCore::ImageMapRole:
         case WebCore::ImageRole:
             return ROLE_SYSTEM_GRAPHIC;

Modified: trunk/Source/WebKit/win/ChangeLog (126971 => 126972)


--- trunk/Source/WebKit/win/ChangeLog	2012-08-29 08:02:53 UTC (rev 126971)
+++ trunk/Source/WebKit/win/ChangeLog	2012-08-29 08:05:25 UTC (rev 126972)
@@ -1,3 +1,15 @@
+2012-08-29  Dominic Mazzoni  <dmazz...@google.com>
+
+        AX: Canvas should have a distinct role
+        https://bugs.webkit.org/show_bug.cgi?id=95248
+
+        Reviewed by Chris Fleizach.
+
+        Map new CanvasRole to the same as ImageRole.
+
+        * AccessibleBase.cpp:
+        (MSAARole):
+
 2012-08-28  Sheriff Bot  <webkit.review....@gmail.com>
 
         Unreviewed, rolling out r126914.

Modified: trunk/Tools/ChangeLog (126971 => 126972)


--- trunk/Tools/ChangeLog	2012-08-29 08:02:53 UTC (rev 126971)
+++ trunk/Tools/ChangeLog	2012-08-29 08:05:25 UTC (rev 126972)
@@ -1,3 +1,15 @@
+2012-08-29  Dominic Mazzoni  <dmazz...@google.com>
+
+        AX: Canvas should have a distinct role
+        https://bugs.webkit.org/show_bug.cgi?id=95248
+
+        Reviewed by Chris Fleizach.
+
+        Add support for canvas accessibility role.
+
+        * DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp:
+        (roleToString):
+
 2012-08-28  Eric Seidel  <e...@webkit.org>
 
         cr-ews bot doesn't set CWD correctly when zipping layout test results

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp (126971 => 126972)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp	2012-08-29 08:02:53 UTC (rev 126971)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp	2012-08-29 08:05:25 UTC (rev 126972)
@@ -206,6 +206,8 @@
         return result.append("UserInterfaceTooltip");
     case WebAccessibilityRoleToggleButton:
         return result.append("ToggleButton");
+    case WebAccessibilityRoleCanvas:
+        return result.append("Canvas");
     default:
         // Also matches WebAccessibilityRoleUnknown.
         return result.append("Unknown");
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to