Merge lp:~abreu-alexandre/ubuntu-html5-theme/rtm-fix-webkit-launch into lp:ubuntu-html5-theme

Proposed by Alexandre Abreu
Status: Superseded
Proposed branch: lp:~abreu-alexandre/ubuntu-html5-theme/rtm-fix-webkit-launch
Merge into: lp:ubuntu-html5-theme
Diff against target: 262 lines (+143/-36) (has conflicts)
10 files modified
debian/ubuntu-html5-container.install (+0/-1)
src/CMakeLists.txt (+1/-1)
src/plugin/CMakeLists.txt (+0/-1)
src/plugin/Ubuntu/CMakeLists.txt (+0/-1)
src/plugin/Ubuntu/WebApps/CMakeLists.txt (+0/-25)
src/plugin/Ubuntu/WebApps/qmldir (+0/-2)
src/ubuntu-html5-app-launcher/CMakeLists.txt (+0/-1)
src/ubuntu-html5-app-launcher/UbuntuJavascriptBindings.qml (+59/-0)
src/ubuntu-html5-app-launcher/main.cpp (+7/-0)
src/ubuntu-html5-app-launcher/main.qml (+76/-4)
Conflict: can't delete src/plugin because it is not empty.  Not deleting.
Conflict because src/plugin is not versioned, but has versioned children.  Versioned directory.
Conflict: can't delete src/plugin/Ubuntu because it is not empty.  Not deleting.
Conflict because src/plugin/Ubuntu is not versioned, but has versioned children.  Versioned directory.
Conflict: can't delete src/plugin/Ubuntu/WebApps because it is not empty.  Not deleting.
Conflict because src/plugin/Ubuntu/WebApps is not versioned, but has versioned children.  Versioned directory.
Contents conflict in src/plugin/Ubuntu/WebApps/WebAppContainer.qml
Text conflict in src/ubuntu-html5-app-launcher/main.cpp
Text conflict in src/ubuntu-html5-app-launcher/main.qml
To merge this branch: bzr merge lp:~abreu-alexandre/ubuntu-html5-theme/rtm-fix-webkit-launch
Reviewer Review Type Date Requested Status
Ubuntu HTML5 Theme Developers Pending
Review via email: mp+249552@code.launchpad.net

Commit message

QtWebkit w/ Qt 5.3 seems to have a race when bundled w/ certain qml elements, something like e.g.:

MainView {

  Page { WebView {} }
}

makes the app (launched as a click) on the devices (w/ RTM or Vivid) spin at startup w/o ever actually showing something,

It does that usually on the first launch, subsequent launches usually work fine. Things do work fine when the Webview is replaced by a Window or even an Item. After some strace and investigation it seems that some bits are racy in QtWebkit in relation w/ its ~/.local/share content.

In the behavior described above, the app goes back into failing mode when one deletes the apps' ~/.local/share. Some cookie DB creation errors (that are not seen consistently though) seem to backup the hypothesis above,

Description of the change

QtWebkit w/ Qt 5.3 seems to have a race when bundled w/ certain qml elements, something like e.g.:

MainView {

  Page { WebView {} }
}

makes the app (launched as a click) on the devices (w/ RTM or Vivid) spin at startup w/o ever actually showing something,

It does that usually on the first launch, subsequent launches usually work fine. Things do work fine when the Webview is replaced by a Window or even an Item. After some strace and investigation it seems that some bits are racy in QtWebkit in relation w/ its ~/.local/share content.

In the behavior described above, the app goes back into failing mode when one deletes the apps' ~/.local/share. Some cookie DB creation errors (that are not seen consistently though) seem to backup the hypothesis above,

To post a comment you must log in.

Unmerged revisions

185. By Alexandre Abreu

fix new window

184. By Alexandre Abreu

fixes

183. By Alexandre Abreu

revert mistakenly commited bits

182. By Alexandre Abreu

fix content hub picker API environment (proper Item based parent)

181. By Alexandre Abreu

fix deps

180. By Alexandre Abreu

forgot files

179. By Alexandre Abreu

fix webkit inspector

178. By Alexandre Abreu

Fix oxide support

177. By Alexandre Abreu

