Index: LayoutTests/http/tests/htmlimports/import-dup-custom-element.html |
diff --git a/LayoutTests/http/tests/htmlimports/import-dup-custom-element.html b/LayoutTests/http/tests/htmlimports/import-dup-custom-element.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c956639bec201335651a471efe6f4805585e736f |
--- /dev/null |
+++ b/LayoutTests/http/tests/htmlimports/import-dup-custom-element.html |
@@ -0,0 +1,48 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src="../../../resources/testharness.js"></script> |
+<script src="../../../resources/testharnessreport.js"></script> |
+<script> |
+var records = []; |
+ |
+function addRecord(str) |
+{ |
+ console.log(str); |
+ records.push(str); |
+} |
+ |
+function recordElement(element) |
+{ |
+ addRecord(element.tagName + ":" + element.id); |
+} |
+</script> |
+<my-custom id="using-toplevel-1"></my-custom> |
+<!-- |
+ |using-custom-element-1.html| reaches |def-custom-element.html| with one indirection |
+ while |using-custom-element-2.html| imports it directly. |
+ So |using-custom-element-2.html| triggers importing |def-custom-element.html| and |
+ |using-custom-element-1.html| finds it and de-dups later. |
+ --> |
+<link rel="import" href="resources/using-custom-element-1.html"> |
+<link rel="import" href="resources/using-custom-element-2.html"> |
+<my-custom id="using-toplevel-2"></my-custom> |
+</head> |
+<body> |
+<script> |
+test(function () { |
+ assert_array_equals(records, ['MY-CUSTOM:using-toplevel-1', |
+ 'MY-CUSTOM:using-1-before', |
+ 'MY-CUSTOM:pointing-before', |
+ 'MY-CUSTOM:def-before', |
+ 'MY-CUSTOM:def-after', |
+ 'MY-CUSTOM:pointing-after', |
+ 'MY-CUSTOM:using-1-after', |
+ 'MY-CUSTOM:using-2-before', |
+ 'MY-CUSTOM:using-2-after', |
+ 'MY-CUSTOM:using-toplevel-2'], |
+ 'Custom Element invocations preserve tree order across imports'); |
+}, 'Custom Element invocations preserve tree order across imports regardless the loading order.'); |
+</script> |
+</body> |
+</html> |