提交 2211c22a 编写于 作者: B bpatel

8151921: Improved page resolution

Reviewed-by: jjg, ksrini
上级 b67a723d
...@@ -380,11 +380,12 @@ public class HtmlWriter { ...@@ -380,11 +380,12 @@ public class HtmlWriter {
HtmlTree script = new HtmlTree(HtmlTag.SCRIPT); HtmlTree script = new HtmlTree(HtmlTag.SCRIPT);
script.addAttr(HtmlAttr.TYPE, "text/javascript"); script.addAttr(HtmlAttr.TYPE, "text/javascript");
String scriptCode = DocletConstants.NL + String scriptCode = DocletConstants.NL +
" targetPage = \"\" + window.location.search;" + DocletConstants.NL + " tmpTargetPage = \"\" + window.location.search;" + DocletConstants.NL +
" if (targetPage != \"\" && targetPage != \"undefined\")" + DocletConstants.NL + " if (tmpTargetPage != \"\" && tmpTargetPage != \"undefined\")" + DocletConstants.NL +
" targetPage = targetPage.substring(1);" + DocletConstants.NL + " tmpTargetPage = tmpTargetPage.substring(1);" + DocletConstants.NL +
" if (targetPage.indexOf(\":\") != -1 || (targetPage != \"\" && !validURL(targetPage)))" + DocletConstants.NL + " if (tmpTargetPage.indexOf(\":\") != -1 || (tmpTargetPage != \"\" && !validURL(tmpTargetPage)))" + DocletConstants.NL +
" targetPage = \"undefined\";" + DocletConstants.NL + " tmpTargetPage = \"undefined\";" + DocletConstants.NL +
" targetPage = tmpTargetPage;" + DocletConstants.NL +
" function validURL(url) {" + DocletConstants.NL + " function validURL(url) {" + DocletConstants.NL +
" try {" + DocletConstants.NL + " try {" + DocletConstants.NL +
" url = decodeURIComponent(url);" + DocletConstants.NL + " url = decodeURIComponent(url);" + DocletConstants.NL +
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
/* /*
* @test * @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. * @summary Verify that the output has the right javascript.
* @author jamieh * @author jamieh
* @library ../lib/ * @library ../lib/
...@@ -50,11 +50,12 @@ public class TestJavascript extends JavadocTester { ...@@ -50,11 +50,12 @@ public class TestJavascript extends JavadocTester {
"<a href=\"index.html?TestJavascript.html\" target=\"_top\">Frames</a>"}, "<a href=\"index.html?TestJavascript.html\" target=\"_top\">Frames</a>"},
{BUG_ID + FS + "index.html", {BUG_ID + FS + "index.html",
"<script type=\"text/javascript\">" + NL + "<script type=\"text/javascript\">" + NL +
" targetPage = \"\" + window.location.search;" + NL + " tmpTargetPage = \"\" + window.location.search;" + NL +
" if (targetPage != \"\" && targetPage != \"undefined\")" + NL + " if (tmpTargetPage != \"\" && tmpTargetPage != \"undefined\")" + NL +
" targetPage = targetPage.substring(1);" + NL + " tmpTargetPage = tmpTargetPage.substring(1);" + NL +
" if (targetPage.indexOf(\":\") != -1 || (targetPage != \"\" && !validURL(targetPage)))" + NL + " if (tmpTargetPage.indexOf(\":\") != -1 || (tmpTargetPage != \"\" && !validURL(tmpTargetPage)))" + NL +
" targetPage = \"undefined\";" + NL + " tmpTargetPage = \"undefined\";" + NL +
" targetPage = tmpTargetPage;" + NL +
" function validURL(url) {" + NL + " function validURL(url) {" + NL +
" try {" + NL + " try {" + NL +
" url = decodeURIComponent(url);" + NL + " url = decodeURIComponent(url);" + NL +
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册