⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245686 in webkit


Ignore:
Timestamp:
May 23, 2019, 9:44:33 AM (7 years ago)
Author:
Kocsen Chung
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

Location:
branches/safari-608.1.24.40-branch/Source/WebKit
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-608.1.24.40-branch/Source/WebKit/ChangeLog

    r245591 r245686  
     12019-05-23  Kocsen Chung  <kocsen_chung@apple.com>
     2
     3        Cherry-pick r245660. rdar://problem/50698533
     4
     5    REGRESSION (r240552): PDF contents are not exposed to Accessibility (VO, etc.)
     6    https://bugs.webkit.org/show_bug.cgi?id=198146
     7    <rdar://problem/50698533>
     8   
     9    Reviewed by Simon Fraser.
     10   
     11    * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
     12    (WebKit::WebPage::updateMockAccessibilityElementAfterCommittingLoad):
     13    * WebProcess/WebPage/WebPage.cpp:
     14    (WebKit::WebPage::didCommitLoad):
     15    (WebKit::WebPage::updateMockAccessibilityElementAfterCommittingLoad):
     16    * WebProcess/WebPage/WebPage.h:
     17    * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h:
     18    * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
     19    (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
     20    (-[WKAccessibilityWebPageObjectBase setWebPage:]):
     21    (-[WKAccessibilityWebPageObjectBase setHasMainFramePlugin:]):
     22    In r240552, we changed to only defer to the main frame PluginView's
     23    accessibility tree if the cached "has a plugin" bit is true. That bit
     24    was only updated in WebPage::platformInitialize, which is long before
     25    we've actually loaded anything or have any clue if we're going to have
     26    a plugin.
     27   
     28    Instead, push updates every time we commit a load, which coincides
     29    with when we make other decisions based on having a plugin or not.
     30    Also, just use the existence of a PluginDocument to make the decision,
     31    instead of actually digging in to see if there's a PluginView, since
     32    PluginView comes in asynchronously.
     33   
     34   
     35    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245660 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     36
     37    2019-05-22  Tim Horton  <timothy_horton@apple.com>
     38
     39            REGRESSION (r240552): PDF contents are not exposed to Accessibility (VO, etc.)
     40            https://bugs.webkit.org/show_bug.cgi?id=198146
     41            <rdar://problem/50698533>
     42
     43            Reviewed by Simon Fraser.
     44
     45            * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
     46            (WebKit::WebPage::updateMockAccessibilityElementAfterCommittingLoad):
     47            * WebProcess/WebPage/WebPage.cpp:
     48            (WebKit::WebPage::didCommitLoad):
     49            (WebKit::WebPage::updateMockAccessibilityElementAfterCommittingLoad):
     50            * WebProcess/WebPage/WebPage.h:
     51            * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h:
     52            * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
     53            (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
     54            (-[WKAccessibilityWebPageObjectBase setWebPage:]):
     55            (-[WKAccessibilityWebPageObjectBase setHasMainFramePlugin:]):
     56            In r240552, we changed to only defer to the main frame PluginView's
     57            accessibility tree if the cached "has a plugin" bit is true. That bit
     58            was only updated in WebPage::platformInitialize, which is long before
     59            we've actually loaded anything or have any clue if we're going to have
     60            a plugin.
     61
     62            Instead, push updates every time we commit a load, which coincides
     63            with when we make other decisions based on having a plugin or not.
     64            Also, just use the existence of a PluginDocument to make the decision,
     65            instead of actually digging in to see if there's a PluginView, since
     66            PluginView comes in asynchronously.
     67
    1682019-05-21  Kocsen Chung  <kocsen_chung@apple.com>
    269
  • branches/safari-608.1.24.40-branch/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm

    r244893 r245686  
    3131#import "PluginView.h"
    3232#import "RemoteObjectRegistry.h"
     33#import "WKAccessibilityWebPageObjectBase.h"
    3334#import "WebPageProxyMessages.h"
    3435#import "WebPaymentCoordinator.h"
     
    225226    m_remoteObjectRegistry = makeWeakPtr(registry);
    226227}
     228
     229void WebPage::updateMockAccessibilityElementAfterCommittingLoad()
     230{
     231    auto* document = mainFrame()->document();
     232    [m_mockAccessibilityElement setHasMainFramePlugin:document ? document->isPluginDocument() : false];
     233}
    227234   
    228235} // namespace WebKit
  • branches/safari-608.1.24.40-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r245358 r245686  
    57435743
    57445744    updateMainFrameScrollOffsetPinning();
     5745
     5746    updateMockAccessibilityElementAfterCommittingLoad();
    57455747}
    57465748
     
    67076709}
    67086710
     6711#if !PLATFORM(COCOA)
     6712void WebPage::updateMockAccessibilityElementAfterCommittingLoad()
     6713{
     6714}
     6715#endif
     6716
    67096717} // namespace WebKit
    67106718
  • branches/safari-608.1.24.40-branch/Source/WebKit/WebProcess/WebPage/WebPage.h

    r245358 r245686  
    15751575    bool shouldDispatchUpdateAfterFocusingElement(const WebCore::Element&) const;
    15761576
     1577    void updateMockAccessibilityElementAfterCommittingLoad();
     1578
    15771579    uint64_t m_pageID;
    15781580
  • branches/safari-608.1.24.40-branch/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h

    r241321 r245686  
    3535    uint64_t m_pageID;
    3636    id m_parent;
    37     bool m_hasPlugin;
     37    bool m_hasMainFramePlugin;
    3838}
    3939
    4040- (void)setWebPage:(WebKit::WebPage*)page;
    4141- (void)setRemoteParent:(id)parent;
     42- (void)setHasMainFramePlugin:(bool)hasPlugin;
    4243
    4344- (id)accessibilityRootObjectWrapper;
  • branches/safari-608.1.24.40-branch/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm

    r243443 r245686  
    121121        WebCore::AXObjectCache::enableAccessibility();
    122122
    123     if (m_hasPlugin)
     123    if (m_hasMainFramePlugin)
    124124        return self.accessibilityPluginObject;
    125125
     
    142142{
    143143    m_page = page;
    144    
     144
    145145    if (page) {
    146146        m_pageID = page->pageID();
    147         m_hasPlugin = page->accessibilityObjectForMainFramePlugin();
     147
     148        auto* frame = page->mainFrame();
     149        m_hasMainFramePlugin = frame && frame->document() ? frame->document()->isPluginDocument() : false;
    148150    } else {
    149151        m_pageID = 0;
    150         m_hasPlugin = false;
     152        m_hasMainFramePlugin = false;
    151153    }
     154}
     155
     156- (void)setHasMainFramePlugin:(bool)hasPlugin
     157{
     158    m_hasMainFramePlugin = hasPlugin;
    152159}
    153160
Note: See TracChangeset for help on using the changeset viewer.