mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 1247824 - Don't set the popup's size unless the width/height attributes exist. r=masayuki
This commit is contained in:
parent
2273c7b9f8
commit
bbd2fd7ef4
@ -524,6 +524,14 @@ nsXULPopupManager::PopupResized(nsIFrame* aFrame, LayoutDeviceIntSize aSize)
|
||||
if (curDevSize.width == aSize.width && curDevSize.height == aSize.height)
|
||||
return;
|
||||
|
||||
nsIContent* popup = menuPopupFrame->GetContent();
|
||||
|
||||
// Only set the width and height if the popup already has these attributes.
|
||||
if (!popup->HasAttr(kNameSpaceID_None, nsGkAtoms::width) ||
|
||||
!popup->HasAttr(kNameSpaceID_None, nsGkAtoms::height)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// The size is different. Convert the actual size to css pixels and store it
|
||||
// as 'width' and 'height' attributes on the popup.
|
||||
nsPresContext* presContext = menuPopupFrame->PresContext();
|
||||
@ -531,7 +539,6 @@ nsXULPopupManager::PopupResized(nsIFrame* aFrame, LayoutDeviceIntSize aSize)
|
||||
CSSIntSize newCSS(presContext->DevPixelsToIntCSSPixels(aSize.width),
|
||||
presContext->DevPixelsToIntCSSPixels(aSize.height));
|
||||
|
||||
nsIContent* popup = menuPopupFrame->GetContent();
|
||||
nsAutoString width, height;
|
||||
width.AppendInt(newCSS.width);
|
||||
height.AppendInt(newCSS.height);
|
||||
|
Loading…
Reference in New Issue
Block a user