style: Handle correctly display changes from ruby to non-ruby in some edge cases.

And add comments to the reset-property-dependent adjustments.

MozReview-Commit-ID: Li6Epx8k5x8
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
Emilio Cobos Álvarez 2017-09-06 12:47:18 +02:00
parent deefacc9de
commit 7d2e2e25d6
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 18 additions and 1 deletions

View file

@ -410,6 +410,15 @@ trait PrivateMatchMethods: TElement {
return ChildCascadeRequirement::MustCascadeChildren
}
// Line break suppression may also be affected if the display
// type changes from ruby to non-ruby.
#[cfg(feature = "gecko")]
{
if old_display.is_ruby_type() != new_display.is_ruby_type() {
return ChildCascadeRequirement::MustCascadeChildren
}
}
// Children with justify-items: auto may depend on our
// justify-items property value.
//

View file

@ -13,7 +13,11 @@ use properties::longhands::float::computed_value::T as float;
use properties::longhands::overflow_x::computed_value::T as overflow;
use properties::longhands::position::computed_value::T as position;
/// An unsized struct that implements all the adjustment methods.
/// A struct that implements all the adjustment methods.
///
/// NOTE(emilio): If new adjustments are introduced that depend on reset
/// properties of the parent, you may need tweaking the
/// `ChildCascadeRequirement` code in `matching.rs`.
pub struct StyleAdjuster<'a, 'b: 'a> {
style: &'a mut StyleBuilder<'b>,
}
@ -331,6 +335,10 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
/// If a <fieldset> has grid/flex display type, we need to inherit
/// this type into its ::-moz-fieldset-content anonymous box.
///
/// NOTE(emilio): We don't need to handle the display change for this case
/// in matching.rs because anonymous box restyling works separately to the
/// normal cascading process.
#[cfg(feature = "gecko")]
fn adjust_for_fieldset_content(
&mut self,