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

@ -812,6 +812,22 @@ impl LonghandIdSet {
&IGNORED_WHEN_COLORS_DISABLED
}
/// Returns the set of properties that are declared as having no effect on
/// Gecko <scrollbar> elements or their descendant scrollbar parts.
#[cfg(debug_assertions)]
#[cfg(feature = "gecko")]
#[inline]
pub fn has_no_effect_on_gecko_scrollbars() -> &'static Self {
// data.py asserts that has_no_effect_on_gecko_scrollbars is True or
// False for properties that are inherited and Gecko pref controlled,
// and is None for all other properties.
${static_longhand_id_set(
"HAS_NO_EFFECT_ON_SCROLLBARS",
lambda p: p.has_effect_on_gecko_scrollbars is False
)}
&HAS_NO_EFFECT_ON_SCROLLBARS
}
/// Iterate over the current longhand id set.
pub fn iter(&self) -> LonghandIdSetIterator {
LonghandIdSetIterator { longhands: self, cur: 0, }