Bug 1339629 Part 17: Add mochitests to test that css rules are distinct after stylesheet cloning.
MozReview-Commit-ID: FsT1rft6Mjw
--- 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>