layout/style/test/test_bug892929.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

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.)

     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 only appear when layout.css.font-features.enabled is true" />
     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");
    65     }
    66   }
    68 }
    70 testCSSFontFeatureValuesRuleOM();
    72 </script>
    73 </body>
    74 </html>

mercurial