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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/htmlimports/import-innerHTML-blocked.html

Issue 1670203002: Block HTML Imports from loading when inserted via innerHTML. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/http/tests/htmlimports/import-innerHTML-blocked.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/htmlimports/import-innerHTML-blocked.html b/third_party/WebKit/LayoutTests/http/tests/htmlimports/import-innerHTML-blocked.html
new file mode 100644
index 0000000000000000000000000000000000000000..260b91ec212ba596fb0993d00e8c530c20711857
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/htmlimports/import-innerHTML-blocked.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+</head>
+<body>
+ <div></div>
+<script>
+ document.querySelector('div').innerHTML = "<link rel='import' id='innerLink' href='resources/hello.html'>";
+</script>
+<link id="followingLink" rel="import" href="resources/hello.html">
+<script>
+test(function() {
+ assert_true(null == innerLink.import, 'Import via innerHTML');
kouhei (in TOK) 2016/02/08 01:00:31 ===?
+ assert_true(null != followingLink.import, 'Following import loaded');
kouhei (in TOK) 2016/02/08 01:00:31 !==?
+}, 'Block imports via innerHTML.');
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698