2 <title>Test that @font-face rules from different origins cascade correctly
</title>
3 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
4 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css">
6 let io
= SpecialPowers
.Cc
["@mozilla.org/network/io-service;1"]
7 .getService(SpecialPowers
.Ci
.nsIIOService
);
9 let utils
= SpecialPowers
.getDOMWindowUtils(window
);
11 function load_sheet(sheet_text
, level
) {
12 if (level
!= "AGENT_SHEET" && level
!= "USER_SHEET" && level
!= "AUTHOR_SHEET") {
13 throw "unknown level";
16 let uri
= io
.newURI("data:text/css," + encodeURI(sheet_text
));
17 utils
.loadSheet(uri
, utils
[level
]);
21 "@font-face { font-family: TestAgent; src: url(about:invalid); }",
25 "@font-face { font-family: TestAuthor; src: url(about:invalid); }",
29 "@font-face { font-family: TestUser; src: url(about:invalid); }",
32 is([...document
.fonts
].map(f
=> f
.family
).join(" "),
34 "document.fonts only contains author @font-face rules");