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

Issue 595356 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit 29 days ago
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Rendered Font does not agree with font-family

Reported by vicric...@gmail.com, Mar 16 2016

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36

Steps to reproduce the problem:
1. Open the attached test.html file
2. Open Dev Tools
3. CTRL-R to reload the page

What is the expected behavior?
The Rendered Font should be Roboto

What went wrong?
The inspector shows the font-face as Roboto, but the Rendered Font is not Roboto (DejaVu Sans or Times New Roman)

Pressing CTRL-R repeatedly results in the Rendered Font changing occasionally.

Additionally, sometimes the reported Rendered Font doesn't agree with what's actually rendered in the page.  Clicking back and forth between the HTML elements in the Dev Tools causes the Rendered Font value to change.

Did this work before? N/A 

Chrome version: 49.0.2623.87  Channel: stable
OS Version: Fedora 22
Flash Version: Shockwave Flash 21.0 r0

The behavior changes slightly when in Device Mode.  Under Linux, in Device Mode, the "wrong" font will be DejaVu Sans, but when Device Mode is disabled, it's Times New Roman.  On Windows, it seems to always be Times New Roman.
 
test.html
336 bytes View Download

Comment 1 by caseq@chromium.org, Mar 16 2016

Cc: caseq@chromium.org
Components: -Platform>DevTools Blink>Fonts
Labels: Needs-Feedback
Works for me -- could it be Roboto is missing on your system? Also, this doesn't seem to be a DevTools issue.

Comment 2 by vicric...@gmail.com, Mar 18 2016

Sorry if I wasn't clear.  Roboto is a Google web font.

<link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet" type="text/css">

I believe part of the problem is the Dev Tools showing the incorrect value for Rendered Font.

On Windows, the inspector shows the Rendered Font sometimes as Roboto, sometimes Times New Roman.  In the page, it seems that it's always rendered as Roboto.

On Linux, it behaves similarly, however, with Device Mode enabled, the font in the page also changes.

Without Device Mode enabled, both Windows and Linux will alternate the Rendered Font (in the inspector) randomly between Roboto and Times New Roman as you reload the page.  The font in the page appears to be Roboto regardless of what the inspector says.

With Device Mode enabled, Linux shows DejaVu Sans as the Rendered Font in the inspector, and in the page.  Reloading the page does not alternate the font in this case.  It's consistently wrong.

Not that it matters, but it works correctly in Firefox.

I attached another file that shows three lines make it easier to see the font change.

test2.html
517 bytes View Download
Project Member

Comment 3 by sheriffbot@chromium.org, Mar 18 2016

Labels: -Needs-Feedback Needs-Review
Owner: caseq@chromium.org
Status: Assigned (was: Unconfirmed)
Thank you for providing more feedback. Assigning to requester "caseq@chromium.org" for another review.

For more details visit https://sites.google.com/a/chromium.org/dev/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 4 by caseq@chromium.org, Mar 18 2016

Components: -Blink>Fonts Platform>DevTools>HTML
Owner: lushnikov@chromium.org
vicricker@, ah, thanks, I can reproduce this now -- it looks like there's a race between the font being loaded and applied and DevTools computing and updating the rendered font, so basically the wrong font indication that you're seeing is likely just stale and would change if you re-open DevTools or just navigate back and forth from the element to cause style list to be updated. I think we should be updating it upon each style recalc.
Project Member

Comment 5 by bugdroid1@chromium.org, Jul 30 2016

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

commit d9ebd07e0297c152cd101ece462e54a7d260c1a3
Author: lushnikov <lushnikov@chromium.org>
Date: Sat Jul 30 01:26:56 2016

DevTools: add CSS.FontsUpdated event to signify that WebFont has loaded.

BUG= 595356 
R=dgozman

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

[add] https://crrev.com/d9ebd07e0297c152cd101ece462e54a7d260c1a3/third_party/WebKit/LayoutTests/inspector-protocol/css/css-fonts-updated-event-expected.txt
[add] https://crrev.com/d9ebd07e0297c152cd101ece462e54a7d260c1a3/third_party/WebKit/LayoutTests/inspector-protocol/css/css-fonts-updated-event.html
[add] https://crrev.com/d9ebd07e0297c152cd101ece462e54a7d260c1a3/third_party/WebKit/LayoutTests/inspector-protocol/css/resources/ahem.css
[modify] https://crrev.com/d9ebd07e0297c152cd101ece462e54a7d260c1a3/third_party/WebKit/Source/core/dom/StyleEngine.cpp
[modify] https://crrev.com/d9ebd07e0297c152cd101ece462e54a7d260c1a3/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
[modify] https://crrev.com/d9ebd07e0297c152cd101ece462e54a7d260c1a3/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.h
[modify] https://crrev.com/d9ebd07e0297c152cd101ece462e54a7d260c1a3/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.idl
[modify] https://crrev.com/d9ebd07e0297c152cd101ece462e54a7d260c1a3/third_party/WebKit/Source/core/inspector/browser_protocol.json
[modify] https://crrev.com/d9ebd07e0297c152cd101ece462e54a7d260c1a3/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleModel.js
[modify] https://crrev.com/d9ebd07e0297c152cd101ece462e54a7d260c1a3/third_party/WebKit/Source/devtools/front_end/sdk/CSSModel.js

Status: Fixed (was: Assigned)

Sign in to add a comment