mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 18:04:46 +00:00
Bug 1404140 - Remove the GetCSNeedsLayoutFlush flag, as it is unneeded now. r=heycam
MANUAL PUSH: Would need to reorder the stack manually (https://bugzilla.mozilla.org/show_bug.cgi?id=1481539) Differential Revision: https://phabricator.services.mozilla.com/D40300
This commit is contained in:
parent
b38e7248ab
commit
0f118f30e5
@ -16,10 +16,6 @@ enum class CSSPropFlags : uint8_t {
|
||||
// attribute mapping.
|
||||
Inaccessible = 1 << 0,
|
||||
|
||||
// This property's getComputedStyle implementation requires layout to
|
||||
// be flushed.
|
||||
GetCSNeedsLayoutFlush = 1 << 1,
|
||||
|
||||
// The following two flags along with the pref defines where the this
|
||||
// property can be used:
|
||||
// * If none of the two flags is presented, the pref completely controls
|
||||
@ -36,24 +32,24 @@ enum class CSSPropFlags : uint8_t {
|
||||
// transitions) these flags are ignored. That is, if the property is disabled
|
||||
// by a pref, we will *not* run animations or transitions on it even in
|
||||
// UA sheets or chrome.
|
||||
EnabledInUASheets = 1 << 2,
|
||||
EnabledInChrome = 1 << 3,
|
||||
EnabledInUASheets = 1 << 1,
|
||||
EnabledInChrome = 1 << 2,
|
||||
EnabledInUASheetsAndChrome = EnabledInUASheets | EnabledInChrome,
|
||||
EnabledMask = EnabledInUASheetsAndChrome,
|
||||
|
||||
// This property can be animated on the compositor.
|
||||
CanAnimateOnCompositor = 1 << 4,
|
||||
CanAnimateOnCompositor = 1 << 3,
|
||||
|
||||
// This property is an internal property that is not represented in
|
||||
// the DOM. Properties with this flag are defined in an #ifndef
|
||||
// CSS_PROP_LIST_EXCLUDE_INTERNAL section.
|
||||
Internal = 1 << 5,
|
||||
Internal = 1 << 4,
|
||||
|
||||
// Whether this property should be serialized by Servo in getComputedStyle.
|
||||
SerializedByServo = 1 << 6,
|
||||
SerializedByServo = 1 << 5,
|
||||
|
||||
// Whether this is a logical property.
|
||||
IsLogical = 1 << 7,
|
||||
IsLogical = 1 << 6,
|
||||
};
|
||||
|
||||
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(CSSPropFlags)
|
||||
|
@ -69,23 +69,42 @@ LONGHANDS_NOT_SERIALIZED_WITH_SERVO = [
|
||||
"column-rule-width",
|
||||
|
||||
# These resolve auto to zero in a few cases, but not all.
|
||||
"max-block-size",
|
||||
"max-height",
|
||||
"max-inline-size",
|
||||
"max-width",
|
||||
"min-block-size",
|
||||
"min-height",
|
||||
"min-inline-size",
|
||||
"min-width",
|
||||
|
||||
# resistfingerprinting stuff.
|
||||
"-moz-osx-font-smoothing",
|
||||
|
||||
# Layout dependent.
|
||||
"width",
|
||||
"height",
|
||||
"line-height",
|
||||
"grid-template-rows",
|
||||
"grid-template-columns",
|
||||
"perspective-origin",
|
||||
"transform-origin",
|
||||
"transform",
|
||||
"top",
|
||||
"right",
|
||||
"bottom",
|
||||
"left",
|
||||
"border-top-width",
|
||||
"border-right-width",
|
||||
"border-bottom-width",
|
||||
"border-left-width",
|
||||
"margin-top",
|
||||
"margin-right",
|
||||
"margin-bottom",
|
||||
"margin-left",
|
||||
"padding-top",
|
||||
"padding-right",
|
||||
"padding-bottom",
|
||||
"padding-left",
|
||||
]
|
||||
|
||||
def serialized_by_servo(prop):
|
||||
# If the property requires layout information, no such luck.
|
||||
if "GETCS_NEEDS_LAYOUT_FLUSH" in prop.flags:
|
||||
return False
|
||||
if prop.type() == "shorthand":
|
||||
# FIXME: Need to serialize a value interpolated with currentcolor
|
||||
# properly to be able to use text-decoration, and figure out what to do
|
||||
@ -114,8 +133,6 @@ def flags(prop):
|
||||
result.append("Internal")
|
||||
if prop.enabled_in == "":
|
||||
result.append("Inaccessible")
|
||||
if "GETCS_NEEDS_LAYOUT_FLUSH" in prop.flags:
|
||||
result.append("GetCSNeedsLayoutFlush")
|
||||
if "CAN_ANIMATE_ON_COMPOSITOR" in prop.flags:
|
||||
result.append("CanAnimateOnCompositor")
|
||||
if exposed_on_getcs(prop):
|
||||
|
@ -4464,11 +4464,6 @@
|
||||
#
|
||||
# Only enabled on Nightly and early beta, at least for now.
|
||||
#
|
||||
# NOTE(emilio): If / when removing this pref, the GETCS_NEEDS_LAYOUT_FLUSH flag
|
||||
# should be removed from line-height (and we should let -moz-block-height
|
||||
# compute to the keyword as well, which shouldn't be observable anyway since
|
||||
# it's an internal value).
|
||||
#
|
||||
# It'd be nice to make numbers compute also to themselves, but it looks like
|
||||
# everybody agrees on turning them into pixels, see the discussion starting
|
||||
# from [1].
|
||||
|
@ -58,7 +58,6 @@
|
||||
animation_value_type="NonNegativeLength",
|
||||
logical=is_logical,
|
||||
logical_group="border-width",
|
||||
flags="GETCS_NEEDS_LAYOUT_FLUSH",
|
||||
allow_quirks="No" if is_logical else "Yes",
|
||||
servo_restyle_damage="reflow rebuild_and_reflow_inline"
|
||||
)}
|
||||
|
@ -339,8 +339,7 @@ ${helpers.predefined_type(
|
||||
servo_2020_pref="layout.2020.unimplemented",
|
||||
extra_prefixes=transform_extra_prefixes,
|
||||
animation_value_type="ComputedValue",
|
||||
flags="CREATES_STACKING_CONTEXT FIXPOS_CB \
|
||||
GETCS_NEEDS_LAYOUT_FLUSH CAN_ANIMATE_ON_COMPOSITOR",
|
||||
flags="CREATES_STACKING_CONTEXT FIXPOS_CB CAN_ANIMATE_ON_COMPOSITOR",
|
||||
spec="https://drafts.csswg.org/css-transforms/#propdef-transform",
|
||||
servo_restyle_damage="reflow_out_of_flow",
|
||||
)}
|
||||
@ -552,7 +551,6 @@ ${helpers.predefined_type(
|
||||
boxed=True,
|
||||
extra_prefixes=transform_extra_prefixes,
|
||||
spec="https://drafts.csswg.org/css-transforms-2/#perspective-origin-property",
|
||||
flags="GETCS_NEEDS_LAYOUT_FLUSH",
|
||||
animation_value_type="ComputedValue",
|
||||
servo_restyle_damage="reflow_out_of_flow"
|
||||
)}
|
||||
@ -600,7 +598,6 @@ ${helpers.predefined_type(
|
||||
extra_prefixes=transform_extra_prefixes,
|
||||
gecko_ffi_name="mTransformOrigin",
|
||||
boxed=True,
|
||||
flags="GETCS_NEEDS_LAYOUT_FLUSH",
|
||||
spec="https://drafts.csswg.org/css-transforms/#transform-origin-property",
|
||||
servo_restyle_damage="reflow_out_of_flow",
|
||||
)}
|
||||
|
@ -23,7 +23,6 @@ ${helpers.predefined_type(
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.2020.unimplemented",
|
||||
animation_value_type="LineHeight",
|
||||
flags="GETCS_NEEDS_LAYOUT_FLUSH",
|
||||
spec="https://drafts.csswg.org/css2/visudet.html#propdef-line-height",
|
||||
servo_restyle_damage="reflow"
|
||||
)}
|
||||
|
@ -24,7 +24,6 @@
|
||||
logical=side[1],
|
||||
logical_group="margin",
|
||||
spec=spec,
|
||||
flags="GETCS_NEEDS_LAYOUT_FLUSH",
|
||||
allowed_in_page_rule=True,
|
||||
servo_restyle_damage="reflow"
|
||||
)}
|
||||
|
@ -23,7 +23,6 @@
|
||||
logical=side[1],
|
||||
logical_group="padding",
|
||||
spec=spec,
|
||||
flags="GETCS_NEEDS_LAYOUT_FLUSH",
|
||||
allow_quirks="No" if side[1] else "Yes",
|
||||
servo_restyle_damage="reflow rebuild_and_reflow_inline"
|
||||
)}
|
||||
|
@ -17,7 +17,6 @@
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.2020.unimplemented",
|
||||
spec="https://www.w3.org/TR/CSS2/visuren.html#propdef-%s" % side,
|
||||
flags="GETCS_NEEDS_LAYOUT_FLUSH",
|
||||
animation_value_type="ComputedValue",
|
||||
allow_quirks="Yes",
|
||||
servo_restyle_damage="reflow_out_of_flow",
|
||||
@ -33,7 +32,6 @@
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
servo_2020_pref="layout.2020.unimplemented",
|
||||
spec="https://drafts.csswg.org/css-logical-props/#propdef-inset-%s" % side,
|
||||
flags="GETCS_NEEDS_LAYOUT_FLUSH",
|
||||
alias="offset-%s:layout.css.offset-logical-properties.enabled" % side,
|
||||
animation_value_type="ComputedValue",
|
||||
logical=True,
|
||||
@ -285,7 +283,6 @@ ${helpers.predefined_type(
|
||||
allow_quirks="No" if logical else "Yes",
|
||||
spec=spec % size,
|
||||
animation_value_type="Size",
|
||||
flags="GETCS_NEEDS_LAYOUT_FLUSH",
|
||||
servo_restyle_damage="reflow",
|
||||
)}
|
||||
// min-width, min-height, min-block-size, min-inline-size
|
||||
@ -379,7 +376,6 @@ ${helpers.predefined_type(
|
||||
engines="gecko",
|
||||
spec="https://drafts.csswg.org/css-grid/#propdef-grid-template-%ss" % kind,
|
||||
boxed=True,
|
||||
flags="GETCS_NEEDS_LAYOUT_FLUSH",
|
||||
animation_value_type="ComputedValue",
|
||||
)}
|
||||
|
||||
|
@ -80,7 +80,6 @@ ${helpers.predefined_type(
|
||||
"Transform",
|
||||
"generics::transform::Transform::none()",
|
||||
engines="gecko",
|
||||
flags="GETCS_NEEDS_LAYOUT_FLUSH",
|
||||
animation_value_type="ComputedValue",
|
||||
spec="None (Nonstandard internal property)",
|
||||
enabled_in="chrome",
|
||||
@ -94,7 +93,6 @@ ${helpers.predefined_type(
|
||||
animation_value_type="ComputedValue",
|
||||
gecko_ffi_name="mWindowTransformOrigin",
|
||||
boxed=True,
|
||||
flags="GETCS_NEEDS_LAYOUT_FLUSH",
|
||||
spec="None (Nonstandard internal property)",
|
||||
enabled_in="chrome",
|
||||
)}
|
||||
|
@ -979,13 +979,10 @@ bitflags! {
|
||||
const APPLIES_TO_CUE = 1 << 6;
|
||||
/// This longhand property applies to ::marker.
|
||||
const APPLIES_TO_MARKER = 1 << 7;
|
||||
/// This property's getComputedStyle implementation requires layout
|
||||
/// to be flushed.
|
||||
const GETCS_NEEDS_LAYOUT_FLUSH = 1 << 8;
|
||||
/// This property is a legacy shorthand.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-cascade/#legacy-shorthand
|
||||
const IS_LEGACY_SHORTHAND = 1 << 9;
|
||||
const IS_LEGACY_SHORTHAND = 1 << 8;
|
||||
|
||||
/* The following flags are currently not used in Rust code, they
|
||||
* only need to be listed in corresponding properties so that
|
||||
|
@ -6040,15 +6040,7 @@ pub unsafe extern "C" fn Servo_GetPropertyValue(
|
||||
prop: nsCSSPropertyID,
|
||||
value: *mut nsAString,
|
||||
) {
|
||||
use style::properties::PropertyFlags;
|
||||
|
||||
if let Ok(longhand) = LonghandId::from_nscsspropertyid(prop) {
|
||||
debug_assert!(
|
||||
!longhand
|
||||
.flags()
|
||||
.contains(PropertyFlags::GETCS_NEEDS_LAYOUT_FLUSH),
|
||||
"We're not supposed to serialize layout-dependent properties"
|
||||
);
|
||||
style
|
||||
.get_longhand_property_value(longhand, &mut CssWriter::new(&mut *value))
|
||||
.unwrap();
|
||||
@ -6068,12 +6060,6 @@ pub unsafe extern "C" fn Servo_GetPropertyValue(
|
||||
"This won't quite do the right thing if we want to serialize \
|
||||
logical shorthands"
|
||||
);
|
||||
debug_assert!(
|
||||
!longhand
|
||||
.flags()
|
||||
.contains(PropertyFlags::GETCS_NEEDS_LAYOUT_FLUSH),
|
||||
"Layout-dependent properties shouldn't get here"
|
||||
);
|
||||
let animated = AnimationValue::from_computed_values(longhand, style).expect(
|
||||
"Somebody tried to serialize a shorthand with \
|
||||
non-animatable properties, would need more code \
|
||||
|
Loading…
Reference in New Issue
Block a user