WebKit is erroneously modifying the DOM; adding 'aria-selected' to tables
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Apr 2011 05:01:14 +0000 (05:01 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Apr 2011 05:01:14 +0000 (05:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=59140

Reviewed by Beth Dakin.

Source/WebCore:

WebKit should not modify the DOM when the screen reader requests certain things be set. There is no
specification that allows this behavior yet, but we are working on something for the future.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::setARIAGrabbed):
(WebCore::AccessibilityRenderObject::setIsExpanded):
(WebCore::AccessibilityRenderObject::setSelected):
(WebCore::AccessibilityRenderObject::setValue):

LayoutTests:

* accessibility/aria-combobox.html:
* platform/mac/accessibility/aria-combobox-expected.txt:
* platform/mac/accessibility/aria-slider-value-change-expected.txt:
* platform/mac/accessibility/aria-slider-value-change.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84600 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/accessibility/aria-combobox.html
LayoutTests/platform/mac/accessibility/aria-combobox-expected.txt
LayoutTests/platform/mac/accessibility/aria-slider-value-change-expected.txt
LayoutTests/platform/mac/accessibility/aria-slider-value-change.html
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.h

index 5f381f8..87a1858 100644 (file)
@@ -1,3 +1,15 @@
+2011-04-21  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Beth Dakin.
+
+        WebKit is erroneously modifying the DOM; adding 'aria-selected' to tables
+        https://bugs.webkit.org/show_bug.cgi?id=59140
+
+        * accessibility/aria-combobox.html:
+        * platform/mac/accessibility/aria-combobox-expected.txt:
+        * platform/mac/accessibility/aria-slider-value-change-expected.txt:
+        * platform/mac/accessibility/aria-slider-value-change.html:
+
 2011-04-21  Dirk Pranke  <dpranke@chromium.org>
 
         Unreviewed, expectations change - new baselines needed as
index c9b9660..40ab8be 100644 (file)
@@ -36,7 +36,8 @@ var successfullyParsed = false;
     
           combobox.showMenu();
 
-          shouldBe("combobox.isExpanded", "true");
+          // As of now, the isExpanded value won't be updated through an AX call.
+          shouldBe("combobox.isExpanded", "false");
 
           var firstChild = combobox.childAtIndex(0);
           shouldBe("firstChild.role", "'AXRole: AXList'");
index 4f68406..5d6164c 100644 (file)
@@ -7,7 +7,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 PASS combobox.role is 'AXRole: AXComboBox'
 PASS combobox.isExpanded is false
-PASS combobox.isExpanded is true
+PASS combobox.isExpanded is false
 PASS firstChild.role is 'AXRole: AXList'
 PASS successfullyParsed is true
 
index 544029b..fa02405 100644 (file)
@@ -5,8 +5,8 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 
 PASS slider.intValue is 50
-PASS slider.intValue > 50 is true
-PASS slider.intValue < 50 is true
+PASS slider.intValue is 50
+PASS slider.intValue is 50
 PASS successfullyParsed is true
 
 TEST COMPLETE
index b4b83f0..29a9562 100644 (file)
@@ -27,11 +27,13 @@ var successfullyParsed = false;
           shouldBe("slider.intValue", "50");
 
           slider.increment();
-          shouldBe("slider.intValue > 50", "true");
+          // As of now, there's no specification designed to update the DOM after an AX call.
+          shouldBe("slider.intValue", "50");
 
           slider.decrement();
           slider.decrement();
-          shouldBe("slider.intValue < 50", "true");
+          // As of now, there's no specification designed to update the DOM after an AX call.
+          shouldBe("slider.intValue", "50");
 
     }
 
index 07a36b9..33b7690 100644 (file)
@@ -2,6 +2,22 @@
 
         Reviewed by Beth Dakin.
 
+        WebKit is erroneously modifying the DOM; adding 'aria-selected' to tables
+        https://bugs.webkit.org/show_bug.cgi?id=59140
+
+        WebKit should not modify the DOM when the screen reader requests certain things be set. There is no
+        specification that allows this behavior yet, but we are working on something for the future.
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::setARIAGrabbed):
+        (WebCore::AccessibilityRenderObject::setIsExpanded):
+        (WebCore::AccessibilityRenderObject::setSelected):
+        (WebCore::AccessibilityRenderObject::setValue):
+
+2011-04-21  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Beth Dakin.
+
         AX: order AccessibilityRole alphabetically
         https://bugs.webkit.org/show_bug.cgi?id=31524
 
index 7830bdf..077968a 100644 (file)
@@ -1634,11 +1634,6 @@ bool AccessibilityRenderObject::isARIAGrabbed()
     return elementAttributeValue(aria_grabbedAttr);
 }
 
-void AccessibilityRenderObject::setARIAGrabbed(bool grabbed)
-{
-    setElementAttributeValue(aria_grabbedAttr, grabbed);
-}
-
 void AccessibilityRenderObject::determineARIADropEffects(Vector<String>& effects)
 {
     const AtomicString& dropEffects = getAttribute(aria_dropeffectAttr);
@@ -2101,22 +2096,6 @@ bool AccessibilityRenderObject::elementAttributeValue(const QualifiedName& attri
     return equalIgnoringCase(getAttribute(attributeName), "true");
 }
     
-void AccessibilityRenderObject::setIsExpanded(bool isExpanded)
-{
-    // Combo boxes, tree items and rows can be expanded (in different ways on different platforms).
-    // That action translates into setting the aria-expanded attribute to true.
-    AccessibilityRole role = roleValue();
-    switch (role) {
-    case ComboBoxRole:
-    case TreeItemRole:
-    case RowRole:
-        setElementAttributeValue(aria_expandedAttr, isExpanded);
-        break;
-    default:
-        break;
-    }
-}
-    
 bool AccessibilityRenderObject::isRequired() const
 {
     if (equalIgnoringCase(getAttribute(aria_requiredAttr), "true"))
@@ -2235,11 +2214,6 @@ void AccessibilityRenderObject::changeValueByPercent(float percentChange)
     
     axObjectCache()->postNotification(m_renderer, AXObjectCache::AXValueChanged, true);
 }
-    
-void AccessibilityRenderObject::setSelected(bool enabled)
-{
-    setElementAttributeValue(aria_selectedAttr, enabled);
-}
 
 void AccessibilityRenderObject::setSelectedRows(AccessibilityChildrenVector& selectedRows)
 {
@@ -2263,9 +2237,6 @@ void AccessibilityRenderObject::setValue(const String& string)
         return;
     Element* element = static_cast<Element*>(m_renderer->node());
 
-    if (roleValue() == SliderRole)
-        element->setAttribute(aria_valuenowAttr, string);
-
     if (!m_renderer->isBoxModelObject())
         return;
     RenderBoxModelObject* renderer = toRenderBoxModelObject(m_renderer);
index 75d31b9..43a6b87 100644 (file)
@@ -101,7 +101,6 @@ public:
     virtual bool isVisited() const;        
     virtual bool isRequired() const;
     virtual bool isLinked() const;
-    virtual void setIsExpanded(bool);
 
     virtual bool canSetFocusAttribute() const;
     virtual bool canSetTextRangeAttributes() const;
@@ -200,7 +199,6 @@ public:
     virtual void setFocused(bool);
     virtual void setSelectedTextRange(const PlainTextRange&);
     virtual void setValue(const String&);
-    virtual void setSelected(bool);
     virtual void setSelectedRows(AccessibilityChildrenVector&);
     virtual void changeValueByPercent(float percentChange);
     virtual AccessibilityOrientation orientation() const;
@@ -231,7 +229,6 @@ public:
     virtual bool supportsARIADropping() const;
     virtual bool supportsARIADragging() const;
     virtual bool isARIAGrabbed();
-    virtual void setARIAGrabbed(bool);
     virtual void determineARIADropEffects(Vector<String>&);
     
     virtual VisiblePosition visiblePositionForPoint(const IntPoint&) const;