mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Propagate text decoration where needed
This commit is contained in:
parent
83fc9943d3
commit
17948f3b39
9 changed files with 75 additions and 40 deletions
|
@ -123,7 +123,7 @@ pub(crate) struct TextFragment {
|
|||
pub font_key: FontInstanceKey,
|
||||
pub glyphs: Vec<Arc<GlyphStore>>,
|
||||
/// A flag that represents the _used_ value of the text-decoration property.
|
||||
pub text_decorations_in_effect: TextDecorationLine,
|
||||
pub text_decoration_line: TextDecorationLine,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
|
@ -195,23 +195,6 @@ impl AbsoluteOrFixedPositionedFragment {
|
|||
pub fn print(&self, tree: &mut PrintTree) {
|
||||
tree.add_item(format!("AbsoluteOrFixedPositionedFragment({:?})", self.0));
|
||||
}
|
||||
|
||||
pub fn set_text_decorations_in_effect(&mut self, text_decorations: TextDecorationLine) {
|
||||
match self {
|
||||
Fragment::Text(fragment) => fragment.text_decorations_in_effect = text_decorations,
|
||||
Fragment::Box(fragment) => {
|
||||
for child in &mut fragment.children {
|
||||
child.set_text_decorations_in_effect(text_decorations);
|
||||
}
|
||||
},
|
||||
Fragment::Anonymous(fragment) => {
|
||||
for child in &mut fragment.children {
|
||||
child.set_text_decorations_in_effect(text_decorations);
|
||||
}
|
||||
},
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl AnonymousFragment {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue