Closed Bug 896596 Opened 11 years ago Closed 11 years ago

_onDragStart hack in CustomizeMode causes placeholders to get inserted after exiting customization mode

Categories

(Firefox :: Toolbars and Customization, defect)

x86_64
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 28

People

(Reporter: mconley, Assigned: mconley)

References

Details

(Whiteboard: [Australis:M8][Australis:P1])

Attachments

(1 file, 1 obsolete file)

simulateItemDrag calls both synthesizeDragStart, and synthesizeDrop - but I believe synthesizeDrop fires its own dragstart event. Two consecutive dragstart events without a drop is unexpected, and results in weird behaviour when dragging items around in customization mode. Might as well just remove the unnecessary synthesizeDragStart.

Setting to P1 because it blocks another P1.
Attached patch Patch v1 (rs=Gijs over IRC) (obsolete) — Splinter Review
Attachment #779317 - Flags: review+
So, on closer examination, I'm not sure if my original assessment is correct - synthesizeDrop seems to capture the dragstart event that it generates, and then stops it from propagating...

At least, it's *supposed* to be doing that.
Comment on attachment 779317 [details] [diff] [review]
Patch v1 (rs=Gijs over IRC)

Revoking r+ until we understand what's happening here.
Attachment #779317 - Flags: review+
Summary: simulateItemDrag in browser/components/customizableui/test/head.js fires two dragstart events → _onDragStart hack in CustomizeMode causes placeholders to get inserted after exiting customization mode
Attached patch Patch v2Splinter Review
Yeah, my original assessment was way off.

What's going on here is that we have a hack in _onDragStart that uses a setTimeout of 0 to insert the placeholders into the panel. As you might expect, our automated tests sometimes exit before that setTimeout can fire - and that means that the placeholders get injected *after* we've exited customization mode. As Gijs would say, this is sad-making.

So, assuming we have to keep this hack (and I don't want to invest too much time trying to make the hack unnecessary), I've added a conditional to just ensure that we're actually customizing and we're not mid-transition.
Attachment #779317 - Attachment is obsolete: true
Attachment #779374 - Flags: review?(gijskruitbosch+bugs)
Comment on attachment 779374 [details] [diff] [review]
Patch v2

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

LGTM!
Attachment #779374 - Flags: review?(gijskruitbosch+bugs) → review+
Thanks Gijs - landed on UX as https://hg.mozilla.org/projects/ux/rev/d7fd9dcb68a8
Whiteboard: [Australis:M?][Australis:P1] → [Australis:M?][Australis:P1][fixed-in-ux]
Whiteboard: [Australis:M?][Australis:P1][fixed-in-ux] → [Australis:M8][Australis:P1][fixed-in-ux]
https://hg.mozilla.org/mozilla-central/rev/d7fd9dcb68a8
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [Australis:M8][Australis:P1][fixed-in-ux] → [Australis:M8][Australis:P1]
Target Milestone: --- → Firefox 28
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: