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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/inspector/elements/elements-linkify-attributes.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/elements/elements-linkify-attributes.html b/third_party/WebKit/LayoutTests/http/tests/inspector/elements/elements-linkify-attributes.html
index 57a79dc390bbefab3a8ac85b3eb8074208e9c5ba..a90644c8a24688c8442f1db43afedcce4b9fe41b 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/elements/elements-linkify-attributes.html
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/elements/elements-linkify-attributes.html
@@ -6,7 +6,7 @@
function test()
{
var i = 0;
- var last = 7;
+ var last = 14;
function check()
{
@@ -17,7 +17,19 @@ function test()
InspectorTest.selectNodeWithId("linkify-" + i, function()
{
var treeElement = InspectorTest.firstElementsTreeOutline().selectedTreeElement;
- InspectorTest.addResult(treeElement.title.outerHTML);
+
+ InspectorTest.addResult("\nRendered text: " + treeElement.title.textContent);
+
+ // Print the embedded links.
+ var links = treeElement.title.querySelectorAll(".devtools-link");
+ links.forEach(link => {
+ var offset = 0;
+ var node = treeElement.title;
+ while ((node = node.traverseNextTextNode(treeElement.title)) && !node.isSelfOrDescendant(link))
+ offset += node.textContent.length;
+ InspectorTest.addResult("Link at offset: " + offset + ": " + link.textContent);
+ });
+
check();
});
}
@@ -38,7 +50,14 @@ Tests that you can click and hover on links in attributes.
<source id="linkify-4" media="(min-width: 465px)" srcset="./kitten-medium.png">
<source id="linkify-5" media="(min-width: 400px)" srcset="./kitten-large.png 2x">
<img id="linkify-6" src="./kitten-small.png">
+ <img id="linkify-7" srcset="./kitten-medium.png, ./kitten-large.png 2x">
+ <img id="linkify-8" srcset="./kitten-medium.png 1x, ./kitten-large.png 2x">
+ <img id="linkify-9" srcset="./kitten-medium.png 1x,./kitten-large.png 2x">
+ <img id="linkify-10" srcset="data:,abc">
+ <img id="linkify-11" srcset="data:,abc 1x">
+ <img id="linkify-12" srcset="data:,abc 1x, data:,def 2x">
+ <img id="linkify-13" srcset="data:,abc 1x,data:,def 2x">
</picture>
-<a id="linkify-7" href="http://www.google.com">a link</a>
+<a id="linkify-14" href="http://www.google.com">a link</a>
</body>
</html>
« 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