mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Update web-platform-tests to revision 58b72393db0bd273bb93268c33666cf893feb985
This commit is contained in:
parent
43a4f01647
commit
64e0a52537
12717 changed files with 59835 additions and 59820 deletions
|
@ -1,54 +0,0 @@
|
|||
var selfPositionValues = [ "start", "end", "self-start", "self-end", "left", "right", "center", "flex-start", "flex-end"];
|
||||
var contentPositionValues = [ "start", "end", "left", "right", "center", "flex-start", "flex-end"];
|
||||
var distributionValues = [ "stretch", "space-around", "space-between", "space-evenly"];
|
||||
var baselineValues = [ "baseline", "first baseline", "last baseline"];
|
||||
|
||||
function checkPlaceShorhand(shorthand, alignValue, justifyValue)
|
||||
{
|
||||
var div = document.createElement("div");
|
||||
var specifiedValue = (alignValue + " " + justifyValue).trim();
|
||||
div.style[shorthand] = specifiedValue;
|
||||
document.body.appendChild(div);
|
||||
|
||||
if (alignValue === justifyValue)
|
||||
specifiedValue = alignValue;
|
||||
|
||||
var resolvedValue = getComputedStyle(div).getPropertyValue(shorthand);
|
||||
if (alignValue === "first baseline")
|
||||
alignValue = "baseline";
|
||||
if (justifyValue === "first baseline")
|
||||
justifyValue = "baseline";
|
||||
if (justifyValue === "")
|
||||
justifyValue = alignValue;
|
||||
var expectedResolvedValue = (alignValue + " " + justifyValue).trim()
|
||||
|
||||
assert_equals(div.style[shorthand], specifiedValue, shorthand + " specified value");
|
||||
// FIXME: We need https://github.com/w3c/csswg-drafts/issues/1041 to clarify which
|
||||
// value is expected for the shorthand's 'resolved value".
|
||||
assert_in_array(resolvedValue, ["", expectedResolvedValue], shorthand + " resolved value");
|
||||
}
|
||||
|
||||
function checkPlaceShorhandLonghands(shorthand, alignLonghand, justifyLonghand, alignValue, justifyValue = "")
|
||||
{
|
||||
var div = document.createElement("div");
|
||||
div.setAttribute("style", shorthand + ": " + alignValue + " " + justifyValue);
|
||||
document.body.appendChild(div);
|
||||
if (justifyValue === "")
|
||||
justifyValue = alignValue;
|
||||
assert_equals(div.style[alignLonghand],
|
||||
alignValue, alignLonghand + " expanded value");
|
||||
assert_equals(div.style[justifyLonghand],
|
||||
justifyValue, justifyLonghand + " expanded value");
|
||||
}
|
||||
|
||||
function checkPlaceShorthandInvalidValues(shorthand, alignLonghand, justifyLonghand, value)
|
||||
{
|
||||
var div = document.createElement("div");
|
||||
var css = alignLonghand + ": start; " + justifyLonghand + ": end;" + shorthand + ": " + value;
|
||||
div.setAttribute("style", css);
|
||||
document.body.appendChild(div);
|
||||
assert_equals(div.style[alignLonghand],
|
||||
"start", alignLonghand + " expanded value");
|
||||
assert_equals(div.style[justifyLonghand],
|
||||
"end", justifyLonghand + " expanded value");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue