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

Bug 407988

Summary: Selection events with RWT.HYPERLINK detail may have incorrect text value
Product: [RT] RAP Reporter: Tim Buschtoens <tbuschto>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ken.lee, tbuschto
Version: 2.1   
Target Milestone: 2.1 RC1   
Hardware: All   
OS: All   
Whiteboard:

Description Tim Buschtoens CLA 2013-05-14 05:25:53 EDT
Using markup, <a> tags can be inserted into various widgets, which may be either treated as normal links, or be used to add a text value to Selection events. That value may be written into the "href" attribute. However, if the value starts with a protocol like "http://", it is truncated in the Selection event. 

This issue was introduced with commit acf5a6e10b0827b739f04f8212134d3c2b49ebfb, which was an attempt to fix another issue in IE. IE will rewrite any url in the "href" attribute to start with "http://" if it has no protocol, breaking values that *don't* start with a protocol. The commit just removes any protocol, ignoring the usecase of putting actual URLs in that attribute.

Simply reverting the commit would re-introduce the issue and is not an option. Somehow the browser must be prevented from re-writing the URL, either by using another attribute, or by modifying the URL itself.
Comment 1 Tim Buschtoens CLA 2013-05-14 08:05:48 EDT
We could revert commit acf5a6e10b0827b739f04f8212134d3c2b49ebfb, fix the javscript tests and document this quirk in the javadoc and developers guide, and possibly keep this bug open. We could also allow an additional attribute like "_rwt_href" to overwrite "href", or we could just duplicate all "href" attributes to such an attribute using regular expressions on the client.
Comment 2 Tim Buschtoens CLA 2013-05-16 11:03:38 EDT
Reverted commit acf5a6e10b0827b739f04f8212134d3c2b49ebfb with
commit 5eb8eb7b557edc117e207b722fc21a4e76d6e441. Also updated JavaDoc and fixed javaScript tests in commit 042f84e478d90b30053ff39dcae885e2ece01c0a. 

This means that the "href" attribute in markup hyperlinks is now once again only suited for URLs. If someone complains we can still implement the approach of supporting an additional attribute to overwrite the href value in the Selection event.