servo: Merge #14922 - Don't inherit all properties for eagerly computed pseudos if there are no matching rules (from heycam:pseudo-inherit); r=emilio
<!-- Please describe your changes on the following line: --> When we resolve style for an eagerly computed pseudo-element, such as an anonymous box, if there are no matching rules we currently just clone the parent's style. We should only do that if `inherit_all` is true, otherwise we should inherit only the inherited properties from the parent. I was going to use `.unwrap_or_default()` on the result of looking up `precomputed_pseudo_element_decls`, but that didn't seem to work since that map lookup returns a reference and not a `Vec` itself. r? @emilio --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix https://bugzilla.mozilla.org/show_bug.cgi?id=1329121 <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: ebd4a8b3ee1aab910ef714420a814912fec31e30
This commit is contained in:
@@ -394,7 +394,7 @@ pub trait ThreadSafeLayoutElement: Clone + Copy + Sized + Debug +
|
||||
&context.default_computed_values,
|
||||
false);
|
||||
data.styles_mut().pseudos
|
||||
.insert(style_pseudo.clone(), new_style.unwrap());
|
||||
.insert(style_pseudo.clone(), new_style);
|
||||
}
|
||||
}
|
||||
PseudoElementCascadeType::Lazy => {
|
||||
|
||||
Reference in New Issue
Block a user