Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <meta charset=utf-8> |
michael@0 | 5 | <title>Bug 892929 test</title> |
michael@0 | 6 | <link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com"> |
michael@0 | 7 | <link rel="help" href="http://www.w3.org/TR/css-fonts-3/#om-fontfeaturevalues" /> |
michael@0 | 8 | <meta name="assert" content="window.CSSFontFeatureValuesRule should only appear when layout.css.font-features.enabled is true" /> |
michael@0 | 9 | <script type="text/javascript" src="/resources/testharness.js"></script> |
michael@0 | 10 | <script type="text/javascript" src="/resources/testharnessreport.js"></script> |
michael@0 | 11 | <style type="text/css"> |
michael@0 | 12 | </style> |
michael@0 | 13 | </head> |
michael@0 | 14 | <body> |
michael@0 | 15 | <div id="log"></div> |
michael@0 | 16 | <pre id="display"></pre> |
michael@0 | 17 | |
michael@0 | 18 | <script type="text/javascript"> |
michael@0 | 19 | |
michael@0 | 20 | function testCSSFontFeatureValuesRuleOM() { |
michael@0 | 21 | var s = document.documentElement.style; |
michael@0 | 22 | var cs = window.getComputedStyle(document.documentElement); |
michael@0 | 23 | |
michael@0 | 24 | var hasFFVRule = "CSSFontFeatureValuesRule" in window; |
michael@0 | 25 | var hasStyleAlternates = "fontVariantAlternates" in s; |
michael@0 | 26 | var hasCompStyleAlternates = "fontVariantAlternates" in cs; |
michael@0 | 27 | |
michael@0 | 28 | test(function() { |
michael@0 | 29 | assert_equals(hasFFVRule, |
michael@0 | 30 | hasStyleAlternates, |
michael@0 | 31 | "style.fontVariantAlternates " + |
michael@0 | 32 | (hasStyleAlternates ? "available" : "not available") + |
michael@0 | 33 | " but " + |
michael@0 | 34 | "window.CSSFontFeatureValuesRule " + |
michael@0 | 35 | (hasFFVRule ? "available" : "not available") + |
michael@0 | 36 | " - "); |
michael@0 | 37 | }, "style.fontVariantAlternates availability matches window.CSSFontFeatureValuesRule availability"); |
michael@0 | 38 | |
michael@0 | 39 | test(function() { |
michael@0 | 40 | assert_equals(hasFFVRule, |
michael@0 | 41 | hasCompStyleAlternates, |
michael@0 | 42 | "computedStyle.fontVariantAlternates " + |
michael@0 | 43 | (hasCompStyleAlternates ? "available" : "not available") + |
michael@0 | 44 | " but " + |
michael@0 | 45 | "window.CSSFontFeatureValuesRule " + |
michael@0 | 46 | (hasFFVRule ? "available" : "not available") + |
michael@0 | 47 | " - "); |
michael@0 | 48 | }, "computedStyle.fontVariantAlternates availability matches window.CSSFontFeatureValuesRule availability"); |
michael@0 | 49 | |
michael@0 | 50 | // if window.CSSFontFeatureValuesRule isn't around, neither should any of the font feature props |
michael@0 | 51 | fontFeatureProps = [ "fontKerning", "fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", |
michael@0 | 52 | "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition", "fontSynthesis", |
michael@0 | 53 | "fontFeatureSettings", "fontLanguageOverride" ]; |
michael@0 | 54 | |
michael@0 | 55 | if (!hasFFVRule) { |
michael@0 | 56 | var i; |
michael@0 | 57 | for (i = 0; i < fontFeatureProps.length; i++) { |
michael@0 | 58 | var prop = fontFeatureProps[i]; |
michael@0 | 59 | test(function() { |
michael@0 | 60 | assert_true(!(prop in s), "window.CSSFontFeatureValuesRule not available but style." + prop + " is available - "); |
michael@0 | 61 | }, "style." + prop + " availability"); |
michael@0 | 62 | test(function() { |
michael@0 | 63 | assert_true(!(prop in cs), "window.CSSFontFeatureValuesRule not available but computedStyle." + prop + " is available - "); |
michael@0 | 64 | }, "computedStyle." + prop + " availability"); |
michael@0 | 65 | } |
michael@0 | 66 | } |
michael@0 | 67 | |
michael@0 | 68 | } |
michael@0 | 69 | |
michael@0 | 70 | testCSSFontFeatureValuesRuleOM(); |
michael@0 | 71 | |
michael@0 | 72 | </script> |
michael@0 | 73 | </body> |
michael@0 | 74 | </html> |