Bug 158697

Summary: [GTK][Wayland] evince-browser-plugin prevents viewing PDFs
Product: WebKit Reporter: Michael Catanzaro <mcatanzaro>
Component: WebKitGTKAssignee: Michael Catanzaro <mcatanzaro>
Status: RESOLVED FIXED    
Severity: Normal CC: berto, bugs-noreply, cgarcia, commit-queue, gustavo, mcatanzaro, mrobinson
Priority: P2    
Version: Other   
Hardware: PC   
OS: Linux   
Bug Depends on:    
Bug Blocks: 81456    
Attachments:
Description Flags
Patch
cgarcia: review-
Patch
mcatanzaro: review+
Archive of layout-test-results from ews115 for mac-yosemite none

Description Michael Catanzaro 2016-06-13 10:25:32 PDT
When running in Wayland with evince-browser-plugin installed, PDF surfaces are completely black and it's impossible to view PDFs. Only solution is to uninstall the evince-browser-plugin. It's probably a regression from r196053.
Comment 1 Michael Catanzaro 2016-08-17 01:08:04 PDT
Note that in Fedora, I've disabled windowless NPAPI plugins in Wayland as a crappy workaround for this, since being able to download PDFs is much more important than being able to install GNOME shell extensions.
Comment 2 Michael Catanzaro 2016-09-03 07:28:41 PDT
I think we should do this upstream, even if it's just a workaround and not a real fix. gnome-session 3.21.91 still defaults to the Wayland session, and it seems quite unlikely that's going to change in the next couple of weeks, so this is going to be a major user experience issue in 3.22.
Comment 3 Michael Catanzaro 2016-09-03 07:38:12 PDT
Created attachment 287861 [details]
Patch
Comment 4 WebKit Commit Bot 2016-09-03 07:40:09 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 5 Carlos Garcia Campos 2016-09-04 01:53:29 PDT
Comment on attachment 287861 [details]
Patch

I'm going to check the issue this week. If I don't have a better solution, I'm fine with a workaround, but we can probably blacklist the evince plugin only instead of disabling all plugins.
Comment 6 Carlos Garcia Campos 2016-09-05 05:57:10 PDT
I've checked this, and I don't think it's a WebKit issue. The evince browser plugin shouldn't claim to support handling PDF documents (well, or any other supported format) on systems that don't support XEmbed. I've patched evince to fail to initialize on wayland and it works. However, there's another problem that needs to be fixed in WebKit. The plugin cache assumes that a plugin is supported on any platform supporting plugins. So, if you update evince, load anything in X11, the cache is updated, then load a PDF in wayland and the information is taken form the cache. We need to add the display information to the cache, somehow.
Comment 7 Carlos Garcia Campos 2016-09-05 06:08:36 PDT
I think the easiest solution would to be have a different plugin cache for every display type. 

~/.cache/webkitgtk/plugins-x11
~/.cache/webkitgtk/plugins-wayland

that way we don't need to change the file format, nor the code handling plugins info, etc.
Comment 8 Carlos Garcia Campos 2016-09-06 02:44:17 PDT
Created attachment 288004 [details]
Patch
Comment 9 Build Bot 2016-09-06 03:46:00 PDT
Comment on attachment 288004 [details]
Patch

Attachment 288004 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/2016842

New failing tests:
transitions/default-timing-function.html
Comment 10 Build Bot 2016-09-06 03:46:03 PDT
Created attachment 288012 [details]
Archive of layout-test-results from ews115 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews115  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 11 Carlos Garcia Campos 2016-09-06 09:30:13 PDT
Committed r205485: <http://trac.webkit.org/changeset/205485>