Closed
Bug 1040882
Opened 10 years ago
Closed 10 years ago
[style editor] Changes are dismissed after a couple of seconds
Categories
(DevTools :: Style Editor, defect, P1)
Tracking
(firefox33 fixed, firefox34 fixed)
RESOLVED
FIXED
Firefox 34
People
(Reporter: paul, Assigned: harth)
References
Details
Attachments
(1 file, 3 obsolete files)
5.59 KB,
patch
|
Sylvestre
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
Anything I change in a stylesheet get dismissed after a couple of seconds.
Reporter | ||
Comment 1•10 years ago
|
||
This is happening at least on Firefox OS. I have 2 devices, happens on both.
Comment 2•10 years ago
|
||
I connect to Firefox Desktop with https://github.com/paulrouget/firefox-remote-styleEditors/blob/master/libs/client.py And I send the following packages: DBG-SERVER: New debugging connection on 127.0.0.1:6080 DBG-SERVER: Got: { "to": "root", "type": "listTabs" } DBG-SERVER: Got: { "to": "conn0.stylesheets98", "type": "getStyleSheets" } DBG-SERVER: Got: { "to": "conn0.stylesheet109", "type": "getText" } DBG-SERVER: Got: { "to": "conn0.stylesheet109", "transition": true, "type": "update", "text": "body {background:#000;}\n" } The page I am in, in this case http://nicolagreco.com/test gets black, but after a couple of seconds, it turns white again.
Assignee | ||
Updated•10 years ago
|
Priority: -- → P1
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → fayearthur
Assignee | ||
Comment 3•10 years ago
|
||
I bisected incorrectly at least once because this isn't super consistent, but I think this range might be correct: Last good nightly: 2014-03-03 First bad nightly: 2014-03-04 Pushlog: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=4cb766685b73&tochange=529b86b92b1d The obvious choice from that is bug 978653. I'm thinking it's a race condition where instead of removing the transition rule, we remove an actual rule.
Assignee | ||
Comment 4•10 years ago
|
||
Whoa. I think this bug has been here since the beginning of the Style Editor, but was just made worse by bug 978653. If you edit the sheet twice in succession what happens is we 1) Add a transition rule 2) Replace all the rules, getting rid of the transition rule 3) Go around to remove the transition rule, but it's not there anymore so we remove a real rule. So this patch will check to make sure the rule we're removing is the transition rule that we added. The test catches this error.
Attachment #8465073 -
Flags: review?(jwalker)
Assignee | ||
Comment 5•10 years ago
|
||
This patch is updated to fix another bug. Since we blow away all the rules on every update, we're also blowing away the transition rule. Therefore we need to add the transition rule to the end of the sheet on every update. Before we were doing some ref counting so that we didn't add it every time.
Attachment #8465073 -
Attachment is obsolete: true
Attachment #8465073 -
Flags: review?(jwalker)
Attachment #8465086 -
Flags: review?(jwalker)
Assignee | ||
Comment 6•10 years ago
|
||
Last one. Fix for try run failure.
Attachment #8465086 -
Attachment is obsolete: true
Attachment #8465086 -
Flags: review?(jwalker)
Attachment #8465215 -
Flags: review?(jwalker)
Comment 7•10 years ago
|
||
Comment on attachment 8465215 [details] [diff] [review] Always add transition rule and only delete transition rule, +fix Review of attachment 8465215 [details] [diff] [review]: ----------------------------------------------------------------- ::: toolkit/devtools/server/actors/stylesheets.js @@ +915,3 @@ > this.document.documentElement.classList.add(TRANSITION_CLASS); > } > + this._transitionRefCount++; An alternative to reference counting might be to cancel and reset the timeout each time _insertTransistionRule is called. That way we only call _onTransitionEnd when we're done. Feels slightly nicer, but not sure it's worth the effort since this works. @@ +937,5 @@ > + let index = this.rawSheet.cssRules.length - 1; > + let rule = this.rawSheet.cssRules[index]; > + if (rule.selectorText == TRANSITION_RULE_SELECTOR) { > + this.rawSheet.deleteRule(index); > + } Maybe we should loop over them all removing any that match TRANSITION_RULE_SELECTOR? @@ +942,3 @@ > } > > events.emit(this, "style-applied"); if (--this._transitionRefCount > 0) then we've not changed the rules, so shouldn't this be in the if block? Then we wouldn't need the additional ref-counting in the test? Perhaps this will break other things though.
Attachment #8465215 -
Flags: review?(jwalker) → review+
Assignee | ||
Comment 8•10 years ago
|
||
Good point, this patch just cancels the timeout. Try: https://tbpl.mozilla.org/?tree=Try&rev=d36cd55f54b7
Attachment #8465215 -
Attachment is obsolete: true
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 10•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/b463979c8dd3
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 34
Assignee | ||
Comment 11•10 years ago
|
||
Comment on attachment 8465649 [details] [diff] [review] Updated to check in Approval Request Comment [Feature/regressing bug #]: bug 978653 [User impact if declined]: Often editing a style sheet in the style editor will cause some page styles to be lost. [Describe test coverage new/current, TBPL]: This patch has a test and has been in mozilla-central for a few days. [Risks and why]: N/A [String/UUID change made/needed]: None
Attachment #8465649 -
Flags: approval-mozilla-aurora?
Updated•10 years ago
|
status-firefox33:
--- → affected
status-firefox34:
--- → fixed
Updated•10 years ago
|
Attachment #8465649 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•