WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
79021
Web font is not used in rendering for the first load
https://bugs.webkit.org/show_bug.cgi?id=79021
Summary
Web font is not used in rendering for the first load
Yuzo Fujishima
Reported
2012-02-20 02:42:25 PST
The example in
https://developers.google.com/webfonts/docs/webfont_loader#Example
doesn't work as expected for - WebKit
r108205
+ Safari 5.1.2 on OS X 10.6.8 - Chrome 19.0.1041.0 dev on OS X 10.6.8 That is, the text is rendered in the web fonts only if the page is reloaded. Safari Version 5.1.2 (6534.52.7), Firefox 10.0.2, and Opera 11.61 work as expected. Reproduction steps: 1. Clear the browse cache (Option+Command+E for Safari). 2. Open the attached webfontloader.html. 3. Observe that the text is rendered in local font. 4. Reload webfontloader.html. 5. Observe that the text is rendered in Web fonts. I observed the following: For the fist load, CSSFontSelector::getFontData is called *before* CSSFontSelector::addFontFaceRule. For the second load, getFontData is called *after* addFontFaceRule. HTMLLinkElement::setCSSStyleSheet is called from CachedCSSStyleSheet::checkNotify for the first load, while from CachedCSSStyleSheet::didAddClient for the second load. I guess layout should be done after the stylesheet is loaded? (This is likely related to
http://code.google.com/p/chromium/issues/detail?id=114928
)
Attachments
Test case webfontloader.html
(1.20 KB, text/html)
2012-02-20 02:43 PST
,
Yuzo Fujishima
no flags
Details
Rendering of the first load
(7.79 KB, image/png)
2012-02-20 02:44 PST
,
Yuzo Fujishima
no flags
Details
Rendering of the second load
(7.99 KB, image/png)
2012-02-20 02:44 PST
,
Yuzo Fujishima
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Yuzo Fujishima
Comment 1
2012-02-20 02:43:01 PST
Created
attachment 127789
[details]
Test case webfontloader.html
Yuzo Fujishima
Comment 2
2012-02-20 02:44:20 PST
Created
attachment 127790
[details]
Rendering of the first load
Yuzo Fujishima
Comment 3
2012-02-20 02:44:52 PST
Created
attachment 127792
[details]
Rendering of the second load
Yuzo Fujishima
Comment 4
2012-02-21 19:36:19 PST
This can be related to
http://wkb.ug/79186
Yuzo Fujishima
Comment 5
2012-02-21 21:35:03 PST
Hi Antti, Can you take a look? I confirmed that
r104060
shows this issue
http://trac.webkit.org/changeset/104060/
Analyze stylesheet scope to minimize style recalcs while
r104052
doesn't.
Yuzo Fujishima
Comment 6
2012-02-22 01:15:28 PST
I've confirmed that applying the following patch fixes the issue. Document::analyzeStylesheetChange(...) is likely to have a bug. diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp index 5125bbb..ac2b283 100644 --- a/Source/WebCore/dom/Document.cpp +++ b/Source/WebCore/dom/Document.cpp @@ -3273,7 +3273,6 @@ void Document::analyzeStylesheetChange(StyleSelectorUpdateFlag updateFlag, const if (m_styleSheets->item(i) != newStylesheets[i]) return; } - requiresStyleSelectorReset = false; // If we are already parsing the body and so may have significant amount of elements, put some effort into trying to avoid style recalcs. if (!body() || m_hasNodesWithPlaceholderStyle)
Brent Fulgham
Comment 7
2022-07-12 16:50:15 PDT
It looks like all browsers engines (WebKit, Blink, and Gecko) handle this load the same way -- all three "pop in" with the new font after it finishes loading. I think this is correct behavior to avoid sites being unable to load if a web font is unavailable. One difference from 2012, is that the web view repaints after the font finishes loading (i.e., no reload is needed by the user). I think this behaves correctly now.
Radar WebKit Bug Importer
Comment 8
2022-07-12 16:51:16 PDT
<
rdar://problem/96918084
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug