commit 6209d028ace069eb926840162b57c9bf1589a58e
parent 1c0b5682e7ed49cd176a83c918a9604a25b5c55a
Author: pstanciu <pstanciu@mozilla.com>
Date: Thu, 16 Oct 2025 02:11:30 +0300
Revert "Bug 1980101 - Apply text-decoration-trim:auto to underline and strikethrough elements in CJK languages. r=layout-jp-market-reviewers,AlaskanEmily" for causing mochitest failures @ browser_parsable_css.js
This reverts commit 12627c518f6f6cd23e271c5a9cb71779190223ac.
Revert "Bug 1980101 - Apply text-decoration-trim:auto by default to links in CJK content. r=layout-jp-market-reviewers,AlaskanEmily"
This reverts commit d976bdc35cd967fcf0920800e3b0cc2468e1abbd.
Revert "Bug 1980101 - Slightly reduce the amount of trimming applied by text-decoration-trim:auto. r=layout-jp-market-reviewers,layout-reviewers,AlaskanEmily"
This reverts commit 264a5e93188a679f0118ec124347f2ee00806586.
Diffstat:
3 files changed, 3 insertions(+), 30 deletions(-)
diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp
@@ -5802,14 +5802,11 @@ static bool ComputeDecorationTrim(
aDecFrame->StyleTextReset()->mTextDecorationTrim;
gfxFloat trimLeft, trimRight;
if (cssTrim.IsAuto()) {
- // Use a trim factor of 1/12.5, so we get 2px of trim (resulting in a 4px
- // gap between adjacent lines) at font-size 25px.
- constexpr gfxFloat kAutoTrimFactor = 1.0 / 12.5;
- // Use the EM size multiplied by kAutoTrimFactor, with a minimum of one
- // CSS pixel to ensure that at least some separation occurs.
+ // Use the EM size divide by 8, or 1 dev pixel if this is too
+ // small to ensure that at least some separation occurs.
const gfxFloat scale = aPresCtx->CSSToDevPixelScale().scale;
const nscoord autoDecorationTrim =
- std::max(aMetrics.emHeight * kAutoTrimFactor, scale);
+ std::max(aMetrics.emHeight * 0.125, scale);
trimLeft = autoDecorationTrim;
trimRight = autoDecorationTrim;
} else {
diff --git a/layout/style/res/html.css b/layout/style/res/html.css
@@ -527,24 +527,6 @@ del {
text-decoration: line-through;
}
-u:lang(ja),
-u:lang(ko),
-u:lang(zh),
-s:lang(ja),
-s:lang(ko),
-s:lang(zh),
-ins:lang(ja),
-ins:lang(ko),
-ins:lang(zh),
-del:lang(ja),
-del:lang(ko),
-del:lang(zh),
-strike:lang(ja),
-strike:lang(ko),
-strike:lang(zh) {
- text-decoration-trim: auto;
-}
-
big {
font-size: larger;
}
diff --git a/layout/style/res/ua.css b/layout/style/res/ua.css
@@ -158,12 +158,6 @@
text-decoration: underline;
}
-:any-link:lang(ja),
-:any-link:lang(ko),
-:any-link:lang(zh) {
- text-decoration-trim: auto;
-}
-
:link {
color: LinkText;
}