Merge lp:~laney/ubiquity/webkit2 into lp:ubiquity

Proposed by Iain Lane
Status: Merged
Approved by: Mathieu Trudel-Lapierre
Approved revision: 6376
Merged at revision: 6371
Proposed branch: lp:~laney/ubiquity/webkit2
Merge into: lp:ubiquity
Diff against target: 191 lines (+53/-27)
5 files modified
d-i/manifest (+9/-9)
d-i/update-control (+1/-1)
debian/changelog (+10/-0)
debian/control (+2/-2)
ubiquity/frontend/gtk_ui.py (+31/-15)
To merge this branch: bzr merge lp:~laney/ubiquity/webkit2
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Approve
Sebastien Bacher Approve
Review via email: mp+282467@code.launchpad.net

Commit message

Port to WebKit 2

Description of the change

Port to webkit2. I think it's fairly straightforward and seems to work.

We need to upload everything at once, so please review but don't merge/upload right away

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

thanks for the work, it doesn't work for me though (using the version published in a ppa an hour ago), the slides don't display

/var/log/installer/debug has

"sys:1: PyGIWarning: WebKit2 was imported without specifying a version first. Use gi.require_version('WebKit2', '4.0') before import to ensure that the right version gets loaded.

(process:8709): Gtk-WARNING **: This process is currently running setuid or setgid.
This is not a supported use of GTK+. You must create a helper
program instead. For further details, see:

    http://www.gtk.org/setuid.html

Refusing to initialize GTK+."

one other small thing
"# True will not sure the menu"

is that a typo sure->show?

review: Needs Fixing
Revision history for this message
Sebastien Bacher (seb128) wrote :

could you also version the import to avoid the require_version warning?

lp:~laney/ubiquity/webkit2 updated
6373. By Iain Lane

Merge with trunk

6374. By Iain Lane

drop and regain privileges harder

6375. By Iain Lane

Set a minimal version for WK2

6376. By Iain Lane

typo sure -> show

Revision history for this message
Iain Lane (laney) wrote :

On Tue, Feb 09, 2016 at 02:54:18PM -0000, Sebastien Bacher wrote:
> Review: Needs Fixing
>
> thanks for the work, it doesn't work for me though (using the version published in a ppa an hour ago), the slides don't display

Try again from the PPA please. All should be fixed.

I did this to test it from a live session:

  $ sudo sed -i 's/main/main universe/' /etc/apt/sources.list
  $ sudo add-apt-repository ppa:laney/wk2
  $ sudo apt update
  $ sudo apt install ubiquity ubiquity-frontend-kde- # recommends? don't need the kdeish bits to test this

Then close terminal and launch using the desktop file on the desktop.

This

  http://people.canonical.com/~laney/weird-things/zlidezhow.png

is a screenshot of it which I took just now.

Cheers,

--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

On 10 February 2016 at 15:12, Iain Lane <email address hidden> wrote:
> On Tue, Feb 09, 2016 at 02:54:18PM -0000, Sebastien Bacher wrote:
>> Review: Needs Fixing
>>
>> thanks for the work, it doesn't work for me though (using the version published in a ppa an hour ago), the slides don't display
>
> Try again from the PPA please. All should be fixed.
>
> I did this to test it from a live session:
>
> $ sudo sed -i 's/main/main universe/' /etc/apt/sources.list
> $ sudo add-apt-repository ppa:laney/wk2
> $ sudo apt update
> $ sudo apt install ubiquity ubiquity-frontend-kde- # recommends? don't need the kdeish bits to test this
>

for historical reasons we depends on : ubiquity-frontend-kde |
ubiquity-frontend-gtk

So one can do:

$ sudo apt install ubiquity ubiquity-frontend-gtk

to upgrade it mid flight.

> Then close terminal and launch using the desktop file on the desktop.
>
> This
>
> http://people.canonical.com/~laney/weird-things/zlidezhow.png
>
> is a screenshot of it which I took just now.
>
> Cheers,
>
> --
> Iain Lane [ <email address hidden> ]
> Debian Developer [ <email address hidden> ]
> Ubuntu Developer [ <email address hidden> ]
>
> https://code.launchpad.net/~laney/ubiquity/webkit2/+merge/282467
> You are subscribed to branch lp:ubiquity.

--
Regards,

Dimitri.

Revision history for this message
Sebastien Bacher (seb128) wrote :

