blob: 0a62ccbc5d83e4d13737b3a27a5043cdd5f95105 [file] [log] [blame]
<html>
<head>
<title></title>
<script type="text/javascript">
function log(message)
{
var console = document.getElementById("console");
console.appendChild(document.createElement("li")).innerHTML = message;
}
function testShorthand(shorthand)
{
var element = document.createElement("div");
element.setAttribute("style",
"border: thin dotted purple; \
background: red url(/background.png) repeat-y scroll right bottom; \
list-style: square outside url(/marker.png); \
margin: 5%; \
-webkit-margin-collapse: collapse; \
-webkit-marquee: ahead small infinite slide slow; \
padding: 2em; \
-webkit-text-stroke: orange 1pt; \
-webkit-columns: 100px 3; \
-webkit-column-rule: thick dashed silver; \
border-spacing: 10px 20px; \
-webkit-border-radius: 6px 8px; \
overflow: scroll; \
-webkit-mask: url(/mask.png) repeat-x scroll center top;");
var allProperties = element.style.cssText.split("; ");
element.style.removeProperty(shorthand);
var remainingProperties = element.style.cssText.split("; ");
var removedProperties = [];
var p;
while (p = allProperties.shift()) {
if (remainingProperties[0] == p)
remainingProperties.shift();
else
removedProperties.push("<tt>" + p.replace(/\:.*/,"") + "</tt>");
}
log("Removing <tt>" + shorthand + "</tt> removes " + removedProperties.join(", ") +".");
}
function test()
{
if (window.layoutTestController)
layoutTestController.dumpAsText();
var shorthands = [
"background",
"background-position",
"border",
"border-top", "border-right", "border-bottom", "border-left",
"border-color", "border-style", "border-width",
"-webkit-border-radius",
"border-spacing",
"-webkit-columns",
"-webkit-column-rule",
"list-style",
"margin",
"-webkit-margin-collapse",
"-webkit-marquee",
"-webkit-mask",
"-webkit-mask-position",
"overflow",
"padding",
"-webkit-text-stroke"
];
for (i in shorthands)
testShorthand(shorthands[i]);
}
</script>
</head>
<body onload="test()">
<p>
Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=9284">http://bugs.webkit.org/show_bug.cgi?id=9284</a>
Quirksmode (CSS1): Removing inline border styles is impossible</i>.
</p>
<p>
Starting with a declaration containing all properties that are constituents of shortcuts, see what is removed
when a shortcut property is removed. The shortcut&rsquo;s constituents and only them should be removed.
</p>
<ul id="console"></ul>
</body>
</html>