Bug 1611965 - Add support for the 'all' value of text-decoration-skip-ink. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D61184

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jonathan Kew 2020-02-19 20:04:36 +00:00
parent 641c8d2b6f
commit 4f84a1029c
4 changed files with 9 additions and 5 deletions

View File

@ -9893,6 +9893,7 @@ exports.CSS_PROPERTIES = {
],
"supports": [],
"values": [
"all",
"auto",
"inherit",
"initial",

View File

@ -4010,7 +4010,7 @@ void nsCSSRendering::PaintDecorationLine(
mozilla::StyleTextDecorationSkipInk skipInk =
aFrame->StyleText()->mTextDecorationSkipInk;
bool skipInkEnabled =
skipInk == mozilla::StyleTextDecorationSkipInk::Auto &&
skipInk != mozilla::StyleTextDecorationSkipInk::None &&
aParams.decoration != StyleTextDecorationLine::LINE_THROUGH &&
StaticPrefs::layout_css_text_decoration_skip_ink_enabled();
@ -4065,14 +4065,16 @@ void nsCSSRendering::PaintDecorationLine(
while (iter.NextRun()) {
if (iter.GetGlyphRun()->mOrientation ==
mozilla::gfx::ShapedTextFlags::TEXT_ORIENT_VERTICAL_UPRIGHT ||
iter.GetGlyphRun()->mIsCJK) {
(iter.GetGlyphRun()->mIsCJK &&
skipInk == mozilla::StyleTextDecorationSkipInk::Auto)) {
// We don't support upright text in vertical modes currently
// (see https://bugzilla.mozilla.org/show_bug.cgi?id=1572294),
// but we do need to update textPos so that following runs will be
// correctly positioned.
// We also don't apply skip-ink to CJK text runs because many fonts
// have an underline that looks really bad if this is done
// (see https://bugzilla.mozilla.org/show_bug.cgi?id=1573249).
// (see https://bugzilla.mozilla.org/show_bug.cgi?id=1573249),
// when skip-ink is set to 'auto'.
textPos.fX +=
textRun->GetAdvanceWidth(
gfxTextRun::Range(iter.GetStringStart(), iter.GetStringEnd()),

View File

@ -7781,7 +7781,7 @@ var gCSSProperties = {
applies_to_first_line: true,
applies_to_placeholder: true,
initial_values: ["auto"],
other_values: ["none"],
other_values: ["none", "all"],
invalid_values: [
"13",
"15%",

View File

@ -1004,7 +1004,7 @@ pub enum OverflowWrap {
Anywhere,
}
/// Implements text-decoration-skip-ink which takes the keywords auto | none
/// Implements text-decoration-skip-ink which takes the keywords auto | none | all
///
/// https://drafts.csswg.org/css-text-decor-4/#text-decoration-skip-ink-property
#[repr(u8)]
@ -1027,6 +1027,7 @@ pub enum OverflowWrap {
pub enum TextDecorationSkipInk {
Auto,
None,
All,
}
/// Implements type for `text-decoration-thickness` property