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

Changeset 245660 in webkit


Ignore:
Timestamp:
May 22, 2019, 5:07:22 PM (7 years ago)
Author:
timothy_horton@apple.com
Message:

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.

Location:
trunk/Source/WebKit
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r245653 r245660  
     12019-05-22  Tim Horton  <timothy_horton@apple.com>
     2
     3        REGRESSION (r240552): PDF contents are not exposed to Accessibility (VO, etc.)
     4        https://bugs.webkit.org/show_bug.cgi?id=198146
     5        <rdar://problem/50698533>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
     10        (WebKit::WebPage::updateMockAccessibilityElementAfterCommittingLoad):
     11        * WebProcess/WebPage/WebPage.cpp:
     12        (WebKit::WebPage::didCommitLoad):
     13        (WebKit::WebPage::updateMockAccessibilityElementAfterCommittingLoad):
     14        * WebProcess/WebPage/WebPage.h:
     15        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h:
     16        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
     17        (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
     18        (-[WKAccessibilityWebPageObjectBase setWebPage:]):
     19        (-[WKAccessibilityWebPageObjectBase setHasMainFramePlugin:]):
     20        In r240552, we changed to only defer to the main frame PluginView's
     21        accessibility tree if the cached "has a plugin" bit is true. That bit
     22        was only updated in WebPage::platformInitialize, which is long before
     23        we've actually loaded anything or have any clue if we're going to have
     24        a plugin.
     25
     26        Instead, push updates every time we commit a load, which coincides
     27        with when we make other decisions based on having a plugin or not.
     28        Also, just use the existence of a PluginDocument to make the decision,
     29        instead of actually digging in to see if there's a PluginView, since
     30        PluginView comes in asynchronously.
     31
    1322019-05-22  Ryosuke Niwa  <rniwa@webkit.org>
    233
  • trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm

    r244893 r245660  
    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
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r245595 r245660  
    57645764
    57655765    updateMainFrameScrollOffsetPinning();
     5766
     5767    updateMockAccessibilityElementAfterCommittingLoad();
    57665768}
    57675769
     
    67286730}
    67296731
     6732#if !PLATFORM(COCOA)
     6733void WebPage::updateMockAccessibilityElementAfterCommittingLoad()
     6734{
     6735}
     6736#endif
     6737
    67306738} // namespace WebKit
    67316739
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.h

    r245639 r245660  
    15871587    bool shouldDispatchUpdateAfterFocusingElement(const WebCore::Element&) const;
    15881588
     1589    void updateMockAccessibilityElementAfterCommittingLoad();
     1590
    15891591    uint64_t m_pageID;
    15901592
  • trunk/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h

    r241321 r245660  
    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;
  • trunk/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm

    r243443 r245660  
    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.