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">
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
;
29 assert_equals(hasFFVRule
,
31 "style.fontVariantAlternates " +
32 (hasStyleAlternates
? "available" : "not available") +
34 "window.CSSFontFeatureValuesRule " +
35 (hasFFVRule
? "available" : "not available") +
37 }, "style.fontVariantAlternates availability matches window.CSSFontFeatureValuesRule availability");
40 assert_equals(hasFFVRule
,
41 hasCompStyleAlternates
,
42 "computedStyle.fontVariantAlternates " +
43 (hasCompStyleAlternates
? "available" : "not available") +
45 "window.CSSFontFeatureValuesRule " +
46 (hasFFVRule
? "available" : "not available") +
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" ];
57 for (i
= 0; i
< fontFeatureProps
.length
; i
++) {
58 var prop
= fontFeatureProps
[i
];
60 assert_true(!(prop
in s
), "window.CSSFontFeatureValuesRule not available but style." + prop
+ " is available - ");
61 }, "style." + prop
+ " availability");
63 assert_true(!(prop
in cs
), "window.CSSFontFeatureValuesRule not available but computedStyle." + prop
+ " is available - ");
64 }, "computedStyle." + prop
+ " availability");
70 testCSSFontFeatureValuesRuleOM();