4 https://bugzilla.mozilla.org/show_bug.cgi?id=1382786
8 <title>Test for Bug
1382786</title>
9 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <script type=
"text/javascript" src=
"property_database.js"></script>
11 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
12 <style id=
"s"></style>
15 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1382786">Mozilla Bug
1382786</a>
17 <div id=
"content" style=
"display: none">
21 <div id=
"control"></div>
22 <script type=
"application/javascript">
24 /** Test for Bug
1382786 **/
25 var test = getComputedStyle($(
"test"),
"::first-letter");
26 var control = getComputedStyle($(
"control"),
"::first-letter");
27 for (let prop in gCSSProperties) {
28 var info = gCSSProperties[prop];
29 if (info.type == CSS_TYPE_TRUE_SHORTHAND) {
30 // Can't get useful info out of getComputedStyle.
34 if (info.prerequisites) {
35 for (let name in info.prerequisites) {
36 prereqs += `${name}: ${info.prerequisites[name]}; `;
39 $(
"s").textContent = `
40 #control::first-letter { ${prop}: ${info.initial_values[
0]}; ${prereqs} }
41 #test::first-letter { ${prop}: ${info.other_values[
0]}; ${prereqs} }
43 if (info.applies_to_first_letter) {
44 isnot(get_computed_value(test, prop),
45 get_computed_value(control, prop),
46 `${prop} should apply to ::first-letter`);
48 is(get_computed_value(test, prop),
49 get_computed_value(control, prop),
50 `${prop} should not apply to ::first-letter`);