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: LayoutTests/fast/html/imports/import-readd-order-2.html

Issue 331763002: HTML Imports: styles in removed imports should be applied when it comes back (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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: LayoutTests/fast/html/imports/import-readd-order-2.html
diff --git a/LayoutTests/fast/html/imports/import-readd-order-2.html b/LayoutTests/fast/html/imports/import-readd-order-2.html
new file mode 100644
index 0000000000000000000000000000000000000000..3c93f9dea0cea6d0e6a6c90122945cfd216f4dd3
--- /dev/null
+++ b/LayoutTests/fast/html/imports/import-readd-order-2.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<link rel=import id=redImport href="./resources/style-red.html">
+<link rel=import id=blueImport href="./resources/style-blue.html">
+</head>
+<body>
+<h1 class="target">Should be red</h1>
+<script>
+var t = async_test('Styles are re-applied in correct ordder after removed imports are re-added in new place');
+window.onload = function() {
+ t.step(function() {
+ assert_equals(window.getComputedStyle(document.querySelector('.target')).color, 'rgb(0, 0, 255)');
+ var importLink = document.querySelector('#blueImport');
+ document.head.removeChild(importLink);
+ document.head.insertBefore(importLink, document.head.lastElementChild);
+ assert_equals(window.getComputedStyle(document.querySelector('.target')).color, 'rgb(255, 0, 0)');
+ Array.prototype.forEach.call(document.querySelectorAll("h1"), function(e) { e.style.display = "none"; });
+ t.done();
+ });
+}
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698