8151921: Improved page resolution
authorbpatel
Thu, 14 Jul 2016 13:35:35 -0700
changeset 41630 9cc5bcc88057
parent 41629 9d203cde7d84
child 41631 a348d1cc8d9d
8151921: Improved page resolution Reviewed-by: jjg, ksrini, ahgross
langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java
langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java
langtools/test/jdk/javadoc/doclet/testJavascript/TestJavascript.java
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Wed Mar 02 18:25:01 2016 -0500
+++ b/langtools/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/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java	Wed Mar 02 18:25:01 2016 -0500
+++ b/langtools/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/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java	Wed Mar 02 18:25:01 2016 -0500
+++ b/langtools/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/langtools/test/jdk/javadoc/doclet/testJavascript/TestJavascript.java	Wed Mar 02 18:25:01 2016 -0500
+++ b/langtools/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"