style: Restrict <baseline-position> and <content-position> depending on the axis in content distribution properties.

This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1430817, and updates us
to the current version of the css-align spec.

MozReview-Commit-ID: LtBcdqYJeK
This commit is contained in:
Emilio Cobos Álvarez 2018-01-24 13:23:19 +01:00
parent 7497720081
commit fd47a93b9c
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 57 additions and 33 deletions

View file

@ -634,11 +634,19 @@
FallbackAllowed::No,
AxisDirection::Block,
)
}).unwrap_or(align_content);
});
let justify_content = match justify_content {
Ok(v) => v,
Err(err) => {
if !align_content.is_valid_on_both_axes() {
return Err(err);
}
align_content
}
};
// NOTE(emilio): align-content parsing is more restrictive than
// justify-content parsing, so no need to do any extra check here for
// that.
if align_content.has_extra_flags() || justify_content.has_extra_flags() {
return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
}