after css changes in bug 785593 and bug 784272, collapsing chatboxes during overflow doesn't always work right.
Created attachment 656248 [details] [diff] [review] overflow width.patch
is it possible to find an alternative to not have to use this hardcoded value? otherwise every style change we make will end up breaking this again
Shane, can you use the XUL overflow event? https://developer.mozilla.org/en-US/docs/XUL/Events
(In reply to Jared Wein [:jaws] from comment #3) > Shane, can you use the XUL overflow event? > https://developer.mozilla.org/en-US/docs/XUL/Events we do use overflow. what doesn't work is using underflow to decide whether to show one of the collapsed chats. underflow only happens the first underflow, we need to continue checking
An idea: when we collapse a chat due to overflow, we could store its size as an attribute and then use it here.
(In reply to :Felipe Gomes from comment #5) > An idea: when we collapse a chat due to overflow, we could store its size as > an attribute and then use it here. I was trying to avoid that, but it looks like boxObject.width == 0 when collapsed, so we may have to do that.
slightly cleaner would be to assume all chatboxes are the same size and store the size in a field in the chatbar rather than on each chatbox
How does this patch handle minimized chats? They have a different width (160px + 4px margin start).
Created attachment 656661 [details] [diff] [review] overflow width.patch revised patch handles dynamic widths, works well with collapsed chats also.
Comment on attachment 656661 [details] [diff] [review] overflow width.patch [Approval Request Comment] Bug caused by (feature/regressing bug #): 785593, 784272 User impact if declined: bad ux in socialapi chat boxes Testing completed (on m-c, etc.): on m-c Risk to taking this patch (and alternatives if risky): String or UUID changes made by this patch: none
I think you're not supposed to use boxObject.width and use getBoundingClientRect().width instead.
(In reply to :Gavin Sharp (use firstname.lastname@example.org for email) from comment #12) > I think you're not supposed to use boxObject.width and use > getBoundingClientRect().width instead. That's correct. boxObject.x/y/width/height are deprecated. They both should return the same value for width though, although the latter accounts for applied transforms.
Created attachment 657363 [details] [diff] [review] overflow width.patch [Approval Request Comment] fixes poor overflow handling of chat windows
Comment on attachment 657363 [details] [diff] [review] overflow width.patch No need to ask for re-review for that kind of tweak.
checkin-needed for aurora, too
Can I please get a better definition of "wonky" so I can verify this fixed? Thanks
(In reply to Anthony Hughes, Mozilla QA (:ashughes) from comment #20) > Can I please get a better definition of "wonky" so I can verify this fixed? > Thanks IIRC you could reproduce by: open 3 chat windows then resize the window, smaller then larger. One of the chat windows will overflow off the edge of the browser window rather than collapsing into the button.