|
Make text visible when font loading takes longer than 3 seconds
When a font resource takes a long time to download, currently Blink
keeps the text invisible until the font is ready. After this patch,
Blink behaves similar to FireFox; keeps the text invisible until 3
seconds, then fallback to the next available font in the fallback
list. When the webfont finally loads, change the text to use it.
- Add a Timer to FontResource that fires after 3 seconds since load start.
- fontLoadWaitLimitExceeded() callback invalidates the fallback font and
triggers style recalc.
- Fallback fonts have m_skipDrawing boolean in CustomFontData, that is
false if the font load exceeds the wait limit.
- FontFallbackList::shouldSkipDrawing() returns true if it contains at
least one FontData with m_skipDrawing == true.
BUG= 235303
TEST=http/tests/webfont/slow-loading.html
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=168258
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+232 lines, -26 lines) |
Patch |
|
M |
LayoutTests/http/tests/webfont/slow-ahem-loading.cgi
|
View
|
|
1 chunk |
+7 lines, -1 line |
0 comments
|
Download
|
|
A |
LayoutTests/http/tests/webfont/slow-loading.html
|
View
|
|
1 chunk |
+74 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/http/tests/webfont/slow-loading-expected.html
|
View
|
|
1 chunk |
+45 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/css/CSSCustomFontData.h
|
View
|
1
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
Source/core/css/CSSFontFace.h
|
View
|
1
2
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/css/CSSFontFace.cpp
|
View
|
1
2
3
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/css/CSSFontFaceSource.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/css/CSSFontFaceSource.cpp
|
View
|
1
2
|
2 chunks |
+8 lines, -1 line |
0 comments
|
Download
|
|
M |
Source/core/css/CSSSegmentedFontFace.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/css/CSSSegmentedFontFace.cpp
|
View
|
1
2
3
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/fetch/FontResource.h
|
View
|
|
4 chunks |
+7 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/fetch/FontResource.cpp
|
View
|
1
2
|
4 chunks |
+16 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/platform/fonts/CustomFontData.h
|
View
|
1
|
3 chunks |
+8 lines, -4 lines |
0 comments
|
Download
|
|
M |
Source/platform/fonts/Font.h
|
View
|
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/platform/fonts/Font.cpp
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
Source/platform/fonts/FontData.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
Source/platform/fonts/FontFallbackList.h
|
View
|
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
Source/platform/fonts/FontFallbackList.cpp
|
View
|
1
2
3
|
4 chunks |
+20 lines, -9 lines |
0 comments
|
Download
|
|
M |
Source/platform/fonts/SegmentedFontData.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
Source/platform/fonts/SegmentedFontData.cpp
|
View
|
|
2 chunks |
+14 lines, -4 lines |
0 comments
|
Download
|
|
M |
Source/platform/fonts/SimpleFontData.h
|
View
|
1
2
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
Total messages: 14 (0 generated)
|