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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-base-element/base_href_data.html

Issue 2685843003: 'data:' may not be used as a document's base URL. (Closed)
Patch Set: Tests. Created 3 years, 10 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/external/wpt/html/semantics/document-metadata/the-base-element/base_href_data.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-base-element/base_href_data.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-base-element/base_href_data.html
new file mode 100644
index 0000000000000000000000000000000000000000..5bc1c8d4bf2569037d77f6280ed0fa72c74ba5e8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-base-element/base_href_data.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<head>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/get-host-info.sub.js"></script>
+
+ <base href="data:/,This is a data URL.">
+</head>
+<body>
+ <script>
+ async_test(t => {
+ var base = document.querySelector('base');
+ var img = new Image();
+ img.onload = t.step_func_done(_ => {
+ assert_equals(img.naturalWidth, 256, "Image loaded correctly.");
+ assert_equals(img.src, get_host_info().HTTP_ORIGIN + "/images/green-256x256.png");
+ assert_equals(base.href, 'data:/,This is a data URL.');
+ });
+ img.onerror = t.unreached_func("Image should have loaded.");
+
+ img.src = "/images/green-256x256.png";
+ }, "'data:' is an invalid base URL.");
+ </script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698