Bug 579257 - Eclipse browser cannot open a link with target="new"

When creating a WebKit browser view in a new Shell, due to following a
link with property target="new", WebKit expects to be given a "related"
browser. Otherwise the "ready-to-show" signal is not emitted for the new
browser view.

Changes for bug 570379 already introduce code that attempts to call
webkit_web_view_new_with_related_view() in the case of creating a
browser view during the "create" signal of another browser. However, the
changes do not address widget hierarchies more complex than a Shell as a
direct parent of a Browser.

This change adds a static field
org.eclipse.swt.browser.WebKit.parentBrowser, which is set during
propagation of the "create" signal for a WebKit browser view (i.e.
during org.eclipse.swt.browser.WebKit.webkit_create_web_view()). The new
field is then used if a new WebKit Browser is created during the
"create" signal, while notifying any registered OpenWindowListener.

This change does not help in cases where the new window browser is not
created during a OpenWindowListener notification (i.e. during the
"create" WebKit signal).

Change-Id: I4a3d550549485a060e1db456087e5325451f39c8
Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/191941
Tested-by: Andrey Loskutov <loskutov@gmx.de>
Reviewed-by: Andrey Loskutov <loskutov@gmx.de>
4 files changed
tree: b5b28455af6adc6e275b0098a88e802fca3da89b
  1. bundles/
  2. container/
  3. examples/
  4. features/
  5. local-build/
  6. tests/
  7. .gitattributes
  8. .gitignore
  9. CONTRIBUTING
  10. Jenkinsfile
  11. LICENSE
  12. NOTICE
  13. pom.xml
  14. README.md
README.md

Contributing to SWT

Thanks for your interest in this project.

Developer resources:

See the following description for how to contribute a feature or a bug fix to SWT.

Information regarding source code management, builds, coding standards, and more and be found under the following link.

Contributor License Agreement:

Before your contribution can be accepted by the project, you need to create and electronically sign the Eclipse Foundation Contributor License Agreement (CLA).

Contact:

Contact the project developers via the project's “dev” list.

Search for bugs:

This project uses Bugzilla to track ongoing development and issues.

Create a new bug:

Be sure to search for existing bugs before you create another one. Remember that contributions are always welcome!