Changeset 78715 in webkit


Ignore:
Timestamp:
Feb 16, 2011 9:12:38 AM (13 years ago)
Author:
mario@webkit.org
Message:

2011-02-16 Mario Sanchez Prada <msanchez@igalia.com>

Reviewed by Martin Robinson.

[GTK] events missing when a document is (re)loaded
https://bugs.webkit.org/show_bug.cgi?id=25831

Added new layout test to check the right signals are emitted.

  • platform/gtk/accessibility/document-reload-events-expected.txt: Added.
  • platform/gtk/accessibility/document-reload-events.html: Added.

2011-02-16 Mario Sanchez Prada <msanchez@igalia.com>

Reviewed by Martin Robinson.

[GTK] events missing when a document is (re)loaded
https://bugs.webkit.org/show_bug.cgi?id=25831

Make sure webArea returns a proper name and that a signal
'state-change::defunct' is emitted when detaching the wrapper.

Test: platform/gtk/accessibility/document-reload-events.html

  • accessibility/gtk/AccessibilityObjectWrapperAtk.cpp: (webkit_accessible_get_name): Returns the current document's title as fallback mechanism for webArea objects. (webkit_accessible_detach): Emit 'state-change::defunct' function as soon as the wrapper is detached from the related core object.

2011-02-16 Mario Sanchez Prada <msanchez@igalia.com>

Reviewed by Martin Robinson.

[GTK] events missing when a document is (re)loaded
https://bugs.webkit.org/show_bug.cgi?id=25831

