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

Issue 652362 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

`@font-face` is broken by `CSSStyleDeclaration.setProperty()`

Reported by anseki....@gmail.com, Oct 3 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36

Example URL:
https://jsfiddle.net/bn1jcssr/

Steps to reproduce the problem:
`@font-face` definition seems to be broken when `font-family` property is accessed by `CSSStyleDeclaration.setProperty()` method even if the value is not changed.
For example:

var style = document.styleSheets[0].cssRules[0].style; // @font-face
style.setProperty('font-family', style.getPropertyValue('font-family')); // no change

Then, elements that are set that `font-family` are shown with another font face, it maybe sans-serif.

Example:
https://jsfiddle.net/bn1jcssr/

What is the expected behavior?
If `font-family` property is not changed, the view also is not changed.
If it is changed to new name, the elements using style named new are changed.

What went wrong?
The elements that are set that `font-family` are shown with another font face, it maybe sans-serif.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? N/A 

Did this work before? N/A 

Does this work in other browsers? Yes 

Chrome version: 53.0.2785.143  Channel: stable
OS Version: 6.3
Flash Version: Shockwave Flash 23.0 r0
 
Components: -Blink Blink>CSS
Labels: Needs-Bisect

This issue seems to occur when `font-family` property is accessed by the following also, regardless of the way to access.
- `style.fontFamily`
- `style['font-family']`

https://jsfiddle.net/bn1jcssr/1/

The title of this issue should be changed.
`@font-face` is broken by accessing to `font-family`
I'm guessing this is because when parsing the stylesheet we use a separate codepath for @font-face descriptors but when we try and modify the value we incorrectly use the parsing routines for regular properties (the font-family property is a list).
Cc: kkaluri@chromium.org
Labels: -Type-Bug -Needs-Bisect M-55 hasbisect OS-Linux OS-Mac Type-Bug-Regression
Owner: rob.buis@chromium.org
Status: Assigned (was: Unconfirmed)
Able to reproduce this issue on Windows 7, Ubuntu 14.04 and Mac 10.12 on latest chrome stable version 53.0.2785.143.This feature is working fine in the M-30 release, after narrowing down the builds i am able to find 

Good Build : 47.0.2516.0 , Revision Range (350069)                                           
Bad Build  : 47.0.2518.0 , Revision Range (350532)

Change Log:
-----------
https://chromium.googlesource.com/chromium/src/+log/158b635df366630504eac45b584ed6a357c290dd..18167629b4bdc20e951b71e9c546ed0c1030090f

From the above CL suspecting the below change
Review URL: https://codereview.chromium.org/1363233002

rob.buis@ - Could please look into this issue, if it's released to your change?  if not please please feel free to assign to the concern dev person 


                                    
Project Member

Comment 5 by bugdroid1@chromium.org, Oct 5 2016

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

commit 03ea643145f194a757feeb7ced2240c2d2c8f5dc
Author: rob.buis <rob.buis@samsung.com>
Date: Wed Oct 05 16:16:41 2016

Fix setting properties on CSSFontFaceRule

Fix setting properties on CSSFontFaceRule, before this patch
we used the regular css style property parsing routines which
are different from the @font-face specific descriptor parsing.
So reintroduce a mode to the CSSParserMode enumeration for
font-face rule and use it in order to properly parse
@font-face descriptors.

BUG= 652362 

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

[add] https://crrev.com/03ea643145f194a757feeb7ced2240c2d2c8f5dc/third_party/WebKit/LayoutTests/fast/css/font-face-family-setting.html
[modify] https://crrev.com/03ea643145f194a757feeb7ced2240c2d2c8f5dc/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
[modify] https://crrev.com/03ea643145f194a757feeb7ced2240c2d2c8f5dc/third_party/WebKit/Source/core/css/parser/CSSParserMode.h

Fixed by r423177.
Status: Fixed (was: Assigned)
Project Member

Comment 8 by bugdroid1@chromium.org, Oct 27 2016

Labels: merge-merged-2840
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/03ea643145f194a757feeb7ced2240c2d2c8f5dc

commit 03ea643145f194a757feeb7ced2240c2d2c8f5dc
Author: rob.buis <rob.buis@samsung.com>
Date: Wed Oct 05 16:16:41 2016

Fix setting properties on CSSFontFaceRule

Fix setting properties on CSSFontFaceRule, before this patch
we used the regular css style property parsing routines which
are different from the @font-face specific descriptor parsing.
So reintroduce a mode to the CSSParserMode enumeration for
font-face rule and use it in order to properly parse
@font-face descriptors.

BUG= 652362 

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

[add] https://crrev.com/03ea643145f194a757feeb7ced2240c2d2c8f5dc/third_party/WebKit/LayoutTests/fast/css/font-face-family-setting.html
[modify] https://crrev.com/03ea643145f194a757feeb7ced2240c2d2c8f5dc/third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp
[modify] https://crrev.com/03ea643145f194a757feeb7ced2240c2d2c8f5dc/third_party/WebKit/Source/core/css/parser/CSSParserMode.h

Comment 9 by dimu@google.com, Nov 4 2016

Labels: -merge-merged-2840
[Automated comment] removing mislabelled merge-merged-2840

Sign in to add a comment