Text not visible while external font downloading
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 4 Jun 2016 02:00:50 +0000 (02:00 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 4 Jun 2016 02:00:50 +0000 (02:00 +0000)
commit0a46400e6954ec7ca4770794a92aec6db3b4da7f
tree828f37af081883d42951f664079149e6d02d847e
parentc77875968e99f76d9f93204905831ba20b5ef0a0
Text not visible while external font downloading
https://bugs.webkit.org/show_bug.cgi?id=25207
<rdar://problem/15167413>

Reviewed by Dean Jackson.

Source/WebCore:

I already laid the groundwork for this when implementing the CSS Font Loading API.
We only have to create a timer and correctly respond to it timing out (by setting
state).

This patch also adds a new internal setting which puts us in a mode where font
loads never complete and the timeout occurs immediately. This is so we can test
the fallback behavior.

Test: fast/text/web-font-load-fallback-during-loading.html

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::CSSFontFace):
(WebCore::CSSFontFace::fontLoadEventOccurred):
(WebCore::CSSFontFace::timeoutFired):
(WebCore::CSSFontFace::setStatus):
(WebCore::CSSFontFace::fontLoaded):
(WebCore::CSSFontFace::webFontsShouldAlwaysFallBack):
(WebCore::CSSFontFace::pump):
(WebCore::CSSFontFace::font):
* css/CSSFontFace.h:
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::fontLoaded):
* css/FontFace.cpp:
(WebCore::FontFace::fontStateChanged):
* page/Settings.cpp:
(WebCore::Settings::Settings):
(WebCore::Settings::setWebFontsAlwaysFallBack):
* page/Settings.h:
(WebCore::Settings::webFontsAlwaysFallBack):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setWebFontsAlwaysFallBack):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

LayoutTests:

* fast/text/web-font-load-fallback-during-loading-no-multiple-expected.txt: Added.
* fast/text/web-font-load-fallback-during-loading-no-multiple.html: Added.
* fast/text/web-font-load-fallback-during-loading-expected.html: Added.
* fast/text/web-font-load-fallback-during-loading.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201676 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/text/web-font-load-fallback-during-loading-expected.html [new file with mode: 0644]
LayoutTests/fast/text/web-font-load-fallback-during-loading-no-multiple-expected.txt [new file with mode: 0644]
LayoutTests/fast/text/web-font-load-fallback-during-loading-no-multiple.html [new file with mode: 0644]
LayoutTests/fast/text/web-font-load-fallback-during-loading.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSFontFace.cpp
Source/WebCore/css/CSSFontFace.h
Source/WebCore/css/CSSFontFaceSource.cpp
Source/WebCore/css/FontFace.cpp
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h
Source/WebCore/testing/InternalSettings.idl