Title: [245686] branches/safari-608.1.24.40-branch/Source/WebKit
Revision
245686
Author
[email protected]
Date
2019-05-23 09:44:33 -0700 (Thu, 23 May 2019)

Log Message

Cherry-pick r245660. rdar://problem/50698533

    REGRESSION (r240552): PDF contents are not exposed to Accessibility (VO, etc.)
    https://bugs.webkit.org/show_bug.cgi?id=198146
    <rdar://problem/50698533>

    Reviewed by Simon Fraser.

    * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
    (WebKit::WebPage::updateMockAccessibilityElementAfterCommittingLoad):
    * WebProcess/WebPage/WebPage.cpp:
    (WebKit::WebPage::didCommitLoad):
    (WebKit::WebPage::updateMockAccessibilityElementAfterCommittingLoad):
    * WebProcess/WebPage/WebPage.h:
    * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h:
    * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
    (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
    (-[WKAccessibilityWebPageObjectBase setWebPage:]):
    (-[WKAccessibilityWebPageObjectBase setHasMainFramePlugin:]):
    In r240552, we changed to only defer to the main frame PluginView's
    accessibility tree if the cached "has a plugin" bit is true. That bit
    was only updated in WebPage::platformInitialize, which is long before
    we've actually loaded anything or have any clue if we're going to have
    a plugin.

    Instead, push updates every time we commit a load, which coincides
    with when we make other decisions based on having a plugin or not.
    Also, just use the existence of a PluginDocument to make the decision,
    instead of actually digging in to see if there's a PluginView, since
    PluginView comes in asynchronously.

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

Modified Paths

Diff

Modified: branches/safari-608.1.24.40-branch/Source/WebKit/ChangeLog (245685 => 245686)


--- branches/safari-608.1.24.40-branch/Source/WebKit/ChangeLog	2019-05-23 16:41:42 UTC (rev 245685)
+++ branches/safari-608.1.24.40-branch/Source/WebKit/ChangeLog	2019-05-23 16:44:33 UTC (rev 245686)
@@ -1,3 +1,70 @@
+2019-05-23  Kocsen Chung  <[email protected]>
+
+        Cherry-pick r245660. rdar://problem/50698533
+
+    REGRESSION (r240552): PDF contents are not exposed to Accessibility (VO, etc.)
+    https://bugs.webkit.org/show_bug.cgi?id=198146
+    <rdar://problem/50698533>
+    
+    Reviewed by Simon Fraser.
+    
+    * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
+    (WebKit::WebPage::updateMockAccessibilityElementAfterCommittingLoad):
+    * WebProcess/WebPage/WebPage.cpp:
+    (WebKit::WebPage::didCommitLoad):
+    (WebKit::WebPage::updateMockAccessibilityElementAfterCommittingLoad):
+    * WebProcess/WebPage/WebPage.h:
+    * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h:
+    * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
+    (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
+    (-[WKAccessibilityWebPageObjectBase setWebPage:]):
+    (-[WKAccessibilityWebPageObjectBase setHasMainFramePlugin:]):
+    In r240552, we changed to only defer to the main frame PluginView's
+    accessibility tree if the cached "has a plugin" bit is true. That bit
+    was only updated in WebPage::platformInitialize, which is long before
+    we've actually loaded anything or have any clue if we're going to have
+    a plugin.
+    
+    Instead, push updates every time we commit a load, which coincides
+    with when we make other decisions based on having a plugin or not.
+    Also, just use the existence of a PluginDocument to make the decision,
+    instead of actually digging in to see if there's a PluginView, since
+    PluginView comes in asynchronously.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245660 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-05-22  Tim Horton  <[email protected]>
+
+            REGRESSION (r240552): PDF contents are not exposed to Accessibility (VO, etc.)
+            https://bugs.webkit.org/show_bug.cgi?id=198146
+            <rdar://problem/50698533>
+
+            Reviewed by Simon Fraser.
+
+            * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
+            (WebKit::WebPage::updateMockAccessibilityElementAfterCommittingLoad):
+            * WebProcess/WebPage/WebPage.cpp:
+            (WebKit::WebPage::didCommitLoad):
+            (WebKit::WebPage::updateMockAccessibilityElementAfterCommittingLoad):
+            * WebProcess/WebPage/WebPage.h:
+            * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h:
+            * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
+            (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
+            (-[WKAccessibilityWebPageObjectBase setWebPage:]):
+            (-[WKAccessibilityWebPageObjectBase setHasMainFramePlugin:]):
+            In r240552, we changed to only defer to the main frame PluginView's
+            accessibility tree if the cached "has a plugin" bit is true. That bit
+            was only updated in WebPage::platformInitialize, which is long before
+            we've actually loaded anything or have any clue if we're going to have
+            a plugin.
+
+            Instead, push updates every time we commit a load, which coincides
+            with when we make other decisions based on having a plugin or not.
+            Also, just use the existence of a PluginDocument to make the decision,
+            instead of actually digging in to see if there's a PluginView, since
+            PluginView comes in asynchronously.
+
 2019-05-21  Kocsen Chung  <[email protected]>
 
         Revert r245465. rdar://problem/50252398

Modified: branches/safari-608.1.24.40-branch/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm (245685 => 245686)


--- branches/safari-608.1.24.40-branch/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm	2019-05-23 16:41:42 UTC (rev 245685)
+++ branches/safari-608.1.24.40-branch/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm	2019-05-23 16:44:33 UTC (rev 245686)
@@ -30,6 +30,7 @@
 #import "LoadParameters.h"
 #import "PluginView.h"
 #import "RemoteObjectRegistry.h"
+#import "WKAccessibilityWebPageObjectBase.h"
 #import "WebPageProxyMessages.h"
 #import "WebPaymentCoordinator.h"
 #import <WebCore/DictionaryLookup.h>
@@ -224,6 +225,12 @@
 {
     m_remoteObjectRegistry = makeWeakPtr(registry);
 }
+
+void WebPage::updateMockAccessibilityElementAfterCommittingLoad()
+{
+    auto* document = mainFrame()->document();
+    [m_mockAccessibilityElement setHasMainFramePlugin:document ? document->isPluginDocument() : false];
+}
     
 } // namespace WebKit
 

Modified: branches/safari-608.1.24.40-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp (245685 => 245686)


--- branches/safari-608.1.24.40-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2019-05-23 16:41:42 UTC (rev 245685)
+++ branches/safari-608.1.24.40-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2019-05-23 16:44:33 UTC (rev 245686)
@@ -5742,6 +5742,8 @@
     WebProcess::singleton().updateActivePages();
 
     updateMainFrameScrollOffsetPinning();
+
+    updateMockAccessibilityElementAfterCommittingLoad();
 }
 
 void WebPage::didFinishDocumentLoad(WebFrame& frame)
@@ -6706,6 +6708,12 @@
     send(Messages::WebPageProxy::ConfigureLoggingChannel(channelName, state, level));
 }
 
+#if !PLATFORM(COCOA)
+void WebPage::updateMockAccessibilityElementAfterCommittingLoad()
+{
+}
+#endif
+
 } // namespace WebKit
 
 #undef RELEASE_LOG_IF_ALLOWED

Modified: branches/safari-608.1.24.40-branch/Source/WebKit/WebProcess/WebPage/WebPage.h (245685 => 245686)


--- branches/safari-608.1.24.40-branch/Source/WebKit/WebProcess/WebPage/WebPage.h	2019-05-23 16:41:42 UTC (rev 245685)
+++ branches/safari-608.1.24.40-branch/Source/WebKit/WebProcess/WebPage/WebPage.h	2019-05-23 16:44:33 UTC (rev 245686)
@@ -1574,6 +1574,8 @@
 
     bool shouldDispatchUpdateAfterFocusingElement(const WebCore::Element&) const;
 
+    void updateMockAccessibilityElementAfterCommittingLoad();
+
     uint64_t m_pageID;
 
     std::unique_ptr<WebCore::Page> m_page;

Modified: branches/safari-608.1.24.40-branch/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h (245685 => 245686)


--- branches/safari-608.1.24.40-branch/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h	2019-05-23 16:41:42 UTC (rev 245685)
+++ branches/safari-608.1.24.40-branch/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h	2019-05-23 16:44:33 UTC (rev 245686)
@@ -34,11 +34,12 @@
     WebKit::WebPage* m_page;
     uint64_t m_pageID;
     id m_parent;
-    bool m_hasPlugin;
+    bool m_hasMainFramePlugin;
 }
 
 - (void)setWebPage:(WebKit::WebPage*)page;
 - (void)setRemoteParent:(id)parent;
+- (void)setHasMainFramePlugin:(bool)hasPlugin;
 
 - (id)accessibilityRootObjectWrapper;
 - (id)accessibilityFocusedUIElement;

Modified: branches/safari-608.1.24.40-branch/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm (245685 => 245686)


--- branches/safari-608.1.24.40-branch/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm	2019-05-23 16:41:42 UTC (rev 245685)
+++ branches/safari-608.1.24.40-branch/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm	2019-05-23 16:44:33 UTC (rev 245686)
@@ -120,7 +120,7 @@
     if (!WebCore::AXObjectCache::accessibilityEnabled())
         WebCore::AXObjectCache::enableAccessibility();
 
-    if (m_hasPlugin)
+    if (m_hasMainFramePlugin)
         return self.accessibilityPluginObject;
 
 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
@@ -141,16 +141,23 @@
 - (void)setWebPage:(WebKit::WebPage*)page
 {
     m_page = page;
-    
+
     if (page) {
         m_pageID = page->pageID();
-        m_hasPlugin = page->accessibilityObjectForMainFramePlugin();
+
+        auto* frame = page->mainFrame();
+        m_hasMainFramePlugin = frame && frame->document() ? frame->document()->isPluginDocument() : false;
     } else {
         m_pageID = 0;
-        m_hasPlugin = false;
+        m_hasMainFramePlugin = false;
     }
 }
 
+- (void)setHasMainFramePlugin:(bool)hasPlugin
+{
+    m_hasMainFramePlugin = hasPlugin;
+}
+
 - (void)setRemoteParent:(id)parent
 {
     if (parent != m_parent) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to