mirror of
https://github.com/servo/servo.git
synced 2025-08-17 19:35:33 +01:00
style: Fix cascade order of shadow parts.
This moves the shadow cascade order into the cascade level, and refactors the code a bit for that. Differential Revision: https://phabricator.services.mozilla.com/D49988
This commit is contained in:
parent
28110c060f
commit
349492b5e2
9 changed files with 237 additions and 282 deletions
|
@ -346,16 +346,10 @@ fn should_ignore_declaration_when_ignoring_document_colors(
|
|||
return false;
|
||||
}
|
||||
|
||||
let is_style_attribute = matches!(
|
||||
cascade_level,
|
||||
CascadeLevel::StyleAttributeNormal | CascadeLevel::StyleAttributeImportant
|
||||
);
|
||||
|
||||
// Don't override colors on pseudo-element's style attributes. The
|
||||
// background-color on ::-moz-color-swatch is an example. Those are set
|
||||
// as an author style (via the style attribute), but it's pretty
|
||||
// important for it to show up for obvious reasons :)
|
||||
if pseudo.is_some() && is_style_attribute {
|
||||
// Don't override background-color on ::-moz-color-swatch. It is set as an
|
||||
// author style (via the style attribute), but it's pretty important for it
|
||||
// to show up for obvious reasons :)
|
||||
if pseudo.map_or(false, |p| p.is_color_swatch()) && longhand_id == LonghandId::BackgroundColor {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue