Add support for text-decoration-style

This commit is contained in:
Fernando Jiménez Moreno 2020-03-04 12:35:47 +01:00
parent 928bd0d1d2
commit 689b413bde
3 changed files with 22 additions and 3 deletions

View file

@ -13,9 +13,9 @@ use gfx::text::glyph::GlyphStore;
use mitochondria::OnceCell;
use net_traits::image_cache::UsePlaceholder;
use std::sync::Arc;
use style::computed_values::text_decoration_style::T as ComputedTextDecorationStyle;
use style::dom::OpaqueNode;
use style::properties::ComputedValues;
use style::values::computed::{BorderStyle, Length, LengthPercentage};
use style::values::specified::ui::CursorKind;
use webrender_api::{self as wr, units};
@ -182,14 +182,19 @@ impl Fragment {
.parent_style
.clone_text_decoration_color()
.to_rgba(color);
let text_decoration_style = fragment.parent_style.clone_text_decoration_style();
if text_decoration_style == ComputedTextDecorationStyle::MozNone {
return;
}
builder.wr.push_line(
&builder.common_properties(rect),
&rect,
wavy_line_thickness,
wr::LineOrientation::Horizontal,
&rgba(text_decoration_color),
wr::LineStyle::Solid,
text_decoration_style.to_webrender(),
);
// XXX(ferjm) support text-decoration-style: double
}
}