Navigation Menu

Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Commit

Permalink
Adjust test expectations to the new baseline-position syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
javifernandez committed Mar 21, 2017
1 parent 39c274a commit 199a472
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions css-align-3/resources/alignment-parsing-utils.js
Expand Up @@ -6,17 +6,26 @@ var baselineValues = [ "baseline", "first baseline", "last baseline"];
function checkPlaceShorhand(shorthand, alignValue, justifyValue)
{
var div = document.createElement("div");
var value = (alignValue + " " + justifyValue).trim();
div.style[shorthand] = value;
var specifiedValue = (alignValue + " " + justifyValue).trim();
div.style[shorthand] = specifiedValue;
document.body.appendChild(div);
var specifiedValue = alignValue;
if (alignValue !== justifyValue)
specifiedValue = value;

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_true(resolvedValue === value || resolvedValue === "", shorthand + " resolved value");
assert_in_array(resolvedValue, ["", expectedResolvedValue], shorthand + " resolved value");
}

function checkPlaceShorhandLonghands(shorthand, alignLonghand, justifyLonghand, alignValue, justifyValue = "")
Expand Down

0 comments on commit 199a472

Please sign in to comment.