8151921: Improved page resolution

Reviewed-by: jjg, ksrini, ahgross
This commit is contained in:
Bhavesh Patel 2016-07-14 13:35:35 -07:00
parent d130403704
commit af3d6a8409
4 changed files with 26 additions and 22 deletions

View File

@ -353,11 +353,12 @@ public class HtmlWriter {
protected Content getFramesJavaScript() {
HtmlTree script = HtmlTree.SCRIPT();
String scriptCode = DocletConstants.NL +
" targetPage = \"\" + window.location.search;" + DocletConstants.NL +
" if (targetPage != \"\" && targetPage != \"undefined\")" + DocletConstants.NL +
" targetPage = targetPage.substring(1);" + DocletConstants.NL +
" if (targetPage.indexOf(\":\") != -1 || (targetPage != \"\" && !validURL(targetPage)))" + DocletConstants.NL +
" targetPage = \"undefined\";" + DocletConstants.NL +
" tmpTargetPage = \"\" + window.location.search;" + DocletConstants.NL +
" if (tmpTargetPage != \"\" && tmpTargetPage != \"undefined\")" + DocletConstants.NL +
" tmpTargetPage = tmpTargetPage.substring(1);" + DocletConstants.NL +
" if (tmpTargetPage.indexOf(\":\") != -1 || (tmpTargetPage != \"\" && !validURL(tmpTargetPage)))" + DocletConstants.NL +
" tmpTargetPage = \"undefined\";" + DocletConstants.NL +
" targetPage = tmpTargetPage;" + DocletConstants.NL +
" function validURL(url) {" + DocletConstants.NL +
" try {" + DocletConstants.NL +
" url = decodeURIComponent(url);" + DocletConstants.NL +

View File

@ -234,11 +234,12 @@ public class HtmlWriter {
protected Content getFramesJavaScript() {
HtmlTree scriptTree = HtmlTree.SCRIPT();
String scriptCode = "\n" +
" targetPage = \"\" + window.location.search;\n" +
" if (targetPage != \"\" && targetPage != \"undefined\")\n" +
" targetPage = targetPage.substring(1);\n" +
" if (targetPage.indexOf(\":\") != -1 || (targetPage != \"\" && !validURL(targetPage)))\n" +
" targetPage = \"undefined\";\n" +
" tmpTargetPage = \"\" + window.location.search;\n" +
" if (tmpTargetPage != \"\" && tmpTargetPage != \"undefined\")\n" +
" tmpTargetPage = tmpTargetPage.substring(1);\n" +
" if (tmpTargetPage.indexOf(\":\") != -1 || (tmpTargetPage != \"\" && !validURL(tmpTargetPage)))\n" +
" tmpTargetPage = \"undefined\";\n" +
" targetPage = tmpTargetPage;\n" +
" function validURL(url) {\n" +
" try {\n" +
" url = decodeURIComponent(url);\n" +

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 4665566 4855876 7025314 8012375 8015997 8016328 8024756
* @bug 4665566 4855876 7025314 8012375 8015997 8016328 8024756 8151921
* @summary Verify that the output has the right javascript.
* @author jamieh
* @library ../lib
@ -54,11 +54,12 @@ public class TestJavascript extends JavadocTester {
checkOutput("index.html", true,
"<script type=\"text/javascript\">\n"
+ " targetPage = \"\" + window.location.search;\n"
+ " if (targetPage != \"\" && targetPage != \"undefined\")\n"
+ " targetPage = targetPage.substring(1);\n"
+ " if (targetPage.indexOf(\":\") != -1 || (targetPage != \"\" && !validURL(targetPage)))\n"
+ " targetPage = \"undefined\";\n"
+ " tmpTargetPage = \"\" + window.location.search;\n"
+ " if (tmpTargetPage != \"\" && tmpTargetPage != \"undefined\")\n"
+ " tmpTargetPage = tmpTargetPage.substring(1);\n"
+ " if (tmpTargetPage.indexOf(\":\") != -1 || (tmpTargetPage != \"\" && !validURL(tmpTargetPage)))\n"
+ " tmpTargetPage = \"undefined\";\n"
+ " targetPage = tmpTargetPage;\n"
+ " function validURL(url) {\n"
+ " try {\n"
+ " url = decodeURIComponent(url);\n"

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 4665566 4855876 7025314 8012375 8015997 8016328 8024756 8148985
* @bug 4665566 4855876 7025314 8012375 8015997 8016328 8024756 8148985 8151921
* @summary Verify that the output has the right javascript.
* @author jamieh
* @library ../lib
@ -54,11 +54,12 @@ public class TestJavascript extends JavadocTester {
checkOutput("index.html", true,
"<script type=\"text/javascript\">\n"
+ " targetPage = \"\" + window.location.search;\n"
+ " if (targetPage != \"\" && targetPage != \"undefined\")\n"
+ " targetPage = targetPage.substring(1);\n"
+ " if (targetPage.indexOf(\":\") != -1 || (targetPage != \"\" && !validURL(targetPage)))\n"
+ " targetPage = \"undefined\";\n"
+ " tmpTargetPage = \"\" + window.location.search;\n"
+ " if (tmpTargetPage != \"\" && tmpTargetPage != \"undefined\")\n"
+ " tmpTargetPage = tmpTargetPage.substring(1);\n"
+ " if (tmpTargetPage.indexOf(\":\") != -1 || (tmpTargetPage != \"\" && !validURL(tmpTargetPage)))\n"
+ " tmpTargetPage = \"undefined\";\n"
+ " targetPage = tmpTargetPage;\n"
+ " function validURL(url) {\n"
+ " try {\n"
+ " url = decodeURIComponent(url);\n"