From e287590a5c6c661175faeb0fa7742c4052619002 Mon Sep 17 00:00:00 2001
From: Kai Koehne <kai.koehne@qt.io>
Date: Fri, 30 Sep 2016 13:17:35 +0200
Subject: [PATCH] Doc: Sanitize WebEngineView::newViewRequested code snippet

Use ; in JavaScript snippets. Also, use = function(x) notation
for slots that get an argument.

Change-Id: Iba6ffe94f882cae2b31022f4f80482ea6c922fde
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
---
 .../qtwebengine_webengineview_newviewrequested.qml     | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/webengine/doc/snippets/qtwebengine_webengineview_newviewrequested.qml b/src/webengine/doc/snippets/qtwebengine_webengineview_newviewrequested.qml
index 4d3095af2..e7e6790f2 100644
--- a/src/webengine/doc/snippets/qtwebengine_webengineview_newviewrequested.qml
+++ b/src/webengine/doc/snippets/qtwebengine_webengineview_newviewrequested.qml
@@ -57,8 +57,8 @@ QtObject {
     id: windowParent
     // Create the initial browsing windows and open the startup page.
     Component.onCompleted: {
-        var firstWindow = windowComponent.createObject(windowParent)
-        firstWindow.webView.loadHtml('<input type="button" value="Click!" onclick="window.open(&quot;http://qt.io&quot;)">')
+        var firstWindow = windowComponent.createObject(windowParent);
+        firstWindow.webView.loadHtml('<input type="button" value="Click!" onclick="window.open(&quot;http://qt.io&quot;)">');
     }
 
     property Component windowComponent: Window {
@@ -74,9 +74,9 @@ QtObject {
 
             // Handle the signal. Dynamically create the window and
             // use its WebEngineView as the destination of our request.
-            onNewViewRequested: {
-                var newWindow = windowComponent.createObject(windowParent)
-                request.openIn(newWindow.webView)
+            onNewViewRequested: function(request) {
+                var newWindow = windowComponent.createObject(windowParent);
+                request.openIn(newWindow.webView);
             }
         }
     }
-- 
GitLab