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

8151921: Improved page resolution

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