Closed Bug 1323713 Opened 8 years ago Closed 7 years ago

"Style sheet could not be loaded" error in Style Editor

Categories

(DevTools :: Style Editor, defect, P1)

50 Branch
x86
Windows Vista
defect

Tracking

(firefox53 verified)

VERIFIED FIXED
Firefox 53
Tracking Status
firefox53 --- verified

People

(Reporter: regspam, Assigned: jdescottes)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.0; rv:50.0) Gecko/20100101 Firefox/50.0
Build ID: 20161208153507

Steps to reproduce:

1. Open http://blahtherapy.com/
2. Open Style Editor
3. The "Style sheet could not be loaded. http://blahtherapy.com/wp-content/cache/autoptimize/autoptimize_008433b6df70039fc9ea6308ed79872c.php" error is displayed. The corresponding stylesheet isn't in the style sheet pane, but is in fact applied to the page.
Component: Untriaged → Developer Tools: Style Editor
OS: Unspecified → Windows Vista
Hardware: Unspecified → x86
Confirmed using the STR provided in comment 0.

The error isn't shown in the browser console, but after investigating for a while, I did track it down.
It happens in \devtools\shared\inspector\css-logic.js, in the prettifyCSS function on this line: http://searchfox.org/mozilla-central/rev/f680e72cc6579f90b992b63ca14d923d2afea612/devtools/shared/inspector/css-logic.js#287

For some reason, the stylesheet http://blahtherapy.com/wp-content/cache/autoptimize/autoptimize_008433b6df70039fc9ea6308ed79872c.php causes this part of the code to have indentLevel be negative. And that fails because we're using the TAB_CHARS.repeat() function which expects its argument to be a positive number.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Inspector bug triage, filter on CLIMBING SHOES.

This bug has clear STRs and should be fixed.
The faulty CSS contains an extra closing } after the "#footer-widget-area div.item-options" selector.

This can be reproduced with the following minimal test stylesheet :

> body{margin: 0}} div{color:red}
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Priority: -- → P1
Comment on attachment 8825529 [details]
Bug 1323713 - fix prettify CSS error when encountering extra closing brace;

https://reviewboard.mozilla.org/r/103652/#review104314

Thanks.  This looks good.
Attachment #8825529 - Flags: review?(ttromey) → review+
Comment on attachment 8825529 [details]
Bug 1323713 - fix prettify CSS error when encountering extra closing brace;

https://reviewboard.mozilla.org/r/103652/#review104314

Thanks! Try https://treeherder.mozilla.org/#/jobs?repo=try&revision=734821d75f30cabf551a581a406e13fc456c67a5 looks ok except for the usual intermittents we have on devtools these days... Landing.
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d76704f625c7
fix prettify CSS error when encountering extra closing brace;r=tromey
https://hg.mozilla.org/mozilla-central/rev/d76704f625c7
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 53
I have reproduced this bug with Nightly 53.0a1(2016-12-15) on Windows 10, 64 bit!

The Bug's fix is verified on Latest Aurora 53.0a2.

Build ID 	20170302004002
User Agent 	Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0

[testday-20170303]
I have reproduced this bug with Nightly 53.0a1 (2016-12-08) (64-bit) on Ubuntu 16.10, 64 bit!

The Bug's fix is verified on Latest Aurora!

Build ID 	20170303084134
User Agent 	Mozilla/5.0 (X11; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0

[testday-20170303]
QA Whiteboard: [good first verify]
I have reproduced this bug with Nightly 53.0a1 (2016-12-08) (64-bit) on Ubuntu 16.04
The bug's fix is now verified on latest Nightly 55.0a1.

Nightly 55.0a1:

Build ID 	20170420100256
User Agent 	Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

[testday: 20170420]
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: