Changeset 243861 in webkit


Ignore:
Timestamp:
Apr 3, 2019 10:50:22 PM (5 years ago)
Author:
Carlos Garcia Campos
Message:

[ATK] Embed the AtkSocket as soon as we receive the plug ID
https://bugs.webkit.org/show_bug.cgi?id=196534

Reviewed by Michael Catanzaro.

We are currently storing the ID and waiting for the next time get_accessible is called to embed the socket. We
can simply embed the socket when the plug ID is received.

  • UIProcess/API/gtk/WebKitWebViewBase.cpp:

(webkitWebViewBaseGetAccessible):

  • UIProcess/WebPageProxy.h:
  • UIProcess/gtk/WebPageProxyGtk.cpp:

(WebKit::WebPageProxy::bindAccessibilityTree):

Location:
trunk/Source/WebKit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r243860 r243861  
     12019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [ATK] Embed the AtkSocket as soon as we receive the plug ID
     4        https://bugs.webkit.org/show_bug.cgi?id=196534
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        We are currently storing the ID and waiting for the next time get_accessible is called to embed the socket. We
     9        can simply embed the socket when the plug ID is received.
     10
     11        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
     12        (webkitWebViewBaseGetAccessible):
     13        * UIProcess/WebPageProxy.h:
     14        * UIProcess/gtk/WebPageProxyGtk.cpp:
     15        (WebKit::WebPageProxy::bindAccessibilityTree):
     16
    1172019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
    218
  • trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp

    r242346 r243861  
    12291229static AtkObject* webkitWebViewBaseGetAccessible(GtkWidget* widget)
    12301230{
    1231     // If the socket has already been created and embedded a plug ID, return it.
    12321231    WebKitWebViewBasePrivate* priv = WEBKIT_WEB_VIEW_BASE(widget)->priv;
    1233     if (priv->accessible && atk_socket_is_occupied(ATK_SOCKET(priv->accessible.get())))
    1234         return priv->accessible.get();
    1235 
    1236     // Create the accessible object and associate it to the widget.
    12371232    if (!priv->accessible) {
     1233        // Create the accessible object and associate it to the widget.
    12381234        priv->accessible = adoptGRef(ATK_OBJECT(webkitWebViewBaseAccessibleNew(widget)));
    12391235
    1240         // Set the parent not to break bottom-up navigation.
    1241         GtkWidget* parentWidget = gtk_widget_get_parent(widget);
    1242         AtkObject* axParent = parentWidget ? gtk_widget_get_accessible(parentWidget) : 0;
    1243         if (axParent)
    1244             atk_object_set_parent(priv->accessible.get(), axParent);
    1245     }
    1246 
    1247     // Try to embed the plug in the socket, if posssible.
    1248     String plugID = priv->pageProxy->accessibilityPlugID();
    1249     if (plugID.isNull())
    1250         return priv->accessible.get();
    1251 
    1252     atk_socket_embed(ATK_SOCKET(priv->accessible.get()), const_cast<gchar*>(plugID.utf8().data()));
     1236        // Set the parent to not break bottom-up navigation.
     1237        if (auto* parentWidget = gtk_widget_get_parent(widget)) {
     1238            if (auto* axParent = gtk_widget_get_accessible(parentWidget))
     1239                atk_object_set_parent(priv->accessible.get(), axParent);
     1240        }
     1241    }
    12531242
    12541243    return priv->accessible.get();
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r243847 r243861  
    11241124#endif
    11251125
    1126 #if PLATFORM(GTK)
    1127     String accessibilityPlugID() const { return m_accessibilityPlugID; }
    1128 #endif
    1129 
    11301126    void setCanRunModal(bool);
    11311127    bool canRunModal();
     
    23052301#endif
    23062302
    2307 #if PLATFORM(GTK)
    2308     String m_accessibilityPlugID;
    2309 #endif
    2310 
    23112303    Optional<WebCore::Color> m_backgroundColor;
    23122304
  • trunk/Source/WebKit/UIProcess/gtk/WebPageProxyGtk.cpp

    r243327 r243861  
    5858void WebPageProxy::bindAccessibilityTree(const String& plugID)
    5959{
    60     m_accessibilityPlugID = plugID;
     60    auto* accessible = gtk_widget_get_accessible(viewWidget());
     61    atk_socket_embed(ATK_SOCKET(accessible), const_cast<char*>(plugID.utf8().data()));
    6162}
    6263
Note: See TracChangeset for help on using the changeset viewer.