Fix oxide support

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2=== modified file 'debian/ubuntu-html5-container.install'
3--- debian/ubuntu-html5-container.install 2014-01-27 18:42:31 +0000
4+++ debian/ubuntu-html5-container.install 2015-02-12 18:30:51 +0000
5@@ -1,3 +1,2 @@
6 usr/bin/ubuntu-html5-app-launcher
7-usr/lib/*/qt5/qml/Ubuntu/WebApps/*
8 usr/share/ubuntu-html5-app-launcher/
9
10=== modified file 'src/CMakeLists.txt'
11--- src/CMakeLists.txt 2014-02-06 22:51:33 +0000
12+++ src/CMakeLists.txt 2015-02-12 18:30:51 +0000
13@@ -1,2 +1,2 @@
14 add_subdirectory(ubuntu-html5-app-launcher)
15-add_subdirectory(plugin)
16+
17
18=== removed file 'src/plugin/CMakeLists.txt'
19--- src/plugin/CMakeLists.txt 2013-11-27 16:33:23 +0000
20+++ src/plugin/CMakeLists.txt 1970-01-01 00:00:00 +0000
21@@ -1,1 +0,0 @@
22-add_subdirectory(Ubuntu)
23
24=== removed file 'src/plugin/Ubuntu/CMakeLists.txt'
25--- src/plugin/Ubuntu/CMakeLists.txt 2013-11-27 16:33:23 +0000
26+++ src/plugin/Ubuntu/CMakeLists.txt 1970-01-01 00:00:00 +0000
27@@ -1,1 +0,0 @@
28-add_subdirectory(WebApps)
29
30=== removed file 'src/plugin/Ubuntu/WebApps/CMakeLists.txt'
31--- src/plugin/Ubuntu/WebApps/CMakeLists.txt 2013-12-10 16:16:11 +0000
32+++ src/plugin/Ubuntu/WebApps/CMakeLists.txt 1970-01-01 00:00:00 +0000
33@@ -1,25 +0,0 @@
34-project(ubuntu-html5-container)
35-
36-# setup install location
37-execute_process(
38- COMMAND qmake -query QT_INSTALL_QML
39- OUTPUT_VARIABLE QT_INSTALL_QML
40- OUTPUT_STRIP_TRAILING_WHITESPACE
41-)
42-set(HTML5_CONTAINER_IMPORTS_DIR "${QT_INSTALL_QML}/Ubuntu/WebApps")
43-
44-# setup install for local component files
45-file(GLOB QML_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.qml qmldir)
46-install(FILES ${QML_FILES} DESTINATION ${HTML5_CONTAINER_IMPORTS_DIR})
47-
48-# make sure that we have all the files in the right place if we test locally
49-# & have a specific build dir
50-if(NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
51- foreach(_qmlfile ${QML_FILES})
52- add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_qmlfile}
53- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_qmlfile}
54- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${_qmlfile} ${CMAKE_CURRENT_BINARY_DIR}/${_qmlfile})
55- endforeach(_qmlfile)
56- add_custom_target(copy_to_build_dir DEPENDS ${QML_FILES})
57-endif()
58-
59
60=== renamed file 'src/plugin/Ubuntu/WebApps/WebAppContainer.qml' => 'src/plugin/Ubuntu/WebApps/WebAppContainer.qml.THIS'
61=== removed file 'src/plugin/Ubuntu/WebApps/qmldir'
62--- src/plugin/Ubuntu/WebApps/qmldir 2013-11-27 16:33:23 +0000
63+++ src/plugin/Ubuntu/WebApps/qmldir 1970-01-01 00:00:00 +0000
64@@ -1,2 +0,0 @@
65-module Ubuntu.WebApps
66-WebAppContainer 0.1 WebAppContainer.qml
67
68=== modified file 'src/ubuntu-html5-app-launcher/CMakeLists.txt'
69--- src/ubuntu-html5-app-launcher/CMakeLists.txt 2014-12-16 21:02:55 +0000
70+++ src/ubuntu-html5-app-launcher/CMakeLists.txt 2015-02-12 18:30:51 +0000
71@@ -27,7 +27,6 @@
72 file(GLOB QML_FILES *.qml)
73 install(FILES ${QML_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/ubuntu-html5-app-launcher/qml)
74
75-
76 # install bin files
77 install(TARGETS ${HTML5_LAUNCHER}
78 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
79
80=== added file 'src/ubuntu-html5-app-launcher/UbuntuJavascriptBindings.qml'
81--- src/ubuntu-html5-app-launcher/UbuntuJavascriptBindings.qml 1970-01-01 00:00:00 +0000
82+++ src/ubuntu-html5-app-launcher/UbuntuJavascriptBindings.qml 2015-02-12 18:30:51 +0000
83@@ -0,0 +1,59 @@
84+/*
85+ * Copyright 2014 Canonical Ltd.
86+ *
87+ * This file is part of ubuntu-html5-container.
88+ *
89+ * ubuntu-html5-container is free software; you can redistribute it and/or modify
90+ * it under the terms of the GNU General Public License as published by
91+ * the Free Software Foundation; version 3.
92+ *
93+ * webbrowser-app is distributed in the hope that it will be useful,
94+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
95+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
96+ * GNU General Public License for more details.
97+ *
98+ * You should have received a copy of the GNU General Public License
99+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
100+ */
101+
102+import QtQuick 2.0
103+import Ubuntu.UnityWebApps 0.1
104+
105+
106+Item {
107+ id: root
108+
109+ property var bindingMainWebview: null
110+
111+ /*!
112+ \internal
113+ */
114+ function getUnityWebappsProxies() {
115+ return UnityWebAppsUtils.makeProxiesForQtWebViewBindee(bindingMainWebview);
116+ }
117+
118+ /*!
119+ \internal
120+ */
121+ Loader {
122+ id: webappBindingsLoader
123+ visible: false
124+ anchors.fill: parent
125+ sourceComponent: bindingMainWebview ? webappBindingsComponent : undefined
126+ }
127+
128+ /*!
129+ \internal
130+ */
131+ Component {
132+ id: webappBindingsComponent
133+
134+ UnityWebApps {
135+ id: webapps
136+ bindee: root
137+ injectExtraUbuntuApis: true
138+ requiresInit: false
139+ }
140+ }
141+}
142+
143
144=== modified file 'src/ubuntu-html5-app-launcher/main.cpp'
145--- src/ubuntu-html5-app-launcher/main.cpp 2014-12-16 21:02:55 +0000
146+++ src/ubuntu-html5-app-launcher/main.cpp 2015-02-12 18:30:51 +0000
147@@ -208,7 +208,9 @@
148 qt_gl_set_global_share_context(glcontext);
149 #endif
150
151+
152 QQuickView view;
153+<<<<<<< TREE
154 QQmlEngine* engine = view.engine();
155
156 if (remoteInspectorEnabled) {
157@@ -223,6 +225,11 @@
158 qputenv("QTWEBKIT_INSPECTOR_SERVER", remoteInspectorPort.toUtf8());
159 }
160
161+=======
162+ view.rootContext()->setContextProperty(
163+ "HtmlIndexDirectory", wwwFolder.canonicalFilePath());
164+
165+>>>>>>> MERGE-SOURCE
166 view.setSource(QUrl::fromLocalFile(Webapp::Config::getContainerMainQmlPath()
167 + "/main.qml"));
168 if (view.status() != QQuickView::Ready)
169
170=== modified file 'src/ubuntu-html5-app-launcher/main.qml'
171--- src/ubuntu-html5-app-launcher/main.qml 2014-12-16 21:02:55 +0000
172+++ src/ubuntu-html5-app-launcher/main.qml 2015-02-12 18:30:51 +0000
173@@ -17,13 +17,85 @@
174 */
175
176 import QtQuick 2.0
177-import Ubuntu.Components 0.1
178-import Ubuntu.WebApps 0.1
179-
180-WebAppContainer {
181+import Ubuntu.Components 1.0
182+import Ubuntu.Components.Extras.Browser 0.1
183+import QtWebKit.experimental 1.0
184+
185+MainView {
186+ id: root
187+
188 width: units.gu(100)
189 height: units.gu(75)
190+<<<<<<< TREE
191
192 remoteInspectorEnabled: inspector
193 htmlIndexDirectory: wwwFolder
194+=======
195+
196+ anchorToKeyboard: true
197+ automaticOrientation: true
198+
199+ Timer {
200+ id: checkTimer
201+ running: true
202+ repeat: false
203+ onTriggered: {
204+ webviewComponentLoader.sourceComponent =
205+ webviewComponent
206+ checkTimer.stop()
207+ }
208+ interval: 100
209+ }
210+
211+ Page {
212+ anchors.fill: parent
213+ Loader {
214+ id: webviewComponentLoader
215+ anchors.fill: parent
216+ onLoaded: {
217+ bindings.bindingMainWebview =
218+ webviewComponentLoader.item;
219+ }
220+ }
221+ }
222+
223+ Component {
224+ id: webviewComponent
225+
226+ UbuntuWebView {
227+ maximumFlickVelocity: height * 5
228+
229+ url: HtmlIndexDirectory !== "" ? ('file://' + HtmlIndexDirectory + '/index.html') : ""
230+
231+ experimental.preferences.localStorageEnabled: true
232+ experimental.preferences.offlineWebApplicationCacheEnabled: true
233+ experimental.preferences.universalAccessFromFileURLsAllowed: true
234+ experimental.preferences.webGLEnabled: true
235+
236+ experimental.databaseQuotaDialog: Item {
237+ Timer {
238+ interval: 1
239+ running: true
240+ onTriggered: {
241+ model.accept(model.expectedUsage)
242+ }
243+ }
244+ }
245+
246+ // port in QTWEBKIT_INSPECTOR_SERVER enviroment variable
247+ experimental.preferences.developerExtrasEnabled: true
248+
249+ onNewTabRequested: {
250+ if (url.toString().indexOf("file://") !== 0) {
251+ Qt.openUrlExternally(url.toString())
252+ return
253+ }
254+ }
255+ }
256+ }
257+
258+ UbuntuJavascriptBindings {
259+ id: bindings
260+ }
261+>>>>>>> MERGE-SOURCE
262 }

Subscribers

People subscribed via source and target branches