diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /layout/style/test/test_bug377947.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'layout/style/test/test_bug377947.html')
-rw-r--r-- | layout/style/test/test_bug377947.html | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/layout/style/test/test_bug377947.html b/layout/style/test/test_bug377947.html new file mode 100644 index 000000000..43f60577c --- /dev/null +++ b/layout/style/test/test_bug377947.html @@ -0,0 +1,107 @@ +<!DOCTYPE HTML> +<html> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=377947 +--> +<head> + <title>Test for Bug 377947</title> + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> +</head> +<body> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=377947">Mozilla Bug 377947</a> +<p id="display"></p> +<div id="content" style="display: none"> + +</div> +<pre id="test"> +<script class="testbody" type="text/javascript"> + +/** Test for Bug 377947 **/ + +/* + * In particular, test that CSSStyleDeclaration.getPropertyValue doesn't + * return values for shorthands when some of the subproperties are not + * specified (a change that wasn't all that related to the main point of + * the bug). And also test that the internal system-font property added + * in bug 377947 doesn't interfere with that. + */ + +var s = document.getElementById("display").style; + +is(s.getPropertyValue("list-style"), "", + "list-style shorthand should start off empty"); +s.listStyleType="disc"; +s.listStyleImage="none"; +is(s.getPropertyValue("list-style"), "", + "list-style shorthand should be empty when some subproperties specified"); +s.listStylePosition="inside"; +isnot(s.getPropertyValue("list-style"), "", + "list-style shorthand should produce value when all subproperties set"); +s.removeProperty("list-style"); +is(s.getPropertyValue("list-style"), "", + "list-style shorthand be empty after removal"); +s.listStyle="none"; +isnot(s.getPropertyValue("list-style"), "", + "list-style shorthand should produce value when shorthand set"); +s.removeProperty("list-style"); +is(s.getPropertyValue("list-style"), "", + "list-style shorthand be empty after removal"); + +is(s.getPropertyValue("font"), "", + "font shorthand should start off empty"); +var all_but_one = { + "font-family": "serif", + "font-style": "normal", + "font-variant": "normal", + "font-weight": "bold", + "font-size": "small", + "font-stretch": "normal", + "font-size-adjust": "none", // has to be default value + "font-feature-settings": "normal", // has to be default value + "font-language-override": "normal", // has to be default value + "font-kerning": "auto", // has to be default value + "font-synthesis": "weight style", // has to be default value + "font-variant-alternates": "normal", // has to be default value + "font-variant-caps": "normal", // has to be default value + "font-variant-east-asian": "normal", // has to be default value + "font-variant-ligatures": "normal", // has to be default value + "font-variant-numeric": "normal", // has to be default value + "font-variant-position": "normal" // has to be default value +}; + +for (var prop in all_but_one) { + s.setProperty(prop, all_but_one[prop], ""); +} +is(s.getPropertyValue("font"), "", + "font shorthand should be empty when some subproperties specified"); +s.setProperty("line-height", "1.5", ""); +isnot(s.getPropertyValue("font"), "", + "font shorthand should produce value when all subproperties set"); +s.setProperty("font-size-adjust", "0.5", ""); +is(s.getPropertyValue("font"), "", + "font shorthand should be empty when font-size-adjust is non-default"); +s.setProperty("font-size-adjust", "none", ""); +isnot(s.getPropertyValue("font"), "", + "font shorthand should produce value when all subproperties set"); +s.removeProperty("font"); +is(s.getPropertyValue("font"), "", + "font shorthand be empty after removal"); +s.font="medium serif"; +isnot(s.getPropertyValue("font"), "", + "font shorthand should produce value when shorthand set"); +s.removeProperty("font"); +is(s.getPropertyValue("font"), "", + "font shorthand be empty after removal"); +s.font="menu"; +isnot(s.getPropertyValue("font"), "", + "font shorthand should produce value when shorthand (system font) set"); +s.removeProperty("font"); +is(s.getPropertyValue("font"), "", + "font shorthand be empty after removal"); + +</script> +</pre> +</body> +</html> + |