Title: [162816] trunk/Source
Revision
162816
Author
[email protected]
Date
2014-01-26 15:40:41 -0800 (Sun, 26 Jan 2014)

Log Message

AX: Disable accessibility after every test run
https://bugs.webkit.org/show_bug.cgi?id=127439

Reviewed by Alexey Proskuryakov.

../WebCore: 

If accessibility is disabled, we may still need to return the existing 
AXObjectCache, so that objects can be cleaned up appropriately.

A such we have to be prepared to handle a nullptr return value in more cases.

* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::disableAccessibility):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::childrenChanged):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::remoteSVGRootElement):
* dom/Document.cpp:
(WebCore::Document::existingAXObjectCache):

../WebKit: 

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (162815 => 162816)


--- trunk/Source/WebCore/ChangeLog	2014-01-26 22:55:41 UTC (rev 162815)
+++ trunk/Source/WebCore/ChangeLog	2014-01-26 23:40:41 UTC (rev 162816)
@@ -1,3 +1,24 @@
+2014-01-26  Chris Fleizach  <[email protected]>
+
+        AX: Disable accessibility after every test run
+        https://bugs.webkit.org/show_bug.cgi?id=127439
+
+        Reviewed by Alexey Proskuryakov.
+
+        If accessibility is disabled, we may still need to return the existing 
+        AXObjectCache, so that objects can be cleaned up appropriately.
+
+        A such we have to be prepared to handle a nullptr return value in more cases.
+
+        * accessibility/AXObjectCache.h:
+        (WebCore::AXObjectCache::disableAccessibility):
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::childrenChanged):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
+        * dom/Document.cpp:
+        (WebCore::Document::existingAXObjectCache):
+
 2014-01-26  Anders Carlsson  <[email protected]>
 
         Move history item visit count handling to WebKit

Modified: trunk/Source/WebCore/accessibility/AXObjectCache.h (162815 => 162816)


--- trunk/Source/WebCore/accessibility/AXObjectCache.h	2014-01-26 22:55:41 UTC (rev 162815)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.h	2014-01-26 23:40:41 UTC (rev 162816)
@@ -128,6 +128,8 @@
 
 #if HAVE(ACCESSIBILITY)
     static void enableAccessibility() { gAccessibilityEnabled = true; }
+    static void disableAccessibility() { gAccessibilityEnabled = false; }
+
     // Enhanced user interface accessibility can be toggled by the assistive technology.
     static void setEnhancedUserInterfaceAccessibility(bool flag) { gAccessibilityEnhancedUserInterfaceEnabled = flag; }
     
@@ -135,6 +137,7 @@
     static bool accessibilityEnhancedUserInterfaceEnabled() { return gAccessibilityEnhancedUserInterfaceEnabled; }
 #else
     static void enableAccessibility() { }
+    static void disableAccessibility() { }
     static void setEnhancedUserInterfaceAccessibility(bool) { }
     static bool accessibilityEnabled() { return false; }
     static bool accessibilityEnhancedUserInterfaceEnabled() { return false; }

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (162815 => 162816)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2014-01-26 22:55:41 UTC (rev 162815)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2014-01-26 23:40:41 UTC (rev 162816)
@@ -133,7 +133,10 @@
     if (!node() && !renderer())
         return;
 
-    axObjectCache()->postNotification(this, document(), AXObjectCache::AXChildrenChanged);
+    AXObjectCache* cache = axObjectCache();
+    if (!cache)
+        return;
+    cache->postNotification(this, document(), AXObjectCache::AXChildrenChanged);
 
     // Go up the accessibility parent chain, but only if the element already exists. This method is
     // called during render layouts, minimal work should be done. 
@@ -147,11 +150,11 @@
 
         // If this element supports ARIA live regions, then notify the AT of changes.
         if (parent->supportsARIALiveRegion())
-            axObjectCache()->postNotification(parent, parent->document(), AXObjectCache::AXLiveRegionChanged);
+            cache->postNotification(parent, parent->document(), AXObjectCache::AXLiveRegionChanged);
         
         // If this element is an ARIA text control, notify the AT of changes.
         if (parent->isARIATextControl() && !parent->isNativeTextControl() && !parent->node()->hasEditableStyle())
