mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
style: Make structs uncacheable if currentcolor is used on properties not using ComplexColor storage.
This commit is contained in:
parent
1346be59b2
commit
73ae5ffd94
2 changed files with 54 additions and 6 deletions
|
@ -626,6 +626,36 @@ 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
|
||||
/// `StyleComplexColor`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::MozBorderBottomColors |
|
||||
LonghandId::MozBorderLeftColors |
|
||||
LonghandId::MozBorderRightColors |
|
||||
LonghandId::MozBorderTopColors |
|
||||
LonghandId::TextShadow
|
||||
)
|
||||
% else:
|
||||
false
|
||||
% endif
|
||||
}
|
||||
}
|
||||
|
||||
/// An identifier for a given shorthand property.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue