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

Bug 306209

Summary: [Browser Widget] Java-Javascript Bridge does not work with SVG documents
Product: [RT] RAP Reporter: Mat Booth <mat.booth>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED NOT_ECLIPSE QA Contact:
Severity: major    
Priority: P3    
Version: 1.3   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
RCP/RAP Single-Sourced Sample Application
none
Screenshot of the problem none

Description Mat Booth CLA 2010-03-17 11:08:34 EDT
Using RAP 1.3.0.20100201-1240 on Eclipse 3.5.1

When using the Browser widget, I cannot call any Java methods from Javascript embedded in SVG documents.

This works perfectly in the RCP Browser widget, and works perfectly in RAP Browser widget plus HTML pages, but not RAP Browser widget plus SVG pages.

Please see the attached screenshot and sample single-sourced RCP/RAP program demonstrating the problem. (Clicking on the SVG map should use the Java/Javascript bridge to set the workbench status line text.)
Comment 1 Mat Booth CLA 2010-03-17 11:11:24 EDT
Created attachment 162299 [details]
RCP/RAP Single-Sourced Sample Application

Run this application on RCP to see correct behaviour.
Run this application on RAP to see the problem.
Comment 2 Mat Booth CLA 2010-03-17 11:43:39 EDT
Created attachment 162309 [details]
Screenshot of the problem

As you can see, the RAP application on the left, throws an exception saying the function is not defined, but the RCP application on the right works correctly.
Comment 3 Ivan Furnadjiev CLA 2010-03-18 17:37:17 EDT
I've just took a look at your screen-shot attached to the bug. It seems that the RAP application is starter from localhost (127.0.0.1), but the page with SVG in the Browser widget is from different domain ( www.matbooth.co.uk). Due to browser security restrictions, it is not possible to register a javascript function in a page, located in a different domain than the RAP application. This is a limitation of BrowserFunction support, but we can't do anything about it - browser security policies.