mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 12:55:46 +00:00
Fix for bug #52124
This commit is contained in:
parent
279ba5b1e5
commit
bb9a09703e
@ -53,6 +53,10 @@
|
||||
#include "nsBoxToBlockAdaptor.h"
|
||||
#include "nsILineIterator.h"
|
||||
#include "nsIFontMetrics.h"
|
||||
#include "nsHTMLContainerFrame.h"
|
||||
#include "nsWidgetsCID.h"
|
||||
|
||||
static NS_DEFINE_IID(kWidgetCID, NS_CHILD_CID);
|
||||
|
||||
//#define DEBUG_REFLOW
|
||||
//#define DEBUG_GROW
|
||||
@ -127,9 +131,46 @@ nsBoxToBlockAdaptor::nsBoxToBlockAdaptor(nsIPresShell* aPresShell, nsIFrame* aFr
|
||||
mOverflow.width = 0;
|
||||
mOverflow.height = 0;
|
||||
mIncludeOverflow = PR_TRUE;
|
||||
mPresShell = aPresShell;
|
||||
NeedsRecalc();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBoxToBlockAdaptor::SetParentBox(nsIBox* aParent)
|
||||
{
|
||||
nsresult rv = nsBox::SetParentBox(aParent);
|
||||
|
||||
nsIBox* parent = aParent;
|
||||
|
||||
|
||||
if (parent) {
|
||||
PRBool needsWidget = PR_FALSE;
|
||||
parent->ChildrenMustHaveWidgets(needsWidget);
|
||||
if (needsWidget) {
|
||||
nsCOMPtr<nsIPresContext> context;
|
||||
mPresShell->GetPresContext(getter_AddRefs(context));
|
||||
nsIView* view = nsnull;
|
||||
mFrame->GetView(context, &view);
|
||||
|
||||
if (!view) {
|
||||
nsCOMPtr<nsIStyleContext> style;
|
||||
mFrame->GetStyleContext(getter_AddRefs(style));
|
||||
nsHTMLContainerFrame::CreateViewForFrame(context,mFrame,style,nsnull,PR_TRUE);
|
||||
mFrame->GetView(context, &view);
|
||||
}
|
||||
|
||||
nsIWidget* widget;
|
||||
view->GetWidget(widget);
|
||||
|
||||
if (!widget)
|
||||
view->CreateWidget(kWidgetCID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsBoxToBlockAdaptor::HasStyleChange()
|
||||
{
|
||||
@ -687,6 +728,7 @@ nsBoxToBlockAdaptor::Reflow(nsBoxLayoutState& aState,
|
||||
if (needsReflow) {
|
||||
Redraw(aState);
|
||||
redrawAfterReflow = PR_TRUE;
|
||||
//printf("Redrawing!!!/n");
|
||||
}
|
||||
|
||||
} break;
|
||||
|
@ -47,6 +47,7 @@ public:
|
||||
NS_IMETHOD SetIncludeOverflow(PRBool aInclude);
|
||||
NS_IMETHOD GetOverflow(nsSize& aOverflow);
|
||||
NS_IMETHOD NeedsRecalc();
|
||||
NS_IMETHOD SetParentBox(nsIBox* aParent);
|
||||
|
||||
NS_IMETHOD Recycle(nsIPresShell* aPresShell);
|
||||
|
||||
@ -94,6 +95,7 @@ protected:
|
||||
PRBool mSizeSet;
|
||||
nsSize mOverflow;
|
||||
PRBool mIncludeOverflow;
|
||||
nsCOMPtr<nsIPresShell> mPresShell;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -322,11 +322,13 @@ nsDeckFrame::Paint(nsIPresContext* aPresContext,
|
||||
|
||||
// only paint the seleced box
|
||||
nsIBox* box = GetSelectedBox();
|
||||
nsIFrame* frame = nsnull;
|
||||
box->GetFrame(&frame);
|
||||
if (box) {
|
||||
nsIFrame* frame = nsnull;
|
||||
box->GetFrame(&frame);
|
||||
|
||||
if (frame != nsnull)
|
||||
PaintChild(aPresContext, aRenderingContext, aDirtyRect, frame, aWhichLayer);
|
||||
if (frame != nsnull)
|
||||
PaintChild(aPresContext, aRenderingContext, aDirtyRect, frame, aWhichLayer);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user