Bug 1851085 - Remove layout.css.computed-style.shorthands pref r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D211487
This commit is contained in:
Gregory Pappas 2024-05-26 16:47:47 +00:00
Родитель 3609b689a2
Коммит dd4a8773bb
10 изменённых файлов: 8 добавлений и 40 удалений

Просмотреть файл

@ -51,14 +51,10 @@ enum class CSSPropFlags : uint16_t {
// Whether this is a logical property.
IsLogical = 1 << 6,
// Whether this shorthand property is unconditionally exposed in
// getComputedStyle.
ShorthandUnconditionallyExposedOnGetCS = 1 << 7,
// Whether this property, when changed, may affect layout, overflow, or paint.
AffectsLayout = 1 << 8,
AffectsOverflow = 1 << 9,
AffectsPaint = 1 << 10,
AffectsLayout = 1 << 7,
AffectsOverflow = 1 << 8,
AffectsPaint = 1 << 9,
};
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(CSSPropFlags)

Просмотреть файл

@ -134,8 +134,6 @@ def flags(prop):
result.append(v)
if exposed_on_getcs(prop):
result.append("ExposedOnGetCS")
if prop.type() == "shorthand" and "SHORTHAND_IN_GETCS" in prop.flags:
result.append("ShorthandUnconditionallyExposedOnGetCS")
if serialized_by_servo(prop):
result.append("SerializedByServo")
if prop.type() == "longhand" and prop.logical:

Просмотреть файл

@ -199,16 +199,8 @@ struct ComputedStyleMap {
}
bool IsEnabled() const {
if (!mCanBeExposed ||
!nsCSSProps::IsEnabled(mProperty, CSSEnabledState::ForAllContent)) {
return false;
}
if (nsCSSProps::IsShorthand(mProperty) &&
!StaticPrefs::layout_css_computed_style_shorthands()) {
return nsCSSProps::PropHasFlags(
mProperty, CSSPropFlags::ShorthandUnconditionallyExposedOnGetCS);
}
return true;
return mCanBeExposed &&
nsCSSProps::IsEnabled(mProperty, CSSEnabledState::ForAllContent);
}
};
@ -2399,9 +2391,6 @@ void nsComputedDOMStyle::RegisterPrefChangeCallbacks() {
}
}
prefs.AppendElement(
StaticPrefs::GetPrefName_layout_css_computed_style_shorthands());
prefs.AppendElement(nullptr);
MOZ_ASSERT(!gCallbackPrefs);

Просмотреть файл

@ -8574,12 +8574,6 @@
mirror: always
rust: true
# Whether we should expose all shorthands in getComputedStyle().
- name: layout.css.computed-style.shorthands
type: bool
value: true
mirror: always
# Are implicit tracks in computed grid templates serialized?
- name: layout.css.serialize-grid-implicit-tracks
type: RelaxedAtomicBool

Просмотреть файл

@ -66,8 +66,6 @@ bitflags! {
/// This property can be animated on the compositor.
const CAN_ANIMATE_ON_COMPOSITOR = 0;
/// This shorthand property is accessible from getComputedStyle.
const SHORTHAND_IN_GETCS = 0;
/// See data.py's documentation about the affects_flags.
const AFFECTS_LAYOUT = 0;
#[allow(missing_docs)]

Просмотреть файл

@ -231,7 +231,6 @@
<%helpers:shorthand name="background-position"
engines="gecko servo"
flags="SHORTHAND_IN_GETCS"
sub_properties="background-position-x background-position-y"
spec="https://drafts.csswg.org/css-backgrounds-4/#the-background-position">
use crate::properties::longhands::{background_position_x, background_position_y};

Просмотреть файл

@ -9,7 +9,6 @@ ${helpers.two_properties_shorthand(
"overflow-x",
"overflow-y",
engines="gecko servo",
flags="SHORTHAND_IN_GETCS",
spec="https://drafts.csswg.org/css-overflow/#propdef-overflow",
)}
@ -74,7 +73,7 @@ ${helpers.two_properties_shorthand(
<%helpers:shorthand
engines="gecko"
name="page-break-before"
flags="SHORTHAND_IN_GETCS IS_LEGACY_SHORTHAND"
flags="IS_LEGACY_SHORTHAND"
sub_properties="break-before"
spec="https://drafts.csswg.org/css-break-3/#page-break-properties"
>
@ -98,7 +97,7 @@ ${helpers.two_properties_shorthand(
<%helpers:shorthand
engines="gecko"
name="page-break-after"
flags="SHORTHAND_IN_GETCS IS_LEGACY_SHORTHAND"
flags="IS_LEGACY_SHORTHAND"
sub_properties="break-after"
spec="https://drafts.csswg.org/css-break-3/#page-break-properties"
>
@ -122,7 +121,7 @@ ${helpers.two_properties_shorthand(
<%helpers:shorthand
engines="gecko"
name="page-break-inside"
flags="SHORTHAND_IN_GETCS IS_LEGACY_SHORTHAND"
flags="IS_LEGACY_SHORTHAND"
sub_properties="break-inside"
spec="https://drafts.csswg.org/css-break-3/#page-break-properties"
>

Просмотреть файл

@ -323,7 +323,6 @@
<%helpers:shorthand name="font-variant"
engines="gecko servo"
servo_pref="layout.legacy_layout",
flags="SHORTHAND_IN_GETCS"
sub_properties="font-variant-caps
${'font-variant-alternates' if engine == 'gecko' else ''}
${'font-variant-east-asian' if engine == 'gecko' else ''}
@ -463,7 +462,6 @@
<%helpers:shorthand name="font-synthesis"
engines="gecko"
flags="SHORTHAND_IN_GETCS"
sub_properties="font-synthesis-weight font-synthesis-style font-synthesis-small-caps font-synthesis-position"
derive_value_info="False"
spec="https://drafts.csswg.org/css-fonts-3/#propdef-font-variant">

Просмотреть файл

@ -5,7 +5,6 @@
<%namespace name="helpers" file="/helpers.mako.rs" />
<%helpers:shorthand name="mask" engines="gecko" extra_prefixes="webkit"
flags="SHORTHAND_IN_GETCS"
sub_properties="mask-mode mask-repeat mask-clip mask-origin mask-composite mask-position-x
mask-position-y mask-size mask-image"
spec="https://drafts.fxtf.org/css-masking/#propdef-mask">
@ -234,7 +233,6 @@
</%helpers:shorthand>
<%helpers:shorthand name="mask-position" engines="gecko" extra_prefixes="webkit"
flags="SHORTHAND_IN_GETCS"
sub_properties="mask-position-x mask-position-y"
spec="https://drafts.csswg.org/css-masks-4/#the-mask-position">
use crate::properties::longhands::{mask_position_x,mask_position_y};

Просмотреть файл

@ -6,7 +6,6 @@
<%helpers:shorthand name="text-decoration"
engines="gecko servo"
flags="SHORTHAND_IN_GETCS"
sub_properties="text-decoration-line
${' text-decoration-style text-decoration-color text-decoration-thickness' if engine == 'gecko' else ''}"
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration">