Closed Bug 1346662 Opened 3 years ago Closed 2 years ago

Changes made to source-mapped CSS are reverted on save


(DevTools :: Style Editor, defect, P3)

53 Branch


(firefox57 fixed)

Firefox 57
Tracking Status
firefox57 --- fixed


(Reporter: zzyxpaw, Assigned: tromey)


(Blocks 1 open bug)



(1 file)

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

Steps to reproduce:

1. Set up a directory with an html file + sass stylesheet, with main.css linked into index.html:

├── index.html
├── main.css
└── scss
    └── main.scss

2. Start sass (or similar) watching for changes to scss/main.scss and regenerating main.css and accordingly.

3. View index.html in Firefox through the filesystem (file://)

4. Open up source-mapped sass file in the style editor

5. Make a change and save it

Actual results:

Firefox correctly live-reloaded the rendered page to reflect the changes, then after about a second, reverted the changes in the style editor without updating the page.

Leaving me with my changes reflected in the rendered page, but the unchanged scss in the style editor.

Undoing brought back my changes, putting the style editor back in sync with the page.

Expected results:

Firefox should not revert changes after saving.
Component: Untriaged → Developer Tools: Style Editor
Inspector bug triage (filter on CLIMBING SHOES).
Priority: -- → P3
Ever confirmed: true
The style editor calls the sheet actor's update method:

However, this doesn't clear out the existing source map info,
so eventually the style editor gets stale text for the original source.

It's possible to clear the source maps in |update| but I wonder what effect
that will have when, say, as-authored editing a rule.
Though probably that is already kind of broken when source maps are present.
Not only did that not work, it's also too complicated - it seems to suffice to set _isUpdating
in updateLinkedStyleSheet
Assignee: nobody → ttromey
Comment on attachment 8907750 [details]
Bug 1346662 - do not revert original text after saving;
Attachment #8907750 - Flags: review?(gl) → review+
Pushed by
do not revert original text after saving; r=gl
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 57
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.