AX: WK2: AX hierarchy is not restored after web process crash
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Dec 2011 23:34:41 +0000 (23:34 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Dec 2011 23:34:41 +0000 (23:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=73870

The accessibility tokens that need to be sent between UI and Web process
were not being sent by the UI process -> the web process when the web
process crashed.

Reviewed by Darin Adler.

* UIProcess/API/mac/WKView.mm:
(-[WKView viewDidMoveToWindow]):
(-[WKView _accessibilityRegisterUIProcessTokens]):
(-[WKView _didRelaunchProcess]):

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/mac/WKView.mm

index 2cffdab..4fddd18 100644 (file)
@@ -1,3 +1,19 @@
+2011-12-05  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: WK2: AX hierarchy is not restored after web process crash
+        https://bugs.webkit.org/show_bug.cgi?id=73870
+
+        The accessibility tokens that need to be sent between UI and Web process
+        were not being sent by the UI process -> the web process when the web
+        process crashed.
+
+        Reviewed by Darin Adler.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView viewDidMoveToWindow]):
+        (-[WKView _accessibilityRegisterUIProcessTokens]):
+        (-[WKView _didRelaunchProcess]):
+
 2011-12-05  Alexey Proskuryakov  <ap@apple.com>
 
         REGRESSION: Full keyboard access doesn't work if enabled before Safari started
index 7dd2bf4..1228f92 100644 (file)
@@ -123,6 +123,7 @@ struct WKViewInterpretKeyEventsParameters {
 - (void)_setPluginComplexTextInputState:(PluginComplexTextInputState)pluginComplexTextInputState;
 - (void)_disableComplexTextInputIfNecessary;
 - (BOOL)_shouldUseTiledDrawingArea;
+- (void)_accessibilityRegisterUIProcessTokens;
 @end
 
 @interface WKViewData : NSObject {
@@ -1818,13 +1819,7 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl
         [self _updateWindowVisibility];
         [self _updateWindowAndViewFrames];
         
-        // Initialize remote accessibility when the window connection has been established.
-        NSData *remoteElementToken = WKAXRemoteTokenForElement(self);
-        NSData *remoteWindowToken = WKAXRemoteTokenForElement([self accessibilityAttributeValue:NSAccessibilityWindowAttribute]);
-        CoreIPC::DataReference elementToken = CoreIPC::DataReference(reinterpret_cast<const uint8_t*>([remoteElementToken bytes]), [remoteElementToken length]);
-        CoreIPC::DataReference windowToken = CoreIPC::DataReference(reinterpret_cast<const uint8_t*>([remoteWindowToken bytes]), [remoteWindowToken length]);
-        _data->_page->registerUIProcessAccessibilityTokens(elementToken, windowToken);
-            
+        [self _accessibilityRegisterUIProcessTokens];            
     } else {
         _data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
         _data->_page->viewStateDidChange(WebPageProxy::ViewWindowIsActive | WebPageProxy::ViewIsInWindow);
@@ -1988,6 +1983,16 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I
     _data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
 }
 
+- (void)_accessibilityRegisterUIProcessTokens
+{
+    // Initialize remote accessibility when the window connection has been established.
+    NSData *remoteElementToken = WKAXRemoteTokenForElement(self);
+    NSData *remoteWindowToken = WKAXRemoteTokenForElement([self accessibilityAttributeValue:NSAccessibilityWindowAttribute]);
+    CoreIPC::DataReference elementToken = CoreIPC::DataReference(reinterpret_cast<const uint8_t*>([remoteElementToken bytes]), [remoteElementToken length]);
+    CoreIPC::DataReference windowToken = CoreIPC::DataReference(reinterpret_cast<const uint8_t*>([remoteWindowToken bytes]), [remoteWindowToken length]);
+    _data->_page->registerUIProcessAccessibilityTokens(elementToken, windowToken);
+}
+
 - (void)_updateRemoteAccessibilityRegistration:(BOOL)registerProcess
 {
     // When the tree is connected/disconnected, the remote accessibility registration
@@ -2126,6 +2131,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I
 
 - (void)_didRelaunchProcess
 {
+    [self _accessibilityRegisterUIProcessTokens];
 }
 
 - (void)_setCursor:(NSCursor *)cursor