Title: [181251] trunk/Source/WebKit2
Revision
181251
Author
wei...@apple.com
Date
2015-03-08 18:17:05 -0700 (Sun, 08 Mar 2015)

Log Message

AX: Expose a frame's accessible name through WK2 C SPI
<rdar://problem/19653068>
https://bugs.webkit.org/show_bug.cgi?id=142468

Reviewed by Dan Bernstein.

* WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
(WKBundleFrameSetAccessibleName):
* WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::setAccessibleName):
* WebProcess/WebPage/WebFrame.h:
Add SPI to set a frame's accessible name. This matches the Legacy WebKit SPI -[WebFrame setAccessibleName:]. 

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (181250 => 181251)


--- trunk/Source/WebKit2/ChangeLog	2015-03-08 23:58:40 UTC (rev 181250)
+++ trunk/Source/WebKit2/ChangeLog	2015-03-09 01:17:05 UTC (rev 181251)
@@ -1,5 +1,21 @@
 2015-03-08  Sam Weinig  <s...@webkit.org>
 
+        AX: Expose a frame's accessible name through WK2 C SPI
+        <rdar://problem/19653068>
+        https://bugs.webkit.org/show_bug.cgi?id=142468
+
+        Reviewed by Dan Bernstein.
+
+        * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
+        (WKBundleFrameSetAccessibleName):
+        * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
+        * WebProcess/WebPage/WebFrame.cpp:
+        (WebKit::WebFrame::setAccessibleName):
+        * WebProcess/WebPage/WebFrame.h:
+        Add SPI to set a frame's accessible name. This matches the Legacy WebKit SPI -[WebFrame setAccessibleName:]. 
+
+2015-03-08  Sam Weinig  <s...@webkit.org>
+
         [Content Extensions] Pass compiled content extensions as read-only shared memory rather than copying them
         https://bugs.webkit.org/show_bug.cgi?id=142458
 

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp (181250 => 181251)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp	2015-03-08 23:58:40 UTC (rev 181250)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp	2015-03-09 01:17:05 UTC (rev 181251)
@@ -240,6 +240,11 @@
     toImpl(frameRef)->setTextDirection(toWTFString(directionRef));
 }
 
+void WKBundleFrameSetAccessibleName(WKBundleFrameRef frameRef, WKStringRef accessibleNameRef)
+{
+    toImpl(frameRef)->setAccessibleName(toWTFString(accessibleNameRef));
+}
+
 WKDataRef WKBundleFrameCopyWebArchive(WKBundleFrameRef frameRef)
 {
     return WKBundleFrameCopyWebArchiveFilteringSubframes(frameRef, 0, 0);

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.h (181250 => 181251)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.h	2015-03-08 23:58:40 UTC (rev 181250)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.h	2015-03-09 01:17:05 UTC (rev 181251)
@@ -74,6 +74,8 @@
 WK_EXPORT WKStringRef WKBundleFrameCopySuggestedFilenameForResourceWithURL(WKBundleFrameRef frame, WKURLRef url);
 WK_EXPORT WKStringRef WKBundleFrameCopyMIMETypeForResourceWithURL(WKBundleFrameRef frame, WKURLRef url);
 
+WK_EXPORT void WKBundleFrameSetAccessibleName(WKBundleFrameRef frame, WKStringRef accessibleName);
+
 WK_EXPORT WKDataRef WKBundleFrameCopyWebArchive(WKBundleFrameRef frame);
 
 typedef bool (*WKBundleFrameFrameFilterCallback)(WKBundleFrameRef frame, WKBundleFrameRef subframe, void* context);

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp (181250 => 181251)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp	2015-03-08 23:58:40 UTC (rev 181250)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp	2015-03-09 01:17:05 UTC (rev 181251)
@@ -510,6 +510,25 @@
     return pluginView && pluginView->handlesPageScaleFactor();
 }
 
+void WebFrame::setAccessibleName(const String& accessibleName)
+{
+    if (!AXObjectCache::accessibilityEnabled())
+        return;
+    
+    if (!m_coreFrame)
+        return;
+
+    auto* document = m_coreFrame->document();
+    if (!document)
+        return;
+    
+    auto* rootObject = document->axObjectCache()->rootObject();
+    if (!rootObject)
+        return;
+
+    rootObject->setAccessibleName(accessibleName);
+}
+
 IntRect WebFrame::contentBounds() const
 {    
     if (!m_coreFrame)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.h (181250 => 181251)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.h	2015-03-08 23:58:40 UTC (rev 181250)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.h	2015-03-09 01:17:05 UTC (rev 181251)
@@ -113,6 +113,7 @@
     bool containsAnyFormControls() const;
     void stopLoading();
     bool handlesPageScaleGesture() const;
+    void setAccessibleName(const String&);
 
     static WebFrame* frameForContext(JSContextRef);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to