mirror of
https://github.com/servo/servo.git
synced 2025-08-18 03:45:33 +01:00
layout: Support wavy
and double
for text-decoration-line
(#37079)
- Add support for `text-decoration-line: double`: Line drawing is done similar to how it works in Firefox and Chromium. A gap of half of line thickness is added between each line. - Fix support for `text-decoration-line: wavy`: Wavy lines rectangles were not calcualted properly, which meant they were rendered as solid lines. Now the amplitude of the wave is 1.5 times line thickness. Testing: A manual test is updated `tests/html/text_deco_simple.html` to cover more cases. In general, rendering of text-decorations is difficult to test via reftesting. Fixes #17887. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
0ea40d6365
commit
7f0cebd442
3 changed files with 84 additions and 20 deletions
|
@ -125,11 +125,15 @@ impl ToWebRender for ComputedTextDecorationStyle {
|
|||
type Type = LineStyle;
|
||||
fn to_webrender(&self) -> Self::Type {
|
||||
match *self {
|
||||
ComputedTextDecorationStyle::Solid => LineStyle::Solid,
|
||||
ComputedTextDecorationStyle::Solid | ComputedTextDecorationStyle::Double => {
|
||||
LineStyle::Solid
|
||||
},
|
||||
ComputedTextDecorationStyle::Dotted => LineStyle::Dotted,
|
||||
ComputedTextDecorationStyle::Dashed => LineStyle::Dashed,
|
||||
ComputedTextDecorationStyle::Wavy => LineStyle::Wavy,
|
||||
_ => LineStyle::Solid,
|
||||
ComputedTextDecorationStyle::MozNone => {
|
||||
unreachable!("Should never try to draw a moz-none text decoration")
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue