mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Auto merge of #19906 - emilio:justify-self-whoops, r=nox
style: justify-self does accept a <baseline-position>. Unlike justify-content, as weird as it is. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19906) <!-- Reviewable:end -->
This commit is contained in:
commit
6101bdf72b
1 changed files with 9 additions and 12 deletions
|
@ -302,10 +302,6 @@ impl SelfAlignment {
|
||||||
/// Returns whether this value is valid for both axis directions.
|
/// Returns whether this value is valid for both axis directions.
|
||||||
pub fn is_valid_on_both_axes(&self) -> bool {
|
pub fn is_valid_on_both_axes(&self) -> bool {
|
||||||
match self.0.value() {
|
match self.0.value() {
|
||||||
// <baseline-position> is only allowed on the block axis.
|
|
||||||
AlignFlags::BASELINE |
|
|
||||||
AlignFlags::LAST_BASELINE => false,
|
|
||||||
|
|
||||||
// left | right are only allowed on the inline axis.
|
// left | right are only allowed on the inline axis.
|
||||||
AlignFlags::LEFT |
|
AlignFlags::LEFT |
|
||||||
AlignFlags::RIGHT => false,
|
AlignFlags::RIGHT => false,
|
||||||
|
@ -325,12 +321,13 @@ impl SelfAlignment {
|
||||||
input: &mut Parser<'i, 't>,
|
input: &mut Parser<'i, 't>,
|
||||||
axis: AxisDirection,
|
axis: AxisDirection,
|
||||||
) -> Result<Self, ParseError<'i>> {
|
) -> Result<Self, ParseError<'i>> {
|
||||||
// <baseline-position>, only on the block axis.
|
// <baseline-position>
|
||||||
if axis == AxisDirection::Block {
|
//
|
||||||
|
// It's weird that this accepts <baseline-position>, but not
|
||||||
|
// justify-content...
|
||||||
if let Ok(value) = input.try(parse_baseline) {
|
if let Ok(value) = input.try(parse_baseline) {
|
||||||
return Ok(SelfAlignment(value));
|
return Ok(SelfAlignment(value));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// auto | normal | stretch
|
// auto | normal | stretch
|
||||||
if let Ok(value) = input.try(parse_auto_normal_stretch) {
|
if let Ok(value) = input.try(parse_auto_normal_stretch) {
|
||||||
|
@ -465,8 +462,8 @@ impl Parse for JustifyItems {
|
||||||
fn parse<'i, 't>(_: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
|
fn parse<'i, 't>(_: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
|
||||||
// <baseline-position>
|
// <baseline-position>
|
||||||
//
|
//
|
||||||
// It's weird that this accepts <baseline-position>, but not the
|
// It's weird that this accepts <baseline-position>, but not
|
||||||
// justify-self / justify-content properties...
|
// justify-content...
|
||||||
if let Ok(baseline) = input.try(parse_baseline) {
|
if let Ok(baseline) = input.try(parse_baseline) {
|
||||||
return Ok(JustifyItems(baseline));
|
return Ok(JustifyItems(baseline));
|
||||||
}
|
}
|
||||||
|
@ -511,7 +508,7 @@ fn parse_auto_normal_stretch<'i, 't>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// normal | stretch | <baseline-position>
|
// normal | stretch
|
||||||
fn parse_normal_stretch<'i, 't>(input: &mut Parser<'i, 't>) -> Result<AlignFlags, ParseError<'i>> {
|
fn parse_normal_stretch<'i, 't>(input: &mut Parser<'i, 't>) -> Result<AlignFlags, ParseError<'i>> {
|
||||||
try_match_ident_ignore_ascii_case! { input,
|
try_match_ident_ignore_ascii_case! { input,
|
||||||
"normal" => Ok(AlignFlags::NORMAL),
|
"normal" => Ok(AlignFlags::NORMAL),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue