mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Auto merge of #16004 - CJKu:bug-1339674, r=heycam
stylo: Update clip-path and transform-box glue. <!-- Please describe your changes on the following line: --> Gecko bug1340044 should be land immediately after this PR been merged. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because it changes only the declaration type of mTransformBox <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16004) <!-- Reviewable:end -->
This commit is contained in:
commit
0b590aeed7
6 changed files with 68 additions and 69 deletions
|
@ -439,13 +439,13 @@ pub mod basic_shape {
|
||||||
fn from(reference: GeometryBox) -> Self {
|
fn from(reference: GeometryBox) -> Self {
|
||||||
use gecko_bindings::structs::StyleGeometryBox::*;
|
use gecko_bindings::structs::StyleGeometryBox::*;
|
||||||
match reference {
|
match reference {
|
||||||
GeometryBox::ShapeBox(ShapeBox::Content) => Content,
|
GeometryBox::ShapeBox(ShapeBox::ContentBox) => ContentBox,
|
||||||
GeometryBox::ShapeBox(ShapeBox::Padding) => Padding,
|
GeometryBox::ShapeBox(ShapeBox::PaddingBox) => PaddingBox,
|
||||||
GeometryBox::ShapeBox(ShapeBox::Border) => Border,
|
GeometryBox::ShapeBox(ShapeBox::BorderBox) => BorderBox,
|
||||||
GeometryBox::ShapeBox(ShapeBox::Margin) => Margin,
|
GeometryBox::ShapeBox(ShapeBox::MarginBox) => MarginBox,
|
||||||
GeometryBox::Fill => Fill,
|
GeometryBox::FillBox => FillBox,
|
||||||
GeometryBox::Stroke => Stroke,
|
GeometryBox::StrokeBox => StrokeBox,
|
||||||
GeometryBox::View => View,
|
GeometryBox::ViewBox => ViewBox,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -457,13 +457,13 @@ pub mod basic_shape {
|
||||||
fn from(reference: StyleGeometryBox) -> Self {
|
fn from(reference: StyleGeometryBox) -> Self {
|
||||||
use gecko_bindings::structs::StyleGeometryBox::*;
|
use gecko_bindings::structs::StyleGeometryBox::*;
|
||||||
match reference {
|
match reference {
|
||||||
Content => GeometryBox::ShapeBox(ShapeBox::Content),
|
ContentBox => GeometryBox::ShapeBox(ShapeBox::ContentBox),
|
||||||
Padding => GeometryBox::ShapeBox(ShapeBox::Padding),
|
PaddingBox => GeometryBox::ShapeBox(ShapeBox::PaddingBox),
|
||||||
Border => GeometryBox::ShapeBox(ShapeBox::Border),
|
BorderBox => GeometryBox::ShapeBox(ShapeBox::BorderBox),
|
||||||
Margin => GeometryBox::ShapeBox(ShapeBox::Margin),
|
MarginBox => GeometryBox::ShapeBox(ShapeBox::MarginBox),
|
||||||
Fill => GeometryBox::Fill,
|
FillBox => GeometryBox::FillBox,
|
||||||
Stroke => GeometryBox::Stroke,
|
StrokeBox => GeometryBox::StrokeBox,
|
||||||
View => GeometryBox::View,
|
ViewBox => GeometryBox::ViewBox,
|
||||||
other => panic!("Unexpected StyleGeometryBox::{:?} while converting to GeometryBox", other),
|
other => panic!("Unexpected StyleGeometryBox::{:?} while converting to GeometryBox", other),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -711,9 +711,6 @@ pub mod root {
|
||||||
pub const NS_STYLE_TOUCH_ACTION_MANIPULATION: ::std::os::raw::c_uint = 16;
|
pub const NS_STYLE_TOUCH_ACTION_MANIPULATION: ::std::os::raw::c_uint = 16;
|
||||||
pub const NS_STYLE_TOP_LAYER_NONE: ::std::os::raw::c_uint = 0;
|
pub const NS_STYLE_TOP_LAYER_NONE: ::std::os::raw::c_uint = 0;
|
||||||
pub const NS_STYLE_TOP_LAYER_TOP: ::std::os::raw::c_uint = 1;
|
pub const NS_STYLE_TOP_LAYER_TOP: ::std::os::raw::c_uint = 1;
|
||||||
pub const NS_STYLE_TRANSFORM_BOX_BORDER_BOX: ::std::os::raw::c_uint = 0;
|
|
||||||
pub const NS_STYLE_TRANSFORM_BOX_FILL_BOX: ::std::os::raw::c_uint = 1;
|
|
||||||
pub const NS_STYLE_TRANSFORM_BOX_VIEW_BOX: ::std::os::raw::c_uint = 2;
|
|
||||||
pub const NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE: ::std::os::raw::c_uint
|
pub const NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE: ::std::os::raw::c_uint
|
||||||
=
|
=
|
||||||
0;
|
0;
|
||||||
|
@ -5965,13 +5962,13 @@ pub mod root {
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
pub enum StyleGeometryBox {
|
pub enum StyleGeometryBox {
|
||||||
Content = 0,
|
ContentBox = 0,
|
||||||
Padding = 1,
|
PaddingBox = 1,
|
||||||
Border = 2,
|
BorderBox = 2,
|
||||||
Margin = 3,
|
MarginBox = 3,
|
||||||
Fill = 4,
|
FillBox = 4,
|
||||||
Stroke = 5,
|
StrokeBox = 5,
|
||||||
View = 6,
|
ViewBox = 6,
|
||||||
NoClip = 7,
|
NoClip = 7,
|
||||||
Text = 8,
|
Text = 8,
|
||||||
NoBox = 9,
|
NoBox = 9,
|
||||||
|
@ -21657,7 +21654,7 @@ pub mod root {
|
||||||
pub mScrollSnapCoordinate: root::nsTArray<root::mozilla::Position>,
|
pub mScrollSnapCoordinate: root::nsTArray<root::mozilla::Position>,
|
||||||
pub mBackfaceVisibility: u8,
|
pub mBackfaceVisibility: u8,
|
||||||
pub mTransformStyle: u8,
|
pub mTransformStyle: u8,
|
||||||
pub mTransformBox: u8,
|
pub mTransformBox: root::nsStyleDisplay_StyleGeometryBox,
|
||||||
pub mSpecifiedTransform: root::RefPtr<root::nsCSSValueSharedList>,
|
pub mSpecifiedTransform: root::RefPtr<root::nsCSSValueSharedList>,
|
||||||
pub mTransformOrigin: [root::nsStyleCoord; 3usize],
|
pub mTransformOrigin: [root::nsStyleCoord; 3usize],
|
||||||
pub mChildPerspective: root::nsStyleCoord,
|
pub mChildPerspective: root::nsStyleCoord,
|
||||||
|
@ -21679,6 +21676,8 @@ pub mod root {
|
||||||
pub mAnimationIterationCountCount: u32,
|
pub mAnimationIterationCountCount: u32,
|
||||||
pub mShapeOutside: root::mozilla::StyleShapeSource,
|
pub mShapeOutside: root::mozilla::StyleShapeSource,
|
||||||
}
|
}
|
||||||
|
pub use self::super::root::mozilla::StyleGeometryBox as
|
||||||
|
nsStyleDisplay_StyleGeometryBox;
|
||||||
#[test]
|
#[test]
|
||||||
fn bindgen_test_layout_nsStyleDisplay() {
|
fn bindgen_test_layout_nsStyleDisplay() {
|
||||||
assert_eq!(::std::mem::size_of::<nsStyleDisplay>() , 416usize , concat
|
assert_eq!(::std::mem::size_of::<nsStyleDisplay>() , 416usize , concat
|
||||||
|
|
|
@ -711,9 +711,6 @@ pub mod root {
|
||||||
pub const NS_STYLE_TOUCH_ACTION_MANIPULATION: ::std::os::raw::c_uint = 16;
|
pub const NS_STYLE_TOUCH_ACTION_MANIPULATION: ::std::os::raw::c_uint = 16;
|
||||||
pub const NS_STYLE_TOP_LAYER_NONE: ::std::os::raw::c_uint = 0;
|
pub const NS_STYLE_TOP_LAYER_NONE: ::std::os::raw::c_uint = 0;
|
||||||
pub const NS_STYLE_TOP_LAYER_TOP: ::std::os::raw::c_uint = 1;
|
pub const NS_STYLE_TOP_LAYER_TOP: ::std::os::raw::c_uint = 1;
|
||||||
pub const NS_STYLE_TRANSFORM_BOX_BORDER_BOX: ::std::os::raw::c_uint = 0;
|
|
||||||
pub const NS_STYLE_TRANSFORM_BOX_FILL_BOX: ::std::os::raw::c_uint = 1;
|
|
||||||
pub const NS_STYLE_TRANSFORM_BOX_VIEW_BOX: ::std::os::raw::c_uint = 2;
|
|
||||||
pub const NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE: ::std::os::raw::c_uint
|
pub const NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE: ::std::os::raw::c_uint
|
||||||
=
|
=
|
||||||
0;
|
0;
|
||||||
|
@ -5804,13 +5801,13 @@ pub mod root {
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
pub enum StyleGeometryBox {
|
pub enum StyleGeometryBox {
|
||||||
Content = 0,
|
ContentBox = 0,
|
||||||
Padding = 1,
|
PaddingBox = 1,
|
||||||
Border = 2,
|
BorderBox = 2,
|
||||||
Margin = 3,
|
MarginBox = 3,
|
||||||
Fill = 4,
|
FillBox = 4,
|
||||||
Stroke = 5,
|
StrokeBox = 5,
|
||||||
View = 6,
|
ViewBox = 6,
|
||||||
NoClip = 7,
|
NoClip = 7,
|
||||||
Text = 8,
|
Text = 8,
|
||||||
NoBox = 9,
|
NoBox = 9,
|
||||||
|
@ -21016,7 +21013,7 @@ pub mod root {
|
||||||
pub mScrollSnapCoordinate: root::nsTArray<root::mozilla::Position>,
|
pub mScrollSnapCoordinate: root::nsTArray<root::mozilla::Position>,
|
||||||
pub mBackfaceVisibility: u8,
|
pub mBackfaceVisibility: u8,
|
||||||
pub mTransformStyle: u8,
|
pub mTransformStyle: u8,
|
||||||
pub mTransformBox: u8,
|
pub mTransformBox: root::nsStyleDisplay_StyleGeometryBox,
|
||||||
pub mSpecifiedTransform: root::RefPtr<root::nsCSSValueSharedList>,
|
pub mSpecifiedTransform: root::RefPtr<root::nsCSSValueSharedList>,
|
||||||
pub mTransformOrigin: [root::nsStyleCoord; 3usize],
|
pub mTransformOrigin: [root::nsStyleCoord; 3usize],
|
||||||
pub mChildPerspective: root::nsStyleCoord,
|
pub mChildPerspective: root::nsStyleCoord,
|
||||||
|
@ -21038,6 +21035,8 @@ pub mod root {
|
||||||
pub mAnimationIterationCountCount: u32,
|
pub mAnimationIterationCountCount: u32,
|
||||||
pub mShapeOutside: root::mozilla::StyleShapeSource,
|
pub mShapeOutside: root::mozilla::StyleShapeSource,
|
||||||
}
|
}
|
||||||
|
pub use self::super::root::mozilla::StyleGeometryBox as
|
||||||
|
nsStyleDisplay_StyleGeometryBox;
|
||||||
#[test]
|
#[test]
|
||||||
fn bindgen_test_layout_nsStyleDisplay() {
|
fn bindgen_test_layout_nsStyleDisplay() {
|
||||||
assert_eq!(::std::mem::size_of::<nsStyleDisplay>() , 416usize , concat
|
assert_eq!(::std::mem::size_of::<nsStyleDisplay>() , 416usize , concat
|
||||||
|
|
|
@ -2000,13 +2000,13 @@ fn static_assert() {
|
||||||
use properties::longhands::${shorthand}_clip::single_value::computed_value::T;
|
use properties::longhands::${shorthand}_clip::single_value::computed_value::T;
|
||||||
|
|
||||||
match servo {
|
match servo {
|
||||||
T::border_box => StyleGeometryBox::Border,
|
T::border_box => StyleGeometryBox::BorderBox,
|
||||||
T::padding_box => StyleGeometryBox::Padding,
|
T::padding_box => StyleGeometryBox::PaddingBox,
|
||||||
T::content_box => StyleGeometryBox::Content,
|
T::content_box => StyleGeometryBox::ContentBox,
|
||||||
% if shorthand == "mask":
|
% if shorthand == "mask":
|
||||||
T::fill_box => StyleGeometryBox::Fill,
|
T::fill_box => StyleGeometryBox::FillBox,
|
||||||
T::stroke_box => StyleGeometryBox::Stroke,
|
T::stroke_box => StyleGeometryBox::StrokeBox,
|
||||||
T::view_box => StyleGeometryBox::View,
|
T::view_box => StyleGeometryBox::ViewBox,
|
||||||
T::no_clip => StyleGeometryBox::NoClip,
|
T::no_clip => StyleGeometryBox::NoClip,
|
||||||
% elif shorthand == "background":
|
% elif shorthand == "background":
|
||||||
T::text => StyleGeometryBox::Text,
|
T::text => StyleGeometryBox::Text,
|
||||||
|
@ -2019,13 +2019,13 @@ fn static_assert() {
|
||||||
use properties::longhands::${shorthand}_origin::single_value::computed_value::T;
|
use properties::longhands::${shorthand}_origin::single_value::computed_value::T;
|
||||||
|
|
||||||
match servo {
|
match servo {
|
||||||
T::border_box => StyleGeometryBox::Border,
|
T::border_box => StyleGeometryBox::BorderBox,
|
||||||
T::padding_box => StyleGeometryBox::Padding,
|
T::padding_box => StyleGeometryBox::PaddingBox,
|
||||||
T::content_box => StyleGeometryBox::Content,
|
T::content_box => StyleGeometryBox::ContentBox,
|
||||||
% if shorthand == "mask":
|
% if shorthand == "mask":
|
||||||
T::fill_box => StyleGeometryBox::Fill,
|
T::fill_box => StyleGeometryBox::FillBox,
|
||||||
T::stroke_box => StyleGeometryBox::Stroke,
|
T::stroke_box => StyleGeometryBox::StrokeBox,
|
||||||
T::view_box => StyleGeometryBox::View,
|
T::view_box => StyleGeometryBox::ViewBox,
|
||||||
% endif
|
% endif
|
||||||
}
|
}
|
||||||
</%self:simple_image_array_property>
|
</%self:simple_image_array_property>
|
||||||
|
|
|
@ -1807,6 +1807,7 @@ ${helpers.single_keyword("backface-visibility",
|
||||||
|
|
||||||
${helpers.single_keyword("transform-box",
|
${helpers.single_keyword("transform-box",
|
||||||
"border-box fill-box view-box",
|
"border-box fill-box view-box",
|
||||||
|
gecko_enum_prefix="StyleGeometryBox",
|
||||||
products="gecko",
|
products="gecko",
|
||||||
spec="https://drafts.csswg.org/css-transforms/#transform-box",
|
spec="https://drafts.csswg.org/css-transforms/#transform-box",
|
||||||
animatable=False)}
|
animatable=False)}
|
||||||
|
|
|
@ -859,9 +859,9 @@ impl ToCss for FillRule {
|
||||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub enum GeometryBox {
|
pub enum GeometryBox {
|
||||||
Fill,
|
FillBox,
|
||||||
Stroke,
|
StrokeBox,
|
||||||
View,
|
ViewBox,
|
||||||
ShapeBox(ShapeBox),
|
ShapeBox(ShapeBox),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -871,9 +871,9 @@ impl Parse for GeometryBox {
|
||||||
Ok(GeometryBox::ShapeBox(shape_box))
|
Ok(GeometryBox::ShapeBox(shape_box))
|
||||||
} else {
|
} else {
|
||||||
match_ignore_ascii_case! { &try!(input.expect_ident()),
|
match_ignore_ascii_case! { &try!(input.expect_ident()),
|
||||||
"fill-box" => Ok(GeometryBox::Fill),
|
"fill-box" => Ok(GeometryBox::FillBox),
|
||||||
"stroke-box" => Ok(GeometryBox::Stroke),
|
"stroke-box" => Ok(GeometryBox::StrokeBox),
|
||||||
"view-box" => Ok(GeometryBox::View),
|
"view-box" => Ok(GeometryBox::ViewBox),
|
||||||
_ => Err(())
|
_ => Err(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -883,9 +883,9 @@ impl Parse for GeometryBox {
|
||||||
impl ToCss for GeometryBox {
|
impl ToCss for GeometryBox {
|
||||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||||
match *self {
|
match *self {
|
||||||
GeometryBox::Fill => dest.write_str("fill-box"),
|
GeometryBox::FillBox => dest.write_str("fill-box"),
|
||||||
GeometryBox::Stroke => dest.write_str("stroke-box"),
|
GeometryBox::StrokeBox => dest.write_str("stroke-box"),
|
||||||
GeometryBox::View => dest.write_str("view-box"),
|
GeometryBox::ViewBox => dest.write_str("view-box"),
|
||||||
GeometryBox::ShapeBox(s) => s.to_css(dest),
|
GeometryBox::ShapeBox(s) => s.to_css(dest),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -898,20 +898,20 @@ impl ComputedValueAsSpecified for GeometryBox {}
|
||||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub enum ShapeBox {
|
pub enum ShapeBox {
|
||||||
Margin,
|
MarginBox,
|
||||||
// https://drafts.csswg.org/css-backgrounds-3/#box
|
// https://drafts.csswg.org/css-backgrounds-3/#box
|
||||||
Border,
|
BorderBox,
|
||||||
Padding,
|
PaddingBox,
|
||||||
Content,
|
ContentBox,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Parse for ShapeBox {
|
impl Parse for ShapeBox {
|
||||||
fn parse(_context: &ParserContext, input: &mut Parser) -> Result<Self, ()> {
|
fn parse(_context: &ParserContext, input: &mut Parser) -> Result<Self, ()> {
|
||||||
match_ignore_ascii_case! { &try!(input.expect_ident()),
|
match_ignore_ascii_case! { &try!(input.expect_ident()),
|
||||||
"margin-box" => Ok(ShapeBox::Margin),
|
"margin-box" => Ok(ShapeBox::MarginBox),
|
||||||
"border-box" => Ok(ShapeBox::Border),
|
"border-box" => Ok(ShapeBox::BorderBox),
|
||||||
"padding-box" => Ok(ShapeBox::Padding),
|
"padding-box" => Ok(ShapeBox::PaddingBox),
|
||||||
"content-box" => Ok(ShapeBox::Content),
|
"content-box" => Ok(ShapeBox::ContentBox),
|
||||||
_ => Err(())
|
_ => Err(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -920,10 +920,10 @@ impl Parse for ShapeBox {
|
||||||
impl ToCss for ShapeBox {
|
impl ToCss for ShapeBox {
|
||||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||||
match *self {
|
match *self {
|
||||||
ShapeBox::Margin => dest.write_str("margin-box"),
|
ShapeBox::MarginBox => dest.write_str("margin-box"),
|
||||||
ShapeBox::Border => dest.write_str("border-box"),
|
ShapeBox::BorderBox => dest.write_str("border-box"),
|
||||||
ShapeBox::Padding => dest.write_str("padding-box"),
|
ShapeBox::PaddingBox => dest.write_str("padding-box"),
|
||||||
ShapeBox::Content => dest.write_str("content-box"),
|
ShapeBox::ContentBox => dest.write_str("content-box"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue