Changeset 158914 in webkit
- Timestamp:
- Nov 8, 2013 2:55:38 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r158913 r158914 1 2013-11-08 Mario Sanchez Prada <mario.prada@samsung.com> 2 3 AX: [ATK] <span> elements exposed through ATK when not needed 4 https://bugs.webkit.org/show_bug.cgi?id=123885 5 6 Reviewed by Chris Fleizach. 7 8 Removed failure expectations for tests now passing. 9 10 * platform/gtk/TestExpectations: Removed expectations. 11 1 12 2013-11-08 Krzysztof Czech <k.czech@samsung.com> 2 13 -
trunk/LayoutTests/platform/gtk/TestExpectations
r158913 r158914 1323 1323 webkit.org/b/114259 platform/gtk/accessibility/combo-box-collapsed-selection-changed.html [ Failure ] 1324 1324 1325 webkit.org/b/123885 platform/gtk/accessibility/spans-paragraphs-and-divs.html [ Failure ]1326 webkit.org/b/123885 platform/gtk/accessibility/spans.html [ Failure ]1327 1328 1325 webkit.org/b/114612 editing/style/block-style-005.html [ Failure ] 1329 1326 -
trunk/Source/WebCore/ChangeLog
r158910 r158914 1 2013-11-08 Mario Sanchez Prada <mario.prada@samsung.com> 2 3 AX: [ATK] <span> elements exposed through ATK when not needed 4 https://bugs.webkit.org/show_bug.cgi?id=123885 5 6 Reviewed by Chris Fleizach. 7 8 As per SVN r158195, the way it's decided whether <span> elements 9 should be ignored or not has slightly changed, causing that the 10 GTK/EFL ports expose them in cases that they should be ignored, 11 such as for text elements that neither are focusable (e.g. by 12 explicitly setting tabindex) nor have a meaningful accessible name 13 suggesting they should be exposed. 14 15 As a result, the flattening that ATK based ports normally do for 16 this kind of elements (by folding them into their parents) do not 17 work correctly anymore, making two tests to fail: 18 19 platform/gtk/accessibility/spans-paragraphs-and-divs.html 20 platform/gtk/accessibility/spans.html 21 22 This patch encapsulates the part of the logic that affects this in 23 the computeAccessibilityIsIgnored() method, placing it in a 24 new method of AccessibilityObject that we can call from ATK's 25 accessibilityPlatformIncludesObject() to ensure we hide those 26 <span> elements when they don't fulfill those requirements. 27 28 * accessibility/AccessibilityObject.cpp: 29 (WebCore::AccessibilityObject::hasAttributesRequiredForInclusion): 30 New virtual method encapsulating part of the logic from the function 31 that computes whether accessibility should be ignored or not. 32 * accessibility/AccessibilityObject.h: 33 34 * accessibility/AccessibilityNodeObject.cpp: 35 (WebCore::AccessibilityNodeObject::hasAttributesRequiredForInclusion): 36 Override of the new method adding additional checks, as extracted from 37 the original bits in computeAccessibilityIsIgnored(). 38 * accessibility/AccessibilityNodeObject.h: 39 40 * accessibility/AccessibilityRenderObject.cpp: 41 (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored): 42 Use the newly added function where we had the original code before. 43 44 * accessibility/atk/AccessibilityObjectAtk.cpp: 45 (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject): 46 Make sure <span> elements are ignored if they are not focusable 47 and they don't have a meaningful accessible name. 48 1 49 2013-11-08 Carlos Garcia Campos <cgarcia@igalia.com> 2 50 -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
r158743 r158914 1915 1915 } 1916 1916 1917 bool AccessibilityNodeObject::hasAttributesRequiredForInclusion() const 1918 { 1919 if (AccessibilityObject::hasAttributesRequiredForInclusion()) 1920 return true; 1921 1922 if (!ariaAccessibilityDescription().isEmpty()) 1923 return true; 1924 1925 return false; 1926 } 1927 1917 1928 bool AccessibilityNodeObject::canSetFocusAttribute() const 1918 1929 { -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h
r157782 r158914 129 129 virtual void colorValue(int& r, int& g, int& b) const OVERRIDE; 130 130 virtual String ariaLabeledByAttribute() const OVERRIDE; 131 virtual bool hasAttributesRequiredForInclusion() const OVERRIDE FINAL; 131 132 132 133 virtual Element* actionElement() const OVERRIDE; -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r158617 r158914 43 43 #include "LocalizedStrings.h" 44 44 #include "MainFrame.h" 45 #include "MathMLNames.h" 45 46 #include "NodeList.h" 46 47 #include "NodeTraversal.h" … … 511 512 previousObject = startObject; 512 513 } 514 } 515 516 bool AccessibilityObject::hasAttributesRequiredForInclusion() const 517 { 518 // These checks are simplified in the interest of execution speed. 519 if (!getAttribute(aria_helpAttr).isEmpty() 520 || !getAttribute(aria_describedbyAttr).isEmpty() 521 || !getAttribute(altAttr).isEmpty() 522 || !getAttribute(titleAttr).isEmpty()) 523 return true; 524 525 #if ENABLE(MATHML) 526 if (!getAttribute(MathMLNames::alttextAttr).isEmpty()) 527 return true; 528 #endif 529 530 return false; 513 531 } 514 532 -
trunk/Source/WebCore/accessibility/AccessibilityObject.h
r158743 r158914 608 608 // A programmatic way to set a name on an AccessibleObject. 609 609 virtual void setAccessibleName(const AtomicString&) { } 610 virtual bool hasAttributesRequiredForInclusion() const; 610 611 611 612 // Accessibility Text - (To be deprecated). -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r158844 r158914 1298 1298 return false; 1299 1299 1300 // Using the help text, title or accessibility description (so we 1301 // check if there's some kind of accessible name for the element) 1302 // to decide an element's visibility is not as definitive as 1303 // previous checks, so this should remain as one of the last. 1304 // 1305 // These checks are simplified in the interest of execution speed; 1306 // for example, any element having an alt attribute will make it 1307 // not ignored, rather than just images. 1308 if (!getAttribute(aria_helpAttr).isEmpty() || !getAttribute(aria_describedbyAttr).isEmpty() || !getAttribute(altAttr).isEmpty() || !getAttribute(titleAttr).isEmpty()) 1300 // Using the presence of an accessible name to decide an element's visibility is not 1301 // as definitive as previous checks, so this should remain as one of the last. 1302 if (hasAttributesRequiredForInclusion()) 1309 1303 return false; 1310 1304 … … 1313 1307 if (isGenericFocusableElement() && node->firstChild()) 1314 1308 return false; 1315 1316 if (!ariaAccessibilityDescription().isEmpty())1317 return false;1318 1319 #if ENABLE(MATHML)1320 if (!getAttribute(MathMLNames::alttextAttr).isEmpty())1321 return false;1322 #endif1323 1309 1324 1310 // <span> tags are inline tags and not meant to convey information if they have no other aria -
trunk/Source/WebCore/accessibility/atk/AccessibilityObjectAtk.cpp
r156295 r158914 22 22 #include "AccessibilityObject.h" 23 23 24 #include "HTMLNames.h" 24 25 #include "RenderObject.h" 25 26 #include "RenderText.h" … … 79 80 return IgnoreObject; 80 81 82 // Lines past this point only make sense for AccessibilityRenderObjects. 83 RenderObject* renderObject = renderer(); 84 if (!renderObject) 85 return DefaultBehavior; 86 87 // We don't want <span> elements to show up in the accessibility hierarchy unless 88 // we have good reasons for that (e.g. focusable or visible because of containing 89 // a meaningful accessible name, maybe set through ARIA), so we can use 90 // atk_component_grab_focus() to set the focus to it. 91 Node* node = renderObject->node(); 92 if (node && node->hasTagName(HTMLNames::spanTag) && !canSetFocusAttribute() && !hasAttributesRequiredForInclusion()) 93 return IgnoreObject; 94 81 95 // Given a paragraph or div containing a non-nested anonymous block, WebCore 82 96 // ignores the paragraph or div and includes the block. We want the opposite: … … 87 101 // Don't call textUnderElement() here, because it's slow and it can 88 102 // crash when called while we're in the middle of a subtree being deleted. 89 if (!render er()->firstChildSlow())103 if (!renderObject->firstChildSlow()) 90 104 return DefaultBehavior; 91 105 … … 93 107 return DefaultBehavior; 94 108 95 for (RenderObject* r = render er()->firstChildSlow(); r; r = r->nextSibling()) {109 for (RenderObject* r = renderObject->firstChildSlow(); r; r = r->nextSibling()) { 96 110 if (r->isAnonymousBlock()) 97 111 return IncludeObject; … … 110 124 // have we encountered instances where the parent of an anonymous block also lacked 111 125 // an aria role but the grandparent had one. 112 if (render er() && renderer()->isAnonymousBlock() && !parent->renderer()->isBody()126 if (renderObject && renderObject->isAnonymousBlock() && !parent->renderer()->isBody() 113 127 && parent->ariaRoleAttribute() == UnknownRole) 114 128 return IgnoreObject;
Note: See TracChangeset
for help on using the changeset viewer.