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

Issue 623616 link

Starred by 7 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Bug-Regression



Sign in to add a comment

DevTools: [network] unused webfonts are shown as pending network requests

Reported by fatimah....@gmail.com, Jun 27 2016

Issue description

Device name: Samsung S5

From "Settings > About Chrome"
Application version: 53.0.2781.0  
OS: Kitkat 4.4.4

URLs (if applicable): Any URL that would lead to fetching .ttf and .woff fonts. Example: https://m.washingtonpost.com

Behavior in Android Browser (if applicable): The Remote Debugging Tool always shows that the .ttf and .woff fonts are "pending", and 0B are downloaded. 

I am not sure if the problem is with the Remote Debugging Tool's representation of what is happening or with Android Chrome, actually not fetching web objects. 

I verified that the problem occurs even when we have the appropriate fonts exist on the server.


The same problem also occurs with the latest version of the Android Chrome Dev, version 53.0.2774.4



Steps to reproduce:
(1) Connect the phone to the computer and run the Remote Debugging Tool.
(2) Fetch: https://m.washingtonpost.com
(3) Observe that .ttf and .woff fonts are always pending. 

Expected result: The fonts should get downloaded. 


Actual result: We always see that the fonts are pending.




 
Components: Blink>Fonts

Comment 2 by e...@chromium.org, Jun 27 2016

Components: -Blink>Fonts Platform>DevTools

Comment 3 by e...@chromium.org, Jun 27 2016

Components: Blink>WebFonts
Labels: -OS-Android Needs-Feedback
Fonts are shown as "pending" until the font is actually used by some texts on ToT/Dev.

I can see the same behavior on Linux and Android on ToT, but can not on the stable channel.
On the stable channel, resources that are shown as "pending" on ToT never appear in the DevTool network tab.

fatimah.zarinni@gmail.com:
Can you check if the font is actually used in the site, or create a minimized test scenario?
Owner: alph@chromium.org
Summary: DevTools: [timeline] unused webfonts are shown as pending network requests (was: When Downloading fonts for webpages Remote Debugging Tool shows them continuously as pending)
Cc: alph@chromium.org
Owner: allada@chromium.org
Summary: DevTools: [network] unused webfonts are shown as pending network requests (was: DevTools: [timeline] unused webfonts are shown as pending network requests)
This affects both network panel and timeline panel. Attaches are screenshots of https://m.washingtonpost.com/


Toyoshim, do you know why fonts go through  FrameFetchContext::dispatchWillSendRequest but apparently do not begin their network request then? This seems to be what is adding confusion to our instrumentation.
Screen Shot 2016-07-01 at 2.37.43 PM.png
253 KB View Download
Screen Shot 2016-07-01 at 2.37.49 PM.png
294 KB View Download
 Issue 625158  has been merged into this issue.
Cc: hirosh...@chromium.org
Components: Blink>Loader
Status: Untriaged (was: Unconfirmed)
hiroshige: in terms of core/fetch, is this an expected behavior change?
This change may be related to recent refactoring on Resource.
Cc: ksakamoto@chromium.org
> but apparently do not begin their network request then?
Blink's loader defers the loading of WebFonts until it is actually used (I expect this behavior hasn't changed recently).

> why fonts go through  FrameFetchContext::dispatchWillSendRequest
A series of recent refactoring changed how WebFonts' deferred loading is implemented, and it might change whether/when dispatchWillSendRequest() is called for deferred WebFonts.

FrameFetchContext::dispatchWillSendRequest() is called from ResourceFetcher::requestResource().
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp?sq=package:chromium&dr=CSs&rcl=1468538294&l=469

Later in requestResource(), resourceNeedsLoad() is false for WebFonts and thus requestResource() returns without calling startLoad().
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp?sq=package:chromium&dr=CSs&rcl=1468538294&l=518

What is the expected behavior?
Should FrameFetchContext::dispatchWillSendRequest() called only when (and just before) the actual load is starting?
Cc: japhet@chromium.org
Cc: -hirosh...@chromium.org allada@chromium.org
Labels: -Pri-3 -Needs-Feedback OS-All Pri-1 Type-Bug-Regression
Owner: hirosh...@chromium.org
Status: Assigned (was: Untriaged)
This is annoying... Let me raise the priority.

