mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
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:
parent
deefacc9de
commit
7d2e2e25d6
2 changed files with 18 additions and 1 deletions
|
@ -410,6 +410,15 @@ trait PrivateMatchMethods: TElement {
|
||||||
return ChildCascadeRequirement::MustCascadeChildren
|
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
|
// Children with justify-items: auto may depend on our
|
||||||
// justify-items property value.
|
// justify-items property value.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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::overflow_x::computed_value::T as overflow;
|
||||||
use properties::longhands::position::computed_value::T as position;
|
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> {
|
pub struct StyleAdjuster<'a, 'b: 'a> {
|
||||||
style: &'a mut StyleBuilder<'b>,
|
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
|
/// If a <fieldset> has grid/flex display type, we need to inherit
|
||||||
/// this type into its ::-moz-fieldset-content anonymous box.
|
/// 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")]
|
#[cfg(feature = "gecko")]
|
||||||
fn adjust_for_fieldset_content(
|
fn adjust_for_fieldset_content(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue