[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
weinig at apple.com
weinig at apple.com
Wed Dec 22 11:23:48 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit d04fec9ae51a9bbe5c29968b386230e24bc2dd5c
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Jul 21 20:10:22 2010 +0000
Patch for https://bugs.webkit.org/show_bug.cgi?id=42539
WebKitTestRunner needs to support printing ALERT, PROMPT and CONFIRM messages
Reviewed by Anders Carlsson.
WebKit2:
- Convert injected bundle UIClient functions to will-style, at least until we establish
more concrete use cases for them past the TestRunner.
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
(WebKit::InjectedBundlePageUIClient::willAddMessageToConsole):
(WebKit::InjectedBundlePageUIClient::willSetStatusbarText):
(WebKit::InjectedBundlePageUIClient::willRunJavaScriptAlert):
(WebKit::InjectedBundlePageUIClient::willRunJavaScriptConfirm):
(WebKit::InjectedBundlePageUIClient::willRunJavaScriptPrompt):
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::addMessageToConsole):
(WebKit::WebChromeClient::runJavaScriptAlert):
(WebKit::WebChromeClient::runJavaScriptConfirm):
(WebKit::WebChromeClient::runJavaScriptPrompt):
(WebKit::WebChromeClient::setStatusbarText):
WebKitTools:
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):
(WTR::InjectedBundlePage::_willAddMessageToConsole):
(WTR::InjectedBundlePage::_willSetStatusbarText):
(WTR::InjectedBundlePage::_willRunJavaScriptAlert):
(WTR::InjectedBundlePage::_willRunJavaScriptConfirm):
(WTR::InjectedBundlePage::_willRunJavaScriptPrompt):
(WTR::InjectedBundlePage::willAddMessageToConsole):
(WTR::InjectedBundlePage::willSetStatusbarText):
(WTR::InjectedBundlePage::willRunJavaScriptAlert):
(WTR::InjectedBundlePage::willRunJavaScriptConfirm):
(WTR::InjectedBundlePage::willRunJavaScriptPrompt):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
LayoutTests:
* platform/mac-wk2/Skipped:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63850 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index e7942d7..1c5e6b6 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,12 @@
+2010-07-21 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=42539
+ WebKitTestRunner needs to support printing ALERT, PROMPT and CONFIRM messages
+
+ * platform/mac-wk2/Skipped:
+
2010-07-21 Tony Chang <tony at chromium.org>
Not reviewed, updating chromium test expectations.
diff --git a/LayoutTests/platform/mac-wk2/Skipped b/LayoutTests/platform/mac-wk2/Skipped
index cbc1f0f..0bb5761 100644
--- a/LayoutTests/platform/mac-wk2/Skipped
+++ b/LayoutTests/platform/mac-wk2/Skipped
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2008 Apple Inc. All rights reserved.
+# Copyright (C) 2010 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -718,16 +718,6 @@ platform/mac/editing/input/wrapped-line-char-rect.html
# <https://bugs.webkit.org/show_bug.cgi?id=42194>
compositing/iframes/layout-on-compositing-change.html
editing/deleting/5390681-2.html
-http/tests/local/send-dragged-file.html
-http/tests/local/send-sliced-dragged-file.html
-http/tests/local/blob/send-data-blob.html
-http/tests/local/blob/send-sliced-data-blob.html
-http/tests/local/formdata/send-form-data-with-sliced-file.html
-http/tests/local/formdata/send-form-data.html
-http/tests/local/formdata/upload-events.html
-http/tests/misc/drag-over-iframe-invalid-source-crash.html
-http/tests/security/listener/xss-window-onclick-addEventListener.html
-http/tests/security/listener/xss-window-onclick-shortcut.html
editing/deleting/5729680.html
editing/deleting/forward-delete-key.html
editing/input/option-page-up-down.html
@@ -746,6 +736,8 @@ editing/pasteboard/drag-drop-url-text.html
editing/pasteboard/drag-image-in-about-blank-frame.html
editing/pasteboard/drag-image-to-contenteditable-in-iframe.html
editing/pasteboard/drop-inputtext-acquires-style.html
+editing/pasteboard/file-input-files-access.html
+editing/pasteboard/files-during-page-drags.html
editing/pasteboard/get-data-text-plain-drop.html
editing/selection/14971.html
editing/selection/4895428-1.html
@@ -849,6 +841,7 @@ fast/events/drag-and-drop-dataTransfer-types-nocrash.html
fast/events/drag-and-drop-fire-drag-dragover.html
fast/events/drag-and-drop.html
fast/events/drag-in-frames.html
+fast/events/drag-outside-window.html
fast/events/drag-parent-node.html
fast/events/drag-to-navigate.html
fast/events/event-input-contentEditable.html
@@ -997,6 +990,7 @@ fast/forms/textfield-inside-anchor.html
fast/forms/textfield-onchange-deletion.html
fast/forms/textfield-outline.html
fast/forms/textfield-to-password-on-focus.html
+fast/frames/frame-dead-region.html
fast/frames/frame-deep-nested-resize.html
fast/frames/hover-timer-crash.html
fast/frames/iframe-window-focus.html
@@ -1022,9 +1016,17 @@ fast/text/international/khmer-selection.html
fast/text/international/thai-offsetForPosition-inside-character.html
fast/text/offsetForPosition-cluster-at-zero.html
fast/text/reset-drag-on-mouse-down.html
+http/tests/local/blob/send-data-blob.html
http/tests/local/blob/send-hybrid-blob.html
+http/tests/local/blob/send-sliced-data-blob.html
http/tests/local/drag-over-remote-content.html
+http/tests/local/formdata/send-form-data-with-sliced-file.html
+http/tests/local/formdata/send-form-data.html
+http/tests/local/formdata/upload-events.html
+http/tests/local/send-dragged-file.html
+http/tests/local/send-sliced-dragged-file.html
http/tests/misc/bubble-drag-events.html
+http/tests/misc/drag-over-iframe-invalid-source-crash.html
http/tests/misc/isindex-with-no-form.html
http/tests/navigation/no-referrer-same-window.html
http/tests/navigation/no-referrer-subframe.html
@@ -1032,6 +1034,8 @@ http/tests/navigation/redirect-preserves-referrer.html
http/tests/security/clipboard/clipboard-file-access.html
http/tests/security/dataTransfer-set-data-file-url.html
http/tests/security/drag-over-remote-content-iframe.html
+http/tests/security/listener/xss-window-onclick-addEventListener.html
+http/tests/security/listener/xss-window-onclick-shortcut.html
media/media-fullscreen-inline.html
platform/mac/editing/deleting/backward-delete.html
platform/mac/editing/pasteboard/dataTransfer-set-data-file-url.html
@@ -1372,7 +1376,7 @@ plugins
http/tests/plugins
java
platform/mac/plugins
-
+fast/loader/loadInProgress.html
# WebKit2 needs layoutTestController.overridePreference
# <https://bugs.webkit.org/show_bug.cgi?id=42197>
@@ -2066,7 +2070,7 @@ fast/loader/stateobjects/pushstate-updates-location.html
fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html
fast/loader/stateobjects/pushstate-within-popstate-handler-assert.html
fast/loader/stateobjects/pushstate-then-replacestate.html
-
+fast/loader/stateobjects/document-destroyed-navigate-back.html
http/tests/loading/state-object-security-exception.html
# WebKitTestRunner needs textInputController
@@ -2160,70 +2164,6 @@ editing/deleting/smart-editing-disabled.html
editing/execCommand/delete-image-in-anchor.html
editing/selection/extend-forward-after-set-base-and-extent.html
editing/selection/select-line.html
-
-
-# WebKitTestRunner needs to support printing ALERT, PROMPT and CONFIRM messages
-# <https://bugs.webkit.org/show_bug.cgi?id=42539>
-editing/pasteboard/paste-noscript-xhtml.xhtml
-editing/selection/5241148.html
-editing/selection/5497643.html
-fast/dom/Element/id-in-frameset.html
-fast/dom/Geolocation/notimer-after-unload.html
-fast/dom/script-element-gc.html
-fast/dom/serialize-nodes.xhtml
-fast/dom/set-inner-text-newlines.html
-fast/dom/Window/alert-undefined.html
-fast/events/attribute-listener-cloned-from-frameless-doc.xhtml
-fast/events/drag-outside-window.html
-fast/events/onload-webkit-before-webcore.html
-fast/events/onunload-clears-onbeforeunload.html
-fast/events/onunload.html
-fast/events/onunload-not-on-body.html
-fast/events/onunload-window-property.html
-fast/events/pageshow-pagehide-on-back-uncached.html
-fast/events/resize-subframe.html
-fast/frames/frame-dead-region.html
-fast/frames/frame-js-url-clientWidth.html
-fast/frames/frame-name-reset.html
-fast/frames/frameElement-widthheight.html
-fast/frames/iframe-display-none.html
-fast/frames/location-change.html
-fast/frames/location-change-no-file-access.html
-fast/frames/sandboxed-iframe-navigation-top-by-name-denied.html
-fast/frames/set-unloaded-frame-location.html
-fast/inspector-support/cssURLQuotes.html
-fast/loader/for-window-event-onload-scripts.html
-fast/loader/hashchange-event.html
-fast/loader/loadInProgress.html
-fast/loader/local-svg-parsed-as-svg.svg
-fast/loader/non-deferred-substitute-load.html
-fast/loader/onhashchange-attribute-listeners.html
-fast/loader/simultaneous-reloads-assert.html
-fast/loader/stateobjects/document-destroyed-navigate-back.html
-fast/parser/parseCommentsInTitles.html
-fast/xsl/subframe-location.html
-http/tests/cookies/third-party-cookie-relaxing.html
-http/tests/misc/DOMContentLoaded-event.html
-http/tests/misc/embedCrasher.html
-http/tests/misc/frame-default-enc-different-domain.html
-http/tests/misc/frame-default-enc-same-domain.html
-http/tests/misc/onload-remove-iframe-crash-2.html
-http/tests/navigation/history-back-across-form-submission-to-fragment.html
-http/tests/security/data-url-inline.css.html
-http/tests/security/popup-blocked-from-fake-event.html
-http/tests/security/popup-blocked-from-window-open.html
-http/tests/xmlhttprequest/readystatechange.html
-platform/mac/plugins/bindings-test-objc.html
-storage/open-database-creation-callback-isolated-world.html
-storage/statement-error-callback-isolated-world.html
-storage/statement-success-callback-isolated-world.html
-storage/transaction-callback-isolated-world.html
-storage/transaction-error-callback-isolated-world.html
-storage/transaction-success-callback-isolated-world.html
-svg/hixie/dynamic/001.xml
-websocket/tests/alert-in-event-handler.html
-websocket/tests/websocket-pending-activity.html
-
# WebKitTestRunner needs layoutTestController.clearAllDatabases
# <https://bugs.webkit.org/show_bug.cgi?id=42540>
storage/change-version.html
@@ -2238,6 +2178,12 @@ storage/sql-error-codes.html
storage/statement-error-callback.html
storage/success-callback.html
storage/transaction-error-callback.html
+storage/open-database-creation-callback-isolated-world.html
+storage/statement-error-callback-isolated-world.html
+storage/statement-success-callback-isolated-world.html
+storage/transaction-callback-isolated-world.html
+storage/transaction-error-callback-isolated-world.html
+storage/transaction-success-callback-isolated-world.html
# WebKitTestRunner needs layoutTestController.pathToLocalResource
# <https://bugs.webkit.org/show_bug.cgi?id=42541>
@@ -2298,6 +2244,7 @@ fast/dom/Geolocation/reentrant-success.html
fast/dom/Geolocation/success.html
fast/dom/Geolocation/timeout.html
fast/dom/Geolocation/watch.html
+fast/dom/Geolocation/notimer-after-unload.html
# WebKitTestRunner needs layoutTestController.setMockGeolocationPosition
fast/dom/Geolocation/timeout-clear-watch.html
@@ -2443,6 +2390,7 @@ fast/loader/stop-provisional-loads.html
# <https://bugs.webkit.org/show_bug.cgi?id=42692>
fast/xmlhttprequest/xmlhttprequest-no-file-access.html
fast/xmlhttprequest/xmlhttprequest-nonexistent-file.html
+fast/frames/location-change-no-file-access.html
# WebKitTestRunner needs layoutTestController.setPrinting
# <https://bugs.webkit.org/show_bug.cgi?id=42693>
@@ -2481,6 +2429,19 @@ http/tests/security/no-referrer.html
# <https://bugs.webkit.org/show_bug.cgi?id=42700>
http/tests/security/setDomainRelaxationForbiddenForURLScheme.html
+# WebKit2 needs layoutTestController.setDeferMainResourceDataLoad
+# <https://bugs.webkit.org/show_bug.cgi?id=42777>
+fast/loader/non-deferred-substitute-load.html
+
+# WebKit2 needs layoutTestController.setAlwaysAcceptCookies
+# <https://bugs.webkit.org/show_bug.cgi?id=42778>
+http/tests/cookies/third-party-cookie-relaxing.html
+
+# WebKit2 needs layoutTestController.setCloseRemainingWindowsWhenComplete
+# <https://bugs.webkit.org/show_bug.cgi?id=42779>
+http/tests/security/popup-blocked-from-fake-event.html
+http/tests/security/popup-blocked-from-window-open.html
+
# WebKitTestRunner needs GCController
# <https://bugs.webkit.org/show_bug.cgi?id=42701>
fast/dom/gc-10.html
@@ -2495,6 +2456,7 @@ platform/mac/fast/text/attributed-substring-from-range.html
# WebKitTestRunner needs to print onunload handler information
# <https://bugs.webkit.org/show_bug.cgi?id=42703>
+fast/events/onunload-clears-onbeforeunload.html
fast/events/pageshow-pagehide.html
fast/events/stop-load-in-unload-handler-using-document-write.html
fast/events/stop-load-in-unload-handler-using-window-stop.html
@@ -2512,10 +2474,14 @@ fast/loader/unload-hyperlink.html
fast/loader/unload-javascript-url.html
fast/loader/unload-reload.html
fast/loader/unload-window-location.html
-http/tests/xmlhttprequest/xhr-onunload.html
http/tests/xmlhttprequest/frame-load-cancelled-abort.html
http/tests/xmlhttprequest/frame-unload-abort-crash.html
http/tests/xmlhttprequest/send-undefined-and-null.html
+http/tests/xmlhttprequest/xhr-onunload.html
+fast/events/onunload.html
+fast/events/onunload-not-on-body.html
+fast/events/pageshow-pagehide-on-back-uncached.html
+http/tests/navigation/history-back-across-form-submission-to-fragment.html
# WebKitTestRunner needs to print history delegate information
# <https://bugs.webkit.org/show_bug.cgi?id=42704>
@@ -2540,7 +2506,6 @@ http/tests/loading/slow-parsing-subframe.html
http/tests/loading/text-content-type-with-binary-extension.html
-
# THINGS WE DON'T HAVE AND DON'T WANT
# WebKitTestRunner doesn't have appleScriptController
@@ -2553,11 +2518,10 @@ platform/mac/fast/dom/objc-wrapper-identity.html
platform/mac/fast/dom/wrapper-classes-objc.html
platform/mac/fast/dom/wrapper-round-tripping.html
platform/mac/fast/objc/longlongTest.html
+platform/mac/plugins/bindings-test-objc.html
# WebKitTestRunner doesn't have eventSender.enableDOMUIEventLogging
platform/mac/fast/events/objc-event-api.html
# WebKitTestRunner doesn't have eventSender.fireKeyboardEventsToElement
platform/mac/fast/events/objc-keyboard-event-creation.html
-
-
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 6819e37..d814c3d 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,28 @@
+2010-07-21 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=42539
+ WebKitTestRunner needs to support printing ALERT, PROMPT and CONFIRM messages
+
+ - Convert injected bundle UIClient functions to will-style, at least until we establish
+ more concrete use cases for them past the TestRunner.
+
+ * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
+ * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
+ (WebKit::InjectedBundlePageUIClient::willAddMessageToConsole):
+ (WebKit::InjectedBundlePageUIClient::willSetStatusbarText):
+ (WebKit::InjectedBundlePageUIClient::willRunJavaScriptAlert):
+ (WebKit::InjectedBundlePageUIClient::willRunJavaScriptConfirm):
+ (WebKit::InjectedBundlePageUIClient::willRunJavaScriptPrompt):
+ * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::addMessageToConsole):
+ (WebKit::WebChromeClient::runJavaScriptAlert):
+ (WebKit::WebChromeClient::runJavaScriptConfirm):
+ (WebKit::WebChromeClient::runJavaScriptPrompt):
+ (WebKit::WebChromeClient::setStatusbarText):
+
2010-07-21 Simon Fraser <simon.fraser at apple.com>
Windows build fix.
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
index b1f107c..a73ef43 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
@@ -60,14 +60,20 @@ struct WKBundlePageLoaderClient {
typedef struct WKBundlePageLoaderClient WKBundlePageLoaderClient;
// UI Client
-typedef void (*WKBundlePageAddMessageToConsoleCallback)(WKBundlePageRef page, WKStringRef message, uint32_t lineNumber, const void *clientInfo);
-typedef void (*WKBundlePageSetStatusbarTextCallback)(WKBundlePageRef page, WKStringRef statusbarText, const void *clientInfo);
+typedef void (*WKBundlePageWillAddMessageToConsoleCallback)(WKBundlePageRef page, WKStringRef message, uint32_t lineNumber, const void *clientInfo);
+typedef void (*WKBundlePageWillSetStatusbarTextCallback)(WKBundlePageRef page, WKStringRef statusbarText, const void *clientInfo);
+typedef void (*WKBundlePageWillRunJavaScriptAlertCallback)(WKBundlePageRef page, WKStringRef alertText, WKBundleFrameRef frame, const void *clientInfo);
+typedef void (*WKBundlePageWillRunJavaScriptConfirmCallback)(WKBundlePageRef page, WKStringRef message, WKBundleFrameRef frame, const void *clientInfo);
+typedef void (*WKBundlePageWillRunJavaScriptPromptCallback)(WKBundlePageRef page, WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef frame, const void *clientInfo);
struct WKBundlePageUIClient {
int version;
const void * clientInfo;
- WKBundlePageAddMessageToConsoleCallback addMessageToConsole;
- WKBundlePageSetStatusbarTextCallback setStatusbarText;
+ WKBundlePageWillAddMessageToConsoleCallback willAddMessageToConsole;
+ WKBundlePageWillSetStatusbarTextCallback willSetStatusbarText;
+ WKBundlePageWillRunJavaScriptAlertCallback willRunJavaScriptAlert;
+ WKBundlePageWillRunJavaScriptConfirmCallback willRunJavaScriptConfirm;
+ WKBundlePageWillRunJavaScriptPromptCallback willRunJavaScriptPrompt;
};
typedef struct WKBundlePageUIClient WKBundlePageUIClient;
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp
index 704322a..b19c67f 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp
@@ -46,16 +46,34 @@ void InjectedBundlePageUIClient::initialize(WKBundlePageUIClient* client)
memset(&m_client, 0, sizeof(m_client));
}
-void InjectedBundlePageUIClient::addMessageToConsole(WebPage* page, const String& message, int32_t lineNumber)
+void InjectedBundlePageUIClient::willAddMessageToConsole(WebPage* page, const String& message, int32_t lineNumber)
{
- if (m_client.addMessageToConsole)
- m_client.addMessageToConsole(toRef(page), toRef(message.impl()), lineNumber, m_client.clientInfo);
+ if (m_client.willAddMessageToConsole)
+ m_client.willAddMessageToConsole(toRef(page), toRef(message.impl()), lineNumber, m_client.clientInfo);
}
-void InjectedBundlePageUIClient::setStatusbarText(WebPage* page, const String& statusbarText)
+void InjectedBundlePageUIClient::willSetStatusbarText(WebPage* page, const String& statusbarText)
{
- if (m_client.setStatusbarText)
- m_client.setStatusbarText(toRef(page), toRef(statusbarText.impl()), m_client.clientInfo);
+ if (m_client.willSetStatusbarText)
+ m_client.willSetStatusbarText(toRef(page), toRef(statusbarText.impl()), m_client.clientInfo);
+}
+
+void InjectedBundlePageUIClient::willRunJavaScriptAlert(WebPage* page, const String& alertText, WebFrame* frame)
+{
+ if (m_client.willRunJavaScriptAlert)
+ m_client.willRunJavaScriptAlert(toRef(page), toRef(alertText.impl()), toRef(frame), m_client.clientInfo);
+}
+
+void InjectedBundlePageUIClient::willRunJavaScriptConfirm(WebPage* page, const String& message, WebFrame* frame)
+{
+ if (m_client.willRunJavaScriptConfirm)
+ m_client.willRunJavaScriptConfirm(toRef(page), toRef(message.impl()), toRef(frame), m_client.clientInfo);
+}
+
+void InjectedBundlePageUIClient::willRunJavaScriptPrompt(WebPage* page, const String& message, const String& defaultValue, WebFrame* frame)
+{
+ if (m_client.willRunJavaScriptPrompt)
+ m_client.willRunJavaScriptPrompt(toRef(page), toRef(message.impl()), toRef(defaultValue.impl()), toRef(frame), m_client.clientInfo);
}
} // namespace WebKit
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h
index e000d97..ba19cd1 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h
@@ -34,6 +34,7 @@ namespace WebCore {
namespace WebKit {
+class WebFrame;
class WebPage;
class InjectedBundlePageUIClient {
@@ -41,8 +42,11 @@ public:
InjectedBundlePageUIClient();
void initialize(WKBundlePageUIClient*);
- void addMessageToConsole(WebPage*, const WebCore::String& message, int32_t lineNumber);
- void setStatusbarText(WebPage*, const WebCore::String&);
+ void willAddMessageToConsole(WebPage*, const WebCore::String& message, int32_t lineNumber);
+ void willSetStatusbarText(WebPage*, const WebCore::String&);
+ void willRunJavaScriptAlert(WebPage*, const WebCore::String&, WebFrame*);
+ void willRunJavaScriptConfirm(WebPage*, const WebCore::String&, WebFrame*);
+ void willRunJavaScriptPrompt(WebPage*, const WebCore::String&, const WebCore::String&, WebFrame*);
private:
WKBundlePageUIClient m_client;
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp b/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
index 0816de9..b17810a 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
@@ -187,7 +187,7 @@ void WebChromeClient::setResizable(bool)
void WebChromeClient::addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, unsigned int lineNumber, const String& sourceID)
{
// Notify the bundle client.
- m_page->injectedBundleUIClient().addMessageToConsole(m_page, message, lineNumber);
+ m_page->injectedBundleUIClient().willAddMessageToConsole(m_page, message, lineNumber);
notImplemented();
}
@@ -212,28 +212,42 @@ void WebChromeClient::closeWindowSoon()
void WebChromeClient::runJavaScriptAlert(Frame* frame, const String& alertText)
{
WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
+
+ // Notify the bundle client.
+ m_page->injectedBundleUIClient().willRunJavaScriptAlert(m_page, alertText, webFrame);
+
WebProcess::shared().connection()->sendSync(WebPageProxyMessage::RunJavaScriptAlert, m_page->pageID(),
CoreIPC::In(webFrame->frameID(), alertText),
CoreIPC::Out(),
CoreIPC::Connection::NoTimeout);
}
-bool WebChromeClient::runJavaScriptConfirm(Frame*, const String&)
+bool WebChromeClient::runJavaScriptConfirm(Frame* frame, const String& message)
{
- notImplemented();
+ WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
+
+ // Notify the bundle client.
+ m_page->injectedBundleUIClient().willRunJavaScriptConfirm(m_page, message, webFrame);
+
+ // Implement for UIProcess.
return false;
}
-bool WebChromeClient::runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result)
+bool WebChromeClient::runJavaScriptPrompt(Frame* frame, const String& message, const String& defaultValue, String& result)
{
- notImplemented();
+ WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
+
+ // Notify the bundle client.
+ m_page->injectedBundleUIClient().willRunJavaScriptPrompt(m_page, message, defaultValue, webFrame);
+
+ // Implement for UIProcess.
return false;
}
void WebChromeClient::setStatusbarText(const String& statusbarText)
{
// Notify the bundle client.
- m_page->injectedBundleUIClient().setStatusbarText(m_page, statusbarText);
+ m_page->injectedBundleUIClient().willSetStatusbarText(m_page, statusbarText);
notImplemented();
}
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 08b36c9..fc8ccfa 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,24 @@
+2010-07-21 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=42539
+ WebKitTestRunner needs to support printing ALERT, PROMPT and CONFIRM messages
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ (WTR::InjectedBundlePage::_willAddMessageToConsole):
+ (WTR::InjectedBundlePage::_willSetStatusbarText):
+ (WTR::InjectedBundlePage::_willRunJavaScriptAlert):
+ (WTR::InjectedBundlePage::_willRunJavaScriptConfirm):
+ (WTR::InjectedBundlePage::_willRunJavaScriptPrompt):
+ (WTR::InjectedBundlePage::willAddMessageToConsole):
+ (WTR::InjectedBundlePage::willSetStatusbarText):
+ (WTR::InjectedBundlePage::willRunJavaScriptAlert):
+ (WTR::InjectedBundlePage::willRunJavaScriptConfirm):
+ (WTR::InjectedBundlePage::willRunJavaScriptPrompt):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
+
2010-07-21 Adam Roben <aroben at apple.com>
Give InjectedBundle our standard set of configurations (minus the
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index f06c46c..cbba470 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -37,6 +37,19 @@
namespace WTR {
+static PassOwnPtr<Vector<char> > WKStringToUTF8(WKStringRef wkStringRef)
+{
+ RetainPtr<CFStringRef> cfString(AdoptCF, WKStringCopyCFString(0, wkStringRef));
+ CFIndex bufferLength = CFStringGetMaximumSizeForEncoding(CFStringGetLength(cfString.get()), kCFStringEncodingUTF8) + 1;
+ OwnPtr<Vector<char> > buffer(new Vector<char>(bufferLength));
+ if (!CFStringGetCString(cfString.get(), buffer->data(), bufferLength, kCFStringEncodingUTF8)) {
+ buffer->shrink(1);
+ (*buffer)[0] = 0;
+ } else
+ buffer->shrink(strlen(buffer->data()) + 1);
+ return buffer.release();
+}
+
InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
: m_page(page)
, m_isLoading(false)
@@ -58,11 +71,13 @@ InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
WKBundlePageUIClient uiClient = {
0,
this,
- _addMessageToConsole,
- _setStatusbarText
+ _willAddMessageToConsole,
+ _willSetStatusbarText,
+ _willRunJavaScriptAlert,
+ _willRunJavaScriptConfirm,
+ _willRunJavaScriptPrompt
};
WKBundlePageSetUIClient(m_page, &uiClient);
-
}
InjectedBundlePage::~InjectedBundlePage()
@@ -129,19 +144,6 @@ void InjectedBundlePage::didCommitLoadForFrame(WKBundleFrameRef frame)
{
}
-static PassOwnPtr<Vector<char> > WKStringToUTF8(WKStringRef wkStringRef)
-{
- RetainPtr<CFStringRef> cfString(AdoptCF, WKStringCopyCFString(0, wkStringRef));
- CFIndex bufferLength = CFStringGetMaximumSizeForEncoding(CFStringGetLength(cfString.get()), kCFStringEncodingUTF8) + 1;
- OwnPtr<Vector<char> > buffer(new Vector<char>(bufferLength));
- if (!CFStringGetCString(cfString.get(), buffer->data(), bufferLength, kCFStringEncodingUTF8)) {
- buffer->shrink(1);
- (*buffer)[0] = 0;
- } else
- buffer->shrink(strlen(buffer->data()) + 1);
- return buffer.release();
-}
-
void InjectedBundlePage::dump()
{
InjectedBundle::shared().layoutTestController()->invalidateWaitToDumpWatchdog();
@@ -194,24 +196,39 @@ void InjectedBundlePage::didClearWindowForFrame(WKBundleFrameRef frame, JSContex
// UI Client Callbacks
-void InjectedBundlePage::_addMessageToConsole(WKBundlePageRef page, WKStringRef message, uint32_t lineNumber, const void *clientInfo)
+void InjectedBundlePage::_willAddMessageToConsole(WKBundlePageRef page, WKStringRef message, uint32_t lineNumber, const void *clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->willAddMessageToConsole(message, lineNumber);
+}
+
+void InjectedBundlePage::_willSetStatusbarText(WKBundlePageRef page, WKStringRef statusbarText, const void *clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->willSetStatusbarText(statusbarText);
+}
+
+void InjectedBundlePage::_willRunJavaScriptAlert(WKBundlePageRef page, WKStringRef message, WKBundleFrameRef frame, const void *clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->willRunJavaScriptAlert(message, frame);
+}
+
+void InjectedBundlePage::_willRunJavaScriptConfirm(WKBundlePageRef page, WKStringRef message, WKBundleFrameRef frame, const void *clientInfo)
{
- static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->addMessageToConsole(message, lineNumber);
+ return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->willRunJavaScriptConfirm(message, frame);
}
-void InjectedBundlePage::_setStatusbarText(WKBundlePageRef page, WKStringRef statusbarText, const void *clientInfo)
+void InjectedBundlePage::_willRunJavaScriptPrompt(WKBundlePageRef page, WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef frame, const void *clientInfo)
{
- static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->setStatusbarText(statusbarText);
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->willRunJavaScriptPrompt(message, defaultValue, frame);
}
-void InjectedBundlePage::addMessageToConsole(WKStringRef message, uint32_t lineNumber)
+void InjectedBundlePage::willAddMessageToConsole(WKStringRef message, uint32_t lineNumber)
{
// FIXME: Strip file: urls.
OwnPtr<Vector<char> > utf8Message = WKStringToUTF8(message);
InjectedBundle::shared().os() << "CONSOLE MESSAGE: line " << lineNumber << ": " << utf8Message->data() << "\n";
}
-void InjectedBundlePage::setStatusbarText(WKStringRef statusbarText)
+void InjectedBundlePage::willSetStatusbarText(WKStringRef statusbarText)
{
if (!InjectedBundle::shared().layoutTestController()->shouldDumpStatusCallbacks())
return;
@@ -220,4 +237,23 @@ void InjectedBundlePage::setStatusbarText(WKStringRef statusbarText)
InjectedBundle::shared().os() << "UI DELEGATE STATUS CALLBACK: setStatusText:" << utf8StatusbarText->data() << "\n";
}
+void InjectedBundlePage::willRunJavaScriptAlert(WKStringRef message, WKBundleFrameRef)
+{
+ OwnPtr<Vector<char> > utf8Message = WKStringToUTF8(message);
+ InjectedBundle::shared().os() << "ALERT: " << utf8Message->data() << "\n";
+}
+
+void InjectedBundlePage::willRunJavaScriptConfirm(WKStringRef message, WKBundleFrameRef)
+{
+ OwnPtr<Vector<char> > utf8Message = WKStringToUTF8(message);
+ InjectedBundle::shared().os() << "CONFIRM: " << utf8Message->data() << "\n";
+}
+
+void InjectedBundlePage::willRunJavaScriptPrompt(WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef)
+{
+ OwnPtr<Vector<char> > utf8Message = WKStringToUTF8(message);
+ OwnPtr<Vector<char> > utf8DefaultValue = WKStringToUTF8(defaultValue);
+ InjectedBundle::shared().os() << "PROMPT: " << utf8Message->data() << ", default text: " << utf8DefaultValue->data() << "\n";
+}
+
} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
index 062c8ef..bce9d2c 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
@@ -60,11 +60,16 @@ private:
void didClearWindowForFrame(WKBundleFrameRef frame, JSContextRef ctx, JSObjectRef window);
// UI Client
- static void _addMessageToConsole(WKBundlePageRef page, WKStringRef message, uint32_t lineNumber, const void *clientInfo);
- static void _setStatusbarText(WKBundlePageRef page, WKStringRef statusbarText, const void *clientInfo);
-
- void addMessageToConsole(WKStringRef message, uint32_t lineNumber);
- void setStatusbarText(WKStringRef statusbarText);
+ static void _willAddMessageToConsole(WKBundlePageRef page, WKStringRef message, uint32_t lineNumber, const void* clientInfo);
+ static void _willSetStatusbarText(WKBundlePageRef page, WKStringRef statusbarText, const void* clientInfo);
+ static void _willRunJavaScriptAlert(WKBundlePageRef page, WKStringRef message, WKBundleFrameRef frame, const void* clientInfo);
+ static void _willRunJavaScriptConfirm(WKBundlePageRef page, WKStringRef message, WKBundleFrameRef frame, const void* clientInfo);
+ static void _willRunJavaScriptPrompt(WKBundlePageRef page, WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef frame, const void* clientInfo);
+ void willAddMessageToConsole(WKStringRef message, uint32_t lineNumber);
+ void willSetStatusbarText(WKStringRef statusbarText);
+ void willRunJavaScriptAlert(WKStringRef message, WKBundleFrameRef);
+ void willRunJavaScriptConfirm(WKStringRef message, WKBundleFrameRef);
+ void willRunJavaScriptPrompt(WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef);
WKBundlePageRef m_page;
bool m_isLoading;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list