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

Issue 781223 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Not on Chrome anymore
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug-Regression


Participants' hotlists:
Hotlist-1


Sign in to add a comment

custom css properties are not applied on the page from stylesheets injected by extensions

Reported by pavel.ag...@gmail.com, Nov 3 2017

Issue description

Chrome Version       : 64.0.3257.0 (Official Build) canary (64-bit)
URLs (if applicable) : <all_urls>

What steps will reproduce the problem?
(1) Create css file with the following content: `:root { --prop:test }`
(2) Create extension manifest file that injects this css file in <all_urls>
(3) Load the folder with these files as unpacked extension
(4) Go to any page
(5) Open DevTools
(6) Select any element
(7) Select "Computed" tab and check "Show all"
(8) `--prop` will be absent

What is the expected result?
`--prop` should have value specified in the injected stylesheet

What happens instead?
`--prop` is absent

Additional information:
In previous Chrome versions it works as expected.
The problem is relevant only to custom css properties with all kind of css selectors.
All other styles apply correctly.

When custom property retrieved via code like this:
`window.getComputedStyle(document.body,null).getPropertyValue("--prop")`
It returns:
`""`
 

Comment 1 by woxxom@gmail.com, Nov 3 2017

Bisect info: 509084 (good) - 509105 (bad)
https://chromium.googlesource.com/chromium/src/+log/442d5288..2fdeded5?pretty=fuller
Suspecting r509096 - 30168b99604c48a32828f26b5acb2674beea1a5d
"Implement user style sheets"
Landed in 64.0.3242.0

Repro: load the attached extension and open the attached test.html - it should display SUCCESS.
test-extension.zip
539 bytes Download
test.html
246 bytes View Download
Cc: m.jeth...@eyeo.com ligim...@chromium.org
Components: Blink>CSS
Labels: -Type-Bug -Pri-3 M-64 ReleaseBlock-Stable Pri-1 Type-Bug-Regression
Owner: nainar@chromium.org
Status: Assigned (was: Unconfirmed)
Possible suspect from the above bisect.

https://chromium-review.googlesource.com/c/chromium/src/+/641294

Assigning to one of the reviewer since the patch is committed by a non googler.  

Comment 3 by m.jeth...@eyeo.com, Nov 6 2017

This is because we did not take into account custom properties in user style sheets.

I have uploaded a patch:

crrev.com/c/754247

Comment 4 by meade@chromium.org, Nov 7 2017

Labels: Update-Monthly
Project Member

Comment 5 by bugdroid1@chromium.org, Nov 10 2017

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

commit 56daa9455a7ab0cc7af996980b741aa1ec82a42b
Author: Manish Jethani <m.jethani@eyeo.com>
Date: Fri Nov 10 06:24:46 2017

Apply custom properties in user style sheets

With crrev.com/c/641294 we introduced user style sheets, but without taking
into account custom properties. This patch adds support for custom properties
in user style sheets by calling StyleResolver::ApplyMatchedProperties for user
rules in the correct order.

BUG= 632009 , 781223 

Change-Id: I1c103fc37484835008b1b55e9b3b8099af50a48a
Reviewed-on: https://chromium-review.googlesource.com/754247
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: nainar <nainar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515478}
[modify] https://crrev.com/56daa9455a7ab0cc7af996980b741aa1ec82a42b/third_party/WebKit/Source/core/css/StyleEngineTest.cpp
[modify] https://crrev.com/56daa9455a7ab0cc7af996980b741aa1ec82a42b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp

Comment 6 by nainar@chromium.org, Nov 10 2017

Status: Fixed (was: Assigned)

Sign in to add a comment