Bug 1339629 Part 17: Add mochitests to test that css rules are distinct after stylesheet cloning. draft
authorBrad Werth <bwerth@mozilla.com>
Wed, 24 May 2017 12:11:22 -0700
changeset 584211 eaed47d528b37fbac0dff59c7b333c465ef5df9a
parent 584210 ec07a12227d2a5a14576e7629031d6d592d5f334
child 630296 527fb81f1c617ff231e058cea2a53ac4a854a0d1
push id60647
push userbwerth@mozilla.com
push dateThu, 25 May 2017 00:33:14 +0000
bugs1339629
milestone55.0a1
Bug 1339629 Part 17: Add mochitests to test that css rules are distinct after stylesheet cloning. MozReview-Commit-ID: FsT1rft6Mjw
layout/style/test/mochitest.ini
layout/style/test/test_stylesheet_clone_font_face.html
--- a/layout/style/test/mochitest.ini
+++ b/layout/style/test/mochitest.ini
@@ -267,16 +267,18 @@ skip-if = toolkit == 'android' #bug 7752
 [test_selectors_on_anonymous_content.html]
 [test_setPropertyWithNull.html]
 [test_shorthand_property_getters.html]
 [test_specified_value_serialization.html]
 [test_style_attr_listener.html]
 [test_style_attribute_quirks.html]
 [test_style_attribute_standards.html]
 [test_style_struct_copy_constructors.html]
+[test_stylesheet_clone_font_face.html]
+skip-if = stylo # bug 1367523
 [test_supports_rules.html]
 [test_system_font_serialization.html]
 [test_text_decoration_shorthands.html]
 [test_transitions_and_reframes.html]
 [test_transitions_and_restyles.html]
 [test_transitions_and_zoom.html]
 [test_transitions_cancel_near_end.html]
 [test_transitions_computed_values.html]
new file mode 100644
--- /dev/null
+++ b/layout/style/test/test_stylesheet_clone_font_face.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<link rel="stylesheet" href="data:text/css,@font-face { font-family: 'MarkA'; src: url(../fonts/markA.ttf); }">
+<link rel="stylesheet" href="data:text/css,@font-face { font-family: 'MarkA'; src: url(../fonts/markA.ttf); }">
+
+<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+<style>
+  body { font-family: "MarkA"; }
+</style>
+<div>ABC</div>
+<script>
+  function runTest() {
+    var links = document.getElementsByTagName("link");
+    links[0].sheet.cssRules[0].style.src = "../fonts/markB.ttf";
+
+    // Test that the cloned sheet is unaffected.
+    isnot(links[1].sheet.cssRules[0].style.src, "../fonts/markB.ttf", "Cloned sheet left unchanged.");
+
+    SimpleTest.finish();
+  }
+
+  SimpleTest.waitForExplicitFinish();
+  runTest();
+</script>
+</html>