mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Don't keep a separate list of ignored-when-colors-disabled longhands.
Most of the change is moving sets around to be static functions on LonghandIdSet. I think I like that pattern, but I can also make the new set a global static and add mako code to be `pub` or something. Though I think the LonghandIdSet::foo().contains(..) pattern is nice to read :) Differential Revision: https://phabricator.services.mozilla.com/D10653
This commit is contained in:
parent
33fed65597
commit
d035d02517
2 changed files with 56 additions and 36 deletions
|
@ -1288,25 +1288,12 @@ impl StrongRuleNode {
|
|||
}
|
||||
}
|
||||
|
||||
// If author colors are not allowed, only claim to have author-specified
|
||||
// rules if we're looking at a non-color property, a border image, or if
|
||||
// we're looking at the background color and it's set to transparent.
|
||||
const IGNORED_WHEN_COLORS_DISABLED: &'static [LonghandId] = &[
|
||||
LonghandId::BackgroundImage,
|
||||
LonghandId::BorderImageSource,
|
||||
LonghandId::BorderTopColor,
|
||||
LonghandId::BorderRightColor,
|
||||
LonghandId::BorderBottomColor,
|
||||
LonghandId::BorderLeftColor,
|
||||
LonghandId::BorderInlineStartColor,
|
||||
LonghandId::BorderInlineEndColor,
|
||||
LonghandId::BorderBlockStartColor,
|
||||
LonghandId::BorderBlockEndColor,
|
||||
];
|
||||
|
||||
// If author colors are not allowed, don't look at those properties
|
||||
// (except for background-color which is special and we handle below).
|
||||
if !author_colors_allowed {
|
||||
for id in IGNORED_WHEN_COLORS_DISABLED {
|
||||
properties.remove(*id);
|
||||
properties.remove_all(LonghandIdSet::ignored_when_colors_disabled());
|
||||
if rule_type_mask & NS_AUTHOR_SPECIFIED_BACKGROUND != 0 {
|
||||
properties.insert(LonghandId::BackgroundColor);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue