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
=== modified file 'd-i/manifest'
--- d-i/manifest 2016-01-27 00:23:39 +0000
+++ d-i/manifest 2016-02-09 17:06:05 +0000
@@ -1,34 +1,34 @@
1apt-setup 1:0.104ubuntu21apt-setup 1:0.104ubuntu3
2base-installer 1.158ubuntu22base-installer 1.158ubuntu2
3bterm-unifont 1.33bterm-unifont 1.4
4choose-mirror 2.65ubuntu24choose-mirror 2.65ubuntu4
5clock-setup 0.126ubuntu15clock-setup 0.126ubuntu1
6console-setup 1.108ubuntu106console-setup 1.108ubuntu10
7debian-installer-utils 1.113ubuntu17debian-installer-utils 1.113ubuntu1
8flash-kernel 3.0~rc.4ubuntu578flash-kernel 3.0~rc.4ubuntu58
9grub-installer 1.128ubuntu29grub-installer 1.128ubuntu2
10hw-detect 1.114ubuntu110hw-detect 1.114ubuntu1
11localechooser 2.65ubuntu311localechooser 2.65ubuntu3
12netcfg 1.135ubuntu112netcfg 1.135ubuntu1
13partconf 1.4813partconf 1.49
14partman-auto 131ubuntu114partman-auto 131ubuntu1
15partman-auto-crypto 22ubuntu115partman-auto-crypto 22ubuntu1
16partman-auto-loop 0ubuntu2116partman-auto-loop 0ubuntu21
17partman-auto-lvm 56ubuntu117partman-auto-lvm 56ubuntu1
18partman-base 187ubuntu118partman-base 187ubuntu1
19partman-basicfilesystems 120ubuntu119partman-basicfilesystems 120ubuntu1
20partman-basicmethods 6020partman-basicmethods 61
21partman-btrfs 18ubuntu121partman-btrfs 18ubuntu1
22partman-crypto 86ubuntu122partman-crypto 86ubuntu1
23partman-efi 71ubuntu123partman-efi 71ubuntu1
24partman-ext3 84ubuntu224partman-ext3 84ubuntu2
25partman-jfs 4625partman-jfs 46
26partman-lvm 11126partman-lvm 112
27partman-newworld 3327partman-newworld 34
28partman-partitioning 110ubuntu128partman-partitioning 110ubuntu1
29partman-target 98ubuntu129partman-target 98ubuntu1
30partman-uboot 530partman-uboot 5
31partman-xfs 5731partman-xfs 58
32preseed 1.68ubuntu132preseed 1.68ubuntu1
33tzsetup 1:0.81ubuntu133tzsetup 1:0.81ubuntu1
34user-setup 1.63ubuntu134user-setup 1.63ubuntu1
3535
=== modified file 'd-i/update-control'
--- d-i/update-control 2015-01-29 17:46:16 +0000
+++ d-i/update-control 2016-02-09 17:06:05 +0000
@@ -41,7 +41,7 @@
41 'dpkg-dev (>= 1.14.4)',41 'dpkg-dev (>= 1.14.4)',
42 'gir1.2-soup-2.4',42 'gir1.2-soup-2.4',
43 'gir1.2-timezonemap-1.0',43 'gir1.2-timezonemap-1.0',
44 'gir1.2-webkit-3.0',44 'gir1.2-webkit2-4.0',
45 'intltool (>= 0.40.0)',45 'intltool (>= 0.40.0)',
46 'imagemagick',46 'imagemagick',
47 'libcairo2-dev',47 'libcairo2-dev',
4848
=== modified file 'debian/changelog'
--- debian/changelog 2016-01-27 00:26:44 +0000
+++ debian/changelog 2016-02-09 17:06:05 +0000
@@ -1,3 +1,13 @@
1ubiquity (2.21.44) UNRELEASED; urgency=medium
2
3 * Port the slideshow screen to WebKit 2 (LP: #1469221)
4 * Automatic update of included source packages: apt-setup
5 1:0.104ubuntu3, bterm-unifont 1.4, choose-mirror 2.65ubuntu4, flash-
6 kernel 3.0~rc.4ubuntu58, partconf 1.49, partman-basicmethods 61,
7 partman-lvm 112, partman-newworld 34, partman-xfs 58.
8
9 -- Iain Lane <iain.lane@canonical.com> Tue, 09 Feb 2016 12:18:57 +0000
10
1ubiquity (2.21.43) xenial; urgency=medium11ubiquity (2.21.43) xenial; urgency=medium
212
3 * ubiquity/install_misc.py: be extra careful retrieving the state of the13 * ubiquity/install_misc.py: be extra careful retrieving the state of the
414
=== modified file 'debian/control'
--- debian/control 2015-12-23 16:37:19 +0000
+++ debian/control 2016-02-09 17:06:05 +0000
@@ -3,7 +3,7 @@
3Priority: optional3Priority: optional
4Maintainer: Ubuntu Installer Team <ubuntu-installer@lists.ubuntu.com>4Maintainer: Ubuntu Installer Team <ubuntu-installer@lists.ubuntu.com>
5Uploaders: Colin Watson <cjwatson@ubuntu.com>, Evan Dandrea <ev@ubuntu.com>5Uploaders: Colin Watson <cjwatson@ubuntu.com>, Evan Dandrea <ev@ubuntu.com>
6Build-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, xvfb6Build-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
7Standards-Version: 3.9.47Standards-Version: 3.9.4
8X-Python3-Version: >= 3.18X-Python3-Version: >= 3.1
9XS-Testsuite: autopkgtest9XS-Testsuite: autopkgtest
@@ -45,7 +45,7 @@
45Package: ubiquity-frontend-gtk45Package: ubiquity-frontend-gtk
46Architecture: amd64 arm64 armhf i386 powerpc ppc64el46Architecture: amd64 arm64 armhf i386 powerpc ppc64el
47Pre-Depends: ${misc:Pre-Depends}47Pre-Depends: ${misc:Pre-Depends}
48Depends: ${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 | busybox48Depends: ${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
49Suggests: gnome-control-center | feh49Suggests: gnome-control-center | feh
50Conflicts: ubuntu-express-frontend-gtk, espresso-frontend-gtk, ubiquity (<< 2.4.3)50Conflicts: ubuntu-express-frontend-gtk, espresso-frontend-gtk, ubiquity (<< 2.4.3)
51Replaces: ubuntu-express-frontend-gtk, espresso-frontend-gtk, ubiquity (<< 2.4.3)51Replaces: ubuntu-express-frontend-gtk, espresso-frontend-gtk, ubiquity (<< 2.4.3)
5252
=== modified file 'ubiquity/frontend/gtk_ui.py'
--- ubiquity/frontend/gtk_ui.py 2015-07-15 05:37:56 +0000
+++ ubiquity/frontend/gtk_ui.py 2016-02-09 17:06:05 +0000
@@ -37,6 +37,7 @@
37import configparser37import configparser
38from functools import reduce38from functools import reduce
39import gettext39import gettext
40import gi
40import os41import os
41import subprocess42import subprocess
42import sys43import sys
@@ -831,15 +832,27 @@
831832
832 return self.returncode833 return self.returncode
833834
834 def on_slideshow_link_clicked(self, unused_view, unused_frame, req,835 def on_context_menu(self, unused_web_view, unused_context_menu,
835 unused_action, decision):836 unused_event, unused_hit_test_result):
836 uri = req.get_uri()837 # True will not show the menu
837 decision.ignore()
838 subprocess.Popen(['sensible-browser', uri],
839 close_fds=True, preexec_fn=misc.drop_all_privileges)
840 return True838 return True
841839
840 def on_slideshow_link_clicked(self, web_view, decision, decision_type):
841 gi.require_version('WebKit2', '4.0')
842 from gi.repository import WebKit2
843 if decision_type == WebKit2.PolicyDecisionType.NEW_WINDOW_ACTION:
844 request = decision.get_request()
845 uri = request.get_uri()
846 decision.ignore()
847 subprocess.Popen(['sensible-browser', uri],
848 close_fds=True,
849 preexec_fn=misc.drop_all_privileges)
850 return True
851 return False
852
842 def start_slideshow(self):853 def start_slideshow(self):
854 # WebKit2 spawns a process which we don't want to run as root
855 misc.drop_privileges_save()
843 self.progress_mode.set_current_page(856 self.progress_mode.set_current_page(
844 self.progress_pages['progress_bar'])857 self.progress_pages['progress_bar'])
845858
@@ -863,32 +876,35 @@
863876
864 slides = 'file://%s#%s' % (slideshow_main, parameters_encoded)877 slides = 'file://%s#%s' % (slideshow_main, parameters_encoded)
865878
866 from gi.repository import WebKit879 gi.require_version('WebKit2', '4.0')
880 from gi.repository import WebKit2
867 # We have no significant browsing interface, so there isn't much point881 # We have no significant browsing interface, so there isn't much point
868 # in WebKit creating a memory-hungry cache.882 # in WebKit creating a memory-hungry cache.
869 WebKit.set_cache_model(WebKit.CacheModel.DOCUMENT_VIEWER)883 context = WebKit2.WebContext.get_default()
870 webview = WebKit.WebView()884 context.set_cache_model(WebKit2.CacheModel.DOCUMENT_VIEWER)
885 webview = WebKit2.WebView()
871 # WebKit puts file URLs in their own domain by default.886 # WebKit puts file URLs in their own domain by default.
872 # This means that anything which checks for the same origin,887 # This means that anything which checks for the same origin,
873 # such as creating a XMLHttpRequest, will fail unless this888 # such as creating a XMLHttpRequest, will fail unless this
874 # is disabled.889 # is disabled.
875 # http://www.gitorious.org/webkit/webkit/commit/624b946890 # http://www.gitorious.org/webkit/webkit/commit/624b946
876 s = webview.get_settings()891 s = webview.get_settings()
877 s.set_property('enable-file-access-from-file-uris', True)892 s.set_property('allow-file-access-from-file-urls', True)
878 s.set_property('enable-default-context-menu', False)893 webview.connect('context-menu', self.on_context_menu)
879 if (os.environ.get('UBIQUITY_A11Y_PROFILE') == 'screen-reader'):894 if (os.environ.get('UBIQUITY_A11Y_PROFILE') == 'screen-reader'):
880 s.set_property('enable-caret-browsing', True)895 s.set_property('enable-caret-browsing', True)
881896
882 webview.connect('new-window-policy-decision-requested',897 webview.connect('decide-policy',
883 self.on_slideshow_link_clicked)898 self.on_slideshow_link_clicked)
884899
885 self.webkit_scrolled_window.add(webview)900 webview.show()
886 webview.open(slides)901 self.page_mode.insert_page(webview, None, 1)
902 webview.load_uri(slides)
887 # TODO do these in a page loaded callback903 # TODO do these in a page loaded callback
888 self.page_mode.show()904 self.page_mode.show()
889 self.page_mode.set_current_page(1)905 self.page_mode.set_current_page(1)
890 webview.show()
891 webview.grab_focus()906 webview.grab_focus()
907 misc.regain_privileges_save()
892908
893 def customize_installer(self):909 def customize_installer(self):
894 """Initial UI setup."""910 """Initial UI setup."""

Subscribers

People subscribed via source and target branches

to status/vote changes: