mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 06:15:43 +00:00
Bug 1062335 - Loop panel size increases after switching themes. r=mixedpuppy
--HG-- extra : rebase_source : f8c63b9dfc7de05d0b53908e72ab8c9083b95a49
This commit is contained in:
parent
e737fd5cac
commit
8c11747eb4
@ -50,7 +50,7 @@ let PanelFrameInternal = {
|
||||
let notificationFrameId = aOrigin ? aType + "-status-" + aOrigin : aType;
|
||||
let frame = aWindow.document.getElementById(notificationFrameId);
|
||||
|
||||
// If the button was customized to a new location, we we'll destroy the
|
||||
// If the button was customized to a new location, destroy the
|
||||
// iframe and start fresh.
|
||||
if (frame && frame.parentNode != aParent) {
|
||||
SharedFrame.forgetGroup(frame.id);
|
||||
@ -157,11 +157,6 @@ let PanelFrame = {
|
||||
panel.addEventListener("popupshown", function onpopupshown() {
|
||||
panel.removeEventListener("popupshown", onpopupshown);
|
||||
SharedFrame.setOwner(notificationFrameId, notificationFrame);
|
||||
// This attribute is needed on both the button and the
|
||||
// containing toolbaritem since the buttons on OS X have
|
||||
// moz-appearance:none, while their container gets
|
||||
// moz-appearance:toolbarbutton due to the way that toolbar buttons
|
||||
// get combined on OS X.
|
||||
let initFrameShow = () => {
|
||||
notificationFrame.docShell.isActive = true;
|
||||
notificationFrame.docShell.isAppTab = true;
|
||||
@ -169,6 +164,11 @@ let PanelFrame = {
|
||||
dynamicResizer.start(panel, notificationFrame);
|
||||
dispatchPanelEvent(aType + "FrameShow");
|
||||
};
|
||||
// This attribute is needed on both the button and the
|
||||
// containing toolbaritem since the buttons on OS X have
|
||||
// moz-appearance:none, while their container gets
|
||||
// moz-appearance:toolbarbutton due to the way that toolbar buttons
|
||||
// get combined on OS X.
|
||||
anchorBtn.setAttribute("open", "true");
|
||||
if (notificationFrame.contentDocument &&
|
||||
notificationFrame.contentDocument.readyState == "complete") {
|
||||
|
@ -421,13 +421,17 @@ function sizeSocialPanelToContent(panel, iframe) {
|
||||
let computedWidth = parseInt(cs.marginLeft) + body.offsetWidth + parseInt(cs.marginRight);
|
||||
width = Math.max(computedWidth, width);
|
||||
}
|
||||
// add extra space the panel needs if any
|
||||
width += panel.boxObject.width - iframe.boxObject.width;
|
||||
height += panel.boxObject.height - iframe.boxObject.height;
|
||||
|
||||
// only add the extra space if the iframe has been loaded
|
||||
if (iframe.boxObject.width && iframe.boxObject.height) {
|
||||
// add extra space the panel needs if any
|
||||
width += panel.boxObject.width - iframe.boxObject.width;
|
||||
height += panel.boxObject.height - iframe.boxObject.height;
|
||||
}
|
||||
|
||||
// when size is computed, we want to be sure changes are "significant" since
|
||||
// some sites will resize when the iframe is resized by a small amount, making
|
||||
// the panel slowely shrink to some minimum.
|
||||
// the panel slowly shrink to some minimum.
|
||||
if (Math.abs(panel.boxObject.width - width) > 2 || Math.abs(panel.boxObject.height - height) > 2) {
|
||||
panel.sizeTo(width, height);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user