Emit the right signals when reloading a document.

  • WebCoreSupport/FrameLoaderClientGtk.cpp: (WebKit::notifyAccessibilityStatus): New function, to make sure the signals involved in reloading a document are properly emitted. (WebKit::notifyStatus): Also notify accessibility if enabled.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r78714 r78715  
     12011-02-16  Mario Sanchez Prada  <msanchez@igalia.com>
     2
     3        Reviewed by Martin Robinson.
     4
     5        [GTK] events missing when a document is (re)loaded
     6        https://bugs.webkit.org/show_bug.cgi?id=25831
     7
     8        Added new layout test to check the right signals are emitted.
     9
     10        * platform/gtk/accessibility/document-reload-events-expected.txt: Added.
     11        * platform/gtk/accessibility/document-reload-events.html: Added.
     12
    1132011-02-16  Nikolas Zimmermann  <nzimmermann@rim.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r78713 r78715  
     12011-02-16  Mario Sanchez Prada  <msanchez@igalia.com>
     2
     3        Reviewed by Martin Robinson.
     4
     5        [GTK] events missing when a document is (re)loaded
     6        https://bugs.webkit.org/show_bug.cgi?id=25831
     7
     8        Make sure webArea returns a proper name and that a signal
     9        'state-change::defunct' is emitted when detaching the wrapper.
     10
     11        Test: platform/gtk/accessibility/document-reload-events.html
     12
     13        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
     14        (webkit_accessible_get_name): Returns the current document's title
     15        as fallback mechanism for webArea objects.
     16        (webkit_accessible_detach): Emit 'state-change::defunct' function
     17        as soon as the wrapper is detached from the related core object.
     18
    1192011-02-15  Nikolas Zimmermann  <nzimmermann@rim.com>
    220
  • trunk/Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp

    r78349 r78715  
    176176        }
    177177
    178         // Try text under the node
     178        // Try text under the node.
    179179        String textUnder = renderObject->textUnderElement();
    180180        if (textUnder.length())
     
    190190                return returnString(alt);
    191191        }
     192    }
     193
     194    // Fallback for the webArea object: just return the document's title.
     195    if (renderObject->isWebArea()) {
     196        Document* document = coreObject->document();
     197        if (document)
     198            return returnString(document->title());
    192199    }
    193200
     
    24652472    ASSERT(accessible->m_object);
    24662473
     2474    if (core(accessible)->roleValue() == WebAreaRole)
     2475        g_signal_emit_by_name(accessible, "state-change", "defunct", true);
     2476
    24672477    // We replace the WebCore AccessibilityObject with a fallback object that
    24682478    // provides default implementations to avoid repetitive null-checking after
  • trunk/Source/WebKit/gtk/ChangeLog

    r78620 r78715  
     12011-02-16  Mario Sanchez Prada  <msanchez@igalia.com>
     2
     3        Reviewed by Martin Robinson.
     4
     5        [GTK] events missing when a document is (re)loaded
     6        https://bugs.webkit.org/show_bug.cgi?id=25831
     7
     8        Emit the right signals when reloading a document.
     9
     10        * WebCoreSupport/FrameLoaderClientGtk.cpp:
     11        (WebKit::notifyAccessibilityStatus): New function, to make sure
     12        the signals involved in reloading a document are properly emitted.
     13        (WebKit::notifyStatus): Also notify accessibility if enabled.
     14
    1152011-02-15  Kenneth Russell  <kbr@google.com>
    216
  • trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp

    r78349 r78715  
    2626#include "FrameLoaderClientGtk.h"
    2727
     28#include "AXObjectCache.h"
     29#include "AccessibilityObject.h"
    2830#include "ArchiveResource.h"
    2931#include "CachedFrame.h"
     
    5658#include "ProgressTracker.h"
    5759#include "RenderPart.h"
     60#include "RenderView.h"
    5861#include "ResourceHandle.h"
    5962#include "ResourceRequest.h"
     
    223226}
    224227
     228static void notifyAccessibilityStatus(WebKitWebFrame* frame, WebKitLoadStatus loadStatus)
     229{
     230    if (loadStatus != WEBKIT_LOAD_PROVISIONAL
     231        && loadStatus != WEBKIT_LOAD_FAILED
     232        && loadStatus != WEBKIT_LOAD_FINISHED)
     233        return;
     234
     235    WebKitWebFramePrivate* priv = frame->priv;
     236    if (!priv->coreFrame || !priv->coreFrame->document())
     237        return;
     238
     239    RenderView* contentRenderer = priv->coreFrame->contentRenderer();
     240    if (!contentRenderer)
     241        return;
     242
     243    AXObjectCache* axObjectCache = priv->coreFrame->document()->axObjectCache();
     244    if (!axObjectCache)
     245        return;
     246
     247    AccessibilityObject* coreAxObject = axObjectCache->getOrCreate(contentRenderer);
     248    if (!coreAxObject)
     249        return;
     250
     251    AtkObject* axObject = coreAxObject->wrapper();
     252    if (!axObject || !ATK_IS_DOCUMENT(axObject))
     253        return;
     254
     255    switch (loadStatus) {
     256    case WEBKIT_LOAD_PROVISIONAL:
     257        g_signal_emit_by_name(axObject, "state-change", "busy", true);
     258        if (core(frame)->loader()->loadType() == FrameLoadTypeReload)
     259            g_signal_emit_by_name(axObject, "reload");
     260        break;
     261    case WEBKIT_LOAD_FAILED:
     262        g_signal_emit_by_name(axObject, "load-stopped");
     263        g_signal_emit_by_name(axObject, "state-change", "busy", false);
     264        break;
     265    case WEBKIT_LOAD_FINISHED:
     266        g_signal_emit_by_name(axObject, "load-complete");
     267        g_signal_emit_by_name(axObject, "state-change", "busy", false);
     268    default:
     269        break;
     270    }
     271}
     272
    225273static void notifyStatus(WebKitWebFrame* frame, WebKitLoadStatus loadStatus)
    226274{
     
    232280        webView->priv->loadStatus = loadStatus;
    233281        g_object_notify(G_OBJECT(webView), "load-status");
     282
     283        if (AXObjectCache::accessibilityEnabled())
     284            notifyAccessibilityStatus(frame, loadStatus);
    234285    }
    235286}
Note: See TracChangeset for help on using the changeset viewer.