RFR: 8012675: Javadoc for javax.swing.text.html.parser.Parser.handleComment() needs to be updated

DamonGuy duke at openjdk.java.net
Thu May 19 01:55:41 UTC 2022


On Fri, 11 Feb 2022 19:20:16 GMT, DamonGuy <duke at openjdk.java.net> wrote:

> Updated Parser class doc by appending to the doc regarding lack of support for HTML script tags. Adding this information to the "parse" function did not seem as consistent for formatting as adding it to the Parser class doc.

I still believe HTML script tags aren't supported for rendering in Java's Parser. 

I have made a new local test. This test generates an HTML file that has an alert function within HTML script tags. An input button calls this alert function and generates a pop-up alert, and this works when the HTML file is opened in a browser.

When I open the same HTML file in a JEditorPane, the script tag itself is displayed along with its contents. The script tag is displayed in a directional text input field and its contents are within these boxes. 

<img width="582" alt="Screen Shot 2022-05-18 at 6 49 22 PM" src="https://user-images.githubusercontent.com/96267980/169186428-098ba614-42cc-4ce5-a323-7bbced8993f2.png">

I looked into TagElement and HTML.java and "SCRIPT" is shown in the list of known tags, so that means "SCRIPT" is not labeled as an "Unknown tag" by the parser, which I confirmed in testing.

I also looked into the strict flag, which enforces SGML compatibility, in Parser as @jayathirthrao suggested. With the flag set to true, the output to JEditorPane remains the same, but with no error logged. The normal sequence continues and the strict flag seems to mostly be associated with syntax issues such as extra spacing.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7446



More information about the client-libs-dev mailing list