Commit 92daa819 authored by mario@webkit.org's avatar mario@webkit.org
Browse files

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.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 198d386b
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 Nikolas Zimmermann <nzimmermann@rim.com>
 
Reviewed by Dirk Schulze.
Accessibility object emitted "load-complete" / Name: "(No name)" / Role: 80
Accessibility object emitted "state-change:busy = 0" / Name: "(No name)" / Role: 80
Accessibility object emitted "state-change:busy = 1" / Name: "(No name)" / Role: 80
Accessibility object emitted "reload" / Name: "(No name)" / Role: 80
Accessibility object emitted "state-change:defunct = 1" / Name: "(No name)" / Role: 80
Accessibility object emitted "load-complete" / Name: "(No name)" / Role: 80
Accessibility object emitted "state-change:busy = 0" / Name: "(No name)" / Role: 80
Test that AtkDocument emits the right signals when reloading.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
<script src="../../../fast/js/resources/js-test-pre.js"></script>
<script>
successfullyParsed = false;
function runTest()
{
if (!layoutTestController.globalFlag) {
layoutTestController.globalFlag = true;
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
setTimeout("window.location.reload()", 0);
} else {
layoutTestController.globalFlag = false;
if (window.layoutTestController)
layoutTestController.notifyDone();
}
}
</script>
</head>
<body id="body" onload="runTest();">
<p id="description"></p>
<div id="console"></div>
<script>
description("Test that AtkDocument emits the right signals when reloading.");
if (window.accessibilityController)
accessibilityController.logAccessibilityEvents();
successfullyParsed = true;
</script>
<script src="../../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
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-15 Nikolas Zimmermann <nzimmermann@rim.com>
 
Reviewed by Dirk Schulze.
......@@ -175,7 +175,7 @@ static const gchar* webkit_accessible_get_name(AtkObject* object)
return webkit_accessible_text_get_text(ATK_TEXT(atkObject), 0, -1);
}
// Try text under the node
// Try text under the node.
String textUnder = renderObject->textUnderElement();
if (textUnder.length())
return returnString(textUnder);
......@@ -191,6 +191,13 @@ static const gchar* webkit_accessible_get_name(AtkObject* object)
}
}
// Fallback for the webArea object: just return the document's title.
if (renderObject->isWebArea()) {
Document* document = coreObject->document();
if (document)
return returnString(document->title());
}
return returnString(coreObject->stringValue());
}
......@@ -2464,6 +2471,9 @@ void webkit_accessible_detach(WebKitAccessible* accessible)
{
ASSERT(accessible->m_object);
if (core(accessible)->roleValue() == WebAreaRole)
g_signal_emit_by_name(accessible, "state-change", "defunct", true);
// We replace the WebCore AccessibilityObject with a fallback object that
// provides default implementations to avoid repetitive null-checking after
// detachment.
......
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.
2011-02-15 Kenneth Russell <kbr@google.com>
 
Reviewed by Darin Fisher.
......
......@@ -25,6 +25,8 @@
#include "config.h"
#include "FrameLoaderClientGtk.h"
#include "AXObjectCache.h"
#include "AccessibilityObject.h"
#include "ArchiveResource.h"
#include "CachedFrame.h"
#include "Color.h"
......@@ -55,6 +57,7 @@
#include "PluginDatabase.h"
#include "ProgressTracker.h"
#include "RenderPart.h"
#include "RenderView.h"
#include "ResourceHandle.h"
#include "ResourceRequest.h"
#include "ScriptController.h"
......@@ -222,6 +225,51 @@ String FrameLoaderClient::userAgent(const KURL& url)
return String::fromUTF8(webkit_web_settings_get_user_agent(settings));
}
static void notifyAccessibilityStatus(WebKitWebFrame* frame, WebKitLoadStatus loadStatus)
{
if (loadStatus != WEBKIT_LOAD_PROVISIONAL
&& loadStatus != WEBKIT_LOAD_FAILED
&& loadStatus != WEBKIT_LOAD_FINISHED)
return;
WebKitWebFramePrivate* priv = frame->priv;
if (!priv->coreFrame || !priv->coreFrame->document())
return;
RenderView* contentRenderer = priv->coreFrame->contentRenderer();
if (!contentRenderer)
return;
AXObjectCache* axObjectCache = priv->coreFrame->document()->axObjectCache();
if (!axObjectCache)
return;
AccessibilityObject* coreAxObject = axObjectCache->getOrCreate(contentRenderer);
if (!coreAxObject)
return;
AtkObject* axObject = coreAxObject->wrapper();
if (!axObject || !ATK_IS_DOCUMENT(axObject))
return;
switch (loadStatus) {
case WEBKIT_LOAD_PROVISIONAL:
g_signal_emit_by_name(axObject, "state-change", "busy", true);
if (core(frame)->loader()->loadType() == FrameLoadTypeReload)
g_signal_emit_by_name(axObject, "reload");
break;
case WEBKIT_LOAD_FAILED:
g_signal_emit_by_name(axObject, "load-stopped");
g_signal_emit_by_name(axObject, "state-change", "busy", false);
break;
case WEBKIT_LOAD_FINISHED:
g_signal_emit_by_name(axObject, "load-complete");
g_signal_emit_by_name(axObject, "state-change", "busy", false);
default:
break;
}
}
static void notifyStatus(WebKitWebFrame* frame, WebKitLoadStatus loadStatus)
{
frame->priv->loadStatus = loadStatus;
......@@ -231,6 +279,9 @@ static void notifyStatus(WebKitWebFrame* frame, WebKitLoadStatus loadStatus)
if (frame == webkit_web_view_get_main_frame(webView)) {
webView->priv->loadStatus = loadStatus;
g_object_notify(G_OBJECT(webView), "load-status");
if (AXObjectCache::accessibilityEnabled())
notifyAccessibilityStatus(frame, loadStatus);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment