Bug 425123 - Port SWT Browser to webkit2gtk
Summary: Port SWT Browser to webkit2gtk
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.4 M6   Edit
Assignee: Sami Wagiaalla CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Webkit2Port4.7
  Show dependency tree
 
Reported: 2014-01-08 13:16 EST by Sami Wagiaalla CLA
Modified: 2017-05-17 14:46 EDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sami Wagiaalla CLA 2014-01-08 13:16:01 EST
webkit1 crashes the main process when a plugin crashes, and webkit2 is the current actively supported version. I have started working on this since I have failed to come up with a solution for https://bugs.eclipse.org/bugs/show_bug.cgi?id=334466 and I have a preliminary patch which I will post shortly.
Your feedback and thoughts would be greatly appreciated :)
Comment 1 Sami Wagiaalla CLA 2014-01-10 14:59:56 EST
Preliminary patch: https://git.eclipse.org/r/#/c/20521/
Comment 2 Sami Wagiaalla CLA 2014-01-21 09:36:44 EST
Uploaded the latest patch https://git.eclipse.org/r/#/c/20521/
This patch includes more features ported such as
- context menu handling
- navigation policy handling
- loading pages from local URI's.

The current major issue is that when loading HTML by providing as a string through setText if the HTML includes links to CSS files, the files are ignored. Actually the files are loaded but the styling is not applied.

I noticed that in the original code the implementation of setText was a bit round about; setText saves the provided HTML and loads a blank page (about:blank) then when the load signal is received the HTML is set using webkit_web_view_load_string. This may have been a work around for the issue above. If anyone has more information on this please let me know.
Comment 3 Dani Megert CLA 2014-01-23 10:44:55 EST
*** Bug 425614 has been marked as a duplicate of this bug. ***
Comment 4 Sami Wagiaalla CLA 2014-01-23 11:33:36 EST
> The current major issue is that when loading HTML by providing as a string
> through setText if the HTML includes links to CSS files, the files are
> ignored. Actually the files are loaded but the styling is not applied.
> 

Turns out this was an encoding issue. Webkit expects linked CSS files to be UTF16. I file this bug about it upstream: https://bugs.webkit.org/show_bug.cgi?id=127481
Comment 5 Marc-André Laperle CLA 2014-01-23 16:46:41 EST
Hello Sami. Using a recent version of webkit1 (2.3.2) with GTK2 (SWT_GTK3=0), I get a crash when first showing the welcome screen (Bug 425614). Does this patch address this issue? Or is this exclusively to support webkit2?
Comment 6 Sami Wagiaalla CLA 2014-01-24 11:56:21 EST
Hi

> Hello Sami. Using a recent version of webkit1 (2.3.2) with GTK2
> (SWT_GTK3=0), I get a crash when first showing the welcome screen (Bug
> 425614).

Maybe you are facing the googletalk-plugin issue: WebKit1 crashes eclipse when googletalk-plugin is installed (Bug 334466). That is what motivated me to work on this.

> Does this patch address this issue? Or is this exclusively to
> support webkit2?

This does not directly address your issue. This bug is to keep track of webkit2 support.
Comment 7 Marc-André Laperle CLA 2014-01-27 15:12:05 EST
(In reply to Sami Wagiaalla from comment #6)
> Hi
> 
> > Hello Sami. Using a recent version of webkit1 (2.3.2) with GTK2
> > (SWT_GTK3=0), I get a crash when first showing the welcome screen (Bug
> > 425614).
> 
> Maybe you are facing the googletalk-plugin issue: WebKit1 crashes eclipse
> when googletalk-plugin is installed (Bug 334466). That is what motivated me
> to work on this.

I just checked, I don't have this installed. Good to know though!

> > Does this patch address this issue? Or is this exclusively to
> > support webkit2?
> 
> This does not directly address your issue. This bug is to keep track of
> webkit2 support.

I see. I tested your patch anyway to see if by any chance it indirectly addressed the crash but I still got it. So it does seem to be worth treating it as a different bug.
Comment 8 Sami Wagiaalla CLA 2014-02-03 16:49:21 EST
> I see. I tested your patch anyway to see if by any chance it indirectly
> addressed the crash but I still got it. So it does seem to be worth treating
> it as a different bug.

Thanks for testing my patch! I will CC myself on your bug. I will look into it if it is still present with WebKit2
Comment 9 Sami Wagiaalla CLA 2014-02-03 16:50:44 EST
> Turns out this was an encoding issue. Webkit expects linked CSS files to be
> UTF16. I file this bug about it upstream:
> https://bugs.webkit.org/show_bug.cgi?id=127481

This issue has now been addressed upstream.

And I have uploaded a new patch https://git.eclipse.org/r/#/c/20521/ which adds policy decision handling.
Comment 10 Sami Wagiaalla CLA 2014-02-07 09:34:31 EST
The latest patch is up: https://git.eclipse.org/r/#/c/20521/

It contains the following fixes:
- Browser back and forward buttons were not working.
- Loading progress is now shown properly.
- The browser does not navigate to an empty page after showing a help popup.
Comment 11 Sami Wagiaalla CLA 2014-02-07 16:54:01 EST
The latest patch: https://git.eclipse.org/r/#/c/20521/
adds support for adding custom HTTP authentication listeners
Comment 12 Sami Wagiaalla CLA 2014-02-11 16:59:11 EST
The latest patch https://git.eclipse.org/r/#/c/20521/ adds support for setting custom HTTP headers.
Comment 13 Alexander Kurtakov CLA 2014-02-27 15:56:57 EST
Initial port is pushed to master.
It's not complete yet but good enough for simple usage or when one has to run on machine with additional browser plugins that might crash webkit 1.x. With webkit 2.x running them out of process this prevents crashing the IDE. Being enabled by SWT_WEBKIT2 env variable only makes it pretty safe change as it would not popup to people that haven't requested it explicitly.
Comment 14 Grant Gayed CLA 2014-03-19 10:59:31 EDT
Worth noting: https://lists.webkit.org/pipermail/webkit-gtk/2014-March/001821.html ("Deciding the deprecation path for WebKit1").
Comment 15 Alexander Kurtakov CLA 2014-03-19 11:13:55 EDT
(In reply to Grant Gayed from comment #14)
> Worth noting:
> https://lists.webkit.org/pipermail/webkit-gtk/2014-March/001821.html
> ("Deciding the deprecation path for WebKit1").

It is finally stating the obvious for everyone who tried to run webkit1 on latest distros :).