mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 04:45:45 +00:00
Fix for titledbox bugs.
This commit is contained in:
parent
41eec21b26
commit
9553090997
@ -577,6 +577,7 @@ NS_IMETHODIMP
|
|||||||
nsBox::GetFlex(nsBoxLayoutState& aState, nscoord& aFlex)
|
nsBox::GetFlex(nsBoxLayoutState& aState, nscoord& aFlex)
|
||||||
{
|
{
|
||||||
aFlex = 0;
|
aFlex = 0;
|
||||||
|
GetDefaultFlex(aFlex);
|
||||||
PRBool collapsed = PR_FALSE;
|
PRBool collapsed = PR_FALSE;
|
||||||
nsIBox::AddCSSFlex(aState, this, aFlex);
|
nsIBox::AddCSSFlex(aState, this, aFlex);
|
||||||
|
|
||||||
@ -1068,6 +1069,13 @@ nsBox::GetMouseThrough(PRBool& aMouseThrough)
|
|||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PRBool
|
||||||
|
nsBox::GetDefaultFlex(PRInt32& aFlex)
|
||||||
|
{
|
||||||
|
aFlex = 0;
|
||||||
|
return PR_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
// nsISupports
|
// nsISupports
|
||||||
NS_IMETHODIMP_(nsrefcnt)
|
NS_IMETHODIMP_(nsrefcnt)
|
||||||
nsBox::AddRef(void)
|
nsBox::AddRef(void)
|
||||||
|
@ -107,6 +107,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
virtual PRBool GetWasCollapsed(nsBoxLayoutState& aState);
|
virtual PRBool GetWasCollapsed(nsBoxLayoutState& aState);
|
||||||
virtual void SetWasCollapsed(nsBoxLayoutState& aState, PRBool aWas);
|
virtual void SetWasCollapsed(nsBoxLayoutState& aState, PRBool aWas);
|
||||||
|
virtual PRBool GetDefaultFlex(PRInt32& aFlex);
|
||||||
|
|
||||||
enum eMouseThrough {
|
enum eMouseThrough {
|
||||||
unset,
|
unset,
|
||||||
|
@ -153,6 +153,8 @@ public:
|
|||||||
void DrawLine(nsIRenderingContext& aRenderingContext, PRBool aHorizontal, nscoord x1, nscoord y1, nscoord x2, nscoord y2);
|
void DrawLine(nsIRenderingContext& aRenderingContext, PRBool aHorizontal, nscoord x1, nscoord y1, nscoord x2, nscoord y2);
|
||||||
void FillRect(nsIRenderingContext& aRenderingContext, PRBool aHorizontal, nscoord x, nscoord y, nscoord width, nscoord height);
|
void FillRect(nsIRenderingContext& aRenderingContext, PRBool aHorizontal, nscoord x, nscoord y, nscoord width, nscoord height);
|
||||||
|
|
||||||
|
nsIBox* GetBoxForFrame(nsIFrame* aFrame, PRBool& aIsAdaptor);
|
||||||
|
|
||||||
nsBoxFrame::Halignment GetHAlign();
|
nsBoxFrame::Halignment GetHAlign();
|
||||||
nsBoxFrame::Valignment GetVAlign();
|
nsBoxFrame::Valignment GetVAlign();
|
||||||
|
|
||||||
@ -253,7 +255,6 @@ nsBoxFrame::~nsBoxFrame()
|
|||||||
NS_ASSERTION(mInner == nsnull,"Error Destroy was never called on this Frame!!!");
|
NS_ASSERTION(mInner == nsnull,"Error Destroy was never called on this Frame!!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsBoxFrame::GetVAlign(Valignment& aAlign)
|
nsBoxFrame::GetVAlign(Valignment& aAlign)
|
||||||
{
|
{
|
||||||
@ -1427,16 +1428,6 @@ nsBoxFrame::GetFrameForPoint(nsIPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
if (mMouseThrough == never)
|
|
||||||
{
|
|
||||||
*aFrame = this;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
//nsresult rv = GetFrameForPointUsing(aPresContext, aPoint, nsnull, aWhichLayer, PR_FALSE, aFrame);
|
|
||||||
|
|
||||||
nsIFrame *kid, *hit = nsnull;
|
nsIFrame *kid, *hit = nsnull;
|
||||||
nsPoint tmp;
|
nsPoint tmp;
|
||||||
|
|
||||||
@ -1456,7 +1447,8 @@ nsBoxFrame::GetFrameForPoint(nsIPresContext* aPresContext,
|
|||||||
// if the kid had a child before see if this child has mouse
|
// if the kid had a child before see if this child has mouse
|
||||||
// though.
|
// though.
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
nsCOMPtr<nsIBox> box = do_QueryInterface(hit, &rv);
|
PRBool isAdaptor = PR_FALSE;
|
||||||
|
nsCOMPtr<nsIBox> box = mInner->GetBoxForFrame(hit, isAdaptor);
|
||||||
if (box) {
|
if (box) {
|
||||||
PRBool mouseThrough = PR_FALSE;
|
PRBool mouseThrough = PR_FALSE;
|
||||||
box->GetMouseThrough(mouseThrough);
|
box->GetMouseThrough(mouseThrough);
|
||||||
@ -1506,6 +1498,43 @@ nsBoxFrame::GetFrameForPoint(nsIPresContext* aPresContext,
|
|||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsIBox*
|
||||||
|
nsBoxFrameInner::GetBoxForFrame(nsIFrame* aFrame, PRBool& aIsAdaptor)
|
||||||
|
{
|
||||||
|
if (aFrame == nsnull)
|
||||||
|
return nsnull;
|
||||||
|
|
||||||
|
nsIBox* ibox = nsnull;
|
||||||
|
if (NS_FAILED(aFrame->QueryInterface(NS_GET_IID(nsIBox), (void**)&ibox))) {
|
||||||
|
aIsAdaptor = PR_TRUE;
|
||||||
|
|
||||||
|
// if we hit a non box. Find the box in out last container
|
||||||
|
// and clear its cache.
|
||||||
|
nsIFrame* parent = nsnull;
|
||||||
|
aFrame->GetParent(&parent);
|
||||||
|
nsIBox* parentBox = nsnull;
|
||||||
|
if (NS_FAILED(parent->QueryInterface(NS_GET_IID(nsIBox), (void**)&parentBox)))
|
||||||
|
return nsnull;
|
||||||
|
|
||||||
|
if (parentBox) {
|
||||||
|
nsIBox* start = nsnull;
|
||||||
|
parentBox->GetChildBox(&start);
|
||||||
|
while (start) {
|
||||||
|
nsIFrame* frame = nsnull;
|
||||||
|
start->GetFrame(&frame);
|
||||||
|
if (frame == aFrame) {
|
||||||
|
ibox = start;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
start->GetNextBox(&start);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ibox;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsBoxFrame::GetMouseThrough(PRBool& aMouseThrough)
|
nsBoxFrame::GetMouseThrough(PRBool& aMouseThrough)
|
||||||
|
@ -161,7 +161,6 @@ public:
|
|||||||
|
|
||||||
virtual PRBool IsHorizontal() const;
|
virtual PRBool IsHorizontal() const;
|
||||||
|
|
||||||
|
|
||||||
virtual ~nsBoxFrame();
|
virtual ~nsBoxFrame();
|
||||||
|
|
||||||
virtual nsresult GetContentOf(nsIContent** aContent);
|
virtual nsresult GetContentOf(nsIContent** aContent);
|
||||||
|
Loading…
Reference in New Issue
Block a user