changeset 3711:69db08651f8f

8151921: Improved page resolution Reviewed-by: jjg, ksrini, ahgross
author bpatel
date Thu, 14 Jul 2016 13:35:35 -0700
parents 3fc90eaaf922
children d02323f750f6
files src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java test/com/sun/javadoc/testJavascript/TestJavascript.java test/jdk/javadoc/doclet/testJavascript/TestJavascript.java
diffstat 4 files changed, 26 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Wed Mar 02 18:25:01 2016 -0500
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Thu Jul 14 13:35:35 2016 -0700
@@ -353,11 +353,12 @@
     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 +
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java	Wed Mar 02 18:25:01 2016 -0500
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java	Thu Jul 14 13:35:35 2016 -0700
@@ -234,11 +234,12 @@
     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" +
--- a/test/com/sun/javadoc/testJavascript/TestJavascript.java	Wed Mar 02 18:25:01 2016 -0500
+++ b/test/com/sun/javadoc/testJavascript/TestJavascript.java	Thu Jul 14 13:35:35 2016 -0700
@@ -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 @@
 
         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"
--- a/test/jdk/javadoc/doclet/testJavascript/TestJavascript.java	Wed Mar 02 18:25:01 2016 -0500
+++ b/test/jdk/javadoc/doclet/testJavascript/TestJavascript.java	Thu Jul 14 13:35:35 2016 -0700
@@ -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 @@
 
         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"