1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4 <link rel=
"stylesheet" src=
"/bogusSheet1.css">
5 <link rel=
"stylesheet" src=
"bogusSheet2.css">
6 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
7 <script src=
"../../http/tests/inspector/elements-test.js"></script>
12 InspectorTest
.expandElementsTree(step1
);
16 var innerMapping
= InspectorTest
.domModel
._idToDOMNode
;
18 for (var nodeId
in innerMapping
) {
19 var node
= innerMapping
[nodeId
];
20 if (node
.nodeName() === "LINK" || node
.nodeName() === "SCRIPT") {
22 var href
= node
.resolveURL(node
.getAttribute("src") || node
.getAttribute("href"));
24 segments
.push("<empty>");
27 if (href
.startsWith("http:")) {
28 InspectorTest
.addResult(href
);
31 var parsedURL
= href
.asParsedURL();
33 testController
.notifyDone("FAIL: no URL match for <" + href
+ ">");
34 var split
= parsedURL
.path
.split("/");
35 for (var i
= split
.length
- 1, j
= 0; j
< 3 && i
>= 0; --i
, ++j
)
36 segments
.push(split
[i
]);
37 InspectorTest
.addResult(segments
.reverse());
39 if (node
.nodeName() === "A")
40 InspectorTest
.addResult(node
.resolveURL(node
.getAttribute("href")));
42 InspectorTest
.completeTest();
51 Tests that src and href element targets are rewritten properly.
54 <a style=
"display:none" href=
" javascript:alert('foo') "></a>
55 <iframe src=
"resources/elements-panel-rewrite-href-iframe.html" onload=
"runTest()"></iframe>