diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 7db095ef64d..839fdeb1dc7 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -4546,6 +4546,31 @@ fn static_assert() { pub fn reset_image_orientation(&mut self, other: &Self) { self.copy_image_orientation_from(other) } + + pub fn clone_image_orientation(&self) -> longhands::image_orientation::computed_value::T { + use gecko_bindings::structs::{nsStyleImageOrientation_Bits, nsStyleImageOrientation_Angles}; + use properties::longhands::image_orientation::computed_value::{Orientation, T}; + + let gecko_orientation = self.gecko.mImageOrientation.mOrientation; + if gecko_orientation & nsStyleImageOrientation_Bits::FROM_IMAGE_MASK as u8 != 0 { + T::FromImage + } else { + const ANGLE0: u8 = nsStyleImageOrientation_Angles::ANGLE_0 as u8; + const ANGLE90: u8 = nsStyleImageOrientation_Angles::ANGLE_90 as u8; + const ANGLE180: u8 = nsStyleImageOrientation_Angles::ANGLE_180 as u8; + const ANGLE270: u8 = nsStyleImageOrientation_Angles::ANGLE_270 as u8; + + let flip = gecko_orientation & nsStyleImageOrientation_Bits::FLIP_MASK as u8 != 0; + let orientation = match gecko_orientation & nsStyleImageOrientation_Bits::ORIENTATION_MASK as u8 { + ANGLE0 => Orientation::Angle0, + ANGLE90 => Orientation::Angle90, + ANGLE180 => Orientation::Angle180, + ANGLE270 => Orientation::Angle270, + _ => unreachable!() + }; + T::AngleWithFlipped(orientation, flip) + } + } <%self:impl_trait style_struct_name="InheritedTable" @@ -5082,6 +5107,30 @@ clip-path ${impl_simple_copy('paint_order', 'mPaintOrder')} + pub fn clone_paint_order(&self) -> longhands::paint_order::computed_value::T { + use self::longhands::paint_order::{COUNT, FILL, MARKERS, NORMAL, SHIFT, STROKE}; + use self::longhands::paint_order::computed_value::T; + + if self.gecko.mPaintOrder == structs::NS_STYLE_PAINT_ORDER_NORMAL as u8 { + return T(NORMAL); + } + + const PAINT_ORDER_BITWIDTH: u8 = structs::NS_STYLE_PAINT_ORDER_BITWIDTH as u8; + let mask = (1 << PAINT_ORDER_BITWIDTH) - 1; + let mut order = 0; + for pos in 0..COUNT { + let value = + match (self.gecko.mPaintOrder >> pos * PAINT_ORDER_BITWIDTH & mask) as u32 { + structs::NS_STYLE_PAINT_ORDER_FILL => FILL, + structs::NS_STYLE_PAINT_ORDER_STROKE => STROKE, + structs::NS_STYLE_PAINT_ORDER_MARKERS => MARKERS, + _ => unreachable!(), + }; + order |= value << (pos * SHIFT); + }; + T(order) + } + pub fn set_stroke_dasharray(&mut self, v: longhands::stroke_dasharray::computed_value::T) { use gecko_bindings::structs::nsStyleSVG_STROKE_DASHARRAY_CONTEXT as CONTEXT_VALUE; use values::generics::svg::SVGStrokeDashArray; diff --git a/components/style/properties/longhand/inherited_box.mako.rs b/components/style/properties/longhand/inherited_box.mako.rs index 2a8bff1a120..99d9216fce3 100644 --- a/components/style/properties/longhand/inherited_box.mako.rs +++ b/components/style/properties/longhand/inherited_box.mako.rs @@ -59,7 +59,7 @@ ${helpers.single_keyword("image-rendering", // Image Orientation <%helpers:longhand name="image-orientation" products="gecko" - animation_value_type="none" + animation_value_type="discrete" spec="https://drafts.csswg.org/css-images/#propdef-image-orientation, \ /// additional values in https://developer.mozilla.org/en-US/docs/Web/CSS/image-orientation"> use std::fmt; diff --git a/components/style/properties/longhand/inherited_svg.mako.rs b/components/style/properties/longhand/inherited_svg.mako.rs index 053dd168629..a5bd2fdb35e 100644 --- a/components/style/properties/longhand/inherited_svg.mako.rs +++ b/components/style/properties/longhand/inherited_svg.mako.rs @@ -133,7 +133,7 @@ ${helpers.predefined_type("marker-end", "UrlOrNone", "Either::Second(None_)", spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties")} <%helpers:longhand name="paint-order" - animation_value_type="none" + animation_value_type="discrete" products="gecko" spec="https://www.w3.org/TR/SVG2/painting.html#PaintOrder">