<Swing Dev> [11] RFR JDK-8199900:JEditorPane scrollToReference should support html5

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Thu Mar 22 10:12:08 UTC 2018


Hi All,

It needs to be noted that html <a name> tag is obsolete in html5  as per 
https://www.w3.org/TR/2011/WD-html-markup-20110405/a.html#a.attrs.name
and so we should use "id" attribute instead in 
JEditorPane.scrollToReference to conform to html5 specification.
As per https://www.w3schools.com/tags/att_global_id.asp, In HTML5, the 
id attribute can be used on *any* HTML element .

So, the proposed fix is to also check for "id" attribute to scroll to 
reference and not just rely on "name" attribute.

Bug: https://bugs.openjdk.java.net/browse/JDK-8199900
webrev: http://cr.openjdk.java.net/~psadhukhan/8199900/webrev.00/

Not sure of how to approach for a testcase for this html5 addition. 
However, existing JEditorPane jtreg tests passed.

Regards
Prasanta

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20180322/168c354f/attachment.html>


More information about the swing-dev mailing list