style: Unpack StyleMotion and use cbindgen for OffsetPath.

Unpack StyleMotion and move its members into nsStyleDisplay, use
cbindgen to generate StyleOffsetPath.

Differential Revision: https://phabricator.services.mozilla.com/D31164
This commit is contained in:
Boris Chiou 2019-05-20 23:42:50 +00:00 committed by Emilio Cobos Álvarez
parent 8ee516b681
commit d80a5d9196
2 changed files with 3 additions and 35 deletions

View file

@ -2205,8 +2205,7 @@ fn static_assert() {
transition-timing-function transition-property
transform-style scroll-snap-points-x
scroll-snap-points-y scroll-snap-coordinate
-moz-binding offset-path shape-outside
-webkit-line-clamp""" %>
-moz-binding shape-outside -webkit-line-clamp""" %>
<%self:impl_trait style_struct_name="Box" skip_longhands="${skip_box_longhands}">
#[inline]
pub fn set_display(&mut self, v: longhands::display::computed_value::T) {
@ -2513,39 +2512,6 @@ fn static_assert() {
<% impl_shape_source("shape_outside", "mShapeOutside") %>
pub fn set_offset_path(&mut self, v: longhands::offset_path::computed_value::T) {
use crate::gecko_bindings::bindings::{Gecko_NewStyleMotion, Gecko_SetStyleMotion};
use crate::gecko_bindings::structs::StyleShapeSourceType;
use crate::values::generics::basic_shape::FillRule;
use crate::values::specified::OffsetPath;
let motion = unsafe { Gecko_NewStyleMotion().as_mut().unwrap() };
match v {
OffsetPath::None => motion.mOffsetPath.mType = StyleShapeSourceType::None,
OffsetPath::Path(p) => {
set_style_svg_path(&mut motion.mOffsetPath, p, FillRule::Nonzero)
},
}
unsafe { Gecko_SetStyleMotion(&mut self.gecko.mMotion, motion) };
}
pub fn clone_offset_path(&self) -> longhands::offset_path::computed_value::T {
use crate::values::specified::OffsetPath;
match unsafe { self.gecko.mMotion.mPtr.as_ref() } {
None => OffsetPath::none(),
Some(v) => (&v.mOffsetPath).into()
}
}
pub fn copy_offset_path_from(&mut self, other: &Self) {
use crate::gecko_bindings::bindings::Gecko_CopyStyleMotions;
unsafe { Gecko_CopyStyleMotions(&mut self.gecko.mMotion, other.gecko.mMotion.mPtr) };
}
pub fn reset_offset_path(&mut self, other: &Self) {
self.copy_offset_path_from(other);
}
#[allow(non_snake_case)]
pub fn set__webkit_line_clamp(&mut self, v: longhands::_webkit_line_clamp::computed_value::T) {
self.gecko.mLineClamp = match v {