mirror of
https://github.com/servo/servo.git
synced 2025-06-21 07:38:59 +01:00
make paint-order animatable
This commit is contained in:
parent
c18cac1f34
commit
25a46c40b3
2 changed files with 25 additions and 1 deletions
|
@ -5082,6 +5082,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;
|
||||
|
|
|
@ -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">
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue