Bug 85496

Summary: [Qt] Add QML/WK2 evaluateJavaScript experimental API
Product: WebKit Reporter: Kenneth Rohde Christiansen <kenneth>
Component: WebKit QtAssignee: Kenneth Rohde Christiansen <kenneth>
Status: RESOLVED FIXED    
Severity: Normal CC: ahf, hausmann, jesus, menard, webkit.review.bot, zalan, zoltan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch hausmann: review+

Description Kenneth Rohde Christiansen 2012-05-03 07:14:21 PDT
SSIA
Comment 1 Kenneth Rohde Christiansen 2012-05-03 07:17:15 PDT
Created attachment 140007 [details]
Patch
Comment 2 Kenneth Rohde Christiansen 2012-05-03 07:18:44 PDT
Can be tested like this. Alex said he would make some actual tests.

diff --git a/Tools/MiniBrowser/qt/qml/BrowserWindow.qml b/Tools/MiniBrowser/qt/qml/BrowserWindow.qml
index 9567e8b..16f5079 100644
--- a/Tools/MiniBrowser/qt/qml/BrowserWindow.qml
+++ b/Tools/MiniBrowser/qt/qml/BrowserWindow.qml
@@ -100,7 +100,7 @@ Rectangle {
                     onClicked: {
                         if (parent.enabled) {
                             console.log("MiniBrowser: Going backward in session history.")
-                            webView.goBack()
+                            webView.experimental.evaluateJavaScript("document.documentElement.innerHTML")
                         }
                     }
                 }
@@ -307,6 +307,7 @@ Rectangle {
             forceActiveFocus();
         }
 
+        experimental.onJavaScriptResult: { console.log(resultId + ': ' + result) }
         experimental.devicePixelRatio: 1.5
         experimental.preferredMinimumContentsWidth: 980
         experimental.itemSelector: ItemSelector { }
Comment 3 Kenneth Rohde Christiansen 2012-05-08 06:33:30 PDT
Created attachment 140701 [details]
Patch
Comment 4 Simon Hausmann 2012-05-08 06:47:43 PDT
Comment on attachment 140701 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=140701&action=review

> Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:1291
> +    closure->method = 0;

This line isn't necessary given that method is a QByteArray that has a constructor.
Comment 5 Kenneth Rohde Christiansen 2012-05-08 07:13:56 PDT
Landed in 116420.