mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Bug 1617515 - Properly advance current position for glyph runs where we don't implement ink-skipping. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D63828 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
f96c310580
commit
92625e728c
@ -4062,6 +4062,16 @@ void nsCSSRendering::PaintDecorationLine(
|
||||
int32_t spacingOffset = isRTL ? aParams.glyphRange.Length() - 1 : 0;
|
||||
gfxTextRun::GlyphRunIterator iter(textRun, aParams.glyphRange, isRTL);
|
||||
|
||||
// For any glyph run where we don't actually do skipping, we'll need to
|
||||
// advance the current position by its width.
|
||||
// (For runs we do process, CreateTextBlob will update the position.)
|
||||
auto currentGlyphRunAdvance = [&]() {
|
||||
return textRun->GetAdvanceWidth(
|
||||
gfxTextRun::Range(iter.GetStringStart(), iter.GetStringEnd()),
|
||||
aParams.provider) /
|
||||
appUnitsPerDevPixel;
|
||||
};
|
||||
|
||||
while (iter.NextRun()) {
|
||||
if (iter.GetGlyphRun()->mOrientation ==
|
||||
mozilla::gfx::ShapedTextFlags::TEXT_ORIENT_VERTICAL_UPRIGHT ||
|
||||
@ -4075,11 +4085,7 @@ void nsCSSRendering::PaintDecorationLine(
|
||||
// have an underline that looks really bad if this is done
|
||||
// (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()),
|
||||
aParams.provider) /
|
||||
appUnitsPerDevPixel;
|
||||
textPos.fX += currentGlyphRunAdvance();
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -4088,6 +4094,7 @@ void nsCSSRendering::PaintDecorationLine(
|
||||
// because old macOS (10.9) may crash trying to retrieve glyph paths
|
||||
// that don't exist.
|
||||
if (font->GetFontEntry()->HasFontTable(TRUETYPE_TAG('s', 'b', 'i', 'x'))) {
|
||||
textPos.fX += currentGlyphRunAdvance();
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -4106,6 +4113,7 @@ void nsCSSRendering::PaintDecorationLine(
|
||||
(float)appUnitsPerDevPixel, textPos, spacingOffset);
|
||||
|
||||
if (!textBlob) {
|
||||
textPos.fX += currentGlyphRunAdvance();
|
||||
continue;
|
||||
}
|
||||
|
||||
|
4
layout/reftests/bugs/1617515-1-ref.html
Normal file
4
layout/reftests/bugs/1617515-1-ref.html
Normal file
@ -0,0 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<div style="font: 32px sans-serif">
|
||||
<u>aa🔥<span></span>aaag-j-q-y</u>
|
4
layout/reftests/bugs/1617515-1.html
Normal file
4
layout/reftests/bugs/1617515-1.html
Normal file
@ -0,0 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<div style="font: 32px sans-serif">
|
||||
<u>aa🔥aaag-j-q-y</u>
|
@ -2090,3 +2090,4 @@ pref(layout.css.xul-box-display-values.content.enabled,true) == 1606130.html 160
|
||||
== 1608124-1.html 1608124-1-ref.html
|
||||
skip-if(!OSX) != 1608124-2.html 1608124-2-notref.html
|
||||
== 1613380.html 1613380-ref.html
|
||||
fuzzy-if(OSX,0-42,0-4) fuzzy-if((Android||winWidget)&&!webrender,0-115,0-2) == 1617515-1.html 1617515-1-ref.html
|
||||
|
Loading…
Reference in New Issue
Block a user