mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
style: added text-decoration-thickness to the text-decoration shorthands.
Differential Revision: https://phabricator.services.mozilla.com/D40335
This commit is contained in:
parent
29f6db4d16
commit
ad1d028e40
3 changed files with 19 additions and 4 deletions
|
@ -653,7 +653,6 @@ def _remove_common_first_line_and_first_letter_properties(props, engine):
|
||||||
props.remove("text-emphasis-style")
|
props.remove("text-emphasis-style")
|
||||||
props.remove("text-emphasis-color")
|
props.remove("text-emphasis-color")
|
||||||
props.remove("text-decoration-skip-ink")
|
props.remove("text-decoration-skip-ink")
|
||||||
props.remove("text-decoration-thickness")
|
|
||||||
props.remove("text-underline-offset")
|
props.remove("text-underline-offset")
|
||||||
|
|
||||||
props.remove("overflow-wrap")
|
props.remove("overflow-wrap")
|
||||||
|
|
|
@ -74,6 +74,7 @@ ${helpers.predefined_type(
|
||||||
"LengthOrAuto",
|
"LengthOrAuto",
|
||||||
"computed::LengthOrAuto::auto()",
|
"computed::LengthOrAuto::auto()",
|
||||||
engines="gecko",
|
engines="gecko",
|
||||||
|
initial_specified_value="specified::LengthOrAuto::auto()",
|
||||||
animation_value_type="ComputedValue",
|
animation_value_type="ComputedValue",
|
||||||
gecko_pref="layout.css.text-decoration-thickness.enabled",
|
gecko_pref="layout.css.text-decoration-thickness.enabled",
|
||||||
spec="https://drafts.csswg.org/css-text-decor-4/#text-decoration-width-property"
|
spec="https://drafts.csswg.org/css-text-decor-4/#text-decoration-width-property"
|
||||||
|
|
|
@ -8,12 +8,13 @@
|
||||||
engines="gecko servo-2013"
|
engines="gecko servo-2013"
|
||||||
flags="SHORTHAND_IN_GETCS"
|
flags="SHORTHAND_IN_GETCS"
|
||||||
sub_properties="text-decoration-line
|
sub_properties="text-decoration-line
|
||||||
${' text-decoration-style text-decoration-color' if engine == 'gecko' else ''}"
|
${' text-decoration-style text-decoration-color text-decoration-thickness' if engine == 'gecko' else ''}"
|
||||||
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration">
|
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration">
|
||||||
|
|
||||||
% if engine == "gecko":
|
% if engine == "gecko":
|
||||||
use crate::values::specified;
|
use crate::values::specified;
|
||||||
use crate::properties::longhands::{text_decoration_style, text_decoration_color};
|
use crate::properties::longhands::{text_decoration_style, text_decoration_color, text_decoration_thickness};
|
||||||
|
use crate::properties::{PropertyId, LonghandId};
|
||||||
% endif
|
% endif
|
||||||
use crate::properties::longhands::text_decoration_line;
|
use crate::properties::longhands::text_decoration_line;
|
||||||
|
|
||||||
|
@ -22,11 +23,14 @@
|
||||||
input: &mut Parser<'i, 't>,
|
input: &mut Parser<'i, 't>,
|
||||||
) -> Result<Longhands, ParseError<'i>> {
|
) -> Result<Longhands, ParseError<'i>> {
|
||||||
% if engine == "gecko":
|
% if engine == "gecko":
|
||||||
let (mut line, mut style, mut color, mut any) = (None, None, None, false);
|
let (mut line, mut style, mut color, mut thickness, mut any) = (None, None, None, None, false);
|
||||||
% else:
|
% else:
|
||||||
let (mut line, mut any) = (None, false);
|
let (mut line, mut any) = (None, false);
|
||||||
% endif
|
% endif
|
||||||
|
|
||||||
|
let text_decoration_thickness_enabled =
|
||||||
|
PropertyId::Longhand(LonghandId::TextDecorationThickness).enabled_for_all_content();
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
macro_rules! parse_component {
|
macro_rules! parse_component {
|
||||||
($value:ident, $module:ident) => (
|
($value:ident, $module:ident) => (
|
||||||
|
@ -45,6 +49,9 @@
|
||||||
% if engine == "gecko":
|
% if engine == "gecko":
|
||||||
parse_component!(style, text_decoration_style);
|
parse_component!(style, text_decoration_style);
|
||||||
parse_component!(color, text_decoration_color);
|
parse_component!(color, text_decoration_color);
|
||||||
|
if text_decoration_thickness_enabled {
|
||||||
|
parse_component!(thickness, text_decoration_thickness);
|
||||||
|
}
|
||||||
% endif
|
% endif
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -60,6 +67,7 @@
|
||||||
% if engine == "gecko":
|
% if engine == "gecko":
|
||||||
text_decoration_style: unwrap_or_initial!(text_decoration_style, style),
|
text_decoration_style: unwrap_or_initial!(text_decoration_style, style),
|
||||||
text_decoration_color: unwrap_or_initial!(text_decoration_color, color),
|
text_decoration_color: unwrap_or_initial!(text_decoration_color, color),
|
||||||
|
text_decoration_thickness: unwrap_or_initial!(text_decoration_thickness, thickness),
|
||||||
% endif
|
% endif
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -78,6 +86,13 @@
|
||||||
dest.write_str(" ")?;
|
dest.write_str(" ")?;
|
||||||
self.text_decoration_color.to_css(dest)?;
|
self.text_decoration_color.to_css(dest)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(text_decoration_thickness) = self.text_decoration_thickness {
|
||||||
|
if !text_decoration_thickness.is_auto() {
|
||||||
|
dest.write_str(" ")?;
|
||||||
|
self.text_decoration_thickness.to_css(dest)?;
|
||||||
|
}
|
||||||
|
}
|
||||||
% endif
|
% endif
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue