Improve word-space detection in getTextContent#21432
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #21432 +/- ##
==========================================
- Coverage 89.76% 89.71% -0.06%
==========================================
Files 260 260
Lines 66032 66100 +68
==========================================
+ Hits 59274 59300 +26
- Misses 6758 6800 +42
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/botio browsertest |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/faf7e21cfd9433b/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_browsertest from @calixteman received. Current queue size: 1 Live output at: http://54.193.163.58:8877/c4ed1bd477dcd9f/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/faf7e21cfd9433b/output.txt Total script time: 18.64 mins
Image differences available at: http://54.241.84.105:8877/faf7e21cfd9433b/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/c4ed1bd477dcd9f/output.txt Total script time: 46.58 mins
Image differences available at: http://54.193.163.58:8877/c4ed1bd477dcd9f/reftest-analyzer.html#web=eq.log |
|
/botio browsertest |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/32efafc3ddbba5e/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_browsertest from @calixteman received. Current queue size: 2 Live output at: http://54.193.163.58:8877/ce9912cab13b025/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/32efafc3ddbba5e/output.txt Total script time: 18.27 mins
Image differences available at: http://54.241.84.105:8877/32efafc3ddbba5e/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/ce9912cab13b025/output.txt Total script time: 0.59 mins |
|
/botio browsertest |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/9a00c9dc6cca79d/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_browsertest from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/f923eb1aab2efab/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/9a00c9dc6cca79d/output.txt Total script time: 18.26 mins
Image differences available at: http://54.241.84.105:8877/9a00c9dc6cca79d/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/f923eb1aab2efab/output.txt Total script time: 46.63 mins
Image differences available at: http://54.193.163.58:8877/f923eb1aab2efab/reftest-analyzer.html#web=eq.log |
The gap between two glyphs was turned into a space using a hardcoded
`trackingSpaceMin` of `0.102 * fontSize`. Depending on the font this was
either too large or too small, producing fake spaces inside words
("Robe rt") or a space between every letter of letter-spaced text
("R E A S O N S").
The threshold is now derived from the font's space width (or the glyph's
advance width for Type3 fonts, where the font size is meaningless) and
raised for uniformly letter-spaced runs. A space wrongly inserted before
the first glyph of such a run is retracted once the next gap confirms it,
and the adaptive state is reset on spacing or text-matrix changes so it
can't leak across sections.
It fixes mozilla#18768 and mozilla#16752.
|
/botio browsertest |
From: Bot.io (Windows)ReceivedCommand cmd_browsertest from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/565979537063732/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/e1b3d9e78915361/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/e1b3d9e78915361/output.txt Total script time: 21.41 mins
Image differences available at: http://54.241.84.105:8877/e1b3d9e78915361/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/565979537063732/output.txt Total script time: 46.86 mins
Image differences available at: http://54.193.163.58:8877/565979537063732/reftest-analyzer.html#web=eq.log |
The gap between two glyphs was turned into a space using a hardcoded
trackingSpaceMinof0.102 * fontSize. Depending on the font this was either too large or too small, producing fake spaces inside words ("Robe rt") or a space between every letter of letter-spaced text ("R E A S O N S").The threshold is now derived from the font's space width (or the glyph's advance width for Type3 fonts, where the font size is meaningless) and raised for uniformly letter-spaced runs. A space wrongly inserted before the first glyph of such a run is retracted once the next gap confirms it, and the adaptive state is reset on spacing or text-matrix changes so it can't leak across sections.
It fixes #18768 and #16752.