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

Issue 824611 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Email to this user bounced
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

font family parsing mishandles CSS keywords like `initial`

Reported by ch...@w3.org, Mar 22 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0

Example URL:
https://test.csswg.org/harness/test/css-fonts-3_dev/single/test_font_family_parsing/format/html5/

Steps to reproduce the problem:
1. https://test.csswg.org/harness/test/css-fonts-3_dev/single/test_font_family_parsing/format/html5/
2. search for "fail"

What is the expected behavior?
2322 Pass

What went wrong?
2024 Pass
208 Fail

Font family declarations that contain CSS keywords like `initial` or `inherit` are not being parsed per CSS Fonts 3.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? No 

Does this work in other browsers? No
 Edge, Firefox > 59 (reversion)

Chrome version: 67.0.3377.0 (Official Build) canary (64-bit) (cohort: Clang-64)  Channel: n/a
OS Version: 10.0
Flash Version: 

"Font family names that happen to be the same as keyword value (‘inherit’, ‘serif’, etc.) must be quoted to prevent confusion with the keywords with the same names. UAs must not consider these keywords as matching the <family-name> type. This applies to any keyword across all of CSS. "
https://drafts.csswg.org/css-fonts-3/#font-family-prop
 
Labels: Needs-Triage-M67

Comment 2 by f...@opera.com, Mar 22 2018

Components: -Blink Blink>CSS
Status: Available (was: Unconfirmed)
Seems to be a problem specific to the shorthand ('font') parsing. The longhand seems to DTRT.
Cc: vamshi.kommuri@chromium.org
Labels: Triaged-ET M-67 Target-67 FoundIn-67
Checked the issue on reported chrome version  67.0.3377.0 and on the latest stable 65.0.3325.181 using Windows 10, Ubuntu 14.04 and Mac 10.13.1. 

We are able to see "2024 Pass" which is reported as wrong behaviour.
                    208 Fail  

And we didn't observe any "2322 Pass" results after navigating to the given URL and searching for "Fail".

As this similar behaviour is seen from M60(60.0.3072.0) considering it as Non-Regression.

Thanks!
Labels: OS-Linux OS-Mac
Owner: rob.b...@samsung.com
Status: Assigned (was: Available)

Comment 6 by timloh@chromium.org, Mar 29 2018

I don't understand the tests here, how does font: '16px simple, initial bongo' parse? I don't think that CSS-wide keywords work in lists.

Comment 7 by timloh@chromium.org, Mar 29 2018

(typo, I meant 'font: 16px simple, initial bongo')
@timloh you are right, it is not very clear. The only idea I have why "simple, initial bongo" qualifies as font-family is this:
"If a sequence of identifiers is given as a font family name, the computed value is the name converted to a string by joining all the identifiers in the sequence by single spaces."
https://drafts.csswg.org/css-fonts-4/#font-family-prop

Comment 9 by ch...@w3.org, Mar 29 2018

I think that is correct. 

However, if you find parts of tests that you think are incorrect, please report them by raising an issue:
https://github.com/w3c/web-platform-tests/labels/wg-css
and we will fix them. 

Likewise, if the spec is wrong, contradictory or unclear then please raise an issue:
https://github.com/w3c/csswg-drafts/labels/css-fonts-3
and we will discuss, and fix the spec.

Comment 10 by ch...@w3.org, Mar 29 2018

> I don't understand the tests here, how does font: '16px simple, initial bongo' parse? I don't think that CSS-wide keywords work in lists.


Exactly. The test is to make sure that things which look like CSS-wide keywords are *not* treated specially in font family names.
Project Member

Comment 11 by bugdroid1@chromium.org, Apr 3 2018

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

commit 2d5bb27c5c0d59fbb8f7a961b5d6861480f154f1
Author: Rob Buis <rob.buis@samsung.com>
Date: Tue Apr 03 12:26:57 2018

Make font shorthand initial/inherit parsing less strict

Make font shorthand initial/inherit parsing less strict, the
current solution means the special logic in ConsumeFontFamily
is not taken into account. Since all font longhands will reject
css wide keywords and ConsumeFontFamily has special rules for them,
we can just remove the while loop.

Bug:  824611 

Change-Id: I9bae2c1497e61bb0d93973bb1bfaac386d0c6d0b
Reviewed-on: https://chromium-review.googlesource.com/982557
Reviewed-by: Timothy Loh <timloh@chromium.org>
Commit-Queue: Rob Buis <rob.buis@samsung.com>
Cr-Commit-Position: refs/heads/master@{#547677}
[delete] https://crrev.com/0e8b553a69ead6ff3cbf96e61358335bddc94f67/third_party/WebKit/LayoutTests/external/wpt/css/css-fonts/test_font_family_parsing-expected.txt
[modify] https://crrev.com/2d5bb27c5c0d59fbb8f7a961b5d6861480f154f1/third_party/WebKit/LayoutTests/fast/css/font-shorthand-mix-inherit-expected.txt
[modify] https://crrev.com/2d5bb27c5c0d59fbb8f7a961b5d6861480f154f1/third_party/WebKit/LayoutTests/fast/css/font-shorthand-mix-inherit.html
[modify] https://crrev.com/2d5bb27c5c0d59fbb8f7a961b5d6861480f154f1/third_party/WebKit/Source/core/css/properties/shorthands/FontCustom.cpp

Status: Fixed (was: Assigned)

Sign in to add a comment