> Should FrameFetchContext::dispatchWillSendRequest() called only when (and just before) the actual load is starting?
Yeah that sounds like the right thing to do (I don't understand full implications though).
Hiroshige-san, could you create a patch?

Labels: M-53
Regressed by: https://codereview.chromium.org/1889973002, affecting M-53.

Creating a CL: https://codereview.chromium.org/2184823006/
Project Member

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

Labels: -M-53 M-54 MovedFrom-53
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 15 by bugdroid1@chromium.org, Jul 29 2016

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

commit 1b4209891f51609fe5aa84e13be6dd482ca734c7
Author: hiroshige <hiroshige@chromium.org>
Date: Fri Jul 29 06:03:10 2016

Call FetchContext::dispatchWillSendRequest() only if an actual load is started

Fixing a regression since [1].
[1] https://codereview.chromium.org/1889973002/

Since [1], FetchContext::dispatchWillSendRequest() was called from
ResourceFetcher::willSendRequest() in the middle of
ResourceFetcher::requestResource(), and might have modified
Resource::m_resourceRequest.
However, if the actual loading is deferred, e.g. when FontResource is not
used, FetchContext::dispatchWillSendRequest() was called without actual
loading, causing stale pending load reports in DevTools.

This CL
- Moves the ResourceFetcher::willSendRequest() call in requestResource() to
  ResourceFetcher::startLoad().
  Now FetchContext::dispatchWillSendRequest() (called from startLoad())
  modifies the local ResourceRequest in startLoad(), not modifying
  ResourceRequest::m_resourceRequest (which is the behavior before [1]).
- Moves setAllowStoredCredentials() call in ResourceFetcher::willSendRequest()
  to its callsites, because this should be done even when the actual loading
  is deferred and should modify Resource::m_resourceRequest.
- Adds a layout test.

BUG= 623616 , 632580

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

[add] https://crrev.com/1b4209891f51609fe5aa84e13be6dd482ca734c7/third_party/WebKit/LayoutTests/http/tests/inspector/network/font-face-expected.txt
[add] https://crrev.com/1b4209891f51609fe5aa84e13be6dd482ca734c7/third_party/WebKit/LayoutTests/http/tests/inspector/network/font-face.html
[add] https://crrev.com/1b4209891f51609fe5aa84e13be6dd482ca734c7/third_party/WebKit/LayoutTests/http/tests/inspector/network/resources/font-face.html
[modify] https://crrev.com/1b4209891f51609fe5aa84e13be6dd482ca734c7/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp

Labels: TE-Verified-54.0.2816.0 TE-Verified-M54
Tested the issue on windows 7, Linux Ubuntu 14.04 and Mac 10.11.6 using chrome version 54.0.2816.0 with the below steps

1. Go to URL https://m.washingtonpost.com/
2.Open dev tools,network panel.
3.Reload(F5) .Not observed any  .ttf and .woff fonts pending

Please find the attached screen cast for the same.Adding TE-Verified labels.

Thanks,
623616.mp4
4.5 MB View Download
Labels: Merge-Request-53

Comment 18 by dimu@chromium.org, Aug 2 2016

Labels: -Merge-Request-53 Merge-Approved-53 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M53 (branch: 2785)
We're cutting M53 Beta RC today for release tomorrow. Please try to merge your change to M53 branch 2785 before 5:30 PM PT today so we can take it for this week beta. Thank you.
Project Member

Comment 20 by bugdroid1@chromium.org, Aug 3 2016

Labels: -merge-approved-53 merge-merged-2785
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e8573e904dd5ed11adb5eac18ac601963e90cc14

commit e8573e904dd5ed11adb5eac18ac601963e90cc14
Author: Hiroshige Hayashizaki <hiroshige@chromium.org>
Date: Wed Aug 03 07:29:32 2016

Call FetchContext::dispatchWillSendRequest() only if an actual load is started

Fixing a regression since [1].
[1] https://codereview.chromium.org/1889973002/

Since [1], FetchContext::dispatchWillSendRequest() was called from
ResourceFetcher::willSendRequest() in the middle of
ResourceFetcher::requestResource(), and might have modified
Resource::m_resourceRequest.
However, if the actual loading is deferred, e.g. when FontResource is not
used, FetchContext::dispatchWillSendRequest() was called without actual
loading, causing stale pending load reports in DevTools.

This CL
- Moves the ResourceFetcher::willSendRequest() call in requestResource() to
  ResourceFetcher::startLoad().
  Now FetchContext::dispatchWillSendRequest() (called from startLoad())
  modifies the local ResourceRequest in startLoad(), not modifying
  ResourceRequest::m_resourceRequest (which is the behavior before [1]).
- Moves setAllowStoredCredentials() call in ResourceFetcher::willSendRequest()
  to its callsites, because this should be done even when the actual loading
  is deferred and should modify Resource::m_resourceRequest.
- Adds a layout test.

BUG= 623616 , 632580

Review-Url: https://codereview.chromium.org/2184823006
Cr-Commit-Position: refs/heads/master@{#408588}
(cherry picked from commit 1b4209891f51609fe5aa84e13be6dd482ca734c7)

Review URL: https://codereview.chromium.org/2207833002 .

Cr-Commit-Position: refs/branch-heads/2785@{#480}
Cr-Branched-From: 68623971be0cfc492a2cb0427d7f478e7b214c24-refs/heads/master@{#403382}

[add] https://crrev.com/e8573e904dd5ed11adb5eac18ac601963e90cc14/third_party/WebKit/LayoutTests/http/tests/inspector/network/font-face-expected.txt
[add] https://crrev.com/e8573e904dd5ed11adb5eac18ac601963e90cc14/third_party/WebKit/LayoutTests/http/tests/inspector/network/font-face.html
[add] https://crrev.com/e8573e904dd5ed11adb5eac18ac601963e90cc14/third_party/WebKit/LayoutTests/http/tests/inspector/network/resources/font-face.html
[modify] https://crrev.com/e8573e904dd5ed11adb5eac18ac601963e90cc14/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp

Status: Fixed (was: Assigned)
Closing as fixed: Regression since M-53 (Comment 13) and the fix is merged into M-53 (Comment 20).
Thank you for fixing the issue !

Best regards,
Fatima
Cc: tkonch...@chromium.org
Labels: TE-Verified-53.0.3785.46 TE-Verified-M53
Tested the issue on windows 8.1, Linux Ubuntu 14.04 and Mac 10.11.5 using chrome version 53.0.3785.46 navigating to https://m.washingtonpost.com and reloading - Not observed any  .ttf and .woff fonts pending 

Please find the screencast

Adding TE-Verified labels
623616.mov
21.6 MB Download

Sign in to add a comment