test/tools/javadoc/TestScriptInComment.java

changeset 3845
735048c9f2d6
parent 3315
6f0746b6de9f
equal deleted inserted replaced
3844:090e85a30eb6 3845:735048c9f2d6
23 * questions. 23 * questions.
24 */ 24 */
25 25
26 /** 26 /**
27 * @test 27 * @test
28 * @bug 8138725 28 * @bug 8138725 8226765
29 * @summary test --allow-script-in-comments 29 * @summary test --allow-script-in-comments
30 * @run main TestScriptInComment 30 * @run main TestScriptInComment
31 */ 31 */
32 32
33 import java.io.File; 33 import java.io.File;
63 LC("<script>#ALERT</script>", true), // script tag in Lower Case 63 LC("<script>#ALERT</script>", true), // script tag in Lower Case
64 UC("<SCRIPT>#ALERT</script>", true), // script tag in Upper Case 64 UC("<SCRIPT>#ALERT</script>", true), // script tag in Upper Case
65 WS("< script >#ALERT</script>", false, "-Xdoclint:none"), // script tag with invalid white space 65 WS("< script >#ALERT</script>", false, "-Xdoclint:none"), // script tag with invalid white space
66 SA("<script src=\"file\"> #ALERT </script>", true), // script tag with an attribute 66 SA("<script src=\"file\"> #ALERT </script>", true), // script tag with an attribute
67 ON("<a onclick='#ALERT'>x</a>", true), // event handler attribute 67 ON("<a onclick='#ALERT'>x</a>", true), // event handler attribute
68 OME("<img alt='1' onmouseenter='#ALERT'>", true), // onmouseenter event handler attribute
69 OML("<img alt='1' onmouseleave='#ALERT'>", true), // onmouseleave event handler attribute
70 OFI("<a href='#' onfocusin='#ALERT'>x</a>", true), // onfocusin event handler attribute
71 OBE("<a onbogusevent='#ALERT'>x</a>", true), // bogus/future event handler attribute
68 URI("<a href='javascript:#ALERT'>x</a>", true); // javadcript URI 72 URI("<a href='javascript:#ALERT'>x</a>", true); // javadcript URI
69 73
70 /** 74 /**
71 * Creates an HTML fragment to be injected into a template. 75 * Creates an HTML fragment to be injected into a template.
72 * @param text the HTML fragment to put into a doc comment or option. 76 * @param text the HTML fragment to put into a doc comment or option.

mercurial