Changes made to source-mapped CSS are reverted on save

RESOLVED FIXED in Firefox 57

Status

DevTools
Style Editor
P3
normal
RESOLVED FIXED
a year ago
a month ago

People

(Reporter: gandalf3, Assigned: tromey)

Tracking

(Blocks: 1 bug)

53 Branch
Firefox 57

Firefox Tracking Flags

(firefox57 fixed)

Details

MozReview Requests

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

a year ago
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
├── main.css.map
└── scss
    └── main.scss

2. Start sass (or similar) watching for changes to scss/main.scss and regenerating main.css and main.css.map 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.

Updated

a year ago
Component: Untriaged → Developer Tools: Style Editor
Blocks: 1339970
Inspector bug triage (filter on CLIMBING SHOES).
Priority: -- → P3
(Assignee)

Updated

10 months ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 2

10 months ago
The style editor calls the sheet actor's update method:

https://dxr.mozilla.org/mozilla-central/rev/f9a5e9ed62103c84e4cde915f4d08f1ce71be83e/devtools/server/actors/stylesheets.js#715

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.
(Assignee)

Comment 3

10 months ago
Not only did that not work, it's also too complicated - it seems to suffice to set _isUpdating
in updateLinkedStyleSheet
(Assignee)

Updated

10 months ago
Assignee: nobody → ttromey
Comment hidden (mozreview-request)

Comment 5

10 months ago
mozreview-review
Comment on attachment 8907750 [details]
Bug 1346662 - do not revert original text after saving;

https://reviewboard.mozilla.org/r/179420/#review184636
Attachment #8907750 - Flags: review?(gl) → review+

Comment 6

10 months ago
Pushed by ttromey@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/270740992bc6
do not revert original text after saving; r=gl
https://hg.mozilla.org/mozilla-central/rev/270740992bc6
Status: NEW → RESOLVED
Last Resolved: 10 months ago
status-firefox57: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 57

Updated

a month ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.