New issue
Advanced search Search tips

Issue 851953 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Empty url() value in CSS background/background-image property causes misbehavior

Reported by m.chinan...@gmail.com, Jun 12 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36

Steps to reproduce the problem:
1. Write some CSS with a background-image: url("");
2. Load your page and inspect using the Styles inspector.
3. On the first load, you'll see that the Styles inspector behaves as normal.
4. Reload the page and now all Styles are italicized, not editable, and not source information (line numbers, sass partials, etc)

What is the expected behavior?
Styles inspector ignores the CSS error and behaves as normal.

What went wrong?
The Styles inspector broke. See attachment for screen recording of this in action.

Did this work before? N/A 

Chrome version: 67.0.3396.79  Channel: stable
OS Version: OS X 10.13.5
Flash Version: 

Firefox and Safari handle this without issue.
 
chrome-issue.mov
389 KB View Download
I'd like to clarify that the Styles inspector issue is being caused by the empty url() value. Removing that CSS restores expected behavior to the Styles inspector. The issue is also present with the shorthand background property, not just the background-image property.
Labels: Needs-Triage-M67

Comment 3 by l...@chromium.org, Jun 12 2018

Labels: Needs-Feedback
Owner: einbinder@chromium.org
Status: Assigned (was: Unconfirmed)
Thanks for the report.  I was unable to reproduce the grayed-out section with `url()` and `url("")` using both a local html file or a JSFiddle.

Could you please provide a sample HTML file to help us investigate?

einbinder@ have you seen this before?
I also cannot reproduce this. I'm suspecting it has something to do with your sourcemaps?
Thanks for the responses, all. See attached ZIP with an example of this issue in action. What I noticed while making this test case: If the empty url('') is written in the HTML inside <style>, the issue _doesn't_ happen. However, if the empty url('') is in a separate CSS file, the issue _does_ happen. Hope this helps!
test.zip
1.8 KB Download
The empty url causes the css file to be loaded twice, the second time as an image. When it is loaded as an image, the content is blocked from the renderer, but overrides the original css content we had. This confuses DevTools into thinking that the css file had no content to begin with.

Sign in to add a comment