mirror of
https://github.com/servo/servo.git
synced 2025-08-21 13:25:34 +01:00
style: Remove -servo-text-decorations-in-effect.
It is bogus, because it depends on the display property as it's cascaded, but the display property can change afterwards, for example, if we get blockified because we're the root element or a flex item. Replace it with a normal field instead. Also, it carries some weight, because it's the last property that uses this concept of "derived" property, and "custom cascade". So we can remove some code after this. Compute it after the cascade process in StyleAdjuster.
This commit is contained in:
parent
1b46e2e759
commit
8732a1d7de
10 changed files with 78 additions and 96 deletions
|
@ -420,6 +420,21 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Computes the used text decoration for Servo.
|
||||
///
|
||||
/// FIXME(emilio): This is a layout tree concept, should move away from
|
||||
/// style, since otherwise we're going to have the same subtle bugs WebKit
|
||||
/// and Blink have with this very same thing.
|
||||
#[cfg(feature = "servo")]
|
||||
fn adjust_for_text_decorations_in_effect(&mut self) {
|
||||
use values::computed::text::TextDecorationsInEffect;
|
||||
|
||||
let decorations_in_effect = TextDecorationsInEffect::from_style(&self.style);
|
||||
if self.style.get_inheritedtext().text_decorations_in_effect != decorations_in_effect {
|
||||
self.style.mutate_inheritedtext().text_decorations_in_effect = decorations_in_effect;
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
fn should_suppress_linebreak(
|
||||
&self,
|
||||
|
@ -614,6 +629,10 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
|
|||
{
|
||||
self.adjust_for_ruby(layout_parent_style, flags);
|
||||
}
|
||||
#[cfg(feature = "servo")]
|
||||
{
|
||||
self.adjust_for_text_decorations_in_effect();
|
||||
}
|
||||
self.set_bits();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue