2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-18 18:30:37 +04:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1999-04-16 05:39:45 +04:00
|
|
|
*
|
2004-04-18 18:30:37 +04:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
1999-04-16 05:39:45 +04:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
1999-04-16 05:39:45 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-18 18:30:37 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-29 00:14:13 +04:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 06:40:37 +03:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-18 18:30:37 +04:00
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
2001-09-29 00:14:13 +04:00
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2004-04-18 18:30:37 +04:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-29 00:14:13 +04:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2004-04-18 18:30:37 +04:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-29 00:14:13 +04:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2006-03-29 22:29:03 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* code for managing absolutely positioned children of a rendering
|
|
|
|
* object that is a containing block for them
|
|
|
|
*/
|
|
|
|
|
1999-12-06 18:49:53 +03:00
|
|
|
#include "nsCOMPtr.h"
|
1999-04-16 05:39:45 +04:00
|
|
|
#include "nsAbsoluteContainingBlock.h"
|
|
|
|
#include "nsContainerFrame.h"
|
1999-07-24 06:37:45 +04:00
|
|
|
#include "nsIPresShell.h"
|
2007-10-02 10:24:26 +04:00
|
|
|
#include "nsHTMLContainerFrame.h"
|
1999-07-24 06:37:45 +04:00
|
|
|
#include "nsHTMLParts.h"
|
2004-08-01 03:15:21 +04:00
|
|
|
#include "nsPresContext.h"
|
1999-04-16 05:39:45 +04:00
|
|
|
|
2002-11-16 13:41:10 +03:00
|
|
|
#ifdef DEBUG
|
|
|
|
#include "nsBlockFrame.h"
|
|
|
|
#endif
|
|
|
|
|
1999-04-16 05:39:45 +04:00
|
|
|
nsresult
|
1999-07-24 06:37:45 +04:00
|
|
|
nsAbsoluteContainingBlock::SetInitialChildList(nsIFrame* aDelegatingFrame,
|
1999-04-16 05:39:45 +04:00
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aChildList)
|
|
|
|
{
|
2003-01-20 21:04:34 +03:00
|
|
|
NS_PRECONDITION(GetChildListName() == aListName, "unexpected child list name");
|
1999-07-24 06:37:45 +04:00
|
|
|
#ifdef NS_DEBUG
|
|
|
|
nsFrame::VerifyDirtyBitSet(aChildList);
|
|
|
|
#endif
|
1999-04-16 05:39:45 +04:00
|
|
|
mAbsoluteFrames.SetFrames(aChildList);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
2005-02-07 04:58:25 +03:00
|
|
|
nsAbsoluteContainingBlock::AppendFrames(nsIFrame* aDelegatingFrame,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aFrameList)
|
1999-07-24 06:37:45 +04:00
|
|
|
{
|
2006-06-29 06:32:36 +04:00
|
|
|
NS_ASSERTION(GetChildListName() == aListName, "unexpected child list");
|
|
|
|
|
1999-07-24 06:37:45 +04:00
|
|
|
// Append the frames to our list of absolutely positioned frames
|
|
|
|
#ifdef NS_DEBUG
|
|
|
|
nsFrame::VerifyDirtyBitSet(aFrameList);
|
|
|
|
#endif
|
|
|
|
mAbsoluteFrames.AppendFrames(nsnull, aFrameList);
|
|
|
|
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
// no damage to intrinsic widths, since absolutely positioned frames can't
|
|
|
|
// change them
|
2007-03-31 01:11:41 +04:00
|
|
|
return aDelegatingFrame->PresContext()->PresShell()->
|
2007-05-06 23:16:51 +04:00
|
|
|
FrameNeedsReflow(aDelegatingFrame, nsIPresShell::eResize,
|
|
|
|
NS_FRAME_HAS_DIRTY_CHILDREN);
|
1999-07-24 06:37:45 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
2005-02-07 04:58:25 +03:00
|
|
|
nsAbsoluteContainingBlock::InsertFrames(nsIFrame* aDelegatingFrame,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aPrevFrame,
|
|
|
|
nsIFrame* aFrameList)
|
1999-07-24 06:37:45 +04:00
|
|
|
{
|
2006-06-29 06:32:36 +04:00
|
|
|
NS_ASSERTION(GetChildListName() == aListName, "unexpected child list");
|
|
|
|
NS_ASSERTION(!aPrevFrame || aPrevFrame->GetParent() == aDelegatingFrame,
|
|
|
|
"inserting after sibling frame with different parent");
|
|
|
|
|
1999-07-24 06:37:45 +04:00
|
|
|
#ifdef NS_DEBUG
|
|
|
|
nsFrame::VerifyDirtyBitSet(aFrameList);
|
|
|
|
#endif
|
|
|
|
mAbsoluteFrames.InsertFrames(nsnull, aPrevFrame, aFrameList);
|
|
|
|
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
// no damage to intrinsic widths, since absolutely positioned frames can't
|
|
|
|
// change them
|
2007-03-31 01:11:41 +04:00
|
|
|
return aDelegatingFrame->PresContext()->PresShell()->
|
2007-05-06 23:16:51 +04:00
|
|
|
FrameNeedsReflow(aDelegatingFrame, nsIPresShell::eResize,
|
|
|
|
NS_FRAME_HAS_DIRTY_CHILDREN);
|
1999-07-24 06:37:45 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsAbsoluteContainingBlock::RemoveFrame(nsIFrame* aDelegatingFrame,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aOldFrame)
|
|
|
|
{
|
2006-06-29 06:32:36 +04:00
|
|
|
NS_ASSERTION(GetChildListName() == aListName, "unexpected child list");
|
2007-10-02 09:57:45 +04:00
|
|
|
nsIFrame* nif = aOldFrame->GetNextInFlow();
|
|
|
|
if (nif) {
|
|
|
|
static_cast<nsContainerFrame*>(nif->GetParent())
|
2008-12-03 04:27:19 +03:00
|
|
|
->DeleteNextInFlowChild(aOldFrame->PresContext(), nif, PR_FALSE);
|
2007-10-02 09:57:45 +04:00
|
|
|
}
|
2006-06-29 06:32:36 +04:00
|
|
|
|
2006-04-10 04:16:29 +04:00
|
|
|
PRBool result = mAbsoluteFrames.DestroyFrame(aOldFrame);
|
1999-07-24 06:37:45 +04:00
|
|
|
NS_ASSERTION(result, "didn't find frame to delete");
|
2007-10-02 09:57:45 +04:00
|
|
|
|
1999-07-27 18:15:42 +04:00
|
|
|
return result ? NS_OK : NS_ERROR_FAILURE;
|
1999-07-24 06:37:45 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
2007-10-02 09:57:45 +04:00
|
|
|
nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
|
|
|
|
nsPresContext* aPresContext,
|
1999-09-16 18:33:19 +04:00
|
|
|
const nsHTMLReflowState& aReflowState,
|
2007-10-02 09:57:45 +04:00
|
|
|
nsReflowStatus& aReflowStatus,
|
1999-09-16 18:33:19 +04:00
|
|
|
nscoord aContainingBlockWidth,
|
1999-12-06 18:49:53 +03:00
|
|
|
nscoord aContainingBlockHeight,
|
2007-10-02 12:29:23 +04:00
|
|
|
PRBool aConstrainHeight,
|
2005-01-24 00:44:46 +03:00
|
|
|
PRBool aCBWidthChanged,
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
PRBool aCBHeightChanged,
|
|
|
|
nsRect* aChildBounds)
|
1999-04-16 05:39:45 +04:00
|
|
|
{
|
1999-12-06 18:49:53 +03:00
|
|
|
// Initialize OUT parameter
|
2003-01-20 21:04:34 +03:00
|
|
|
if (aChildBounds)
|
|
|
|
aChildBounds->SetRect(0, 0, 0, 0);
|
2007-10-02 09:57:45 +04:00
|
|
|
nsReflowStatus reflowStatus = NS_FRAME_COMPLETE;
|
1999-12-06 18:49:53 +03:00
|
|
|
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
PRBool reflowAll = aReflowState.ShouldReflowAllKids();
|
1999-04-16 05:39:45 +04:00
|
|
|
|
|
|
|
nsIFrame* kidFrame;
|
2007-10-02 09:57:45 +04:00
|
|
|
nsOverflowContinuationTracker tracker(aPresContext, aDelegatingFrame, PR_TRUE);
|
2003-06-26 15:30:17 +04:00
|
|
|
for (kidFrame = mAbsoluteFrames.FirstChild(); kidFrame; kidFrame = kidFrame->GetNextSibling()) {
|
2009-04-22 07:02:17 +04:00
|
|
|
if (reflowAll ||
|
|
|
|
NS_SUBTREE_DIRTY(kidFrame) ||
|
|
|
|
FrameDependsOnContainer(kidFrame, aCBWidthChanged, aCBHeightChanged)) {
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
// Reflow the frame
|
2007-10-02 09:57:45 +04:00
|
|
|
nsReflowStatus kidStatus = NS_FRAME_COMPLETE;
|
|
|
|
ReflowAbsoluteFrame(aDelegatingFrame, aPresContext, aReflowState,
|
|
|
|
aContainingBlockWidth, aContainingBlockHeight,
|
2007-10-02 12:29:23 +04:00
|
|
|
aConstrainHeight, kidFrame, kidStatus, aChildBounds);
|
2007-10-02 09:57:45 +04:00
|
|
|
nsIFrame* nextFrame = kidFrame->GetNextInFlow();
|
|
|
|
if (!NS_FRAME_IS_FULLY_COMPLETE(kidStatus)) {
|
|
|
|
// Need a continuation
|
|
|
|
if (!nextFrame) {
|
|
|
|
nsresult rv = nsHTMLContainerFrame::CreateNextInFlow(aPresContext,
|
|
|
|
aDelegatingFrame, kidFrame, nextFrame);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
kidFrame->SetNextSibling(nextFrame->GetNextSibling());
|
|
|
|
nextFrame->SetNextSibling(nsnull);
|
|
|
|
}
|
|
|
|
// Add it as an overflow container.
|
|
|
|
//XXXfr This is a hack to fix some of our printing dataloss.
|
|
|
|
// See bug 154892. Not sure how to do it "right" yet; probably want
|
|
|
|
// to keep continuations within an nsAbsoluteContainingBlock eventually.
|
|
|
|
tracker.Insert(nextFrame, kidStatus);
|
2008-05-28 17:39:41 +04:00
|
|
|
NS_MergeReflowStatusInto(&reflowStatus, kidStatus);
|
2007-10-02 09:57:45 +04:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
// Delete any continuations
|
|
|
|
if (nextFrame) {
|
|
|
|
tracker.Finish(kidFrame);
|
|
|
|
static_cast<nsContainerFrame*>(nextFrame->GetParent())
|
2008-12-03 04:27:19 +03:00
|
|
|
->DeleteNextInFlowChild(aPresContext, nextFrame, PR_TRUE);
|
2007-10-02 09:57:45 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
tracker.Skip(kidFrame, reflowStatus);
|
|
|
|
if (aChildBounds) {
|
|
|
|
aChildBounds->UnionRect(*aChildBounds, kidFrame->GetOverflowRect() +
|
|
|
|
kidFrame->GetPosition());
|
|
|
|
}
|
2000-02-16 04:05:38 +03:00
|
|
|
}
|
1999-04-16 05:39:45 +04:00
|
|
|
}
|
2007-10-02 09:57:45 +04:00
|
|
|
// Abspos frames can't cause their parent to be incomplete,
|
|
|
|
// only overflow incomplete.
|
|
|
|
if (NS_FRAME_IS_NOT_COMPLETE(reflowStatus))
|
|
|
|
NS_FRAME_SET_OVERFLOW_INCOMPLETE(reflowStatus);
|
|
|
|
|
2008-05-28 17:39:41 +04:00
|
|
|
NS_MergeReflowStatusInto(&aReflowStatus, reflowStatus);
|
1999-04-16 05:39:45 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2007-05-04 03:11:00 +04:00
|
|
|
static inline PRBool IsFixedPaddingSize(nsStyleUnit aUnit) {
|
2008-07-16 01:31:36 +04:00
|
|
|
return aUnit == eStyleUnit_Coord;
|
2004-11-14 23:22:58 +03:00
|
|
|
}
|
2007-05-04 03:11:00 +04:00
|
|
|
static inline PRBool IsFixedMarginSize(nsStyleUnit aUnit) {
|
2008-07-16 01:31:36 +04:00
|
|
|
return aUnit == eStyleUnit_Coord;
|
2004-11-14 23:22:58 +03:00
|
|
|
}
|
2007-05-04 03:11:00 +04:00
|
|
|
static inline PRBool IsFixedMaxSize(nsStyleUnit aUnit) {
|
2008-07-16 01:31:36 +04:00
|
|
|
return aUnit == eStyleUnit_None || aUnit == eStyleUnit_Coord;
|
2007-05-05 21:01:51 +04:00
|
|
|
}
|
|
|
|
static inline PRBool IsFixedOffset(nsStyleUnit aUnit) {
|
2008-07-16 01:31:36 +04:00
|
|
|
return aUnit == eStyleUnit_Coord;
|
2007-05-05 21:01:51 +04:00
|
|
|
}
|
|
|
|
static inline PRBool IsFixedHeight(nsStyleUnit aUnit) {
|
2008-07-16 01:31:36 +04:00
|
|
|
return aUnit == eStyleUnit_Coord;
|
2004-11-14 23:22:58 +03:00
|
|
|
}
|
|
|
|
|
2007-05-04 03:11:00 +04:00
|
|
|
static inline PRBool IsFixedWidth(const nsStyleCoord& aCoord)
|
|
|
|
{
|
|
|
|
return aCoord.GetUnit() == eStyleUnit_Coord ||
|
|
|
|
(aCoord.GetUnit() == eStyleUnit_Enumerated &&
|
2007-11-15 21:10:31 +03:00
|
|
|
(aCoord.GetIntValue() == NS_STYLE_WIDTH_MAX_CONTENT ||
|
|
|
|
aCoord.GetIntValue() == NS_STYLE_WIDTH_MIN_CONTENT));
|
2007-05-04 03:11:00 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline PRBool IsFixedMaxWidth(const nsStyleCoord& aCoord)
|
|
|
|
{
|
2007-05-11 10:01:31 +04:00
|
|
|
return aCoord.GetUnit() == eStyleUnit_None ||
|
2007-05-04 03:11:00 +04:00
|
|
|
IsFixedWidth(aCoord);
|
|
|
|
}
|
|
|
|
|
2004-11-14 23:22:58 +03:00
|
|
|
PRBool
|
2005-01-24 00:44:46 +03:00
|
|
|
nsAbsoluteContainingBlock::FrameDependsOnContainer(nsIFrame* f,
|
|
|
|
PRBool aCBWidthChanged,
|
|
|
|
PRBool aCBHeightChanged)
|
2004-11-14 23:22:58 +03:00
|
|
|
{
|
2005-01-24 00:44:46 +03:00
|
|
|
const nsStylePosition* pos = f->GetStylePosition();
|
|
|
|
// See if f's position might have changed because it depends on a
|
|
|
|
// placeholder's position
|
|
|
|
// This can happen in the following cases:
|
|
|
|
// 1) Vertical positioning. "top" must be auto and "bottom" must be auto
|
|
|
|
// (otherwise the vertical position is completely determined by
|
|
|
|
// whichever of them is not auto and the height).
|
|
|
|
// 2) Horizontal positioning. "left" must be auto and "right" must be auto
|
|
|
|
// (otherwise the horizontal position is completely determined by
|
|
|
|
// whichever of them is not auto and the width).
|
|
|
|
// See nsHTMLReflowState::InitAbsoluteConstraints -- these are the
|
|
|
|
// only cases when we call CalculateHypotheticalBox().
|
|
|
|
if ((pos->mOffset.GetTopUnit() == eStyleUnit_Auto &&
|
|
|
|
pos->mOffset.GetBottomUnit() == eStyleUnit_Auto) ||
|
|
|
|
(pos->mOffset.GetLeftUnit() == eStyleUnit_Auto &&
|
|
|
|
pos->mOffset.GetRightUnit() == eStyleUnit_Auto)) {
|
|
|
|
return PR_TRUE;
|
|
|
|
}
|
|
|
|
if (!aCBWidthChanged && !aCBHeightChanged) {
|
|
|
|
// skip getting style data
|
|
|
|
return PR_FALSE;
|
|
|
|
}
|
|
|
|
const nsStylePadding* padding = f->GetStylePadding();
|
|
|
|
const nsStyleMargin* margin = f->GetStyleMargin();
|
|
|
|
if (aCBWidthChanged) {
|
|
|
|
// See if f's width might have changed.
|
|
|
|
// If border-left, border-right, padding-left, padding-right,
|
|
|
|
// width, min-width, and max-width are all lengths, 'none', or enumerated,
|
|
|
|
// then our frame width does not depend on the parent width.
|
2005-04-29 19:44:38 +04:00
|
|
|
// Note that borders never depend on the parent width
|
2007-11-15 21:10:31 +03:00
|
|
|
// XXX All of the enumerated values except -moz-available are ok too.
|
2007-05-04 03:11:00 +04:00
|
|
|
if (!IsFixedWidth(pos->mWidth) ||
|
|
|
|
!IsFixedWidth(pos->mMinWidth) ||
|
|
|
|
!IsFixedMaxWidth(pos->mMaxWidth) ||
|
2005-01-24 00:44:46 +03:00
|
|
|
!IsFixedPaddingSize(padding->mPadding.GetLeftUnit()) ||
|
|
|
|
!IsFixedPaddingSize(padding->mPadding.GetRightUnit())) {
|
2004-11-14 23:22:58 +03:00
|
|
|
return PR_TRUE;
|
|
|
|
}
|
2005-01-24 00:44:46 +03:00
|
|
|
|
|
|
|
// See if f's position might have changed. If we're RTL then the
|
|
|
|
// rules are slightly different. We'll assume percentage or auto
|
|
|
|
// margins will always induce a dependency on the size
|
|
|
|
if (!IsFixedMarginSize(margin->mMargin.GetLeftUnit()) ||
|
|
|
|
!IsFixedMarginSize(margin->mMargin.GetRightUnit())) {
|
|
|
|
return PR_TRUE;
|
2004-11-14 23:22:58 +03:00
|
|
|
}
|
2005-01-24 00:44:46 +03:00
|
|
|
if (f->GetStyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL) {
|
|
|
|
// Note that even if 'left' is a length, our position can
|
|
|
|
// still depend on the containing block width, because if
|
|
|
|
// 'right' is also a length we will discard 'left' and be
|
|
|
|
// positioned relative to the containing block right edge.
|
|
|
|
// 'left' length and 'right' auto is the only combination
|
|
|
|
// we can be sure of.
|
2007-05-05 21:01:51 +04:00
|
|
|
if (!IsFixedOffset(pos->mOffset.GetLeftUnit()) ||
|
2005-01-24 00:44:46 +03:00
|
|
|
pos->mOffset.GetRightUnit() != eStyleUnit_Auto) {
|
2004-11-14 23:22:58 +03:00
|
|
|
return PR_TRUE;
|
|
|
|
}
|
2005-01-24 00:44:46 +03:00
|
|
|
} else {
|
2007-05-05 21:01:51 +04:00
|
|
|
if (!IsFixedOffset(pos->mOffset.GetLeftUnit())) {
|
2004-11-14 23:22:58 +03:00
|
|
|
return PR_TRUE;
|
|
|
|
}
|
|
|
|
}
|
2005-01-24 00:44:46 +03:00
|
|
|
}
|
|
|
|
if (aCBHeightChanged) {
|
|
|
|
// See if f's height might have changed.
|
|
|
|
// If border-top, border-bottom, padding-top, padding-bottom,
|
|
|
|
// min-height, and max-height are all lengths or 'none',
|
|
|
|
// and height is a length or height and bottom are auto and top is not auto,
|
|
|
|
// then our frame height does not depend on the parent height.
|
2005-04-29 19:44:38 +04:00
|
|
|
// Note that borders never depend on the parent height
|
2007-05-05 21:01:51 +04:00
|
|
|
if (!(IsFixedHeight(pos->mHeight.GetUnit()) ||
|
2005-01-24 00:44:46 +03:00
|
|
|
(pos->mHeight.GetUnit() == eStyleUnit_Auto &&
|
|
|
|
pos->mOffset.GetBottomUnit() == eStyleUnit_Auto &&
|
|
|
|
pos->mOffset.GetTopUnit() != eStyleUnit_Auto)) ||
|
2007-05-05 21:01:51 +04:00
|
|
|
!IsFixedHeight(pos->mMinHeight.GetUnit()) ||
|
2005-01-24 00:44:46 +03:00
|
|
|
!IsFixedMaxSize(pos->mMaxHeight.GetUnit()) ||
|
|
|
|
!IsFixedPaddingSize(padding->mPadding.GetTopUnit()) ||
|
|
|
|
!IsFixedPaddingSize(padding->mPadding.GetBottomUnit())) {
|
|
|
|
return PR_TRUE;
|
|
|
|
}
|
2004-11-14 23:22:58 +03:00
|
|
|
|
2005-01-24 00:44:46 +03:00
|
|
|
// See if f's position might have changed.
|
|
|
|
if (!IsFixedMarginSize(margin->mMargin.GetTopUnit()) ||
|
|
|
|
!IsFixedMarginSize(margin->mMargin.GetBottomUnit())) {
|
|
|
|
return PR_TRUE;
|
|
|
|
}
|
2007-05-05 21:01:51 +04:00
|
|
|
if (!IsFixedOffset(pos->mOffset.GetTopUnit())) {
|
2005-01-24 00:44:46 +03:00
|
|
|
return PR_TRUE;
|
2004-11-14 23:22:58 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return PR_FALSE;
|
|
|
|
}
|
|
|
|
|
1999-07-24 06:37:45 +04:00
|
|
|
void
|
2006-04-10 04:16:29 +04:00
|
|
|
nsAbsoluteContainingBlock::DestroyFrames(nsIFrame* aDelegatingFrame)
|
1999-07-24 06:37:45 +04:00
|
|
|
{
|
2006-04-10 04:16:29 +04:00
|
|
|
mAbsoluteFrames.DestroyFrames();
|
1999-07-24 06:37:45 +04:00
|
|
|
}
|
|
|
|
|
2008-10-16 00:30:42 +04:00
|
|
|
void
|
|
|
|
nsAbsoluteContainingBlock::MarkSizeDependentFramesDirty()
|
|
|
|
{
|
|
|
|
for (nsIFrame* kidFrame = mAbsoluteFrames.FirstChild();
|
|
|
|
kidFrame;
|
|
|
|
kidFrame = kidFrame->GetNextSibling()) {
|
2009-04-22 07:02:17 +04:00
|
|
|
if (FrameDependsOnContainer(kidFrame, PR_TRUE, PR_TRUE)) {
|
2008-10-16 00:30:42 +04:00
|
|
|
// Add the weakest flags that will make sure we reflow this frame later
|
|
|
|
kidFrame->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-04-16 05:39:45 +04:00
|
|
|
// XXX Optimize the case where it's a resize reflow and the absolutely
|
|
|
|
// positioned child has the exact same size and position and skip the
|
|
|
|
// reflow...
|
2003-01-20 21:04:34 +03:00
|
|
|
|
|
|
|
// When bug 154892 is checked in, make sure that when
|
2007-01-30 03:06:41 +03:00
|
|
|
// GetChildListName() == nsGkAtoms::fixedList, the height is unconstrained.
|
2003-01-20 21:04:34 +03:00
|
|
|
// since we don't allow replicated frames to split.
|
|
|
|
|
1999-04-16 05:39:45 +04:00
|
|
|
nsresult
|
1999-07-24 06:37:45 +04:00
|
|
|
nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegatingFrame,
|
2004-08-01 03:15:21 +04:00
|
|
|
nsPresContext* aPresContext,
|
1999-04-16 05:39:45 +04:00
|
|
|
const nsHTMLReflowState& aReflowState,
|
1999-09-16 18:33:19 +04:00
|
|
|
nscoord aContainingBlockWidth,
|
|
|
|
nscoord aContainingBlockHeight,
|
2007-10-02 12:29:23 +04:00
|
|
|
PRBool aConstrainHeight,
|
1999-04-16 05:39:45 +04:00
|
|
|
nsIFrame* aKidFrame,
|
2007-07-16 22:55:24 +04:00
|
|
|
nsReflowStatus& aStatus,
|
|
|
|
nsRect* aChildBounds)
|
1999-04-16 05:39:45 +04:00
|
|
|
{
|
2002-11-16 13:41:10 +03:00
|
|
|
#ifdef DEBUG
|
|
|
|
if (nsBlockFrame::gNoisyReflow) {
|
|
|
|
nsFrame::IndentBy(stdout,nsBlockFrame::gNoiseIndent);
|
|
|
|
printf("abs pos ");
|
|
|
|
if (nsnull != aKidFrame) {
|
2009-01-12 22:20:59 +03:00
|
|
|
nsIFrameDebug *frameDebug = do_QueryFrame(aKidFrame);
|
|
|
|
if (frameDebug) {
|
2002-11-16 13:41:10 +03:00
|
|
|
nsAutoString name;
|
|
|
|
frameDebug->GetFrameName(name);
|
2006-02-03 17:18:39 +03:00
|
|
|
printf("%s ", NS_LossyConvertUTF16toASCII(name).get());
|
2002-11-16 13:41:10 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
char width[16];
|
|
|
|
char height[16];
|
|
|
|
PrettyUC(aReflowState.availableWidth, width);
|
|
|
|
PrettyUC(aReflowState.availableHeight, height);
|
|
|
|
printf(" a=%s,%s ", width, height);
|
2007-01-26 03:05:12 +03:00
|
|
|
PrettyUC(aReflowState.ComputedWidth(), width);
|
2007-08-02 22:08:05 +04:00
|
|
|
PrettyUC(aReflowState.ComputedHeight(), height);
|
2002-11-16 13:41:10 +03:00
|
|
|
printf("c=%s,%s \n", width, height);
|
|
|
|
}
|
2005-03-23 06:35:08 +03:00
|
|
|
AutoNoisyIndenter indent(nsBlockFrame::gNoisy);
|
2002-11-16 13:41:10 +03:00
|
|
|
#endif // DEBUG
|
|
|
|
|
2007-02-26 17:00:21 +03:00
|
|
|
// Store position and overflow rect so taht we can invalidate the correct
|
|
|
|
// area if the position changes
|
|
|
|
nsRect oldOverflowRect(aKidFrame->GetOverflowRect() +
|
|
|
|
aKidFrame->GetPosition());
|
|
|
|
nsRect oldRect = aKidFrame->GetRect();
|
|
|
|
|
1999-04-16 05:39:45 +04:00
|
|
|
nsresult rv;
|
|
|
|
// Get the border values
|
2008-07-17 10:30:25 +04:00
|
|
|
const nsMargin& border = aReflowState.mStyleBorder->GetActualBorder();
|
2002-09-24 15:43:48 +04:00
|
|
|
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
nscoord availWidth = aContainingBlockWidth;
|
|
|
|
if (availWidth == -1) {
|
2007-01-26 03:05:12 +03:00
|
|
|
NS_ASSERTION(aReflowState.ComputedWidth() != NS_UNCONSTRAINEDSIZE,
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
"Must have a useful width _somewhere_");
|
|
|
|
availWidth =
|
2007-01-26 03:05:12 +03:00
|
|
|
aReflowState.ComputedWidth() + aReflowState.mComputedPadding.LeftRight();
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
nsHTMLReflowMetrics kidDesiredSize;
|
|
|
|
nsHTMLReflowState kidReflowState(aPresContext, aReflowState, aKidFrame,
|
|
|
|
nsSize(availWidth, NS_UNCONSTRAINEDSIZE),
|
|
|
|
aContainingBlockWidth,
|
|
|
|
aContainingBlockHeight);
|
|
|
|
|
|
|
|
// Send the WillReflow() notification and position the frame
|
|
|
|
aKidFrame->WillReflow(aPresContext);
|
|
|
|
|
2007-10-02 09:57:45 +04:00
|
|
|
PRBool constrainHeight = (aReflowState.availableHeight != NS_UNCONSTRAINEDSIZE)
|
2007-10-02 12:29:23 +04:00
|
|
|
&& aConstrainHeight
|
|
|
|
// Don't split if told not to (e.g. for fixed frames)
|
2007-10-02 09:57:45 +04:00
|
|
|
&& (aDelegatingFrame->GetType() != nsGkAtoms::positionedInlineFrame)
|
|
|
|
//XXX we don't handle splitting frames for inline absolute containing blocks yet
|
|
|
|
&& (aKidFrame->GetRect().y <= aReflowState.availableHeight);
|
|
|
|
// Don't split things below the fold. (Ideally we shouldn't *have*
|
|
|
|
// anything totally below the fold, but we can't position frames
|
|
|
|
// across next-in-flow breaks yet.
|
|
|
|
if (constrainHeight) {
|
2008-08-04 15:19:53 +04:00
|
|
|
kidReflowState.availableHeight = aReflowState.availableHeight - border.top
|
|
|
|
- kidReflowState.mComputedMargin.top;
|
|
|
|
if (NS_AUTOOFFSET != kidReflowState.mComputedOffsets.top)
|
|
|
|
kidReflowState.availableHeight -= kidReflowState.mComputedOffsets.top;
|
2007-10-02 09:57:45 +04:00
|
|
|
}
|
|
|
|
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
// Do the reflow
|
|
|
|
rv = aKidFrame->Reflow(aPresContext, kidDesiredSize, kidReflowState, aStatus);
|
|
|
|
|
|
|
|
// If we're solving for 'left' or 'top', then compute it now that we know the
|
|
|
|
// width/height
|
|
|
|
if ((NS_AUTOOFFSET == kidReflowState.mComputedOffsets.left) ||
|
|
|
|
(NS_AUTOOFFSET == kidReflowState.mComputedOffsets.top)) {
|
|
|
|
if (-1 == aContainingBlockWidth) {
|
|
|
|
// Get the containing block width/height
|
|
|
|
kidReflowState.ComputeContainingBlockRectangle(aPresContext,
|
|
|
|
&aReflowState,
|
|
|
|
aContainingBlockWidth,
|
|
|
|
aContainingBlockHeight);
|
2004-12-06 03:27:21 +03:00
|
|
|
}
|
|
|
|
|
2004-11-27 02:28:09 +03:00
|
|
|
if (NS_AUTOOFFSET == kidReflowState.mComputedOffsets.left) {
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
NS_ASSERTION(NS_AUTOOFFSET != kidReflowState.mComputedOffsets.right,
|
|
|
|
"Can't solve for both left and right");
|
|
|
|
kidReflowState.mComputedOffsets.left = aContainingBlockWidth -
|
|
|
|
kidReflowState.mComputedOffsets.right -
|
|
|
|
kidReflowState.mComputedMargin.right -
|
|
|
|
kidDesiredSize.width -
|
|
|
|
kidReflowState.mComputedMargin.left;
|
1999-10-30 06:52:11 +04:00
|
|
|
}
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
if (NS_AUTOOFFSET == kidReflowState.mComputedOffsets.top) {
|
|
|
|
kidReflowState.mComputedOffsets.top = aContainingBlockHeight -
|
|
|
|
kidReflowState.mComputedOffsets.bottom -
|
|
|
|
kidReflowState.mComputedMargin.bottom -
|
|
|
|
kidDesiredSize.height -
|
|
|
|
kidReflowState.mComputedMargin.top;
|
1999-04-16 05:39:45 +04:00
|
|
|
}
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
}
|
2004-11-27 02:28:09 +03:00
|
|
|
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
// Position the child relative to our padding edge
|
|
|
|
nsRect rect(border.left + kidReflowState.mComputedOffsets.left + kidReflowState.mComputedMargin.left,
|
|
|
|
border.top + kidReflowState.mComputedOffsets.top + kidReflowState.mComputedMargin.top,
|
|
|
|
kidDesiredSize.width, kidDesiredSize.height);
|
|
|
|
aKidFrame->SetRect(rect);
|
|
|
|
|
2007-05-02 04:07:51 +04:00
|
|
|
nsIView* view = aKidFrame->GetView();
|
|
|
|
if (view) {
|
|
|
|
// Size and position the view and set its opacity, visibility, content
|
|
|
|
// transparency, and clip
|
|
|
|
nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, aKidFrame,
|
|
|
|
view,
|
|
|
|
&kidDesiredSize.mOverflowArea);
|
|
|
|
} else {
|
|
|
|
nsContainerFrame::PositionChildViews(aKidFrame);
|
|
|
|
}
|
2007-02-26 17:00:21 +03:00
|
|
|
|
|
|
|
if (oldRect.TopLeft() != rect.TopLeft() ||
|
2007-03-27 07:58:17 +04:00
|
|
|
(aDelegatingFrame->GetStateBits() & NS_FRAME_FIRST_REFLOW) ||
|
2007-08-28 05:35:59 +04:00
|
|
|
(kidDesiredSize.mOverflowArea + rect.TopLeft() != oldOverflowRect &&
|
|
|
|
(kidDesiredSize.mOverflowArea + rect.TopLeft() != rect || oldRect != oldOverflowRect))) {
|
2007-02-26 17:00:21 +03:00
|
|
|
// The frame moved; we have to invalidate the whole frame
|
|
|
|
// because the children may have moved after they were reflowed
|
2007-08-28 05:35:59 +04:00
|
|
|
// We also have to invalidate when we have overflow and the overflow
|
|
|
|
// changes because the change might be caused by clipping
|
2007-03-27 07:58:17 +04:00
|
|
|
// XXX This could be optimized in some cases, especially clipping changes
|
2007-02-26 17:00:21 +03:00
|
|
|
aKidFrame->GetParent()->Invalidate(oldOverflowRect);
|
|
|
|
aKidFrame->GetParent()->Invalidate(kidDesiredSize.mOverflowArea +
|
|
|
|
rect.TopLeft());
|
|
|
|
} else if (oldRect.Size() != rect.Size()) {
|
|
|
|
// Invalidate the area where the frame changed size.
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
nscoord innerWidth = PR_MIN(oldRect.width, rect.width);
|
|
|
|
nscoord innerHeight = PR_MIN(oldRect.height, rect.height);
|
|
|
|
nscoord outerWidth = PR_MAX(oldRect.width, rect.width);
|
|
|
|
nscoord outerHeight = PR_MAX(oldRect.height, rect.height);
|
|
|
|
aKidFrame->GetParent()->Invalidate(
|
|
|
|
nsRect(rect.x + innerWidth, rect.y, outerWidth - innerWidth, outerHeight));
|
|
|
|
// Invalidate the horizontal strip
|
|
|
|
aKidFrame->GetParent()->Invalidate(
|
|
|
|
nsRect(rect.x, rect.y + innerHeight, outerWidth, outerHeight - innerHeight));
|
|
|
|
}
|
|
|
|
aKidFrame->DidReflow(aPresContext, &kidReflowState, NS_FRAME_REFLOW_FINISHED);
|
|
|
|
|
2002-11-16 13:41:10 +03:00
|
|
|
#ifdef DEBUG
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
if (nsBlockFrame::gNoisyReflow) {
|
|
|
|
nsFrame::IndentBy(stdout,nsBlockFrame::gNoiseIndent - 1);
|
|
|
|
printf("abs pos ");
|
|
|
|
if (nsnull != aKidFrame) {
|
2009-01-12 22:20:59 +03:00
|
|
|
nsIFrameDebug *frameDebug = do_QueryFrame(aKidFrame);
|
|
|
|
if (frameDebug) {
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
nsAutoString name;
|
|
|
|
frameDebug->GetFrameName(name);
|
|
|
|
printf("%s ", NS_LossyConvertUTF16toASCII(name).get());
|
2002-11-16 13:41:10 +03:00
|
|
|
}
|
|
|
|
}
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
printf("%p rect=%d,%d,%d,%d", aKidFrame, rect.x, rect.y, rect.width, rect.height);
|
|
|
|
printf("\n");
|
|
|
|
}
|
2002-11-16 13:41:10 +03:00
|
|
|
#endif
|
2004-11-27 02:28:09 +03:00
|
|
|
|
2007-07-16 22:55:24 +04:00
|
|
|
if (aChildBounds)
|
|
|
|
aChildBounds->UnionRect(*aChildBounds, kidDesiredSize.mOverflowArea +
|
|
|
|
rect.TopLeft());
|
|
|
|
|
1999-12-06 18:49:53 +03:00
|
|
|
return rv;
|
1999-04-16 05:39:45 +04:00
|
|
|
}
|
2002-11-16 13:41:10 +03:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
void nsAbsoluteContainingBlock::PrettyUC(nscoord aSize,
|
|
|
|
char* aBuf)
|
|
|
|
{
|
|
|
|
if (NS_UNCONSTRAINEDSIZE == aSize) {
|
|
|
|
strcpy(aBuf, "UC");
|
|
|
|
}
|
|
|
|
else {
|
2004-11-14 23:22:58 +03:00
|
|
|
if((PRInt32)0xdeadbeef == aSize)
|
2002-11-16 13:41:10 +03:00
|
|
|
{
|
|
|
|
strcpy(aBuf, "deadbeef");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
sprintf(aBuf, "%d", aSize);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|