Font Loading API specifies font is loaded but sizing of font after load reports incon...
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 May 2017 18:02:50 +0000 (18:02 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 May 2017 18:02:50 +0000 (18:02 +0000)
commite4bfd9e1f889bbe59a381861c73b506f16295631
tree27006a91f0441aafa6977ca6197bc4bcb4219d4a
parenta1ac2155ed1c69cb57838087ab2fcb9eec52dad5
Font Loading API specifies font is loaded but sizing of font after load reports inconsistent values
https://bugs.webkit.org/show_bug.cgi?id=168533

Reviewed by Zalan Bujtas.

Source/WebCore:

Previously, we were marking all local() fonts as immediately successful,
regardless of whether or not they were present on the system. Instead, we
should use the load() function to make this determination and mark the font
as failed if it doesn't exist. (This is, after all, the whole point of the
load() function). This brings us in-line with Firefox's and Chrome's
behavior.

Test: fast/text/font-loading-local.html

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::pump): Remote loading requires the FontSelector,
but it isn't available for local fonts. Now that load() is called for both
local and remote fonts, the ASSERT() should be lowered into the load()
function and scoped to just the case where we have a remote font.
(WebCore::CSSFontFace::font): Ditto.
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::CSSFontFaceSource): Don't immediatley set
the success/failure state for local fonts.
(WebCore::CSSFontFaceSource::load): Move loading logic from font() to
load(). None of this code is new; it just is moved.
(WebCore::CSSFontFaceSource::font): Delete code moved to load().
* css/CSSFontFaceSource.h:
* css/FontFace.cpp:
(WebCore::FontFace::create):

LayoutTests:

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216079 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/text/font-loading-local-expected.txt [new file with mode: 0644]
LayoutTests/fast/text/font-loading-local.html [new file with mode: 0644]
LayoutTests/fast/text/web-font-load-fallback-during-loading.html
Source/WebCore/ChangeLog
Source/WebCore/css/CSSFontFace.cpp
Source/WebCore/css/CSSFontFaceSource.cpp
Source/WebCore/css/CSSFontFaceSource.h
Source/WebCore/css/FontFace.cpp