mirror of
https://github.com/servo/servo.git
synced 2025-08-13 01:15:34 +01:00
style: Remove the last usage of lossy currentcolor.
We don't have lossy currentcolor in the style system anymore, except for a single property -moz-font-smoothing-background-color. I could've converted it into a proper StyleColor and thread down all the necessary information to the font metrics code. But it doesn't really seem worth it given it's not exposed to the web, so I just did the simplest thing, which is making currentcolor compute to transparent to that specific property. This patch also removes the stores_complex_colors_lossily code and related, since now we always can cache computed colors. Differential Revision: https://phabricator.services.mozilla.com/D26187
This commit is contained in:
parent
681f861018
commit
5d2724994c
8 changed files with 24 additions and 78 deletions
|
@ -1287,32 +1287,6 @@ impl LonghandId {
|
|||
LonghandId::Direction
|
||||
)
|
||||
}
|
||||
|
||||
/// Whether computed values of this property lossily convert any complex
|
||||
/// colors into RGBA colors.
|
||||
///
|
||||
/// In Gecko, there are some properties still that compute currentcolor
|
||||
/// down to an RGBA color at computed value time, instead of as
|
||||
/// `StyleColor`s. For these properties, we must return `false`,
|
||||
/// so that we correctly avoid caching style data in the rule tree.
|
||||
pub fn stores_complex_colors_lossily(&self) -> bool {
|
||||
% if product == "gecko":
|
||||
matches!(*self,
|
||||
% for property in data.longhands:
|
||||
% if property.predefined_type == "RGBAColor":
|
||||
LonghandId::${property.camel_case} |
|
||||
% endif
|
||||
% endfor
|
||||
LonghandId::BackgroundImage |
|
||||
LonghandId::BorderImageSource |
|
||||
LonghandId::BoxShadow |
|
||||
LonghandId::MaskImage |
|
||||
LonghandId::TextShadow
|
||||
)
|
||||
% else:
|
||||
false
|
||||
% endif
|
||||
}
|
||||
}
|
||||
|
||||
/// An iterator over all the property ids that are enabled for a given
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue