mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Auto merge of #16558 - nox:placement, r=emilio
Properly parse alignment shorthands (fixes #16391) <!-- 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/16558) <!-- Reviewable:end -->
This commit is contained in:
commit
e9658bb5b4
2 changed files with 42 additions and 0 deletions
|
@ -249,8 +249,14 @@
|
|||
|
||||
pub fn parse_value(context: &ParserContext, input: &mut Parser) -> Result<Longhands, ()> {
|
||||
let align = align_content::parse(context, input)?;
|
||||
if align.has_extra_flags() {
|
||||
return Err(());
|
||||
}
|
||||
let justify = input.try(|input| justify_content::parse(context, input))
|
||||
.unwrap_or(justify_content::SpecifiedValue::from(align));
|
||||
if justify.has_extra_flags() {
|
||||
return Err(());
|
||||
}
|
||||
|
||||
Ok(Longhands {
|
||||
align_content: align,
|
||||
|
@ -279,7 +285,13 @@
|
|||
|
||||
pub fn parse_value(context: &ParserContext, input: &mut Parser) -> Result<Longhands, ()> {
|
||||
let align = AlignJustifySelf::parse(context, input)?;
|
||||
if align.has_extra_flags() {
|
||||
return Err(());
|
||||
}
|
||||
let justify = input.try(|input| AlignJustifySelf::parse(context, input)).unwrap_or(align.clone());
|
||||
if justify.has_extra_flags() {
|
||||
return Err(());
|
||||
}
|
||||
|
||||
Ok(Longhands {
|
||||
align_self: align,
|
||||
|
@ -314,8 +326,14 @@
|
|||
|
||||
pub fn parse_value(context: &ParserContext, input: &mut Parser) -> Result<Longhands, ()> {
|
||||
let align = AlignItems::parse(context, input)?;
|
||||
if align.has_extra_flags() {
|
||||
return Err(());
|
||||
}
|
||||
let justify = input.try(|input| JustifyItems::parse(context, input))
|
||||
.unwrap_or(JustifyItems::from(align));
|
||||
if justify.has_extra_flags() {
|
||||
return Err(());
|
||||
}
|
||||
|
||||
Ok(Longhands {
|
||||
align_items: align,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue