Changeset 127084 in webkit
- Timestamp:
- Aug 29, 2012 7:14:44 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 16 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r127082 r127084 1 2012-08-29 Dominic Mazzoni <dmazzoni@google.com> 2 3 AX: Canvas should have a distinct role 4 https://bugs.webkit.org/show_bug.cgi?id=95248 5 6 Reviewed by Chris Fleizach. 7 8 Add new tests for canvas role. 9 10 * accessibility/canvas.html: Deleted. 11 * accessibility/canvas-expected.txt: Deleted. 12 * accessibility/canvas-description-and-role.html: Added. 13 * platform/chromium/accessibility/canvas-description-and-role-expected.txt: Added. 14 * platform/gtk/TestExpectations: 15 * platform/mac/accessibility/canvas.html: Added. 16 * platform/mac/accessibility/canvas-expected.txt: Added. 17 * platform/mac/accessibility/canvas-description-and-role-expected.txt: Added. 18 1 19 2012-08-29 Michael Saboff <msaboff@apple.com> 2 20 -
trunk/LayoutTests/platform/gtk/TestExpectations
r127070 r127084 624 624 BUGWKGTK : accessibility/aria-used-on-image-maps.html = TEXT 625 625 BUGWKGTK : accessibility/button-press-action.html = TEXT 626 BUGWKGTK : accessibility/canvas .html = TEXT626 BUGWKGTK : accessibility/canvas-description-and-role.html = TEXT 627 627 BUGWKGTK : accessibility/canvas-fallback-content.html = TEXT 628 628 BUGWKGTK : accessibility/editable-webarea-context-menu-point.html = TEXT -
trunk/Source/WebCore/ChangeLog
r127082 r127084 1 2012-08-29 Dominic Mazzoni <dmazzoni@google.com> 2 3 AX: Canvas should have a distinct role 4 https://bugs.webkit.org/show_bug.cgi?id=95248 5 6 Reviewed by Chris Fleizach. 7 8 Add new role for a canvas element, and a method to determine if 9 a canvas has fallback content, so each platform can decide on the 10 appropriate role mapping to use. 11 12 Test: accessibility/canvas-description-and-role.html 13 14 * accessibility/AccessibilityNodeObject.cpp: 15 (WebCore::AccessibilityNodeObject::canvasHasFallbackContent): 16 (WebCore): 17 * accessibility/AccessibilityNodeObject.h: 18 (AccessibilityNodeObject): 19 * accessibility/AccessibilityObject.h: 20 (WebCore::AccessibilityObject::isCanvas): 21 (WebCore::AccessibilityObject::canvasHasFallbackContent): 22 * accessibility/AccessibilityRenderObject.cpp: 23 (WebCore::AccessibilityRenderObject::accessibilityIsIgnored): 24 (WebCore::AccessibilityRenderObject::determineAccessibilityRole): 25 (WebCore::AccessibilityRenderObject::canHaveChildren): 26 * accessibility/gtk/WebKitAccessibleWrapperAtk.cpp: 27 (atkRole): 28 * accessibility/mac/WebAccessibilityObjectWrapper.mm: 29 (createAccessibilityRoleMap): 30 (-[WebAccessibilityObjectWrapper role]): 31 1 32 2012-08-29 Michael Saboff <msaboff@apple.com> 2 33 -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
r127006 r127084 307 307 } 308 308 309 bool AccessibilityNodeObject::canvasHasFallbackContent() const 310 { 311 Node* node = this->node(); 312 if (!node || !node->hasTagName(canvasTag)) 313 return false; 314 315 // If it has any children that are elements, we'll assume it might be fallback 316 // content. If it has no children or its only children are not elements 317 // (e.g. just text nodes), it doesn't have fallback content. 318 for (Node* child = node->firstChild(); child; child = child->nextSibling()) { 319 if (child->isElementNode()) 320 return true; 321 } 322 323 return false; 324 } 325 309 326 bool AccessibilityNodeObject::canSetFocusAttribute() const 310 327 { -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h
r127006 r127084 67 67 virtual bool isAccessibilityNodeObject() const { return true; } 68 68 69 virtual bool canvasHasFallbackContent() const; 70 69 71 virtual bool canSetFocusAttribute() const; 70 72 -
trunk/Source/WebCore/accessibility/AccessibilityObject.h
r127006 r127084 105 105 BusyIndicatorRole, 106 106 ButtonRole, 107 CanvasRole, 107 108 CellRole, 108 109 CheckBoxRole, … … 382 383 bool isCheckboxOrRadio() const { return isCheckbox() || isRadioButton(); } 383 384 bool isScrollView() const { return roleValue() == ScrollAreaRole; } 385 bool isCanvas() const { return roleValue() == CanvasRole; } 384 386 bool isBlockquote() const; 385 387 bool isLandmark() const; … … 459 461 bool supportsARIAExpanded() const; 460 462 AccessibilitySortDirection sortDirection() const; 463 virtual bool canvasHasFallbackContent() const { return false; } 461 464 462 465 // ARIA drag and drop -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r127006 r127084 1493 1493 1494 1494 Node* node = m_renderer->node(); 1495 if (isImage() || isInputImage() || isNativeImage() ) {1495 if (isImage() || isInputImage() || isNativeImage() || isCanvas()) { 1496 1496 if (node && node->isHTMLElement()) { 1497 1497 const AtomicString& alt = toHTMLElement(node)->getAttribute(altAttr); … … 1976 1976 } 1977 1977 1978 if (node && node->hasTagName(canvasTag)) {1979 RenderHTMLCanvas* canvas = toRenderHTMLCanvas(m_renderer);1980 if (canvas->height() <= 1 || canvas->width() <= 1)1981 return true;1982 return false;1983 }1984 1985 1978 if (isNativeImage()) { 1986 1979 // check for one-dimensional image … … 1997 1990 return false; 1998 1991 } 1999 1992 1993 if (isCanvas()) { 1994 if (canvasHasFallbackContent()) 1995 return false; 1996 RenderHTMLCanvas* canvas = toRenderHTMLCanvas(m_renderer); 1997 if (canvas->height() <= 1 || canvas->width() <= 1) 1998 return true; 1999 // Otherwise fall through; use presence of help text, title, or description to decide. 2000 } 2001 2000 2002 if (isWebArea() || m_renderer->isListMarker()) 2001 2003 return false; … … 3179 3181 } 3180 3182 if (node && node->hasTagName(canvasTag)) 3181 return ImageRole;3183 return CanvasRole; 3182 3184 3183 3185 if (cssBox && cssBox->isRenderView()) … … 3424 3426 return false; 3425 3427 3426 // Canvas is a special case; its role is ImageRole but it is allowed to have children.3427 if (node() && node()->hasTagName(canvasTag))3428 return true;3429 3430 3428 // Elements that should not have children 3431 3429 switch (roleValue()) { -
trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp
r127006 r127084 502 502 case ImageMapLinkRole: 503 503 return ATK_ROLE_LINK; 504 case CanvasRole: 504 505 case ImageMapRole: 505 506 case ImageRole: -
trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm
r127006 r127084 1579 1579 { SpinButtonRole, NSAccessibilityIncrementorRole }, 1580 1580 { FooterRole, NSAccessibilityGroupRole }, 1581 { ToggleButtonRole, NSAccessibilityButtonRole } 1581 { ToggleButtonRole, NSAccessibilityButtonRole }, 1582 { CanvasRole, NSAccessibilityImageRole } 1582 1583 }; 1583 1584 AccessibilityRoleMap& roleMap = *new AccessibilityRoleMap; … … 1600 1601 if (m_object->isAttachment()) 1601 1602 return [[self attachmentView] accessibilityAttributeValue:NSAccessibilityRoleAttribute]; 1602 NSString* string = roleValueToNSString(m_object->roleValue()); 1603 AccessibilityRole role = m_object->roleValue(); 1604 if (role == CanvasRole && m_object->canvasHasFallbackContent()) 1605 role = GroupRole; 1606 NSString* string = roleValueToNSString(role); 1603 1607 if (string != nil) 1604 1608 return string; -
trunk/Source/WebKit/chromium/ChangeLog
r127081 r127084 1 2012-08-29 Dominic Mazzoni <dmazzoni@google.com> 2 3 AX: Canvas should have a distinct role 4 https://bugs.webkit.org/show_bug.cgi?id=95248 5 6 Reviewed by Chris Fleizach. 7 8 Add support for canvas accessibility role. 9 10 * public/WebAccessibilityRole.h: 11 * src/AssertMatchingEnums.cpp: 12 1 13 2012-08-29 Alex Sakhartchouk <alexst@chromium.org> 2 14 -
trunk/Source/WebKit/chromium/public/WebAccessibilityRole.h
r127006 r127084 50 50 WebAccessibilityRoleBusyIndicator, 51 51 WebAccessibilityRoleButton, 52 WebAccessibilityRoleCanvas, 52 53 WebAccessibilityRoleCell, 53 54 WebAccessibilityRoleCheckBox, -
trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp
r127006 r127084 262 262 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleUserInterfaceTooltip, UserInterfaceTooltipRole); 263 263 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleToggleButton, ToggleButtonRole); 264 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleCanvas, CanvasRole); 264 265 265 266 COMPILE_ASSERT_MATCHING_ENUM(WebApplicationCacheHost::Uncached, ApplicationCacheHost::UNCACHED); -
trunk/Source/WebKit/win/AccessibleBase.cpp
r127006 r127084 658 658 case WebCore::WebCoreLinkRole: 659 659 return ROLE_SYSTEM_LINK; 660 case WebCore::CanvasRole: 660 661 case WebCore::ImageMapRole: 661 662 case WebCore::ImageRole: -
trunk/Source/WebKit/win/ChangeLog
r127006 r127084 1 2012-08-29 Dominic Mazzoni <dmazzoni@google.com> 2 3 AX: Canvas should have a distinct role 4 https://bugs.webkit.org/show_bug.cgi?id=95248 5 6 Reviewed by Chris Fleizach. 7 8 Map new CanvasRole to the same as ImageRole. 9 10 * AccessibleBase.cpp: 11 (MSAARole): 12 1 13 2012-08-29 Sheriff Bot <webkit.review.bot@gmail.com> 2 14 -
trunk/Tools/ChangeLog
r127070 r127084 1 2012-08-29 Dominic Mazzoni <dmazzoni@google.com> 2 3 AX: Canvas should have a distinct role 4 https://bugs.webkit.org/show_bug.cgi?id=95248 5 6 Reviewed by Chris Fleizach. 7 8 Add support for canvas accessibility role. 9 10 * DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp: 11 (roleToString): 12 1 13 2012-08-29 José Dapena Paz <jdapena@igalia.com> 2 14 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp
r127006 r127084 207 207 case WebAccessibilityRoleToggleButton: 208 208 return result.append("ToggleButton"); 209 case WebAccessibilityRoleCanvas: 210 return result.append("Canvas"); 209 211 default: 210 212 // Also matches WebAccessibilityRoleUnknown.
Note: See TracChangeset
for help on using the changeset viewer.