4 <script type=
"text/javascript">
7 var console
= document
.getElementById("console");
8 console
.appendChild(document
.createElement("li")).innerHTML
= message
;
11 function testShorthand(shorthand
)
13 var element
= document
.createElement("div");
14 element
.setAttribute("style",
15 "border: thin dotted purple; \
16 background: red url(/background.png) repeat-y scroll right bottom; \
17 list-style: square outside url(/marker.png); \
19 -webkit-margin-collapse: collapse; \
21 -webkit-text-stroke: orange 1pt; \
22 -webkit-columns: 100px 3; \
23 -webkit-column-rule: thick dashed silver; \
24 border-spacing: 10px 20px; \
25 -webkit-border-radius: 6px 8px; \
27 -webkit-mask: url(/mask.png) repeat-x center top;");
28 var allProperties
= element
.style
.cssText
.concat(" ").split("; ");
29 element
.style
.removeProperty(shorthand
);
30 var remainingProperties
= element
.style
.cssText
.concat(" ").split("; ");
31 var removedProperties
= [];
32 var addedProperties
= [];
34 for (var i
= 0; i
< allProperties
.length
; i
++) {
35 if (remainingProperties
.indexOf(allProperties
[i
]) < 0)
36 removedProperties
.push("<tt>" + allProperties
[i
].replace(/\:.*/,"") + "</tt>");
38 for (var i
= 0; i
< remainingProperties
.length
; i
++) {
39 if (allProperties
.indexOf(remainingProperties
[i
]) < 0)
40 addedProperties
.push("<tt>" + remainingProperties
[i
].replace(/\:.*/,"") + "</tt>");
43 log("Removing <tt>" + shorthand
+ '</tt><br>removes "' + removedProperties
.join(", ")
44 + '"<br>and adds "' + addedProperties
.join(", ") + '".');
49 if (window
.testRunner
)
50 testRunner
.dumpAsText();
54 "background-position",
56 "border-top", "border-right", "border-bottom", "border-left",
57 "border-color", "border-style", "border-width",
59 "-webkit-border-radius",
62 "-webkit-column-rule",
65 "-webkit-margin-collapse",
67 "-webkit-mask-position",
74 testShorthand(shorthands
[i
]);
78 <body onload=
"test()">
80 Test for
<i><a href=
"http://bugs.webkit.org/show_bug.cgi?id=9284">http://bugs.webkit.org/show_bug.cgi?id=
9284</a>
81 Quirksmode (CSS1): Removing inline border styles is impossible
</i>.
84 Starting with a declaration containing all properties that are constituents of shortcuts, see what is removed
85 when a shortcut property is removed. The shortcut
’s constituents and only them should be removed.
87 <ul id=
"console"></ul>