mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
style: Fix recascading when child blockification depends on our display value.
All other browsers get it right because they basically throw away all the styles in a subtree after a display change. We do better, but need to do this check. MozReview-Commit-ID: BODx0gnSzwI Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
parent
35504c1bb7
commit
05371b56eb
1 changed files with 9 additions and 0 deletions
|
@ -395,6 +395,15 @@ trait PrivateMatchMethods: TElement {
|
|||
StyleChange::Unchanged => ChildCascadeRequirement::CanSkipCascade,
|
||||
StyleChange::Changed { reset_only } => {
|
||||
if reset_only {
|
||||
let old_display = old_values.get_box().clone_display();
|
||||
let new_display = new_values.get_box().clone_display();
|
||||
|
||||
if old_display.is_item_container() != new_display.is_item_container() {
|
||||
// Blockification of children may depend on our display
|
||||
// value, so we need to actually do the recascade.
|
||||
return ChildCascadeRequirement::MustCascadeChildren
|
||||
}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
{
|
||||
use values::specified::align;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue