Closed Bug 880701 Opened 11 years ago Closed 11 years ago

Add capability for PanelUI to ignore mutations

Categories

(Firefox :: Toolbars and Customization, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 28

People

(Reporter: bwinton, Assigned: mconley)

References

Details

(Whiteboard: [Australis:M7][User Research Build+])

Attachments

(1 file, 7 obsolete files)

And that makes the first call to wrapToolbarItem take 60ms, which causes us to skip four frames, if my math works out…

Thoughts on how to fix it:
1) Have the PanelUI not resize itself on mutation if we're entering/leaving customize mode.
2) Use a document fragment to update all the toolbar items with their wrapped versions in one big swoop.


As a side note, I wonder if this is the cause for question #1 in bug 873060
Whiteboard: [Australis:M?]
I think we should try to slip a fix for this into the UR build if possible.
Assignee: nobody → mconley
No longer blocks: australis-cust
Whiteboard: [Australis:M?] → [Australis:M7][User Research Build+]
Hey Mike - can you maybe take a look at this?
Assignee: mconley → mdeboer
Status: NEW → ASSIGNED
(We probably also want to do something similar on the transition out of Customize mode, when we unwrap the items…)
Comment on attachment 761027 [details] [diff] [review]
WIP: add transitioning property to CustomizeMode

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

Just a drive-by - I don't think I like panelmultiview reaching into CustomizeMode like this.

Lots of the UI "prepares" itself before we go into customization mode. You can see that happening in browser/base/content/browser-customization.js. I think we might want to do something similar here. Alter panelUI.js so that it has customizationStart and customizationEnd functions, and have those called within browser-customization.js.

Those functions should do the manipulation of the panelmultiview - maybe calling a method on the minding, or (more likely) setting a property. Does that make sense?
Blocks: 881909
Attached patch Patch v1 (obsolete) — Splinter Review
Hey Mike,

I needed this bug in order to work on bug 881909, and I did some fiddling with it. In the end, I think this is what I need. I call startBatchUpdate and endBatchUpdate in my (soon to be posted) patch in bug 881909.

Hope it's cool if I yank this one from you!

-Mike
Assignee: mdeboer → mconley
Attachment #761027 - Attachment is obsolete: true
Comment on attachment 761663 [details] [diff] [review]
Patch v1

How does this look, Jared? I'll actually be calling beginBatchUpdate and endBatchUpdate in bug 881909.
Attachment #761663 - Flags: review?(jaws)
Comment on attachment 761663 [details] [diff] [review]
Patch v1

I've just realized that both this and my patch in bug 881909 don't apply cleanly to trunk. Let me fix that...
Attachment #761663 - Flags: review?(jaws)
Blocks: 880391
Attached patch Patch 1.1 (obsolete) — Splinter Review
Attachment #761663 - Attachment is obsolete: true
Attached patch Patch v1.2 (obsolete) — Splinter Review
Attachment #762086 - Attachment is obsolete: true
Summary: CustomizeMode.wrapToolbarItem causes sync reflow (due to MutationObserver firing _syncContainerWithMainView in PanelUI.xml) → Add capability for PanelUI to ignore mutations
Updated the summary, since bug 881909 takes care of making sure we don't reflow when wrapping the items.
Comment on attachment 762099 [details] [diff] [review]
Patch v1.2

What do you think of this, Jared?
Attachment #762099 - Flags: review?(jaws)
Comment on attachment 762099 [details] [diff] [review]
Patch v1.2

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

::: browser/components/customizableui/content/panelUI.xml
@@ +88,5 @@
>        <field name="_anchorElement">null</field>
>        <field name="_mainViewHeight">0</field>
>        <field name="_subViewObserver">null</field>
>        <field name="_transitioning">false</field>
> +      <field name="ignoreMutations">false</field>

This can be a property that calls disconnect or observe when it is set. That would also allow us to keep syncContainerWith*View private. It could also kick off the sync when ignoreMutations becomes true.
Attachment #762099 - Flags: review?(jaws) → review+
Attached patch Patch v1.3 (obsolete) — Splinter Review
Having ignoreMutations take care of connecting / disconnecting observers is kinda complicated...this is what it looks like.

Maybe I've been looking at this performance stuff for too long, but this looks pretty complicated. :/

Perhaps we can have the mutation observer functions check ignoreMutations instead?
Attachment #762099 - Attachment is obsolete: true
Attachment #762162 - Flags: feedback?(jaws)
Ok let's just go with Patch v1.2. Thanks for trying my recommendation.
Attachment #762162 - Flags: feedback?(jaws)
Attachment #762099 - Attachment is obsolete: false
Attachment #762162 - Attachment is obsolete: true
Attached patch Patch v1.4 (obsolete) — Splinter Review
I liked your suggestion about re-hiding the _sync functions, and I think I've found a happy medium here.
Attachment #762099 - Attachment is obsolete: true
Comment on attachment 762213 [details] [diff] [review]
Patch v1.4

I *think* this is the least complicated solution. This way, in bug 881909, I can call ensureRegistered(true), and we don't call the _sync functions until CustomizeMode.enter/exit is ready.

Sorry to make you review this thing yet again. :/
Attachment #762213 - Flags: review?(jaws)
Comment on attachment 762213 [details] [diff] [review]
Patch v1.4

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

Yeah, this looks nice.

::: browser/components/customizableui/content/panelUI.js
@@ +200,5 @@
>        tempPanel.openPopup(iconAnchor || aAnchor, "bottomcenter topright");
>      }
>    },
>  
> +  /** 

nit, trailing whitespace
Attachment #762213 - Flags: review?(jaws) → review+
https://hg.mozilla.org/projects/ux/rev/91e3867710d7
Whiteboard: [Australis:M7][User Research Build+] → [Australis:M7][User Research Build+][fixed-in-ux]
This seems to have broken sizing the menupanel to its contents. :-(
(In reply to :Gijs Kruitbosch from comment #20)
> This seems to have broken sizing the menupanel to its contents. :-(

We should back this out until we have a fix for the menupanel sizing.
Yep, backed out as:

https://hg.mozilla.org/projects/ux/rev/0965605b441e
Whiteboard: [Australis:M7][User Research Build+][fixed-in-ux] → [Australis:M7][User Research Build+]
Attached patch Patch v1.5 (r+'d by jaws) (obsolete) — Splinter Review
I think this bug was caused because we were trying to sync the panelview container heights too early, before the panel had even opened. We should only sync the container after ignoreMutations is set to false if the panel is open. If the panel is closed, the sync will happen automatically once the onpopupshowing event is fired.
Attachment #762213 - Attachment is obsolete: true
Fixing some documentation. Going to re-land now.
Attachment #762718 - Attachment is obsolete: true
Relanded as https://hg.mozilla.org/projects/ux/rev/cd6b6424d334
Whiteboard: [Australis:M7][User Research Build+] → [Australis:M7][User Research Build+][fixed-in-ux]
Blocks: 873060
https://hg.mozilla.org/mozilla-central/rev/cd6b6424d334
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [Australis:M7][User Research Build+][fixed-in-ux] → [Australis:M7][User Research Build+]
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: