mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 653930 - Setting marginWidth and marginHeight on an iframe should trigger a reflow.r=bz
This commit is contained in:
parent
e56ab2d65a
commit
3fa8eba250
@ -862,6 +862,31 @@ nsFrameLoader::Show(PRInt32 marginWidth, PRInt32 marginHeight,
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
nsFrameLoader::MarginsChanged(PRUint32 aMarginWidth,
|
||||
PRUint32 aMarginHeight)
|
||||
{
|
||||
// We assume that the margins are always zero for remote frames.
|
||||
if (mRemoteFrame)
|
||||
return;
|
||||
|
||||
// If there's no docshell, we're probably not up and running yet.
|
||||
// nsFrameLoader::Show() will take care of setting the right
|
||||
// margins.
|
||||
if (!mDocShell)
|
||||
return;
|
||||
|
||||
// Set the margins
|
||||
mDocShell->SetMarginWidth(aMarginWidth);
|
||||
mDocShell->SetMarginHeight(aMarginHeight);
|
||||
|
||||
// Trigger a restyle if there's a prescontext
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
mDocShell->GetPresContext(getter_AddRefs(presContext));
|
||||
if (presContext)
|
||||
presContext->RebuildAllStyleData(nsChangeHint(0));
|
||||
}
|
||||
|
||||
bool
|
||||
nsFrameLoader::ShowRemoteFrame(const nsIntSize& size)
|
||||
{
|
||||
|
@ -207,6 +207,11 @@ public:
|
||||
PRInt32 scrollbarPrefX, PRInt32 scrollbarPrefY,
|
||||
nsSubDocumentFrame* frame);
|
||||
|
||||
/**
|
||||
* Called when the margin properties of the containing frame are changed.
|
||||
*/
|
||||
void MarginsChanged(PRUint32 aMarginWidth, PRUint32 aMarginHeight);
|
||||
|
||||
/**
|
||||
* Called from the layout frame associated with this frame loader, when
|
||||
* the frame is being torn down; this notifies us that out widget and view
|
||||
|
@ -700,6 +700,17 @@ nsSubDocumentFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
||||
FrameNeedsReflow(rootFrame, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
|
||||
}
|
||||
}
|
||||
else if (aAttribute == nsGkAtoms::marginwidth ||
|
||||
aAttribute == nsGkAtoms::marginheight) {
|
||||
|
||||
// Retrieve the attributes
|
||||
nsIntSize margins = GetMarginAttributes();
|
||||
|
||||
// Notify the frameloader
|
||||
nsRefPtr<nsFrameLoader> frameloader = FrameLoader();
|
||||
if (frameloader)
|
||||
frameloader->MarginsChanged(margins.width, margins.height);
|
||||
}
|
||||
else if (aAttribute == nsGkAtoms::type) {
|
||||
if (!mFrameLoader)
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user