-[WKWebView evaluateJavaScript] provides a misleading error when the return cannot...
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Jun 2015 16:57:01 +0000 (16:57 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Jun 2015 16:57:01 +0000 (16:57 +0000)
commit112116e36a9f3791fba6deca47318c1086ae9134
tree2145096bd98fc9457151d91b6926e6f1b9461820
parent03ac18affdae2292c22154e5a46dbed9ed1c29ce
-[WKWebView evaluateJavaScript] provides a misleading error when the return cannot be serialized
https://bugs.webkit.org/show_bug.cgi?id=145900

Reviewed by Sam Weinig.

Source/WebCore:

* English.lproj/Localizable.strings:

Source/WebKit2:

We used to conflate to cases: (1) when there was a JavaScript exception, and
(2) when the result could not be serialized for IPC. Turns out that it was quite
misleading!

* UIProcess/API/C/WKPage.cpp:
(WKPageRunJavaScriptInMainFrame):
* UIProcess/API/Cocoa/WKError.h:
* UIProcess/API/Cocoa/WKError.mm:
(localizedDescriptionForErrorCode):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView evaluateJavaScript:completionHandler:]):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::runJavaScriptInMainFrame):
(WebKit::WebPageProxy::scriptValueCallback):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::runJavaScriptInMainFrame):
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_run_javascript):
(resourcesStreamReadCallback):

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewEvaluateJavaScript.mm:
(TEST): Added tests.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185554 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/English.lproj/Localizable.strings
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/API/Cocoa/WKError.h
Source/WebKit2/UIProcess/API/Cocoa/WKError.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewEvaluateJavaScript.mm