Bug 1405635: Test that custom content doesn't inherit from the root element. r=bholley
☠☠ backed out by eaa0d99df029 ☠ ☠
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 05 Oct 2017 01:40:48 +0200
changeset 384827 1df4622b548bade48b18d2b9f2cbf7aa2de1bc63
parent 384826 85888997be8808a46742dbbc6b9bf7d71cdcf49c
child 384828 64fe29d5b248fcf253dea7d55b3862c7acc6c220
push id95880
push userarchaeopteryx@coole-files.de
push dateSat, 07 Oct 2017 08:58:44 +0000
treeherdermozilla-inbound@156942799371 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1405635
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1405635: Test that custom content doesn't inherit from the root element. r=bholley MozReview-Commit-ID: GvjsdQk5Wt4
layout/style/test/mochitest.ini
layout/style/test/test_custom_content_inheritance.html
--- a/layout/style/test/mochitest.ini
+++ b/layout/style/test/mochitest.ini
@@ -191,16 +191,17 @@ support-files = file_bug1381233.html
 skip-if = toolkit == 'android' #bug 536603
 [test_css_eof_handling.html]
 [test_css_escape_api.html]
 [test_css_function_mismatched_parenthesis.html]
 [test_css_loader_crossorigin_data_url.html]
 [test_css_parse_error_smoketest.html]
 [test_css_supports.html]
 [test_css_supports_variables.html]
+[test_custom_content_inheritance.html]
 [test_default_bidi_css.html]
 [test_default_computed_style.html]
 [test_descriptor_storage.html]
 [test_descriptor_syntax_errors.html]
 [test_dont_use_document_colors.html]
 [test_dynamic_change_causing_reflow.html]
 [test_exposed_prop_accessors.html]
 [test_extra_inherit_initial.html]
new file mode 100644
--- /dev/null
+++ b/layout/style/test/test_custom_content_inheritance.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<title>Test for custom content inheritance</title>
+<style>
+  html { color: red !important; }
+</style>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<script>
+onload = function() {
+  try {
+    let doc = SpecialPowers.wrap(document);
+    let div = doc.createElement('div');
+    div.id = "test-id";
+    ok(!!doc.insertAnonymousContent,
+       "Must have the insertAnonymousContent API");
+    let content = doc.insertAnonymousContent(div);
+    ok(!!content, "Must have anon content");
+    isnot(content.getComputedStylePropertyValue("test-id", "color"),
+          getComputedStyle(document.documentElement).color,
+          "Custom anon content shouldn't inherit from the root element");
+  } catch(e) {
+    ok(false, "Threw: " + e);
+  }
+  SimpleTest.finish();
+};
+SimpleTest.waitForExplicitFinish();
+</script>