mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
cargo fix --edition --features gecko
This commit is contained in:
parent
a15d33a10e
commit
b1822a39fa
87 changed files with 614 additions and 585 deletions
|
@ -6,9 +6,9 @@
|
|||
//!
|
||||
//! https://drafts.csswg.org/css-align/
|
||||
|
||||
use crate::gecko_bindings::structs;
|
||||
use crate::parser::{Parse, ParserContext};
|
||||
use cssparser::Parser;
|
||||
use gecko_bindings::structs;
|
||||
use parser::{Parse, ParserContext};
|
||||
use std::fmt::{self, Write};
|
||||
use style_traits::{CssWriter, KeywordsCollectFn, ParseError, SpecifiedValueInfo, ToCss};
|
||||
|
||||
|
@ -195,25 +195,25 @@ impl ContentDistribution {
|
|||
// when this function is updated.
|
||||
|
||||
// Try to parse normal first
|
||||
if input.try(|i| i.expect_ident_matching("normal")).is_ok() {
|
||||
if input.r#try(|i| i.expect_ident_matching("normal")).is_ok() {
|
||||
return Ok(ContentDistribution::normal());
|
||||
}
|
||||
|
||||
// Parse <baseline-position>, but only on the block axis.
|
||||
if axis == AxisDirection::Block {
|
||||
if let Ok(value) = input.try(parse_baseline) {
|
||||
if let Ok(value) = input.r#try(parse_baseline) {
|
||||
return Ok(ContentDistribution::new(value));
|
||||
}
|
||||
}
|
||||
|
||||
// <content-distribution>
|
||||
if let Ok(value) = input.try(parse_content_distribution) {
|
||||
if let Ok(value) = input.r#try(parse_content_distribution) {
|
||||
return Ok(ContentDistribution::new(value));
|
||||
}
|
||||
|
||||
// <overflow-position>? <content-position>
|
||||
let overflow_position = input
|
||||
.try(parse_overflow_position)
|
||||
.r#try(parse_overflow_position)
|
||||
.unwrap_or(AlignFlags::empty());
|
||||
|
||||
let content_position = try_match_ident_ignore_ascii_case! { input,
|
||||
|
@ -358,18 +358,18 @@ impl SelfAlignment {
|
|||
//
|
||||
// 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.r#try(parse_baseline) {
|
||||
return Ok(SelfAlignment(value));
|
||||
}
|
||||
|
||||
// auto | normal | stretch
|
||||
if let Ok(value) = input.try(parse_auto_normal_stretch) {
|
||||
if let Ok(value) = input.r#try(parse_auto_normal_stretch) {
|
||||
return Ok(SelfAlignment(value));
|
||||
}
|
||||
|
||||
// <overflow-position>? <self-position>
|
||||
let overflow_position = input
|
||||
.try(parse_overflow_position)
|
||||
.r#try(parse_overflow_position)
|
||||
.unwrap_or(AlignFlags::empty());
|
||||
let self_position = parse_self_position(input, axis)?;
|
||||
Ok(SelfAlignment(overflow_position | self_position))
|
||||
|
@ -484,17 +484,17 @@ impl Parse for AlignItems {
|
|||
// this function is updated.
|
||||
|
||||
// <baseline-position>
|
||||
if let Ok(baseline) = input.try(parse_baseline) {
|
||||
if let Ok(baseline) = input.r#try(parse_baseline) {
|
||||
return Ok(AlignItems(baseline));
|
||||
}
|
||||
|
||||
// normal | stretch
|
||||
if let Ok(value) = input.try(parse_normal_stretch) {
|
||||
if let Ok(value) = input.r#try(parse_normal_stretch) {
|
||||
return Ok(AlignItems(value));
|
||||
}
|
||||
// <overflow-position>? <self-position>
|
||||
let overflow = input
|
||||
.try(parse_overflow_position)
|
||||
.r#try(parse_overflow_position)
|
||||
.unwrap_or(AlignFlags::empty());
|
||||
let self_position = parse_self_position(input, AxisDirection::Block)?;
|
||||
Ok(AlignItems(self_position | overflow))
|
||||
|
@ -542,23 +542,23 @@ impl Parse for JustifyItems {
|
|||
//
|
||||
// It's weird that this accepts <baseline-position>, but not
|
||||
// justify-content...
|
||||
if let Ok(baseline) = input.try(parse_baseline) {
|
||||
if let Ok(baseline) = input.r#try(parse_baseline) {
|
||||
return Ok(JustifyItems(baseline));
|
||||
}
|
||||
|
||||
// normal | stretch
|
||||
if let Ok(value) = input.try(parse_normal_stretch) {
|
||||
if let Ok(value) = input.r#try(parse_normal_stretch) {
|
||||
return Ok(JustifyItems(value));
|
||||
}
|
||||
|
||||
// legacy | [ legacy && [ left | right | center ] ]
|
||||
if let Ok(value) = input.try(parse_legacy) {
|
||||
if let Ok(value) = input.r#try(parse_legacy) {
|
||||
return Ok(JustifyItems(value));
|
||||
}
|
||||
|
||||
// <overflow-position>? <self-position>
|
||||
let overflow = input
|
||||
.try(parse_overflow_position)
|
||||
.r#try(parse_overflow_position)
|
||||
.unwrap_or(AlignFlags::empty());
|
||||
let self_position = parse_self_position(input, AxisDirection::Inline)?;
|
||||
Ok(JustifyItems(overflow | self_position))
|
||||
|
@ -714,7 +714,7 @@ fn parse_legacy<'i, 't>(input: &mut Parser<'i, 't>) -> Result<AlignFlags, ParseE
|
|||
// when this function is updated.
|
||||
let flags = try_match_ident_ignore_ascii_case! { input,
|
||||
"legacy" => {
|
||||
let flags = input.try(parse_left_right_center)
|
||||
let flags = input.r#try(parse_left_right_center)
|
||||
.unwrap_or(AlignFlags::empty());
|
||||
|
||||
return Ok(AlignFlags::LEGACY | flags)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue