-
Notifications
You must be signed in to change notification settings - Fork 182
Closed
Labels
Linux/GTKHappens on LinuxHappens on LinuxWebkitbugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is neededjunitJUnit test failureJUnit test failureregressionSomething that used to workSomething that used to work
Description
The problem
It is not possible to open a child browser with newer versions of WebKit.
How to reproduce
The problem can be reproduced in Ubuntu 24.04 (tested using WSL2) with WebKit 2.46
- Install the proper version of WebKit with this command:
VERSION=2.46.3-0ubuntu0.24.04.1 && sudo apt-get install libwebkitgtk-6.0-4=${VERSION} libjavascriptcoregtk-6.0-1=${VERSION}
- Run this snippet:
Snippet
public class OpenChildBrowser {
public static void main(String[] args) {
Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
final Browser browser = new Browser(shell, SWT.NONE);
Shell childShell = new Shell(shell, SWT.None);
childShell.setText("Child shell");
childShell.setLayout(new FillLayout());
final Browser browserChild = new Browser(childShell, SWT.NONE);
browser.addOpenWindowListener(event -> {
System.out.println("Open Window Listener");
event.browser = browserChild;
});
browserChild.addVisibilityWindowListener(VisibilityWindowListener.showAdapter(event -> {
System.out.println("Open shell");
childShell.open();
browserChild.setText("Child Browser");
}));
shell.open();
browser.setText("""
<html>
<script type='text/javascript'>
var newWin = window.open('about:blank');
</script>
<body>
This test uses javascript to open a new window.
</body>
</html>
""");
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
Expected result
A child window should be opened
Actual result
No child window is opened
Reverting back to a working version of WebKit
Version 2.44 of WebKit didn't have this problem. You can revert back to that version by running this command:
VERSION=2.44.0-2 && sudo apt-get install libwebkit2gtk-4.1-0=${VERSION} libjavascriptcoregtk-4.1-0=${VERSION}
Original issue: failing tests
These 3 tests fail on Linux. I noticed in this run of #1496 and I was also able to reproduce it locally using WSL2:
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_browser_Browser.test_OpenWindowListener_open_ChildPopup()
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_browser_Browser.test_OpenWindow_Progress_Listener_ValidateEventOrder()
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_browser_Browser.test_VisibilityWindowListener_eventSize()
It seems to be some issue with JavaScript (just my guess), here are some screenshots (WSL2):
All 3 tests timed out.
Metadata
Metadata
Assignees
Labels
Linux/GTKHappens on LinuxHappens on LinuxWebkitbugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is neededjunitJUnit test failureJUnit test failureregressionSomething that used to workSomething that used to work