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:
Emilio Cobos Álvarez 2017-09-04 22:04:18 +02:00
parent 35504c1bb7
commit 05371b56eb
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -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;