style: Ignore pref-controlled properties in cached scrollbar style assertions.

Now if you add a new inherited, pref-controlled property, you must
declare whether it can have an effect on scrollbar styles.  If no,
then the property will be skipped in the assertions that check
whether our cached styles are equal to those we would compute.

Differential Revision: https://phabricator.services.mozilla.com/D37507
This commit is contained in:
Cameron McCormack 2019-07-10 22:43:24 +00:00 committed by Emilio Cobos Álvarez
parent 145acbf876
commit e3b57efc7e
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
5 changed files with 36 additions and 1 deletions

View file

@ -175,6 +175,7 @@ class Longhand(object):
predefined_type=None, servo_pref=None, gecko_pref=None,
enabled_in="content", need_index=False,
gecko_ffi_name=None,
has_effect_on_gecko_scrollbars=None,
allowed_in_keyframe_block=True, cast_type='u8',
logical=False, logical_group=None, alias=None, extra_prefixes=None, boxed=False,
flags=None, allowed_in_page_rule=False, allow_quirks="No",
@ -192,6 +193,14 @@ class Longhand(object):
self.style_struct = style_struct
self.servo_pref = servo_pref
self.gecko_pref = gecko_pref
self.has_effect_on_gecko_scrollbars = has_effect_on_gecko_scrollbars
assert (
has_effect_on_gecko_scrollbars in [None, False, True] and
not style_struct.inherited or
(gecko_pref is None) == (has_effect_on_gecko_scrollbars is None)), (
"Property " + name + ": has_effect_on_gecko_scrollbars must be " +
"specified, and must have a value of True or False, iff a " +
"property is inherited and is behind a Gecko pref")
# For enabled_in, the setup is as follows:
# It needs to be one of the four values: ["", "ua", "chrome", "content"]
# * "chrome" implies "ua", and implies that they're explicitly