mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Introduce CSSPixelLength and update NonNegativeLength.
First, we define computed::CSSPixelLength which contains a CSSFloat, a pixel value, and then we replace computed::Length with CSSPixelLength. Therefore, the |ComputedValue| of NoCalcLength, AbsoluteLength, FontRelativeLength, ViewportPercentageLength, CharacterWidth, and PhysicalLength is CSSPixelLength. Besides, we drop NonNegativeAu, and replace computed::NonNegativeLength with NonNegative<computed::Length>. (i.e. NonNegative<CSSPixelLength>)
This commit is contained in:
parent
cad3aff508
commit
a949e2a057
40 changed files with 502 additions and 406 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
use app_units::Au;
|
||||
use values::RGBA;
|
||||
use values::computed::{ComputedUrl, LengthOrPercentage, NonNegativeAu};
|
||||
use values::computed::{ComputedUrl, LengthOrPercentage, NonNegativeLength};
|
||||
use values::computed::{NonNegativeNumber, NonNegativeLengthOrPercentage, Number};
|
||||
use values::computed::Opacity;
|
||||
use values::generics::svg as generic;
|
||||
|
@ -72,8 +72,8 @@ impl Into<NonNegativeSvgLengthOrPercentageOrNumber> for SvgLengthOrPercentageOrN
|
|||
/// An non-negative wrapper of SVGLength.
|
||||
pub type SVGWidth = generic::SVGLength<NonNegativeSvgLengthOrPercentageOrNumber>;
|
||||
|
||||
impl From<NonNegativeAu> for SVGWidth {
|
||||
fn from(length: NonNegativeAu) -> Self {
|
||||
impl From<NonNegativeLength> for SVGWidth {
|
||||
fn from(length: NonNegativeLength) -> Self {
|
||||
generic::SVGLength::Length(
|
||||
generic::SvgLengthOrPercentageOrNumber::LengthOrPercentage(length.into()))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue