AX: WK2: When creating the window remote token, use what's returned from accessibility
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Mar 2011 00:54:34 +0000 (00:54 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Mar 2011 00:54:34 +0000 (00:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=57398

Reviewed by Darin Adler.

This will allow a specific WKView to override what's used for the window attribute of the
HTML elements.

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

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

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

index dc446ce..007e580 100644 (file)
@@ -1,3 +1,16 @@
+2011-03-29  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Darin Adler.
+
+        AX: WK2: When creating the window remote token, use what's returned from accessibility
+        https://bugs.webkit.org/show_bug.cgi?id=57398
+
+        This will allow a specific WKView to override what's used for the window attribute of the
+        HTML elements.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView viewDidMoveToWindow]):
+
 2011-03-29  Jeff Miller  <jeffm@apple.com>
 
         Reviewed by Sam Weinig.
index ca9b236..9e269de 100644 (file)
@@ -1468,7 +1468,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
         // Initialize remote accessibility when the window connection has been established.
 #if !defined(BUILDING_ON_SNOW_LEOPARD)
         NSData *remoteElementToken = WKAXRemoteTokenForElement(self);
-        NSData *remoteWindowToken = WKAXRemoteTokenForElement([self window]);
+        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);