-            axObjectCache()->postNotification(parent, parent->document(), AXObjectCache::AXValueChanged);
+            cache->postNotification(parent, parent->document(), AXObjectCache::AXValueChanged);
     }
 }
 

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (162815 => 162816)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2014-01-26 22:55:41 UTC (rev 162815)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2014-01-26 23:40:41 UTC (rev 162816)
@@ -2796,44 +2796,47 @@
 {
 #if ENABLE(SVG)
     if (!m_renderer || !m_renderer->isRenderImage())
-        return 0;
+        return nullptr;
     
     CachedImage* cachedImage = toRenderImage(m_renderer)->cachedImage();
     if (!cachedImage)
-        return 0;
+        return nullptr;
     
     Image* image = cachedImage->image();
     if (!image || !image->isSVGImage())
-        return 0;
+        return nullptr;
     
     SVGImage* svgImage = static_cast<SVGImage*>(image);
     FrameView* frameView = svgImage->frameView();
     if (!frameView)
-        return 0;
+        return nullptr;
     Frame& frame = frameView->frame();
     
     Document* doc = frame.document();
     if (!doc || !doc->isSVGDocument())
-        return 0;
+        return nullptr;
     
     SVGSVGElement* rootElement = toSVGDocument(doc)->rootElement();
     if (!rootElement)
-        return 0;
+        return nullptr;
     RenderObject* rendererRoot = rootElement->renderer();
     if (!rendererRoot)
-        return 0;
+        return nullptr;
     
-    AccessibilityObject* rootSVGObject = frame.document()->axObjectCache()->getOrCreate(rendererRoot);
+    AXObjectCache* cache = frame.document()->axObjectCache();
+    if (!cache)
+        return nullptr;
+    AccessibilityObject* rootSVGObject = cache->getOrCreate(rendererRoot);
 
     // In order to connect the AX hierarchy from the SVG root element from the loaded resource
     // the parent must be set, because there's no other way to get back to who created the image.
     ASSERT(rootSVGObject && rootSVGObject->isAccessibilitySVGRoot());
     if (!rootSVGObject->isAccessibilitySVGRoot())
-        return 0;
+        return nullptr;
     
     return toAccessibilitySVGRoot(rootSVGObject);
 #else
-    return 0;
+    return nullptr;
 #endif
 }
     

Modified: trunk/Source/WebCore/dom/Document.cpp (162815 => 162816)


--- trunk/Source/WebCore/dom/Document.cpp	2014-01-26 22:55:41 UTC (rev 162815)
+++ trunk/Source/WebCore/dom/Document.cpp	2014-01-26 23:40:41 UTC (rev 162816)
@@ -2175,9 +2175,6 @@
 
 AXObjectCache* Document::existingAXObjectCache() const
 {
-    if (!AXObjectCache::accessibilityEnabled())
-        return nullptr;
-
     if (!topDocument()->hasLivingRenderTree())
         return nullptr;
 

Modified: trunk/Source/WebCore/testing/Internals.cpp (162815 => 162816)


--- trunk/Source/WebCore/testing/Internals.cpp	2014-01-26 22:55:41 UTC (rev 162815)
+++ trunk/Source/WebCore/testing/Internals.cpp	2014-01-26 23:40:41 UTC (rev 162816)
@@ -27,6 +27,7 @@
 #include "config.h"
 #include "Internals.h"
 
+#include "AXObjectCache.h"
 #include "AnimationController.h"
 #include "ApplicationCacheStorage.h"
 #include "BackForwardController.h"
@@ -291,6 +292,9 @@
 #if ENABLE(VIDEO)
     MediaSessionManager::sharedManager().resetRestrictions();
 #endif
+#if HAVE(ACCESSIBILITY)
+    AXObjectCache::disableAccessibility();
+#endif
 }
 
 Internals::Internals(Document* document)

Modified: trunk/Source/WebKit/ChangeLog (162815 => 162816)


--- trunk/Source/WebKit/ChangeLog	2014-01-26 22:55:41 UTC (rev 162815)
+++ trunk/Source/WebKit/ChangeLog	2014-01-26 23:40:41 UTC (rev 162816)
@@ -1,3 +1,12 @@
+2014-01-26  Chris Fleizach  <[email protected]>
+
+        AX: Disable accessibility after every test run
+        https://bugs.webkit.org/show_bug.cgi?id=127439
+
+        Reviewed by Alexey Proskuryakov.
+
+        * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
+
 2014-01-26  Anders Carlsson  <[email protected]>
 
         Fix build.

Modified: trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in (162815 => 162816)


--- trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in	2014-01-26 22:55:41 UTC (rev 162815)
+++ trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in	2014-01-26 23:40:41 UTC (rev 162816)
@@ -469,3 +469,5 @@
         symbolWithPointer(?completeURL@Document@WebCore@@UBE?AVURL@2@ABVString@WTF@@@Z, ?completeURL@Document@WebCore@@UEBA?AVURL@2@AEBVString@WTF@@@Z)
         symbolWithPointer(??1DOMWindow@WebCore@@UAE@XZ, ??1DOMWindow@WebCore@@UEAA@XZ)
         symbolWithPointer(?visibleContentRect@ScrollableArea@WebCore@@QBE?AVIntRect@2@W4VisibleContentRectBehavior@12@@Z, ?visibleContentRect@ScrollableArea@WebCore@@QEBA?AVIntRect@2@W4VisibleContentRectBehavior@12@@Z)
+        symbolWithPointer(?gAccessibilityEnabled@AXObjectCache@WebCore@@0_NA, ?gAccessibilityEnabled@AXObjectCache@WebCore@@0_NA)
+
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to