mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Use Rust types for some misc properties.
-moz-tab-size, border-image-outset and border-image-slice. This is not a particularly interesting patch, just removes some code. We can remove way more code when a few related properties are also ported. Differential Revision: https://phabricator.services.mozilla.com/D19825
This commit is contained in:
parent
eefd440656
commit
6118e4d993
16 changed files with 149 additions and 184 deletions
|
@ -4,22 +4,8 @@
|
|||
|
||||
//! Specified types for CSS borders.
|
||||
|
||||
use crate::parser::ParserContext;
|
||||
use crate::values::generics::rect::Rect;
|
||||
use crate::values::specified::length::LengthOrNumber;
|
||||
use cssparser::Parser;
|
||||
use style_traits::ParseError;
|
||||
use crate::values::specified::length::NonNegativeLengthOrNumber;
|
||||
|
||||
/// A specified rectangle made of four `<length-or-number>` values.
|
||||
pub type LengthOrNumberRect = Rect<LengthOrNumber>;
|
||||
|
||||
impl LengthOrNumberRect {
|
||||
/// Parses a `LengthOrNumberRect`, rejecting negative values.
|
||||
#[inline]
|
||||
pub fn parse_non_negative<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
Rect::parse_with(context, input, LengthOrNumber::parse_non_negative)
|
||||
}
|
||||
}
|
||||
pub type NonNegativeLengthOrNumberRect = Rect<NonNegativeLengthOrNumber>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue