Bug 1839315: part 4) Link from `SheetLoadData::mWasAlternate` to spec. r=emilio DONTBUILD
[gecko.git] / layout / style / test / test_bug892929.html
bloba67db56ee32f3a21ce949653631ce9a412ab5573
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <meta charset=utf-8>
5 <title>Bug 892929 test</title>
6 <link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com">
7 <link rel="help" href="http://www.w3.org/TR/css-fonts-3/#om-fontfeaturevalues" />
8 <meta name="assert" content="window.CSSFontFeatureValuesRule should appear by default" />
9 <script type="text/javascript" src="/resources/testharness.js"></script>
10 <script type="text/javascript" src="/resources/testharnessreport.js"></script>
11 <style type="text/css">
12 </style>
13 </head>
14 <body>
15 <div id="log"></div>
16 <pre id="display"></pre>
18 <script type="text/javascript">
20 function testCSSFontFeatureValuesRuleOM() {
21 var s = document.documentElement.style;
22 var cs = window.getComputedStyle(document.documentElement);
24 var hasFFVRule = "CSSFontFeatureValuesRule" in window;
25 var hasStyleAlternates = "fontVariantAlternates" in s;
26 var hasCompStyleAlternates = "fontVariantAlternates" in cs;
28 test(function() {
29 assert_equals(hasFFVRule,
30 hasStyleAlternates,
31 "style.fontVariantAlternates " +
32 (hasStyleAlternates ? "available" : "not available") +
33 " but " +
34 "window.CSSFontFeatureValuesRule " +
35 (hasFFVRule ? "available" : "not available") +
36 " - ");
37 }, "style.fontVariantAlternates availability matches window.CSSFontFeatureValuesRule availability");
39 test(function() {
40 assert_equals(hasFFVRule,
41 hasCompStyleAlternates,
42 "computedStyle.fontVariantAlternates " +
43 (hasCompStyleAlternates ? "available" : "not available") +
44 " but " +
45 "window.CSSFontFeatureValuesRule " +
46 (hasFFVRule ? "available" : "not available") +
47 " - ");
48 }, "computedStyle.fontVariantAlternates availability matches window.CSSFontFeatureValuesRule availability");
50 // if window.CSSFontFeatureValuesRule isn't around, neither should any of the font feature props
51 fontFeatureProps = [ "fontKerning", "fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian",
52 "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition", "fontSynthesis",
53 "fontFeatureSettings", "fontLanguageOverride" ];
55 if (!hasFFVRule) {
56 var i;
57 for (i = 0; i < fontFeatureProps.length; i++) {
58 var prop = fontFeatureProps[i];
59 test(function() {
60 assert_true(!(prop in s), "window.CSSFontFeatureValuesRule not available but style." + prop + " is available - ");
61 }, "style." + prop + " availability");
62 test(function() {
63 assert_true(!(prop in cs), "window.CSSFontFeatureValuesRule not available but computedStyle." + prop + " is available - ");
64 }, "computedStyle." + prop + " availability");
70 testCSSFontFeatureValuesRuleOM();
72 </script>
73 </body>
74 </html>