Skip to content

Commit a93e7ef

Browse files
authored
Enable will-change property for servo; merge change_bits_for_longhand (#128)
Signed-off-by: Euclid Ye <[email protected]>
1 parent 0190fff commit a93e7ef

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

style/properties/longhands/box.mako.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,12 @@ ${helpers.predefined_type(
233233
"offset-path",
234234
"OffsetPath",
235235
"computed::OffsetPath::none()",
236-
engines="gecko",
236+
engines="gecko servo",
237237
flags="CAN_ANIMATE_ON_COMPOSITOR",
238238
spec="https://drafts.fxtf.org/motion-1/#offset-path-property",
239239
servo_restyle_damage="reflow_out_of_flow",
240240
affects="overflow",
241+
servo_pref="layout.unimplemented",
241242
)}
242243

243244
// Motion Path Module Level 1
@@ -476,10 +477,11 @@ ${helpers.predefined_type(
476477
"contain",
477478
"Contain",
478479
"specified::Contain::empty()",
479-
engines="gecko",
480+
engines="gecko servo",
480481
animation_type="none",
481482
spec="https://drafts.csswg.org/css-contain/#contain-property",
482483
affects="layout",
484+
servo_pref="layout.unimplemented",
483485
)}
484486

485487
${helpers.predefined_type(
@@ -554,7 +556,7 @@ ${helpers.predefined_type(
554556
"will-change",
555557
"WillChange",
556558
"computed::WillChange::auto()",
557-
engines="gecko",
559+
engines="gecko servo",
558560
animation_type="none",
559561
spec="https://drafts.csswg.org/css-will-change/#will-change",
560562
affects="layout",

style/properties/longhands/effects.mako.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ ${helpers.predefined_type(
5959
"backdrop-filter",
6060
"Filter",
6161
None,
62-
engines="gecko",
62+
engines="gecko servo",
6363
vector=True,
6464
simple_vector_bindings=True,
6565
gecko_ffi_name="mBackdropFilters",
@@ -68,6 +68,7 @@ ${helpers.predefined_type(
6868
gecko_pref="layout.css.backdrop-filter.enabled",
6969
spec="https://drafts.fxtf.org/filter-effects-2/#propdef-backdrop-filter",
7070
affects="overflow",
71+
servo_pref="layout.unimplemented",
7172
)}
7273
7374
${helpers.single_keyword(

style/properties/longhands/svg.mako.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ ${helpers.single_keyword(
180180
${helpers.predefined_type(
181181
"mask-image",
182182
"Image",
183-
engines="gecko",
183+
engines="gecko servo",
184184
initial_value="computed::Image::None",
185185
initial_specified_value="specified::Image::None",
186186
parse_method="parse_with_cors_anonymous",
@@ -189,6 +189,7 @@ ${helpers.predefined_type(
189189
extra_prefixes="webkit",
190190
animation_type="discrete",
191191
affects="paint",
192+
servo_pref="layout.unimplemented",
192193
)}
193194
194195
${helpers.predefined_type(

style/properties/longhands/ui.mako.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,11 @@ ${helpers.predefined_type(
432432
"view-transition-name",
433433
"ViewTransitionName",
434434
"computed::ViewTransitionName::none()",
435-
engines="gecko",
435+
engines="gecko servo",
436436
animation_type="discrete",
437437
gecko_pref="dom.viewTransitions.enabled",
438438
spec="https://drafts.csswg.org/css-view-transitions-1/#view-transition-name-prop",
439439
affects="",
440440
enabled_in="ua",
441+
servo_pref="layout.unimplemented",
441442
)}

style/values/specified/box.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ pub struct WillChange {
968968
/// A bitfield with the kind of change that the value will create, based
969969
/// on the above field.
970970
#[css(skip)]
971-
bits: WillChangeBits,
971+
pub bits: WillChangeBits,
972972
}
973973

974974
impl WillChange {
@@ -1022,10 +1022,6 @@ bitflags! {
10221022
}
10231023
}
10241024

1025-
#[cfg(feature="servo")]
1026-
fn change_bits_for_longhand(_longhand: LonghandId) -> WillChangeBits { WillChangeBits::empty() }
1027-
1028-
#[cfg(feature = "gecko")]
10291025
fn change_bits_for_longhand(longhand: LonghandId) -> WillChangeBits {
10301026
match longhand {
10311027
LonghandId::Opacity => WillChangeBits::OPACITY,

style/values/specified/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub use self::box_::{
4444
ContainerName, ContainerType, ContentVisibility, Display, Float, LineClamp, Overflow,
4545
OverflowAnchor, OverflowClipBox, OverscrollBehavior, Perspective, PositionProperty, Resize,
4646
ScrollSnapAlign, ScrollSnapAxis, ScrollSnapStop, ScrollSnapStrictness, ScrollSnapType,
47-
ScrollbarGutter, TouchAction, VerticalAlign, WillChange, Zoom,
47+
ScrollbarGutter, TouchAction, VerticalAlign, WillChange, WillChangeBits, Zoom,
4848
};
4949
pub use self::color::{
5050
Color, ColorOrAuto, ColorPropertyValue, ColorScheme, ForcedColorAdjust, PrintColorAdjust,

0 commit comments

Comments
 (0)