the updated version works fine here, tried on yesterday's daily with the ppa, the slides display as they should, you can switch to next/previous ones and clicking on an url in summary slide opens the webbrowser on the correct url

review: Approve
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'd-i/manifest'
2--- d-i/manifest 2016-01-27 00:23:39 +0000
3+++ d-i/manifest 2016-02-09 17:06:05 +0000
4@@ -1,34 +1,34 @@
5-apt-setup 1:0.104ubuntu2
6+apt-setup 1:0.104ubuntu3
7 base-installer 1.158ubuntu2
8-bterm-unifont 1.3
9-choose-mirror 2.65ubuntu2
10+bterm-unifont 1.4
11+choose-mirror 2.65ubuntu4
12 clock-setup 0.126ubuntu1
13 console-setup 1.108ubuntu10
14 debian-installer-utils 1.113ubuntu1
15-flash-kernel 3.0~rc.4ubuntu57
16+flash-kernel 3.0~rc.4ubuntu58
17 grub-installer 1.128ubuntu2
18 hw-detect 1.114ubuntu1
19 localechooser 2.65ubuntu3
20 netcfg 1.135ubuntu1
21-partconf 1.48
22+partconf 1.49
23 partman-auto 131ubuntu1
24 partman-auto-crypto 22ubuntu1
25 partman-auto-loop 0ubuntu21
26 partman-auto-lvm 56ubuntu1
27 partman-base 187ubuntu1
28 partman-basicfilesystems 120ubuntu1
29-partman-basicmethods 60
30+partman-basicmethods 61
31 partman-btrfs 18ubuntu1
32 partman-crypto 86ubuntu1
33 partman-efi 71ubuntu1
34 partman-ext3 84ubuntu2
35 partman-jfs 46
36-partman-lvm 111
37-partman-newworld 33
38+partman-lvm 112
39+partman-newworld 34
40 partman-partitioning 110ubuntu1
41 partman-target 98ubuntu1
42 partman-uboot 5
43-partman-xfs 57
44+partman-xfs 58
45 preseed 1.68ubuntu1
46 tzsetup 1:0.81ubuntu1
47 user-setup 1.63ubuntu1
48
49=== modified file 'd-i/update-control'
50--- d-i/update-control 2015-01-29 17:46:16 +0000
51+++ d-i/update-control 2016-02-09 17:06:05 +0000
52@@ -41,7 +41,7 @@
53 'dpkg-dev (>= 1.14.4)',
54 'gir1.2-soup-2.4',
55 'gir1.2-timezonemap-1.0',
56- 'gir1.2-webkit-3.0',
57+ 'gir1.2-webkit2-4.0',
58 'intltool (>= 0.40.0)',
59 'imagemagick',
60 'libcairo2-dev',
61
62=== modified file 'debian/changelog'
63--- debian/changelog 2016-01-27 00:26:44 +0000
64+++ debian/changelog 2016-02-09 17:06:05 +0000
65@@ -1,3 +1,13 @@
66+ubiquity (2.21.44) UNRELEASED; urgency=medium
67+
68+ * Port the slideshow screen to WebKit 2 (LP: #1469221)
69+ * Automatic update of included source packages: apt-setup
70+ 1:0.104ubuntu3, bterm-unifont 1.4, choose-mirror 2.65ubuntu4, flash-
71+ kernel 3.0~rc.4ubuntu58, partconf 1.49, partman-basicmethods 61,
72+ partman-lvm 112, partman-newworld 34, partman-xfs 58.
73+
74+ -- Iain Lane <iain.lane@canonical.com> Tue, 09 Feb 2016 12:18:57 +0000
75+
76 ubiquity (2.21.43) xenial; urgency=medium
77
78 * ubiquity/install_misc.py: be extra careful retrieving the state of the
79
80=== modified file 'debian/control'
81--- debian/control 2015-12-23 16:37:19 +0000
82+++ debian/control 2016-02-09 17:06:05 +0000
83@@ -3,7 +3,7 @@
84 Priority: optional
85 Maintainer: Ubuntu Installer Team <ubuntu-installer@lists.ubuntu.com>
86 Uploaders: Colin Watson <cjwatson@ubuntu.com>, Evan Dandrea <ev@ubuntu.com>
87-Build-Depends: adwaita-icon-theme, apt, autopoint, bf-utf-source, check, dctrl-tools, debconf (>= 1.5.43), debconf-utils, debhelper (>= 9), devio, dh-autoreconf, dh-di (>= 3), dh-systemd, dpkg-dev (>= 1.15.7), gir1.2-soup-2.4, gir1.2-timezonemap-1.0, gir1.2-webkit-3.0, gir1.2-xkl-1.0, gobject-introspection, imagemagick, intltool (>= 0.40.0), intltool-debian (>= 0.30+20040212), iso-codes, isoquery, keymapper (>= 0.5.3-7), libbogl-dev, libcairo2-dev, libdebconfclient0-dev (>= 0.68), libdebian-installer4-dev (>= 0.76), libgirepository1.0-dev, libglib2.0-dev, libgtk-3-dev, libido3-0.1-dev, libindicator3-dev, libiw-dev (>= 27+28pre9), liblocale-gettext-perl, libparted-dev (>= 2.2), librsvg2-bin, libsubunit-dev, locales, pep8, pkg-config, po-debconf (>= 1.0), pyflakes (>= 0.7.2), python-gi-dev, python-scour, python3-all (>= 3.1), python3-apt (>= 0.7.100.3~), python3-cairo, python3-dbus, python3-gi, python3-gi-cairo, python3-icu (>= 1.0), python3-mock (>= 0.7.0), python3-pam, tzdata, ubuntu-artwork, udev, wget, xkb-data (>= 0.9), xkb-data-i18n, xvfb
88+Build-Depends: adwaita-icon-theme, apt, autopoint, bf-utf-source, check, dctrl-tools, debconf (>= 1.5.43), debconf-utils, debhelper (>= 9), devio, dh-autoreconf, dh-di (>= 3), dh-systemd, dpkg-dev (>= 1.15.7), gir1.2-soup-2.4, gir1.2-timezonemap-1.0, gir1.2-webkit2-4.0, gir1.2-xkl-1.0, gobject-introspection, imagemagick, intltool (>= 0.40.0), intltool-debian (>= 0.30+20040212), iso-codes, isoquery, keymapper (>= 0.5.3-7), libbogl-dev, libcairo2-dev, libdebconfclient0-dev (>= 0.68), libdebian-installer4-dev (>= 0.76), libgirepository1.0-dev, libglib2.0-dev, libgtk-3-dev, libido3-0.1-dev, libindicator3-dev, libiw-dev (>= 27+28pre9), liblocale-gettext-perl, libparted-dev (>= 2.2), librsvg2-bin, libsubunit-dev, locales, pep8, pkg-config, po-debconf (>= 1.0), pyflakes (>= 0.7.2), python-gi-dev, python-scour, python3-all (>= 3.1), python3-apt (>= 0.7.100.3~), python3-cairo, python3-dbus, python3-gi, python3-gi-cairo, python3-icu (>= 1.0), python3-mock (>= 0.7.0), python3-pam, tzdata, ubuntu-artwork, udev, wget, xkb-data (>= 0.9), xkb-data-i18n, xvfb
89 Standards-Version: 3.9.4
90 X-Python3-Version: >= 3.1
91 XS-Testsuite: autopkgtest
92@@ -45,7 +45,7 @@
93 Package: ubiquity-frontend-gtk
94 Architecture: amd64 arm64 armhf i386 powerpc ppc64el
95 Pre-Depends: ${misc:Pre-Depends}
96-Depends: ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends}, ubiquity (= ${binary:Version}), python3-dbus, gir1.2-gtk-3.0, gir1.2-pango-1.0, gir1.2-soup-2.4, gir1.2-vte-2.91, gir1.2-webkit-3.0, iso-codes, metacity | marco | xfwm4 | matchbox-window-manager | lubuntu-default-settings | openbox | gnome-shell, gir1.2-xkl-1.0, gir1.2-timezonemap-1.0, python3-gi, python3-cairo, python3-gi-cairo, gir1.2-appindicator3-0.1, busybox-static | busybox
97+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends}, ubiquity (= ${binary:Version}), python3-dbus, gir1.2-gtk-3.0, gir1.2-pango-1.0, gir1.2-soup-2.4, gir1.2-vte-2.91, gir1.2-webkit2-4.0, iso-codes, metacity | marco | xfwm4 | matchbox-window-manager | lubuntu-default-settings | openbox | gnome-shell, gir1.2-xkl-1.0, gir1.2-timezonemap-1.0, python3-gi, python3-cairo, python3-gi-cairo, gir1.2-appindicator3-0.1, busybox-static | busybox
98 Suggests: gnome-control-center | feh
99 Conflicts: ubuntu-express-frontend-gtk, espresso-frontend-gtk, ubiquity (<< 2.4.3)
100 Replaces: ubuntu-express-frontend-gtk, espresso-frontend-gtk, ubiquity (<< 2.4.3)
101
102=== modified file 'ubiquity/frontend/gtk_ui.py'
103--- ubiquity/frontend/gtk_ui.py 2015-07-15 05:37:56 +0000
104+++ ubiquity/frontend/gtk_ui.py 2016-02-09 17:06:05 +0000
105@@ -37,6 +37,7 @@
106 import configparser
107 from functools import reduce
108 import gettext
109+import gi
110 import os
111 import subprocess
112 import sys
113@@ -831,15 +832,27 @@
114
115 return self.returncode
116
117- def on_slideshow_link_clicked(self, unused_view, unused_frame, req,
118- unused_action, decision):
119- uri = req.get_uri()
120- decision.ignore()
121- subprocess.Popen(['sensible-browser', uri],
122- close_fds=True, preexec_fn=misc.drop_all_privileges)
123+ def on_context_menu(self, unused_web_view, unused_context_menu,
124+ unused_event, unused_hit_test_result):
125+ # True will not show the menu
126 return True
127
128+ def on_slideshow_link_clicked(self, web_view, decision, decision_type):
129+ gi.require_version('WebKit2', '4.0')
130+ from gi.repository import WebKit2
131+ if decision_type == WebKit2.PolicyDecisionType.NEW_WINDOW_ACTION:
132+ request = decision.get_request()
133+ uri = request.get_uri()
134+ decision.ignore()
135+ subprocess.Popen(['sensible-browser', uri],
136+ close_fds=True,
137+ preexec_fn=misc.drop_all_privileges)
138+ return True
139+ return False
140+
141 def start_slideshow(self):
142+ # WebKit2 spawns a process which we don't want to run as root
143+ misc.drop_privileges_save()
144 self.progress_mode.set_current_page(
145 self.progress_pages['progress_bar'])
146
147@@ -863,32 +876,35 @@
148
149 slides = 'file://%s#%s' % (slideshow_main, parameters_encoded)
150
151- from gi.repository import WebKit
152+ gi.require_version('WebKit2', '4.0')
153+ from gi.repository import WebKit2
154 # We have no significant browsing interface, so there isn't much point
155 # in WebKit creating a memory-hungry cache.
156- WebKit.set_cache_model(WebKit.CacheModel.DOCUMENT_VIEWER)
157- webview = WebKit.WebView()
158+ context = WebKit2.WebContext.get_default()
159+ context.set_cache_model(WebKit2.CacheModel.DOCUMENT_VIEWER)
160+ webview = WebKit2.WebView()
161 # WebKit puts file URLs in their own domain by default.
162 # This means that anything which checks for the same origin,
163 # such as creating a XMLHttpRequest, will fail unless this
164 # is disabled.
165 # http://www.gitorious.org/webkit/webkit/commit/624b946
166 s = webview.get_settings()
167- s.set_property('enable-file-access-from-file-uris', True)
168- s.set_property('enable-default-context-menu', False)
169+ s.set_property('allow-file-access-from-file-urls', True)
170+ webview.connect('context-menu', self.on_context_menu)
171 if (os.environ.get('UBIQUITY_A11Y_PROFILE') == 'screen-reader'):
172 s.set_property('enable-caret-browsing', True)
173
174- webview.connect('new-window-policy-decision-requested',
175+ webview.connect('decide-policy',
176 self.on_slideshow_link_clicked)
177
178- self.webkit_scrolled_window.add(webview)
179- webview.open(slides)
180+ webview.show()
181+ self.page_mode.insert_page(webview, None, 1)
182+ webview.load_uri(slides)
183 # TODO do these in a page loaded callback
184 self.page_mode.show()
185 self.page_mode.set_current_page(1)
186- webview.show()
187 webview.grab_focus()
188+ misc.regain_privileges_save()
189
190 def customize_installer(self):
191 """Initial UI setup."""

Subscribers

People subscribed via source and target branches

to status/vote changes: