Closed Bug 978653 Opened 10 years ago Closed 10 years ago

Wait longer to fire 'style-applied' event after updating a style sheet in StyleSheetActor

Categories

(DevTools :: Style Editor, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 30

People

(Reporter: harth, Assigned: harth)

Details

Attachments

(1 file, 1 obsolete file)

When you update a style sheet in the Style Editor, a global transition rule is inserted in the document so that any changes to the page style will have a smooth transition.

bug 966805 is an orange caused by the Style Editor firing a 'style-applied' event before the style on the page is fully updated. It's instead fired in the middle of a transition.
Before we were waiting for the transition duration plus a small buffer. This patch increases the buffer. It also gets rid of a related line of code that wasn't being used.

As we use a global transition rule and we're blind to what rules change when we replace the text of the style sheet, there's no way to know if we should expect a transition to occur or how many should occur, so we can't listen for an event like 'transitionend'.


try: https://tbpl.mozilla.org/?tree=Try&rev=328e859ef789
Assignee: nobody → fayearthur
Attachment #8384411 - Flags: review?(pbrosset)
Actually, thought it was odd that the buffer was a multiplier before. Small change to add a constant buffer time instead of making it a multiple of the transition duration.
Attachment #8384411 - Attachment is obsolete: true
Attachment #8384411 - Flags: review?(pbrosset)
Attachment #8384415 - Flags: review?(pbrosset)
Comment on attachment 8384415 [details] [diff] [review]
Increase wait time before firing 'style-applied'

Review of attachment 8384415 [details] [diff] [review]:
-----------------------------------------------------------------

If this solves the orange, then fine with me (I've re-launched a few bc runs on the try build).
However, I'd like to suggest that, for tests only, we introduce a mode where there are no transitions. This should reduce the chances for failures, right?
Attachment #8384415 - Flags: review?(pbrosset) → review+
Keywords: checkin-needed
(In reply to Patrick Brosset [:pbrosset] [:patrick] from comment #3)
> If this solves the orange, then fine with me (I've re-launched a few bc runs
> on the try build).
> However, I'd like to suggest that, for tests only, we introduce a mode where
> there are no transitions. This should reduce the chances for failures, right?

That's a good point. We used to a pref to turn off the transitions, but it wasn't being used. Maybe we should add it back.
https://hg.mozilla.org/mozilla-central/rev/01a05eb98629
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 30
QA Whiteboard: [qa-]
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: