Title: [174741] trunk
Revision
174741
Author
cfleiz...@apple.com
Date
2014-10-15 12:35:29 -0700 (Wed, 15 Oct 2014)

Log Message

AX: Going back is broken for VoiceOver
https://bugs.webkit.org/show_bug.cgi?id=137382

Reviewed by Darin Adler.

Source/WebCore:

There were two issues preventing VoiceOver from navigating when using page history to go back/forward.
  1) Existing AXLoadComplete does not get fired when you just move through page history. 
       There were existing frameLoad notifications used by GTK. I think we should use those which seem more reliable.
  2) The AccessibilityScrollView cached its children, but on some history page loads, that cache was never cleared out.
       Rather than trying to find those places to clear out the cache, it's easier to just add the elements to the children
       array everytime it's asked for. Since there's only ever 3 elements (web area + 2 scroll bars) this should not be a performance hit.

Tests are not possible since they require monitoring notifications across multiple page loads.

* accessibility/AXObjectCache.h:
* accessibility/AccessibilityScrollView.cpp:
(WebCore::AccessibilityScrollView::updateChildrenIfNecessary):
* accessibility/ios/AXObjectCacheIOS.mm:
(WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
* dom/Document.cpp:
(WebCore::Document::implicitClose):

LayoutTests:

Update tests now that AXLoadComplete is sent more reliably.

* platform/mac/accessibility/aria-expanded-notifications-expected.txt:
* platform/mac/accessibility/aria-expanded-notifications.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (174740 => 174741)


--- trunk/LayoutTests/ChangeLog	2014-10-15 19:18:23 UTC (rev 174740)
+++ trunk/LayoutTests/ChangeLog	2014-10-15 19:35:29 UTC (rev 174741)
@@ -1,3 +1,15 @@
+2014-10-13  Chris Fleizach  <cfleiz...@apple.com>
+
+        AX: Going back is broken for VoiceOver
+        https://bugs.webkit.org/show_bug.cgi?id=137382
+
+        Reviewed by Darin Adler.
+
+        Update tests now that AXLoadComplete is sent more reliably.
+
+        * platform/mac/accessibility/aria-expanded-notifications-expected.txt:
+        * platform/mac/accessibility/aria-expanded-notifications.html:
+
 2014-10-15  Simon Fraser  <simon.fra...@apple.com>
 
         Sometimes can't scroll overflow:scroll areas in subframes

Modified: trunk/LayoutTests/platform/mac/accessibility/aria-expanded-notifications-expected.txt (174740 => 174741)


--- trunk/LayoutTests/platform/mac/accessibility/aria-expanded-notifications-expected.txt	2014-10-15 19:18:23 UTC (rev 174740)
+++ trunk/LayoutTests/platform/mac/accessibility/aria-expanded-notifications-expected.txt	2014-10-15 19:35:29 UTC (rev 174741)
@@ -9,6 +9,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+Notification: AXLoadComplete
 Notification: AXRowCountChanged
 Notification: AXRowCollapsed
 Notification: AXRowCountChanged

Modified: trunk/LayoutTests/platform/mac/accessibility/aria-expanded-notifications.html (174740 => 174741)


--- trunk/LayoutTests/platform/mac/accessibility/aria-expanded-notifications.html	2014-10-15 19:18:23 UTC (rev 174740)
+++ trunk/LayoutTests/platform/mac/accessibility/aria-expanded-notifications.html	2014-10-15 19:35:29 UTC (rev 174741)
@@ -32,7 +32,7 @@
     function notifyCallback(element, notification) {  
         notifyName = notification;
         document.getElementById("notifications").innerHTML += "Notification: " + notifyName + "<br>";
-        if (notifyCount == 3) {
+        if (notifyCount == 4) {
             accessibilityController.removeNotificationListener();
             window.testRunner.notifyDone();
         }

Modified: trunk/Source/WebCore/ChangeLog (174740 => 174741)


--- trunk/Source/WebCore/ChangeLog	2014-10-15 19:18:23 UTC (rev 174740)
+++ trunk/Source/WebCore/ChangeLog	2014-10-15 19:35:29 UTC (rev 174741)
@@ -1,3 +1,29 @@
+2014-10-13  Chris Fleizach  <cfleiz...@apple.com>
+
+        AX: Going back is broken for VoiceOver
+        https://bugs.webkit.org/show_bug.cgi?id=137382
+
+        Reviewed by Darin Adler.
+
+        There were two issues preventing VoiceOver from navigating when using page history to go back/forward.
+          1) Existing AXLoadComplete does not get fired when you just move through page history. 
+               There were existing frameLoad notifications used by GTK. I think we should use those which seem more reliable.
+          2) The AccessibilityScrollView cached its children, but on some history page loads, that cache was never cleared out.
+               Rather than trying to find those places to clear out the cache, it's easier to just add the elements to the children
+               array everytime it's asked for. Since there's only ever 3 elements (web area + 2 scroll bars) this should not be a performance hit.
+
+        Tests are not possible since they require monitoring notifications across multiple page loads.
+
+        * accessibility/AXObjectCache.h:
+        * accessibility/AccessibilityScrollView.cpp:
+        (WebCore::AccessibilityScrollView::updateChildrenIfNecessary):
+        * accessibility/ios/AXObjectCacheIOS.mm:
+        (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
+        * accessibility/mac/AXObjectCacheMac.mm:
+        (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
+        * dom/Document.cpp:
+        (WebCore::Document::implicitClose):
+
 2014-10-15  Simon Fraser  <simon.fra...@apple.com>
 
         Sometimes can't scroll overflow:scroll areas in subframes

Modified: trunk/Source/WebCore/accessibility/AXObjectCache.h (174740 => 174741)


--- trunk/Source/WebCore/accessibility/AXObjectCache.h	2014-10-15 19:18:23 UTC (rev 174740)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.h	2014-10-15 19:35:29 UTC (rev 174741)
@@ -165,6 +165,7 @@
         AXFocusedUIElementChanged,
         AXLayoutComplete,
         AXLoadComplete,
+        AXNewDocumentLoadComplete,
         AXSelectedChildrenChanged,
         AXSelectedTextChanged,
         AXValueChanged,

Modified: trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp (174740 => 174741)


--- trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp	2014-10-15 19:18:23 UTC (rev 174740)
+++ trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp	2014-10-15 19:35:29 UTC (rev 174741)
@@ -106,13 +106,11 @@
 
 void AccessibilityScrollView::updateChildrenIfNecessary()
 {
-    if (m_childrenDirty)
-        clearChildren();
-
-    if (!m_haveChildren)
-        addChildren();
-    
-    updateScrollbars();
+    // Always update our children when asked for them so that we don't inadvertently cache them after
+    // a new web area has been created for this scroll view (like when moving back and forth through history).
+    // Since a ScrollViews children will always be relatively small and limited this should not be a performance problem.
+    clearChildren();
+    addChildren();
 }
 
 void AccessibilityScrollView::updateScrollbars()

Modified: trunk/Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm (174740 => 174741)


--- trunk/Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm	2014-10-15 19:18:23 UTC (rev 174740)
+++ trunk/Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm	2014-10-15 19:35:29 UTC (rev 174741)
@@ -99,8 +99,13 @@
 {
 }
 
-void AXObjectCache::frameLoadingEventPlatformNotification(AccessibilityObject*, AXLoadingEvent)
+void AXObjectCache::frameLoadingEventPlatformNotification(AccessibilityObject* axFrameObject, AXLoadingEvent loadingEvent)
 {
+    if (!axFrameObject)
+        return;
+    
+    if (loadingEvent == AXLoadingFinished && axFrameObject->document() == axFrameObject->topDocument())
+        postPlatformNotification(axFrameObject, AXLoadComplete);
 }
 
 void AXObjectCache::platformHandleFocusedUIElementChanged(Node*, Node* newNode)

Modified: trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm (174740 => 174741)


--- trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm	2014-10-15 19:18:23 UTC (rev 174740)
+++ trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm	2014-10-15 19:35:29 UTC (rev 174741)
@@ -160,8 +160,13 @@
 {
 }
 
-void AXObjectCache::frameLoadingEventPlatformNotification(AccessibilityObject*, AXLoadingEvent)
+void AXObjectCache::frameLoadingEventPlatformNotification(AccessibilityObject* axFrameObject, AXLoadingEvent loadingEvent)
 {
+    if (!axFrameObject)
+        return;
+    
+    if (loadingEvent == AXLoadingFinished && axFrameObject->document() == axFrameObject->topDocument())
+        postPlatformNotification(axFrameObject, AXLoadComplete);
 }
 
 void AXObjectCache::platformHandleFocusedUIElementChanged(Node*, Node*)

Modified: trunk/Source/WebCore/dom/Document.cpp (174740 => 174741)


--- trunk/Source/WebCore/dom/Document.cpp	2014-10-15 19:18:23 UTC (rev 174740)
+++ trunk/Source/WebCore/dom/Document.cpp	2014-10-15 19:35:29 UTC (rev 174741)
@@ -2495,10 +2495,14 @@
         // The AX cache may have been cleared at this point, but we need to make sure it contains an
         // AX object to send the notification to. getOrCreate will make sure that an valid AX object
         // exists in the cache (we ignore the return value because we don't need it here). This is 
-        // only safe to call when a layout is not in progress, so it can not be used in postNotification.    
+        // only safe to call when a layout is not in progress, so it can not be used in postNotification.
+        //
+        // This notification is now called AXNewDocumentLoadComplete because there are other handlers that will
+        // catch new AND page history loads, and that uses AXLoadComplete
+        
         axObjectCache()->getOrCreate(renderView());
         if (this == &topDocument())
-            axObjectCache()->postNotification(renderView(), AXObjectCache::AXLoadComplete);
+            axObjectCache()->postNotification(renderView(), AXObjectCache::AXNewDocumentLoadComplete);
         else {
             // AXLoadComplete can only be posted on the top document, so if it's a document
             // in an iframe that just finished loading, post AXLayoutComplete instead.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to