mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Implement rotate property styling
This commit is contained in:
parent
a8c133d07e
commit
62c0c6feee
9 changed files with 113 additions and 16 deletions
|
@ -3016,13 +3016,45 @@ fn static_assert() {
|
|||
${impl_copy_animation_value(ident, gecko_ffi_name)}
|
||||
</%def>
|
||||
|
||||
<%def name="impl_individual_transform(ident, type, gecko_ffi_name)">
|
||||
pub fn set_${ident}(&mut self, other: values::computed::${type}) {
|
||||
unsafe { self.gecko.${gecko_ffi_name}.clear() };
|
||||
|
||||
if let Some(operation) = other.to_transform_operation() {
|
||||
convert_transform(&[operation], &mut self.gecko.${gecko_ffi_name})
|
||||
}
|
||||
}
|
||||
|
||||
pub fn copy_${ident}_from(&mut self, other: &Self) {
|
||||
unsafe { self.gecko.${gecko_ffi_name}.set(&other.gecko.${gecko_ffi_name}); }
|
||||
}
|
||||
|
||||
pub fn reset_${ident}(&mut self, other: &Self) {
|
||||
self.copy_${ident}_from(other)
|
||||
}
|
||||
|
||||
pub fn clone_${ident}(&self) -> values::computed::${type} {
|
||||
use values::generics::transform::${type};
|
||||
|
||||
if self.gecko.${gecko_ffi_name}.mRawPtr.is_null() {
|
||||
return ${type}::None;
|
||||
}
|
||||
|
||||
let list = unsafe { (*self.gecko.${gecko_ffi_name}.to_safe().get()).mHead.as_ref() };
|
||||
|
||||
let mut transform = clone_transform_from_list(list);
|
||||
debug_assert_eq!(transform.0.len(), 1);
|
||||
${type}::from_transform_operation(&transform.0.pop().unwrap())
|
||||
}
|
||||
</%def>
|
||||
|
||||
<% skip_box_longhands= """display overflow-y vertical-align
|
||||
animation-name animation-delay animation-duration
|
||||
animation-direction animation-fill-mode animation-play-state
|
||||
animation-iteration-count animation-timing-function
|
||||
transition-duration transition-delay
|
||||
transition-timing-function transition-property
|
||||
page-break-before page-break-after
|
||||
page-break-before page-break-after rotate
|
||||
scroll-snap-points-x scroll-snap-points-y
|
||||
scroll-snap-type-x scroll-snap-type-y scroll-snap-coordinate
|
||||
perspective-origin -moz-binding will-change
|
||||
|
@ -3454,6 +3486,8 @@ fn static_assert() {
|
|||
}
|
||||
}
|
||||
|
||||
${impl_individual_transform('rotate', 'Rotate', 'mSpecifiedRotate')}
|
||||
|
||||
pub fn set_will_change(&mut self, v: longhands::will_change::computed_value::T) {
|
||||
use gecko_bindings::bindings::{Gecko_AppendWillChange, Gecko_ClearWillChange};
|
||||
use gecko_bindings::structs::NS_STYLE_WILL_CHANGE_OPACITY;
|
||||
|
|
|
@ -390,6 +390,14 @@ ${helpers.predefined_type("transform", "Transform",
|
|||
flags="CREATES_STACKING_CONTEXT FIXPOS_CB",
|
||||
spec="https://drafts.csswg.org/css-transforms/#propdef-transform")}
|
||||
|
||||
${helpers.predefined_type("rotate", "Rotate",
|
||||
"generics::transform::Rotate::None",
|
||||
animation_value_type="ComputedValue",
|
||||
boxed=True,
|
||||
flags="CREATES_STACKING_CONTEXT FIXPOS_CB",
|
||||
gecko_pref="layout.css.individual-transform.enabled",
|
||||
spec="https://drafts.csswg.org/css-transforms-2/#individual-transforms")}
|
||||
|
||||
// CSSOM View Module
|
||||
// https://www.w3.org/TR/cssom-view-1/
|
||||
${helpers.single_keyword("scroll-behavior",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue