New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 602968 link

Starred by 34 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug

Blocking:
issue 652974
issue 692574



Sign in to add a comment

Text with custom web fonts disappearing in Chrome 48

Reported by v.tambov...@gmail.com, Apr 13 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0

Example URL:
https://app.tacticrealtime.com/data/AdvertPreview/17ca3e775c5cc9e5a7fc48c17473827f/14417

Steps to reproduce the problem:
This is a copy of #582198 since it is said to copy the issue and I have the same problem here:

Other browsers tested: 
Chrome 47, Chrome 48, Firefox, Safari, Chromium 49, Chrome 51 canary, Opera

Add OK or FAIL, along with the version, after other browsers where you have tested this issue:
  Chrome 47: OK
  Chrome 48: FAIL
  Chrome 49: FAIL
  Chrome 51: FAIL
    Firefox: OK
     Safari: OK
      Opera: OK

What steps will reproduce the problem?
1. Banner should be in an iframe.
2. Set of banners placed on one preview page. (link provided)
3. Custom font via @font-face applied. (doesn't depend from exact font-family, tested with different ones)

What is the expected behavior?
Expected result you can see with Chrome lover than 48 ver. or any other browser. Also screenshots are attached.

What went wrong?

The texts using custom fonts become invisible, however fonts are loaded and text exists in <p> tag. 
If you reload banner with "Reload" button on provided link, text will be shown.
If you inspect <p> element that contains invisible text and change it's any CSS property or turn on/off text will appear.
Conclusion: text exists, but it is invisible.

This is definitely a change in Chrome 48.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? Yes Chrome 47

Does this work in other browsers? Yes 

Chrome version: Version 49.0.2623.112 m  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 21.0 r0
 
2016-04-13 12.58.02 Test _ TACTIC™ Advert Preview - Google Chrome.png
212 KB View Download
Labels: Needs-Bisect
Components: -Blink Blink>WebFonts
Cc: kavvaru@chromium.org
Labels: -Needs-Bisect M-52 hasbisect OS-Linux OS-Mac
Owner: senorblanco@chromium.org
Status: Assigned (was: Unconfirmed)
v.tambovtsev@ Thanks for the issue.

Able to reproduce the issue on windows 7, Linux Ubuntu 14.04 and Mac 10.11.3 using chrome version 49.0.2623.112 and canary 52.0.2707.2 with the below steps

1. go to URL https://app.tacticrealtime.com/data/AdvertPreview/17ca3e775c5cc9e5a7fc48c17473827f/14417
2.Observed some of the image fonts are not rendered.

This is reproducible on ALL OS and it is regression issue broken in M48.
Please find the bisect information as below.

Narrow Bisect::
Good :: 48.0.2537.0  -- (official build 354398)
Bad:: 48.0.2538.0 --   (official build 354651)

CHANGELOG URL:
  https://chromium.googlesource.com/chromium/src/+log/e9db8061b1f0b6776858f9c4968f8e85cfff1d63..6b1707c86a8b8f9f0e93dbffc849ed6e500ff43b

Blink Change Log::
https://chromium.googlesource.com/skia/+log/80803ff..466c2c4

Possible suspect from the above blink CL
https://codereview.chromium.org/1393283008

senorblanco @ could you please look into this issue if it is related to your change,else please help us in finding the appropriate owner for this issue.

Thanks,
Actually, I have this but with fonts disappearing not only _inside_ an iframe, but even on the page _containing_ and iframe
Owner: ----
Status: Available (was: Assigned)
That change was a benign refactor that's 6 months old and pretty much impossible to revert now, given the other things which have landed since then.

(Also, given that the HTML alone for this case is 200K, this is also desperately in need of a reduction.)

Is there a WebFonts expert who could take a look?
Cc: japhet@chromium.org
Components: Blink>Loader
I think the culprit is japhet@'s change in that bisect range (http://crrev.com/71adea2).

The example page hits this assertion in debug build @ ToT:

ASSERTION FAILED: resource->isLoaded()
../../third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp(539) : void blink::ResourceFetcher::initializeRevalidation(const blink::FetchRequest &, blink::Resource *)
1   0x7f4fca6e1d06 blink::ResourceFetcher::initializeRevalidation(blink::FetchRequest const&, blink::Resource*)
2   0x7f4fca6e0d3f blink::ResourceFetcher::requestResource(blink::FetchRequest&, blink::ResourceFactory const&, blink::SubstituteData const&)
3   0x7f4fca6b1579
4   0x7f4fca402a06
5   0x7f4fca46bd40
6   0x7f4fca46c31f
7   0x7f4fca562abd
8   0x7f4fca562c20
9   0x7f4fca57fd3a blink::StyleResolver::appendCSSStyleSheet(blink::CSSStyleSheet&)
10  0x7f4fca57fdc3 blink::StyleResolver::appendPendingAuthorStyleSheets()
11  0x7f4fcab034b1
12  0x7f4fcac102ec blink::StyleEngine::attributeChangedForElement(blink::QualifiedName const&, blink::Element&)

Received signal 11 SEGV_MAPERR 0000fbadbeef
#0 0x7f4fe10375fe base::debug::StackTrace::StackTrace()
#1 0x7f4fe103713f base::debug::(anonymous namespace)::StackDumpSignalHandler()
#2 0x7f4fd21a3340 <unknown>
#3 0x7f4fca6e1d0d blink::ResourceFetcher::initializeRevalidation()
#4 0x7f4fca6e0d3f blink::ResourceFetcher::requestResource()
#5 0x7f4fca6b1579 blink::FontResource::fetch()
#6 0x7f4fca402a06 blink::CSSFontFaceSrcValue::fetch()
#7 0x7f4fca46bd40 blink::FontFace::initCSSFontFace()
#8 0x7f4fca46c31f blink::FontFace::create()
#9 0x7f4fca562abd blink::ScopedStyleResolver::addFontFaceRules()
#10 0x7f4fca562c20 blink::ScopedStyleResolver::appendCSSStyleSheet()
#11 0x7f4fca57fd3a blink::StyleResolver::appendCSSStyleSheet()
#12 0x7f4fca57fdc3 blink::StyleResolver::appendPendingAuthorStyleSheets()
#13 0x7f4fcab034b1 blink::StyleEngine::ensureResolver()
#14 0x7f4fcac102ec blink::StyleEngine::attributeChangedForElement()

Project Member

Comment 8 by sheriffbot@chromium.org, Jun 1 2016

Labels: -M-52 M-53 MovedFrom-52
Moving this nonessential bug to the next milestone.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 9 by sheriffbot@chromium.org, Jul 14 2016

Labels: -M-53 MovedFrom-53
This issue has been moved once and is lower than Pri-1. Removing the milestone.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
 Issue 640701  has been merged into this issue.
Still possible to reproduce on  Chrome (52.0.2743.116) (also on Linux) and Canary (54.0.2825.0)


chrom_bug.PNG
217 KB View Download
Yeah, my company is seeing this too on our page. We're using font-awesome and a custom icon font for some of our buttons. It only happens when the font isn't cached. So, if I open up my console and disable the cache, the font icons will render invisible. If I go into the css style editor and toggle the font property, the icons fix themselves. Also, once the user has hit a page once and cached it, it'll be fine until the cache invalidates. 

Comment 13 by b...@orbit.org, Sep 21 2016

Note, still seeing this in 53.0.2785.116. For me the repro is:

 - Parent page with iframe child page
 - Parent loads CSS file with custom @font-face
 - Child loads (different) CSS file with same custom @font-face code
 - Now font renders invisible (in parent) under "certain circumstances"

Easy (but stupid) workaround:

 - Create duplicates of the custom font files
 - Child CSS loads the duplicated custom font files instead of loading the same ones as the parent.

(Found this workaround mentioned in https://bugs.chromium.org/p/chromium/issues/detail?id=582198 which I assume was actually the same issue as this one)
Btw, there is still bug in Chrome, however we found workaround, so it works now in first post:
https://app.tacticrealtime.com/data/AdvertPreview/17ca3e775c5cc9e5a7fc48c17473827f/14417

Workaround:
For each font we add format to url (.woff2?format), so for browser it looks like it loads new font.

Comment 15 by phistuck@gmail.com, Sep 29 2016

Can you, please, supply a stable URL with as less code as possible? It is very hard to work on a bug that its reproduction URL no longer reproduces the issue at hand.
Problem is still reproduced (55.0.2883.87 on Windows).

Comment 17 by cle...@gmail.com, Feb 22 2017

I can vouch for the above, it is very easy to reproduce this problem when sharing font files between a parent window and iframe. Only workaround I have found is to load separate font files for the iframed window as mentioned above
Cc: ksakamoto@chromium.org
I prepare a page that can reproduce this issue.
http://yuri.twintail.org/chrome/font/602968/

I can see this issue only with the font that the first referenced site use.
But I believe it is just because of timing. What I notice here are:

- when the second font in an iframe is created, FontResource is already in memory cache, and notifyFinished() is synchronously called when addClients is called.
- but isLoaded() returns false because revalidation is running.
- it will not be notified after the revalidation is finished.

https://codereview.chromium.org/2550663002/diff/20001/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp

This is ksakamoto's old patch. I think this is a right patch to fix this issue.
If we are counting revalidation cases in, we should check m_font->hasCustomFontData() rather than isLoaded().

Blocking: 692574 652974
Update 'Blocking' to point issues that should happen due to the same root cause.
Project Member

Comment 21 by bugdroid1@chromium.org, Mar 3 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/99cc846f07ae952c27c026f7a4ddc0dbfba0a83a

commit 99cc846f07ae952c27c026f7a4ddc0dbfba0a83a
Author: ksakamoto <ksakamoto@chromium.org>
Date: Fri Mar 03 07:24:10 2017

RemoteFontFaceSource should keep FontCustomPlatformData over FontResource revalidation

RemoteFontFaceSource assumed that FontResource::isLoaded() never returns
false after notifyFinished(), but FontResource can go back to "loading"
state by resource revalidation. This caused a bug where webfonts are not
displayed when loaded in one frame and immediately revalidated in
another frame.

To fix this bug, this CL does the following:
- Make FontCustomPlatformData RefCounted.
- Make RemoteFontFaceSource to get RefPtr<FontCustomPlatformData> and
  use it in RemoteFontFaceSource::createFontData().
- RemoteFontFaceSource never accesses FontResource after notifyFinished().

BUG= 602968 ,  652974 ,  692574 

Review-Url: https://codereview.chromium.org/2717123003
Cr-Commit-Position: refs/heads/master@{#454537}

[add] https://crrev.com/99cc846f07ae952c27c026f7a4ddc0dbfba0a83a/third_party/WebKit/LayoutTests/http/tests/webfont/font-face-revalidation-expected.html
[add] https://crrev.com/99cc846f07ae952c27c026f7a4ddc0dbfba0a83a/third_party/WebKit/LayoutTests/http/tests/webfont/font-face-revalidation.html
[modify] https://crrev.com/99cc846f07ae952c27c026f7a4ddc0dbfba0a83a/third_party/WebKit/Source/core/css/BinaryDataFontFaceSource.h
[modify] https://crrev.com/99cc846f07ae952c27c026f7a4ddc0dbfba0a83a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
[modify] https://crrev.com/99cc846f07ae952c27c026f7a4ddc0dbfba0a83a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.h
[modify] https://crrev.com/99cc846f07ae952c27c026f7a4ddc0dbfba0a83a/third_party/WebKit/Source/core/loader/resource/FontResource.cpp
[modify] https://crrev.com/99cc846f07ae952c27c026f7a4ddc0dbfba0a83a/third_party/WebKit/Source/core/loader/resource/FontResource.h
[modify] https://crrev.com/99cc846f07ae952c27c026f7a4ddc0dbfba0a83a/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp
[modify] https://crrev.com/99cc846f07ae952c27c026f7a4ddc0dbfba0a83a/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.h
[modify] https://crrev.com/99cc846f07ae952c27c026f7a4ddc0dbfba0a83a/third_party/WebKit/Source/platform/testing/FontTestHelpers.cpp

for those describing workarounds, is the key to solving this involve actually creating a new css sheet that's a clone of the existing one, then loading that into the iframe?

or does the copy also need to re-declare the font-faces with different font-family names?

ie:
main.css
font-face { font-family: "my custom font" src: "foo" };

iframe.css
font-face { font-family: "my custom font 2" src: "foo" };

Comment 23 by cle...@gmail.com, Mar 6 2017

@dan.a.qu...@gmail.com

Simply creating a CSS file that was a clone of the existing one that is used exclusively for the iframe worked for me. Didn't have to rename the font family. (Also note that I did this with the font-faces set up in an isolated CSS from my main styles, so I didn't need to do duplicate the rest of my page styles for it to work)
Cc: -ksakamoto@chromium.org
Owner: ksakamoto@chromium.org
Status: Fixed (was: Available)
This should be fixed in latest canary (59.0.3032.0). If not, please let us know.
 Issue 585239  has been merged into this issue.
Hi all, it's probably unlikely, but does anyone have a suggested fix in code that can be done for chromium 49? For reasons beyond my control, I cannot upgrade to the latest version of chromium to get the recent fix, and the codebase has diverged drastically since then, such that it's too complex to backport the fix in this bug. I'm hoping there's a simple one or two line change that can be done in chromium 49.

Sign in to add a comment