Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 519333

Summary: Regression after (Bug 498392 Create a more general configuration design), on Linux Webkit1,2
Product: z_Archived Reporter: Leo Ufimtsev <lufimtse>
Component: NebulaAssignee: Project Inbox <nebula-inbox>
Status: RESOLVED FIXED QA Contact: Leo Ufimtsev <lufimtse>
Severity: normal    
Priority: P3 CC: dirk.fauth, lufimtse, nebula-inbox, wim.jongman
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=518961
https://bugs.eclipse.org/bugs/show_bug.cgi?id=519340
Whiteboard:

Description Leo Ufimtsev CLA 2017-07-06 13:12:16 EDT
As of:
https://git.eclipse.org/r/#/c/77810/
commit 4c8848af261711f5ccefadbb0a6b1a7fbf10efaf
Author: Dirk Fauth <dirk.fauth@googlemail.com> 2016-08-09 18:24:41

RichTextEditorExample.java no longer works on neither Linux Gtk, Webkit1 nor Webkit2.

The following throws an uncaught exception:
296: public void completed(ProgressEvent event) {
297:		browser.evaluate("initEditor();");

In commit: 4c8848af261711f5ccefadbb0a6b1a7fbf10efaf
template.html's initEditor() was altered, and after that alteration, the function throws an error. 

Last working commit: (1 before)
commit b67556dd99613332018ee8e56fe4434a9eae6733

- I've tested on Win10, RichTextEditorExample works.
- I could not get RichTextEditorExample to work on Cocoa, I get an exception 
  "org/eclipse/swt/widgets/Layout : Unsupported major.minor version 52"
  (Does someone know how to fix? Or can someone test on Cocoa?)

So I presume there is a javascript incompatibility with the webkit(1/2) engine. Maybe some javascript is executed that isn't supported by webkit? 
But I cannot exclude a fault in the SWT/Gtk/WebkitGtk(1 or 2) implementation either.

If someone can narrow it down to a small javascript snippet, I could consult with the Webkit community about it.
I'd also be great to see if this works on Cocoa. If it doesn't, then it would help us understand if it's Webkit or Linux specific issue.
Comment 1 Dirk Fauth CLA 2017-07-06 14:28:10 EDT
The error "Unsupported major.minor version 52" means you need to execute the example using Java 8.
Comment 2 Leo Ufimtsev CLA 2017-07-06 16:22:16 EDT
(In reply to Dirk Fauth from comment #1)
> The error "Unsupported major.minor version 52" means you need to execute the
> example using Java 8.

Thank you for pointing this out. This works on Mac/Java8/SWT master. So it seems SWT/Linux/Webkit(1&2) is the only combo where it doesn't work.

From what I gather, some Javascript in 
template.html: 154: function initEditor() {
is triggering the exception. 

I don't know much about Nebula/RichTextEditor. Hmm: 
1) Do you have Linux to test this with? 
2) Any ideas what's causing this exception? Anyway to narrow this down to the specific javascript that's causing breakage?
Comment 3 Leo Ufimtsev CLA 2017-07-06 16:31:11 EDT
(I changed Target milestone because I thought I accidentally set the target milestone instead of version when I submitted. But if it's suppose to be 1.4.0, then so be it :-) )
Comment 4 Wim Jongman CLA 2017-07-06 16:33:33 EDT
(In reply to Leo Ufimtsev from comment #3)
> (I changed Target milestone because I thought I accidentally set the target
> milestone instead of version when I submitted. But if it's suppose to be
> 1.4.0, then so be it :-) )

Yes we are working against 1.4.0 so this is the target milestone. If we don't fix it we will move it but it should be set always.
Comment 5 Leo Ufimtsev CLA 2017-07-06 16:37:58 EDT
(In reply to Leo Ufimtsev from comment #2)
> (In reply to Dirk Fauth from comment #1)
> > The error "Unsupported major.minor version 52" means you need to execute the
> > example using Java 8.
> 
> Thank you for pointing this out. This works on Mac/Java8/SWT master. So it
> seems SWT/Linux/Webkit(1&2) is the only combo where it doesn't work.

Submitted:
Bug 519340 – org.eclipse.nebula.widgets.richtext.example doesn't launch on Cocoa due to java 1.7
Comment 6 Dirk Fauth CLA 2017-07-07 03:46:22 EDT
(In reply to Leo Ufimtsev from comment #2)
> Thank you for pointing this out. This works on Mac/Java8/SWT master. So it
> seems SWT/Linux/Webkit(1&2) is the only combo where it doesn't work.
> 
> From what I gather, some Javascript in 
> template.html: 154: function initEditor() {
> is triggering the exception. 
> 
> I don't know much about Nebula/RichTextEditor. Hmm: 
> 1) Do you have Linux to test this with? 
> 2) Any ideas what's causing this exception? Anyway to narrow this down to
> the specific javascript that's causing breakage?

1. No I don't have a Linux system to test
2. I have absolutely no idea why it works on Windows and Mac but not on Linux. What is done in the end is that the ckeditor is initialized, and the configuration is retrieved from a Java class. Unfortunately the error is not very speaking. Could be a typo or semantically issues that is not treated on Windows and Mac, could be also an issue with the Java-Javascript binding stuff in SWT Browser and BrowserFunctions.
Comment 7 Leo Ufimtsev CLA 2017-07-07 10:11:24 EDT
(In reply to Dirk Fauth from comment #6)
> 1. No I don't have a Linux system to test
> 2. I have absolutely no idea why it works on Windows and Mac but not on
> Linux. What is done in the end is that the ckeditor is initialized, and the
> configuration is retrieved from a Java class. Unfortunately the error is not
> very speaking. Could be a typo or semantically issues that is not treated on
> Windows and Mac, could be also an issue with the Java-Javascript binding
> stuff in SWT Browser and BrowserFunctions.

Hmmm. I'm not aware of anything broken in Swt/Webkit1 that could cause the issue (but who knows..).
On Swt/Webkit2 port, there is one thing that still needs doing:
Bug 510905 – [GTK3][Webkit2] Implement webkit2 support for browser function (Part 2: Java return a value from callback.)

But the old commit before regression (b67556dd99613332018ee8e56fe4434a9eae6733) worked on on Swt/Webkit2. So something in the update (4c8848af261711f5ccefadbb0a6b1a7fbf10efaf) doesn't work well on Webkit1/2.

Seems like I'd have to step through the javascript to find out the exact broken spot.
It might be some time before I can get to this. If a snippet of this is made available, it would help.
Comment 8 Leo Ufimtsev CLA 2018-01-30 17:56:15 EST
Fixed via https://git.eclipse.org/r/#/c/116384/