mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Do not use buggy text_decorations_in_effect
This commit is contained in:
parent
689b413bde
commit
83fc9943d3
4 changed files with 48 additions and 8 deletions
|
@ -19,6 +19,7 @@ use style::dom::OpaqueNode;
|
|||
use style::logical_geometry::WritingMode;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::Length;
|
||||
use style::values::specified::text::TextDecorationLine;
|
||||
use style::Zero;
|
||||
use webrender_api::{FontInstanceKey, ImageKey};
|
||||
|
||||
|
@ -121,6 +122,8 @@ pub(crate) struct TextFragment {
|
|||
#[serde(skip_serializing)]
|
||||
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,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
|
@ -192,6 +195,23 @@ 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