Bug 1405635: Test that custom content doesn't inherit from the root element. r=bholley

MozReview-Commit-ID: GvjsdQk5Wt4
This commit is contained in:
Emilio Cobos Álvarez 2017-10-05 01:40:48 +02:00
Родитель d58679a14d
Коммит d7ff7725af
2 изменённых файлов: 27 добавлений и 0 удалений

Просмотреть файл

@ -196,6 +196,7 @@ skip-if = toolkit == 'android' #bug 536603
[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]

Просмотреть файл

@ -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>