mirror of
https://github.com/servo/servo.git
synced 2025-08-16 02:45:36 +01:00
Bug 1374233 - Part 13: Use NonNegative{*} types for components of Shadow and Filter.
MozReview-Commit-ID: Im4KGy1n9IJ
This commit is contained in:
parent
6dd8b159d7
commit
8651acd94c
13 changed files with 84 additions and 53 deletions
|
@ -17,9 +17,9 @@ use nsstring::{nsACString, nsCString};
|
|||
use std::cmp::max;
|
||||
use values::{Auto, Either, ExtremumLength, None_, Normal};
|
||||
use values::computed::{Angle, LengthOrPercentage, LengthOrPercentageOrAuto};
|
||||
use values::computed::{LengthOrPercentageOrNone, Number, NumberOrPercentage, NonNegativeAu};
|
||||
use values::computed::{LengthOrPercentageOrNone, Number, NumberOrPercentage};
|
||||
use values::computed::{MaxLength, MozLength, Percentage};
|
||||
use values::computed::NonNegativeLengthOrPercentage;
|
||||
use values::computed::{NonNegativeAu, NonNegativeLengthOrPercentage, NonNegativeNumber};
|
||||
use values::computed::basic_shape::ShapeRadius as ComputedShapeRadius;
|
||||
use values::generics::{CounterStyleOrNone, NonNegative};
|
||||
use values::generics::basic_shape::ShapeRadius;
|
||||
|
@ -155,6 +155,16 @@ impl GeckoStyleCoordConvertible for NonNegativeAu {
|
|||
}
|
||||
}
|
||||
|
||||
impl GeckoStyleCoordConvertible for NonNegativeNumber {
|
||||
fn to_gecko_style_coord<T: CoordDataMut>(&self, coord: &mut T) {
|
||||
self.0.to_gecko_style_coord(coord);
|
||||
}
|
||||
|
||||
fn from_gecko_style_coord<T: CoordData>(coord: &T) -> Option<Self> {
|
||||
Number::from_gecko_style_coord(coord).map(NonNegative::<Number>)
|
||||
}
|
||||
}
|
||||
|
||||
impl GeckoStyleCoordConvertible for LengthOrPercentageOrAuto {
|
||||
fn to_gecko_style_coord<T: CoordDataMut>(&self, coord: &mut T) {
|
||||
let value = match *self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue