|
| 1 | +2018-01-09 Myles C. Maxfield < [email protected]> |
| 2 | + |
| 3 | + font-display:fallback can cause a visual flash (which is supposed to be impossible) |
| 4 | + https://bugs.webkit.org/show_bug.cgi?id=181374 |
| 5 | + |
| 6 | + Reviewed by Simon Fraser. |
| 7 | + |
| 8 | + A FontCascade represents an entire font-family fallback list, but sometimes we need to pull out a single |
| 9 | + representative font from the list to calculate things like line height. Previously, if the first item in |
| 10 | + the font-family list was in the middle of being downloaded, this representative font was hardcoded to be |
| 11 | + Times. However, when actually laying out and drawing the glyphs, we have logic to skip the interstitial |
| 12 | + Times if there are any installed fonts present in the font-family list (so you wouldn't ever actually |
| 13 | + see Times). This means that line height (among other things) was being calculated as if Times was used, |
| 14 | + but in reality, some other font from the font-family list was being used. |
| 15 | + |
| 16 | + Alone, this isn't a huge problem, but font-display:fallback makes a font transition between "timed out" |
| 17 | + and "failed," and when the font hits the failed state, the representative font skips over the cancelled |
| 18 | + item and hits the next item in the fallback list. This means that line heights will change, which causes |
| 19 | + a visual flash, even when font-display:fallback is specified. |
| 20 | + |
| 21 | + The solution is simply to educate the logic which identifies this representative font so that it |
| 22 | + understands what to do for currently-loading fonts. |
| 23 | + |
| 24 | + Tests: fast/text/font-display/swap-flash.html |
| 25 | + |
| 26 | + * platform/graphics/FontCascadeFonts.h: |
| 27 | + (WebCore::FontCascadeFonts::primaryFont): |
| 28 | + * rendering/line/BreakingContext.h: |
| 29 | + (WebCore::textWidth): |
| 30 | + |
1 | 31 | 2018-01-04 Filip Pizlo < [email protected]>
|
2 | 32 |
|
3 | 33 | CodeBlocks should be in IsoSubspaces
|
|
0 commit comments