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

Unified Diff: third_party/WebKit/LayoutTests/loader/image-loader-base.html

Issue 2105283002: <image>'s src URL is resolved incorrectly when <base> element dynamically added (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: <image>'s src URL is resolved incorrectly when <base> element dynamically added. Created 4 years, 5 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
Index: third_party/WebKit/LayoutTests/loader/image-loader-base.html
diff --git a/third_party/WebKit/LayoutTests/loader/image-loader-base.html b/third_party/WebKit/LayoutTests/loader/image-loader-base.html
new file mode 100644
index 0000000000000000000000000000000000000000..68e7e1fdcfda418199738f08f1cde6657de82f85
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/loader/image-loader-base.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>base element test </title>
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+function runTest() {
+ var image = document.getElementsByTagName('img')[1];
Yoav Weiss 2016/07/04 07:18:14 I'm assuming you're using natural{Width, Height} a
+ if (image.naturalHeight != 0 || image.naturalWidth != 0)
+ document.write('PASS');
+ else
+ document.write('FAIL: <base> is added after reference image is set. ');
+}
+</script>
+</head>
+<body onload="runTest()">
+Test for bugs.chromium.org #569760: <br/>
+ <div id="">
Yoav Weiss 2016/07/04 07:18:14 Why a div here?
+ <img id="img1" src=""><br>
Yoav Weiss 2016/07/04 07:18:14 Is the empty "src" part of the test? If not, can y
+ Reference<br>
Yoav Weiss 2016/07/04 07:18:14 Why is this indented?
+ <img id="ref" src=" ">
+ </div>
+<script>
+ document.getElementById('ref').src = 'resources/image1.png';
Yoav Weiss 2016/07/04 07:18:14 Inconsistent indentation. 4 spaces as indentation
+
+ var base = document.createElement("base");
+ base.setAttribute("href", "resources/");
+ document.head.appendChild(base);
+ document.getElementById('img1').src = 'image1.png';
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698