aboutsummaryrefslogtreecommitdiffstats
path: root/ports/geckolib
diff options
context:
space:
mode:
authorHiroyuki Ikezoe <hikezoe@mozilla.com>2017-05-20 11:59:32 +0900
committerHiroyuki Ikezoe <hikezoe@mozilla.com>2017-05-21 08:33:12 +0900
commit3a3bc03eb88827d4a4b83b4279c7e02655f4606c (patch)
tree1cf5fb11e378fdcd109719c4b46cc4ac6ddf5ead /ports/geckolib
parentaba0db09435bc7894703c377376d1d65553f88d3 (diff)
downloadservo-3a3bc03eb88827d4a4b83b4279c7e02655f4606c.tar.gz
servo-3a3bc03eb88827d4a4b83b4279c7e02655f4606c.zip
Support prefixed intrinsic size value for {width,height,{inline,block}-size}}.
Diffstat (limited to 'ports/geckolib')
-rw-r--r--ports/geckolib/glue.rs26
1 files changed, 18 insertions, 8 deletions
diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs
index a78a43ef395..835d99feeca 100644
--- a/ports/geckolib/glue.rs
+++ b/ports/geckolib/glue.rs
@@ -1770,15 +1770,18 @@ pub extern "C" fn Servo_DeclarationBlock_SetPixelValue(declarations:
value: f32) {
use style::properties::{PropertyDeclaration, LonghandId};
use style::properties::longhands::border_spacing::SpecifiedValue as BorderSpacing;
+ use style::properties::longhands::height::SpecifiedValue as Height;
+ use style::properties::longhands::width::SpecifiedValue as Width;
use style::values::specified::BorderWidth;
+ use style::values::specified::MozLength;
use style::values::specified::length::{NoCalcLength, LengthOrPercentage};
let long = get_longhand_from_id!(property);
let nocalc = NoCalcLength::from_px(value);
let prop = match_wrap_declared! { long,
- Height => nocalc.into(),
- Width => nocalc.into(),
+ Height => Height(MozLength::LengthOrPercentageOrAuto(nocalc.into())),
+ Width => Width(MozLength::LengthOrPercentageOrAuto(nocalc.into())),
BorderTopWidth => BorderWidth::Width(nocalc.into()),
BorderRightWidth => BorderWidth::Width(nocalc.into()),
BorderBottomWidth => BorderWidth::Width(nocalc.into()),
@@ -1816,6 +1819,8 @@ pub extern "C" fn Servo_DeclarationBlock_SetLengthValue(declarations:
unit: structs::nsCSSUnit) {
use style::properties::{PropertyDeclaration, LonghandId};
use style::properties::longhands::_moz_script_min_size::SpecifiedValue as MozScriptMinSize;
+ use style::properties::longhands::width::SpecifiedValue as Width;
+ use style::values::specified::MozLength;
use style::values::specified::length::{AbsoluteLength, FontRelativeLength, PhysicalLength};
use style::values::specified::length::{LengthOrPercentage, NoCalcLength};
@@ -1835,7 +1840,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetLengthValue(declarations:
};
let prop = match_wrap_declared! { long,
- Width => nocalc.into(),
+ Width => Width(MozLength::LengthOrPercentageOrAuto(nocalc.into())),
FontSize => LengthOrPercentage::from(nocalc).into(),
MozScriptMinSize => MozScriptMinSize(nocalc),
};
@@ -1870,14 +1875,17 @@ pub extern "C" fn Servo_DeclarationBlock_SetPercentValue(declarations:
property: nsCSSPropertyID,
value: f32) {
use style::properties::{PropertyDeclaration, LonghandId};
+ use style::properties::longhands::height::SpecifiedValue as Height;
+ use style::properties::longhands::width::SpecifiedValue as Width;
+ use style::values::specified::MozLength;
use style::values::specified::length::{LengthOrPercentage, Percentage};
let long = get_longhand_from_id!(property);
let pc = Percentage(value);
let prop = match_wrap_declared! { long,
- Height => pc.into(),
- Width => pc.into(),
+ Height => Height(MozLength::LengthOrPercentageOrAuto(pc.into())),
+ Width => Width(MozLength::LengthOrPercentageOrAuto(pc.into())),
MarginTop => pc.into(),
MarginRight => pc.into(),
MarginBottom => pc.into(),
@@ -1894,14 +1902,16 @@ pub extern "C" fn Servo_DeclarationBlock_SetAutoValue(declarations:
RawServoDeclarationBlockBorrowed,
property: nsCSSPropertyID) {
use style::properties::{PropertyDeclaration, LonghandId};
- use style::values::specified::LengthOrPercentageOrAuto;
+ use style::properties::longhands::height::SpecifiedValue as Height;
+ use style::properties::longhands::width::SpecifiedValue as Width;
+ use style::values::specified::{LengthOrPercentageOrAuto, MozLength};
let long = get_longhand_from_id!(property);
let auto = LengthOrPercentageOrAuto::Auto;
let prop = match_wrap_declared! { long,
- Height => auto,
- Width => auto,
+ Height => Height(MozLength::LengthOrPercentageOrAuto(auto)),
+ Width => Width(MozLength::LengthOrPercentageOrAuto(auto)),
MarginTop => auto,
MarginRight => auto,
MarginBottom => auto,