Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(471)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/elements/elements-linkify-attributes.html

Issue 2871593003: DevTools: correctly parse srcset attribute before linkifying urls (Closed)
Patch Set: ac Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/elements/elements-linkify-attributes-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../inspector-test.js"></script> 3 <script src="../inspector-test.js"></script>
4 <script src="../elements-test.js"></script> 4 <script src="../elements-test.js"></script>
5 <script> 5 <script>
6 function test() 6 function test()
7 { 7 {
8 var i = 0; 8 var i = 0;
9 var last = 7; 9 var last = 14;
10 10
11 function check() 11 function check()
12 { 12 {
13 i++; 13 i++;
14 if (i > last) 14 if (i > last)
15 return InspectorTest.completeTest(); 15 return InspectorTest.completeTest();
16 16
17 InspectorTest.selectNodeWithId("linkify-" + i, function() 17 InspectorTest.selectNodeWithId("linkify-" + i, function()
18 { 18 {
19 var treeElement = InspectorTest.firstElementsTreeOutline().selectedT reeElement; 19 var treeElement = InspectorTest.firstElementsTreeOutline().selectedT reeElement;
20 InspectorTest.addResult(treeElement.title.outerHTML); 20
21 InspectorTest.addResult("\nRendered text: " + treeElement.title.text Content);
22
23 // Print the embedded links.
24 var links = treeElement.title.querySelectorAll(".devtools-link");
25 links.forEach(link => {
26 var offset = 0;
27 var node = treeElement.title;
28 while ((node = node.traverseNextTextNode(treeElement.title)) && !node.isSelfOrDescendant(link))
29 offset += node.textContent.length;
30 InspectorTest.addResult("Link at offset: " + offset + ": " + lin k.textContent);
31 });
32
21 check(); 33 check();
22 }); 34 });
23 } 35 }
24 check(); 36 check();
25 } 37 }
26 38
27 </script> 39 </script>
28 </head> 40 </head>
29 41
30 <body onload="runTest()"> 42 <body onload="runTest()">
31 <p> 43 <p>
32 Tests that you can click and hover on links in attributes. 44 Tests that you can click and hover on links in attributes.
33 </p> 45 </p>
34 <img id="linkify-1" srcset="./1x/googlelogo_color_272x92dp.png 1x, ./2x/googlelo go_color_272x92dp.png 2x"> 46 <img id="linkify-1" srcset="./1x/googlelogo_color_272x92dp.png 1x, ./2x/googlelo go_color_272x92dp.png 2x">
35 <img id="linkify-2" srcset="./1x/googlelogo_color_272x92dp.png"> 47 <img id="linkify-2" srcset="./1x/googlelogo_color_272x92dp.png">
36 <picture> 48 <picture>
37 <source id="linkify-3" media="(min-width: 650px)" srcset="./kitten-large.png "> 49 <source id="linkify-3" media="(min-width: 650px)" srcset="./kitten-large.png ">
38 <source id="linkify-4" media="(min-width: 465px)" srcset="./kitten-medium.pn g"> 50 <source id="linkify-4" media="(min-width: 465px)" srcset="./kitten-medium.pn g">
39 <source id="linkify-5" media="(min-width: 400px)" srcset="./kitten-large.png 2x"> 51 <source id="linkify-5" media="(min-width: 400px)" srcset="./kitten-large.png 2x">
40 <img id="linkify-6" src="./kitten-small.png"> 52 <img id="linkify-6" src="./kitten-small.png">
53 <img id="linkify-7" srcset="./kitten-medium.png, ./kitten-large.png 2x">
54 <img id="linkify-8" srcset="./kitten-medium.png 1x, ./kitten-large.png 2x">
55 <img id="linkify-9" srcset="./kitten-medium.png 1x,./kitten-large.png 2x">
56 <img id="linkify-10" srcset="data:,abc">
57 <img id="linkify-11" srcset="data:,abc 1x">
58 <img id="linkify-12" srcset="data:,abc 1x, data:,def 2x">
59 <img id="linkify-13" srcset="data:,abc 1x,data:,def 2x">
41 </picture> 60 </picture>
42 <a id="linkify-7" href="http://www.google.com">a link</a> 61 <a id="linkify-14" href="http://www.google.com">a link</a>
43 </body> 62 </body>
44 </html> 63 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/elements/elements-linkify-attributes-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698