2017-10-27 20:33:53 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
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-04-16 05:39:45 +04:00
|
|
|
#include "nsAbsoluteContainingBlock.h"
|
2013-04-01 19:26:01 +04:00
|
|
|
|
1999-04-16 05:39:45 +04:00
|
|
|
#include "nsContainerFrame.h"
|
2013-04-01 19:26:01 +04:00
|
|
|
#include "nsGkAtoms.h"
|
1999-07-24 06:37:45 +04:00
|
|
|
#include "nsIPresShell.h"
|
2016-10-31 18:58:18 +03:00
|
|
|
#include "mozilla/CSSAlignUtils.h"
|
2016-07-21 13:36:34 +03:00
|
|
|
#include "mozilla/ReflowInput.h"
|
2004-08-01 03:15:21 +04:00
|
|
|
#include "nsPresContext.h"
|
2009-09-18 15:09:35 +04:00
|
|
|
#include "nsCSSFrameConstructor.h"
|
2015-03-26 21:57:39 +03:00
|
|
|
#include "nsGridContainerFrame.h"
|
1999-04-16 05:39:45 +04:00
|
|
|
|
2016-08-15 09:43:21 +03:00
|
|
|
#include "mozilla/Sprintf.h"
|
2015-05-26 21:33:55 +03:00
|
|
|
|
2002-11-16 13:41:10 +03:00
|
|
|
#ifdef DEBUG
|
|
|
|
#include "nsBlockFrame.h"
|
2013-04-01 19:26:01 +04:00
|
|
|
|
2015-05-26 21:33:55 +03:00
|
|
|
static void PrettyUC(nscoord aSize, char* aBuf, int aBufSize)
|
2013-04-01 19:26:01 +04:00
|
|
|
{
|
|
|
|
if (NS_UNCONSTRAINEDSIZE == aSize) {
|
|
|
|
strcpy(aBuf, "UC");
|
|
|
|
} else {
|
|
|
|
if((int32_t)0xdeadbeef == aSize) {
|
|
|
|
strcpy(aBuf, "deadbeef");
|
|
|
|
} else {
|
2015-05-26 21:33:55 +03:00
|
|
|
snprintf(aBuf, aBufSize, "%d", aSize);
|
2013-04-01 19:26:01 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2002-11-16 13:41:10 +03:00
|
|
|
#endif
|
|
|
|
|
2014-07-24 12:28:46 +04:00
|
|
|
using namespace mozilla;
|
|
|
|
|
2016-10-31 18:59:40 +03:00
|
|
|
typedef mozilla::CSSAlignUtils::AlignJustifyFlags AlignJustifyFlags;
|
|
|
|
|
2014-05-28 23:36:58 +04:00
|
|
|
void
|
1999-07-24 06:37:45 +04:00
|
|
|
nsAbsoluteContainingBlock::SetInitialChildList(nsIFrame* aDelegatingFrame,
|
2011-08-25 00:54:30 +04:00
|
|
|
ChildListID aListID,
|
2009-07-28 16:53:20 +04:00
|
|
|
nsFrameList& aChildList)
|
1999-04-16 05:39:45 +04:00
|
|
|
{
|
2013-04-01 19:26:01 +04:00
|
|
|
NS_PRECONDITION(mChildListID == aListID, "unexpected child list name");
|
2012-06-25 23:59:42 +04:00
|
|
|
#ifdef DEBUG
|
1999-07-24 06:37:45 +04:00
|
|
|
nsFrame::VerifyDirtyBitSet(aChildList);
|
|
|
|
#endif
|
1999-04-16 05:39:45 +04:00
|
|
|
mAbsoluteFrames.SetFrames(aChildList);
|
|
|
|
}
|
|
|
|
|
2014-05-28 23:36:58 +04:00
|
|
|
void
|
2005-02-07 04:58:25 +03:00
|
|
|
nsAbsoluteContainingBlock::AppendFrames(nsIFrame* aDelegatingFrame,
|
2011-08-25 00:54:30 +04:00
|
|
|
ChildListID aListID,
|
2009-07-30 21:23:32 +04:00
|
|
|
nsFrameList& aFrameList)
|
1999-07-24 06:37:45 +04:00
|
|
|
{
|
2013-04-01 19:26:01 +04:00
|
|
|
NS_ASSERTION(mChildListID == aListID, "unexpected child list");
|
2006-06-29 06:32:36 +04:00
|
|
|
|
1999-07-24 06:37:45 +04:00
|
|
|
// Append the frames to our list of absolutely positioned frames
|
2012-06-25 23:59:42 +04:00
|
|
|
#ifdef DEBUG
|
1999-07-24 06:37:45 +04:00
|
|
|
nsFrame::VerifyDirtyBitSet(aFrameList);
|
|
|
|
#endif
|
2012-07-30 18:20:58 +04:00
|
|
|
mAbsoluteFrames.AppendFrames(nullptr, aFrameList);
|
1999-07-24 06:37: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
|
|
|
// no damage to intrinsic widths, since absolutely positioned frames can't
|
|
|
|
// change them
|
2010-03-21 00:54:19 +03:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2014-05-28 23:36:58 +04:00
|
|
|
void
|
2005-02-07 04:58:25 +03:00
|
|
|
nsAbsoluteContainingBlock::InsertFrames(nsIFrame* aDelegatingFrame,
|
2011-08-25 00:54:30 +04:00
|
|
|
ChildListID aListID,
|
2005-02-07 04:58:25 +03:00
|
|
|
nsIFrame* aPrevFrame,
|
2009-07-30 21:23:32 +04:00
|
|
|
nsFrameList& aFrameList)
|
1999-07-24 06:37:45 +04:00
|
|
|
{
|
2013-04-01 19:26:01 +04:00
|
|
|
NS_ASSERTION(mChildListID == aListID, "unexpected child list");
|
2006-06-29 06:32:36 +04:00
|
|
|
NS_ASSERTION(!aPrevFrame || aPrevFrame->GetParent() == aDelegatingFrame,
|
|
|
|
"inserting after sibling frame with different parent");
|
|
|
|
|
2012-06-25 23:59:42 +04:00
|
|
|
#ifdef DEBUG
|
1999-07-24 06:37:45 +04:00
|
|
|
nsFrame::VerifyDirtyBitSet(aFrameList);
|
|
|
|
#endif
|
2012-07-30 18:20:58 +04:00
|
|
|
mAbsoluteFrames.InsertFrames(nullptr, aPrevFrame, aFrameList);
|
1999-07-24 06:37: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
|
|
|
// no damage to intrinsic widths, since absolutely positioned frames can't
|
|
|
|
// change them
|
2010-03-21 00:54:19 +03:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2009-09-18 15:09:36 +04:00
|
|
|
void
|
1999-07-24 06:37:45 +04:00
|
|
|
nsAbsoluteContainingBlock::RemoveFrame(nsIFrame* aDelegatingFrame,
|
2011-08-25 00:54:30 +04:00
|
|
|
ChildListID aListID,
|
1999-07-24 06:37:45 +04:00
|
|
|
nsIFrame* aOldFrame)
|
|
|
|
{
|
2013-04-01 19:26:01 +04:00
|
|
|
NS_ASSERTION(mChildListID == aListID, "unexpected child list");
|
2007-10-02 09:57:45 +04:00
|
|
|
nsIFrame* nif = aOldFrame->GetNextInFlow();
|
|
|
|
if (nif) {
|
2014-05-25 02:20:40 +04:00
|
|
|
nif->GetParent()->DeleteNextInFlowChild(nif, false);
|
2007-10-02 09:57:45 +04:00
|
|
|
}
|
2006-06-29 06:32:36 +04:00
|
|
|
|
2009-09-18 15:09:36 +04:00
|
|
|
mAbsoluteFrames.DestroyFrame(aOldFrame);
|
1999-07-24 06:37:45 +04:00
|
|
|
}
|
|
|
|
|
2014-05-13 04:47:53 +04:00
|
|
|
void
|
2007-10-02 09:57:45 +04:00
|
|
|
nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
|
|
|
|
nsPresContext* aPresContext,
|
2017-05-20 20:15:26 +03:00
|
|
|
const ReflowInput& aReflowInput,
|
2007-10-02 09:57:45 +04:00
|
|
|
nsReflowStatus& aReflowStatus,
|
2013-04-15 12:31:45 +04:00
|
|
|
const nsRect& aContainingBlock,
|
2015-12-23 01:03:16 +03:00
|
|
|
AbsPosReflowFlags aFlags,
|
2010-10-07 08:25:45 +04:00
|
|
|
nsOverflowAreas* aOverflowAreas)
|
1999-04-16 05:39:45 +04:00
|
|
|
{
|
2017-02-14 12:55:48 +03:00
|
|
|
nsReflowStatus reflowStatus;
|
1999-12-06 18:49:53 +03:00
|
|
|
|
2016-07-21 13:36:39 +03:00
|
|
|
const bool reflowAll = aReflowInput.ShouldReflowAllKids();
|
2015-12-23 01:03:16 +03:00
|
|
|
const bool isGrid = !!(aFlags & AbsPosReflowFlags::eIsGridContainerCB);
|
1999-04-16 05:39:45 +04:00
|
|
|
nsIFrame* kidFrame;
|
2014-02-07 02:07:47 +04:00
|
|
|
nsOverflowContinuationTracker tracker(aDelegatingFrame, true);
|
2003-06-26 15:30:17 +04:00
|
|
|
for (kidFrame = mAbsoluteFrames.FirstChild(); kidFrame; kidFrame = kidFrame->GetNextSibling()) {
|
2011-09-29 10:19:26 +04:00
|
|
|
bool kidNeedsReflow = reflowAll || NS_SUBTREE_DIRTY(kidFrame) ||
|
2015-12-23 01:03:16 +03:00
|
|
|
FrameDependsOnContainer(kidFrame,
|
|
|
|
!!(aFlags & AbsPosReflowFlags::eCBWidthChanged),
|
|
|
|
!!(aFlags & AbsPosReflowFlags::eCBHeightChanged));
|
2017-05-20 20:15:26 +03:00
|
|
|
nscoord availBSize = aReflowInput.AvailableBSize();
|
|
|
|
const nsRect& cb = isGrid ? nsGridContainerFrame::GridItemCB(kidFrame)
|
|
|
|
: aContainingBlock;
|
|
|
|
WritingMode containerWM = aReflowInput.GetWritingMode();
|
|
|
|
if (!kidNeedsReflow && availBSize != NS_UNCONSTRAINEDSIZE) {
|
|
|
|
// If we need to redo pagination on the kid, we need to reflow it.
|
|
|
|
// This can happen either if the available height shrunk and the
|
|
|
|
// kid (or its overflow that creates overflow containers) is now
|
|
|
|
// too large to fit in the available height, or if the available
|
|
|
|
// height has increased and the kid has a next-in-flow that we
|
|
|
|
// might need to pull from.
|
|
|
|
WritingMode kidWM = kidFrame->GetWritingMode();
|
|
|
|
if (containerWM.GetBlockDir() != kidWM.GetBlockDir()) {
|
|
|
|
// Not sure what the right test would be here.
|
|
|
|
kidNeedsReflow = true;
|
|
|
|
} else {
|
|
|
|
nscoord kidBEnd = kidFrame->GetLogicalRect(cb.Size()).BEnd(kidWM);
|
|
|
|
nscoord kidOverflowBEnd =
|
|
|
|
LogicalRect(containerWM,
|
2017-05-25 23:21:20 +03:00
|
|
|
// Use ...RelativeToSelf to ignore transforms
|
|
|
|
kidFrame->GetScrollableOverflowRectRelativeToSelf() +
|
|
|
|
kidFrame->GetPosition(),
|
2017-05-20 20:15:26 +03:00
|
|
|
aContainingBlock.Size()).BEnd(containerWM);
|
|
|
|
MOZ_ASSERT(kidOverflowBEnd >= kidBEnd);
|
|
|
|
if (kidOverflowBEnd > availBSize ||
|
|
|
|
(kidBEnd < availBSize && kidFrame->GetNextInFlow())) {
|
|
|
|
kidNeedsReflow = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-04-22 03:53:52 +04:00
|
|
|
if (kidNeedsReflow && !aPresContext->HasPendingInterrupt()) {
|
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
|
2017-02-14 12:55:48 +03:00
|
|
|
nsReflowStatus kidStatus;
|
2016-07-21 13:36:39 +03:00
|
|
|
ReflowAbsoluteFrame(aDelegatingFrame, aPresContext, aReflowInput, cb,
|
2015-12-23 01:03:16 +03:00
|
|
|
aFlags, kidFrame, kidStatus, aOverflowAreas);
|
2007-10-02 09:57:45 +04:00
|
|
|
nsIFrame* nextFrame = kidFrame->GetNextInFlow();
|
2017-02-11 17:38:48 +03:00
|
|
|
if (!kidStatus.IsFullyComplete() &&
|
2014-11-24 19:42:31 +03:00
|
|
|
aDelegatingFrame->IsFrameOfType(nsIFrame::eCanContainOverflowContainers)) {
|
2007-10-02 09:57:45 +04:00
|
|
|
// Need a continuation
|
|
|
|
if (!nextFrame) {
|
2013-03-20 05:47:49 +04:00
|
|
|
nextFrame =
|
|
|
|
aPresContext->PresShell()->FrameConstructor()->
|
|
|
|
CreateContinuingFrame(aPresContext, kidFrame, aDelegatingFrame);
|
2007-10-02 09:57:45 +04:00
|
|
|
}
|
|
|
|
// 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);
|
2017-02-13 12:15:01 +03:00
|
|
|
reflowStatus.MergeCompletionStatusFrom(kidStatus);
|
2007-10-02 09:57:45 +04:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
// Delete any continuations
|
|
|
|
if (nextFrame) {
|
2013-06-10 22:31:59 +04:00
|
|
|
nsOverflowContinuationTracker::AutoFinish fini(&tracker, kidFrame);
|
2014-05-25 02:20:40 +04:00
|
|
|
nextFrame->GetParent()->DeleteNextInFlowChild(nextFrame, true);
|
2007-10-02 09:57:45 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
tracker.Skip(kidFrame, reflowStatus);
|
2010-10-07 08:25:45 +04:00
|
|
|
if (aOverflowAreas) {
|
|
|
|
aDelegatingFrame->ConsiderChildOverflow(*aOverflowAreas, kidFrame);
|
2007-10-02 09:57:45 +04:00
|
|
|
}
|
2000-02-16 04:05:38 +03:00
|
|
|
}
|
2009-04-22 03:53:52 +04:00
|
|
|
|
2009-05-10 07:57:47 +04:00
|
|
|
// Make a CheckForInterrupt call, here, not just HasPendingInterrupt. That
|
|
|
|
// will make sure that we end up reflowing aDelegatingFrame in cases when
|
|
|
|
// one of our kids interrupted. Otherwise we'd set the dirty or
|
|
|
|
// dirty-children bit on the kid in the condition below, and then when
|
|
|
|
// reflow completes and we go to mark dirty bits on all ancestors of that
|
|
|
|
// kid we'll immediately bail out, because the kid already has a dirty bit.
|
|
|
|
// In particular, we won't set any dirty bits on aDelegatingFrame, so when
|
|
|
|
// the following reflow happens we won't reflow the kid in question. This
|
|
|
|
// might be slightly suboptimal in cases where |kidFrame| itself did not
|
|
|
|
// interrupt, since we'll trigger a reflow of it too when it's not strictly
|
|
|
|
// needed. But the logic to not do that is enough more complicated, and
|
|
|
|
// the case enough of an edge case, that this is probably better.
|
|
|
|
if (kidNeedsReflow && aPresContext->CheckForInterrupt(aDelegatingFrame)) {
|
2009-04-22 03:53:52 +04:00
|
|
|
if (aDelegatingFrame->GetStateBits() & NS_FRAME_IS_DIRTY) {
|
|
|
|
kidFrame->AddStateBits(NS_FRAME_IS_DIRTY);
|
|
|
|
} else {
|
|
|
|
kidFrame->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
|
|
|
|
}
|
|
|
|
}
|
1999-04-16 05:39:45 +04:00
|
|
|
}
|
2009-04-22 03:53:52 +04:00
|
|
|
|
2007-10-02 09:57:45 +04:00
|
|
|
// Abspos frames can't cause their parent to be incomplete,
|
|
|
|
// only overflow incomplete.
|
2017-02-11 17:17:26 +03:00
|
|
|
if (reflowStatus.IsIncomplete())
|
2017-02-11 18:18:04 +03:00
|
|
|
reflowStatus.SetOverflowIncomplete();
|
2007-10-02 09:57:45 +04:00
|
|
|
|
2017-02-13 12:15:01 +03:00
|
|
|
aReflowStatus.MergeCompletionStatusFrom(reflowStatus);
|
1999-04-16 05:39:45 +04:00
|
|
|
}
|
|
|
|
|
2010-08-31 20:05:12 +04:00
|
|
|
static inline bool IsFixedPaddingSize(const nsStyleCoord& aCoord)
|
|
|
|
{ return aCoord.ConvertsToLength(); }
|
|
|
|
static inline bool IsFixedMarginSize(const nsStyleCoord& aCoord)
|
|
|
|
{ return aCoord.ConvertsToLength(); }
|
|
|
|
static inline bool IsFixedOffset(const nsStyleCoord& aCoord)
|
|
|
|
{ return aCoord.ConvertsToLength(); }
|
2007-05-04 03:11:00 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool
|
2005-01-24 00:44:46 +03:00
|
|
|
nsAbsoluteContainingBlock::FrameDependsOnContainer(nsIFrame* f,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aCBWidthChanged,
|
|
|
|
bool aCBHeightChanged)
|
2004-11-14 23:22:58 +03:00
|
|
|
{
|
2013-02-17 01:51:02 +04:00
|
|
|
const nsStylePosition* pos = f->StylePosition();
|
2005-01-24 00:44:46 +03:00
|
|
|
// 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).
|
2016-07-21 13:36:35 +03:00
|
|
|
// See ReflowInput::InitAbsoluteConstraints -- these are the
|
2005-01-24 00:44:46 +03:00
|
|
|
// 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)) {
|
2011-10-17 18:59:28 +04:00
|
|
|
return true;
|
2005-01-24 00:44:46 +03:00
|
|
|
}
|
|
|
|
if (!aCBWidthChanged && !aCBHeightChanged) {
|
|
|
|
// skip getting style data
|
2011-10-17 18:59:28 +04:00
|
|
|
return false;
|
2005-01-24 00:44:46 +03:00
|
|
|
}
|
2013-02-17 01:51:02 +04:00
|
|
|
const nsStylePadding* padding = f->StylePadding();
|
|
|
|
const nsStyleMargin* margin = f->StyleMargin();
|
2015-06-05 10:47:09 +03:00
|
|
|
WritingMode wm = f->GetWritingMode();
|
|
|
|
if (wm.IsVertical() ? aCBHeightChanged : aCBWidthChanged) {
|
|
|
|
// See if f's inline-size might have changed.
|
|
|
|
// If margin-inline-start/end, padding-inline-start/end,
|
|
|
|
// inline-size, min/max-inline-size are all lengths, 'none', or enumerated,
|
|
|
|
// then our frame isize does not depend on the parent isize.
|
|
|
|
// Note that borders never depend on the parent isize.
|
2007-11-15 21:10:31 +03:00
|
|
|
// XXX All of the enumerated values except -moz-available are ok too.
|
2015-06-05 10:47:09 +03:00
|
|
|
if (pos->ISizeDependsOnContainer(wm) ||
|
|
|
|
pos->MinISizeDependsOnContainer(wm) ||
|
|
|
|
pos->MaxISizeDependsOnContainer(wm) ||
|
|
|
|
!IsFixedPaddingSize(padding->mPadding.GetIStart(wm)) ||
|
|
|
|
!IsFixedPaddingSize(padding->mPadding.GetIEnd(wm))) {
|
2011-10-17 18:59:28 +04:00
|
|
|
return 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 we're RTL then the
|
|
|
|
// rules are slightly different. We'll assume percentage or auto
|
|
|
|
// margins will always induce a dependency on the size
|
2015-06-05 10:47:09 +03:00
|
|
|
if (!IsFixedMarginSize(margin->mMargin.GetIStart(wm)) ||
|
|
|
|
!IsFixedMarginSize(margin->mMargin.GetIEnd(wm))) {
|
2011-10-17 18:59:28 +04:00
|
|
|
return true;
|
2004-11-14 23:22:58 +03:00
|
|
|
}
|
2005-01-24 00:44:46 +03:00
|
|
|
}
|
2015-06-05 10:47:09 +03:00
|
|
|
if (wm.IsVertical() ? aCBWidthChanged : aCBHeightChanged) {
|
|
|
|
// See if f's block-size might have changed.
|
|
|
|
// If margin-block-start/end, padding-block-start/end,
|
|
|
|
// min-block-size, and max-block-size are all lengths or 'none',
|
|
|
|
// and bsize is a length or bsize and bend are auto and bstart is not auto,
|
|
|
|
// then our frame bsize does not depend on the parent bsize.
|
|
|
|
// Note that borders never depend on the parent bsize.
|
|
|
|
if ((pos->BSizeDependsOnContainer(wm) &&
|
|
|
|
!(pos->BSize(wm).GetUnit() == eStyleUnit_Auto &&
|
|
|
|
pos->mOffset.GetBEndUnit(wm) == eStyleUnit_Auto &&
|
|
|
|
pos->mOffset.GetBStartUnit(wm) != eStyleUnit_Auto)) ||
|
|
|
|
pos->MinBSizeDependsOnContainer(wm) ||
|
|
|
|
pos->MaxBSizeDependsOnContainer(wm) ||
|
|
|
|
!IsFixedPaddingSize(padding->mPadding.GetBStart(wm)) ||
|
|
|
|
!IsFixedPaddingSize(padding->mPadding.GetBEnd(wm))) {
|
2011-10-17 18:59:28 +04:00
|
|
|
return true;
|
2005-01-24 00:44:46 +03:00
|
|
|
}
|
2017-07-06 15:00:35 +03:00
|
|
|
|
2005-01-24 00:44:46 +03:00
|
|
|
// See if f's position might have changed.
|
2015-06-05 10:47:09 +03:00
|
|
|
if (!IsFixedMarginSize(margin->mMargin.GetBStart(wm)) ||
|
|
|
|
!IsFixedMarginSize(margin->mMargin.GetBEnd(wm))) {
|
2011-10-17 18:59:28 +04:00
|
|
|
return true;
|
2005-01-24 00:44:46 +03:00
|
|
|
}
|
Bug 1347759 - Fix conditions under which we reflow absolutely positioned element due to size change of its container for everything other than horizontal LTR. r=jfkthame
I found this problem because I was debugging the failure of
layout/reftests/w3c-css/received/css-writing-modes-3/clearance-calculations-vrl-008.xht
with my patch for bug 1308876. It was failing because the red reference
box that was intended to be covered up was being mispositioned leftwards
by the width of the scrollbar, since we were not reflowing it when we
decided that the viewport did not need scrollbars. This patch fixes
that failure.
This led me to this bug, where
nsAbsoluteContainingBlock::FrameDependsOnContainer was incorrectly
testing conditions for when the values of 'top', 'right', 'bottom', and
'left' require reflow due to changes in the size of the containing
block.
The old code is incorrect in a number of cases, such as:
1. in RTL, with 'right: 100px', it will say that the frame does not
depend on its container's width since 'right' (offset-inline-start)
is a fixed offset and 'left' is 'auto'. However, since the
positioning is relative to the right edge, a change in container size
does require that the absolutely positioned element be repositioned
relative to the container's left edge.
2. In vertical-rl, again with 'right: 100px', it will make the same
mistake, since 'right' (now offset-block-start) is a fixed offset.
This is the case from the test I was debugging.
3. In vertical-rl with rtl direction and 'bottom: 100px', we will make
the same mistake because 'bottom' (inline-start) is fixed and 'top'
is 'auto', and we use 'bottom' rather than 'top'.
However, in cases (1) and (3) we actually avoid hitting the bug in these
simple-ish cases because ReflowInput::ShouldReflowAllKids() returns true
whenever IsIResize() is true, which means that
nsAbsoluteContainingBlock::Reflow doesn't even call
FrameDependsOnContainer. However, FrameDependsOnContainer should still
do the right thing because it's needed for
nsAbsoluteContainingBlock::MarkSizeDependentFramesDirty, which is only
used (from nsBlockFrame) when we reflow again for clearance or for
interruptible reflow. I haven't attempted to write a testcase for that
because it seems likely to require spending hours in the debugger trying
to trigger the right code.
This means that the only test that fails prior to the patch is
dynamic-offset-vrl-001.html, which exercises case (2), and also happens
to be the most similar to problem in clearance-calculations-vrl-008.xht.
This patch also makes the tests stricter so that we do optimize away
resizes in some cases where we're able to do so, such as
'left: 100px; right: auto' in RTL. (Or, rather, we would if it weren't
for the IsIResize() in ShouldReflowAllKids().)
MozReview-Commit-ID: 8xm1AHC21oh
--HG--
extra : transplant_source : %06%B4%40%EB%A9%C8M%F3%99%80%A9%DE%1F%1E%90%D3%F1%04W.
2017-03-16 19:39:19 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Since we store coordinates relative to top and left, the position
|
|
|
|
// of a frame depends on that of its container if it is fixed relative
|
|
|
|
// to the right or bottom, or if it is positioned using percentages
|
|
|
|
// relative to the left or top. Because of the dependency on the
|
|
|
|
// sides (left and top) that we use to store coordinates, these tests
|
|
|
|
// are easier to do using physical coordinates rather than logical.
|
|
|
|
if (aCBWidthChanged) {
|
|
|
|
if (!IsFixedOffset(pos->mOffset.GetLeft())) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
// Note that even if 'left' is a length, our position can still
|
|
|
|
// depend on the containing block width, because if our direction or
|
|
|
|
// writing-mode moves from right to left (in either block or inline
|
|
|
|
// progression) and 'right' is not 'auto', 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.
|
|
|
|
if ((wm.GetInlineDir() == WritingMode::eInlineRTL ||
|
|
|
|
wm.GetBlockDir() == WritingMode::eBlockRL) &&
|
|
|
|
pos->mOffset.GetRightUnit() != eStyleUnit_Auto) {
|
2011-10-17 18:59:28 +04:00
|
|
|
return true;
|
2004-11-14 23:22:58 +03:00
|
|
|
}
|
|
|
|
}
|
Bug 1347759 - Fix conditions under which we reflow absolutely positioned element due to size change of its container for everything other than horizontal LTR. r=jfkthame
I found this problem because I was debugging the failure of
layout/reftests/w3c-css/received/css-writing-modes-3/clearance-calculations-vrl-008.xht
with my patch for bug 1308876. It was failing because the red reference
box that was intended to be covered up was being mispositioned leftwards
by the width of the scrollbar, since we were not reflowing it when we
decided that the viewport did not need scrollbars. This patch fixes
that failure.
This led me to this bug, where
nsAbsoluteContainingBlock::FrameDependsOnContainer was incorrectly
testing conditions for when the values of 'top', 'right', 'bottom', and
'left' require reflow due to changes in the size of the containing
block.
The old code is incorrect in a number of cases, such as:
1. in RTL, with 'right: 100px', it will say that the frame does not
depend on its container's width since 'right' (offset-inline-start)
is a fixed offset and 'left' is 'auto'. However, since the
positioning is relative to the right edge, a change in container size
does require that the absolutely positioned element be repositioned
relative to the container's left edge.
2. In vertical-rl, again with 'right: 100px', it will make the same
mistake, since 'right' (now offset-block-start) is a fixed offset.
This is the case from the test I was debugging.
3. In vertical-rl with rtl direction and 'bottom: 100px', we will make
the same mistake because 'bottom' (inline-start) is fixed and 'top'
is 'auto', and we use 'bottom' rather than 'top'.
However, in cases (1) and (3) we actually avoid hitting the bug in these
simple-ish cases because ReflowInput::ShouldReflowAllKids() returns true
whenever IsIResize() is true, which means that
nsAbsoluteContainingBlock::Reflow doesn't even call
FrameDependsOnContainer. However, FrameDependsOnContainer should still
do the right thing because it's needed for
nsAbsoluteContainingBlock::MarkSizeDependentFramesDirty, which is only
used (from nsBlockFrame) when we reflow again for clearance or for
interruptible reflow. I haven't attempted to write a testcase for that
because it seems likely to require spending hours in the debugger trying
to trigger the right code.
This means that the only test that fails prior to the patch is
dynamic-offset-vrl-001.html, which exercises case (2), and also happens
to be the most similar to problem in clearance-calculations-vrl-008.xht.
This patch also makes the tests stricter so that we do optimize away
resizes in some cases where we're able to do so, such as
'left: 100px; right: auto' in RTL. (Or, rather, we would if it weren't
for the IsIResize() in ShouldReflowAllKids().)
MozReview-Commit-ID: 8xm1AHC21oh
--HG--
extra : transplant_source : %06%B4%40%EB%A9%C8M%F3%99%80%A9%DE%1F%1E%90%D3%F1%04W.
2017-03-16 19:39:19 +03:00
|
|
|
if (aCBHeightChanged) {
|
|
|
|
if (!IsFixedOffset(pos->mOffset.GetTop())) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
// See comment above for width changes.
|
|
|
|
if (wm.GetInlineDir() == WritingMode::eInlineBTT &&
|
|
|
|
pos->mOffset.GetBottomUnit() != eStyleUnit_Auto) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-10-17 18:59:28 +04:00
|
|
|
return false;
|
2004-11-14 23:22:58 +03:00
|
|
|
}
|
|
|
|
|
1999-07-24 06:37:45 +04:00
|
|
|
void
|
2009-12-24 08:21:15 +03:00
|
|
|
nsAbsoluteContainingBlock::DestroyFrames(nsIFrame* aDelegatingFrame,
|
2017-11-07 03:20:33 +03:00
|
|
|
nsIFrame* aDestructRoot,
|
|
|
|
PostDestroyData& aPostDestroyData)
|
1999-07-24 06:37:45 +04:00
|
|
|
{
|
2017-11-07 03:20:33 +03:00
|
|
|
mAbsoluteFrames.DestroyFramesFrom(aDestructRoot, aPostDestroyData);
|
1999-07-24 06:37:45 +04:00
|
|
|
}
|
|
|
|
|
2008-10-16 00:30:42 +04:00
|
|
|
void
|
|
|
|
nsAbsoluteContainingBlock::MarkSizeDependentFramesDirty()
|
2009-04-22 03:53:52 +04:00
|
|
|
{
|
2011-10-17 18:59:28 +04:00
|
|
|
DoMarkFramesDirty(false);
|
2009-04-22 03:53:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsAbsoluteContainingBlock::MarkAllFramesDirty()
|
|
|
|
{
|
2011-10-17 18:59:28 +04:00
|
|
|
DoMarkFramesDirty(true);
|
2009-04-22 03:53:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2011-09-29 10:19:26 +04:00
|
|
|
nsAbsoluteContainingBlock::DoMarkFramesDirty(bool aMarkAllDirty)
|
2008-10-16 00:30:42 +04:00
|
|
|
{
|
2015-06-29 23:02:21 +03:00
|
|
|
for (nsIFrame* kidFrame : mAbsoluteFrames) {
|
2009-04-22 03:53:52 +04:00
|
|
|
if (aMarkAllDirty) {
|
|
|
|
kidFrame->AddStateBits(NS_FRAME_IS_DIRTY);
|
2011-10-17 18:59:28 +04:00
|
|
|
} else if (FrameDependsOnContainer(kidFrame, true, 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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-31 22:29:49 +03:00
|
|
|
// Given an out-of-flow frame, this method returns the parent frame of its
|
|
|
|
// placeholder frame or null if it doesn't have a placeholder for some reason.
|
2016-10-31 18:58:18 +03:00
|
|
|
static nsContainerFrame*
|
2017-05-31 22:29:49 +03:00
|
|
|
GetPlaceholderContainer(nsIFrame* aPositionedFrame)
|
2016-10-31 18:58:18 +03:00
|
|
|
{
|
2017-05-31 22:29:49 +03:00
|
|
|
nsIFrame* placeholder = aPositionedFrame->GetPlaceholderFrame();
|
2017-05-31 22:29:49 +03:00
|
|
|
return placeholder ? placeholder->GetParent() : nullptr;
|
2016-10-31 18:58:18 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function returns the offset of an abs/fixed-pos child's static
|
|
|
|
* position, with respect to the "start" corner of its alignment container,
|
|
|
|
* according to CSS Box Alignment. This function only operates in a single
|
|
|
|
* axis at a time -- callers can choose which axis via the |aAbsPosCBAxis|
|
|
|
|
* parameter.
|
|
|
|
*
|
|
|
|
* @param aKidReflowInput The ReflowInput for the to-be-aligned abspos child.
|
|
|
|
* @param aKidSizeInAbsPosCBWM The child frame's size (after it's been given
|
2016-11-09 03:30:00 +03:00
|
|
|
* the opportunity to reflow), in terms of
|
|
|
|
* aAbsPosCBWM.
|
|
|
|
* @param aAbsPosCBSize The abspos CB size, in terms of aAbsPosCBWM.
|
2016-10-31 18:58:18 +03:00
|
|
|
* @param aPlaceholderContainer The parent of the child frame's corresponding
|
|
|
|
* placeholder frame, cast to a nsContainerFrame.
|
|
|
|
* (This will help us choose which alignment enum
|
|
|
|
* we should use for the child.)
|
|
|
|
* @param aAbsPosCBWM The child frame's containing block's WritingMode.
|
|
|
|
* @param aAbsPosCBAxis The axis (of the containing block) that we should
|
|
|
|
* be doing this computation for.
|
|
|
|
*/
|
|
|
|
static nscoord
|
|
|
|
OffsetToAlignedStaticPos(const ReflowInput& aKidReflowInput,
|
|
|
|
const LogicalSize& aKidSizeInAbsPosCBWM,
|
2016-11-09 03:30:00 +03:00
|
|
|
const LogicalSize& aAbsPosCBSize,
|
2016-10-31 18:58:18 +03:00
|
|
|
nsContainerFrame* aPlaceholderContainer,
|
|
|
|
WritingMode aAbsPosCBWM,
|
|
|
|
LogicalAxis aAbsPosCBAxis)
|
|
|
|
{
|
|
|
|
if (!aPlaceholderContainer) {
|
|
|
|
// (The placeholder container should be the thing that kicks this whole
|
|
|
|
// process off, by setting PLACEHOLDER_STATICPOS_NEEDS_CSSALIGN. So it
|
|
|
|
// should exist... but bail gracefully if it doesn't.)
|
|
|
|
NS_ERROR("Missing placeholder-container when computing a "
|
|
|
|
"CSS Box Alignment static position");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// (Most of this function is simply preparing args that we'll pass to
|
|
|
|
// AlignJustifySelf at the end.)
|
|
|
|
|
|
|
|
// NOTE: Our alignment container is aPlaceholderContainer's content-box
|
|
|
|
// (or an area within it, if aPlaceholderContainer is a grid). So, we'll
|
|
|
|
// perform most of our arithmetic/alignment in aPlaceholderContainer's
|
|
|
|
// WritingMode. For brevity, we use the abbreviation "pc" for "placeholder
|
|
|
|
// container" in variables below.
|
|
|
|
WritingMode pcWM = aPlaceholderContainer->GetWritingMode();
|
|
|
|
|
|
|
|
// Find what axis aAbsPosCBAxis corresponds to, in placeholder's parent's
|
|
|
|
// writing-mode.
|
|
|
|
LogicalAxis pcAxis = (pcWM.IsOrthogonalTo(aAbsPosCBWM)
|
|
|
|
? GetOrthogonalAxis(aAbsPosCBAxis)
|
|
|
|
: aAbsPosCBAxis);
|
|
|
|
|
2017-05-01 20:32:52 +03:00
|
|
|
LayoutFrameType parentType = aPlaceholderContainer->Type();
|
2016-10-31 18:58:18 +03:00
|
|
|
LogicalSize alignAreaSize(pcWM);
|
2017-05-01 20:32:52 +03:00
|
|
|
if (parentType == LayoutFrameType::FlexContainer) {
|
2016-11-09 03:30:00 +03:00
|
|
|
// The alignment container is the flex container's content box:
|
2016-10-31 18:58:18 +03:00
|
|
|
alignAreaSize = aPlaceholderContainer->GetLogicalSize(pcWM);
|
|
|
|
LogicalMargin pcBorderPadding =
|
|
|
|
aPlaceholderContainer->GetLogicalUsedBorderAndPadding(pcWM);
|
|
|
|
alignAreaSize -= pcBorderPadding.Size(pcWM);
|
2017-05-01 20:32:52 +03:00
|
|
|
} else if (parentType == LayoutFrameType::GridContainer) {
|
2016-11-09 03:30:00 +03:00
|
|
|
// This abspos elem's parent is a grid container. Per CSS Grid 10.1 & 10.2:
|
|
|
|
// - If the grid container *also* generates the abspos containing block (a
|
|
|
|
// grid area) for this abspos child, we use that abspos containing block as
|
|
|
|
// the alignment container, too. (And its size is aAbsPosCBSize.)
|
|
|
|
// - Otherwise, we use the grid's padding box as the alignment container.
|
|
|
|
// https://drafts.csswg.org/css-grid/#static-position
|
|
|
|
if (aPlaceholderContainer == aKidReflowInput.mCBReflowInput->mFrame) {
|
|
|
|
// The alignment container is the grid area that we're using as the
|
|
|
|
// absolute containing block.
|
|
|
|
alignAreaSize = aAbsPosCBSize.ConvertTo(pcWM, aAbsPosCBWM);
|
|
|
|
} else {
|
|
|
|
// The alignment container is a the grid container's padding box (which
|
|
|
|
// we can get by subtracting away its border from frame's size):
|
|
|
|
alignAreaSize = aPlaceholderContainer->GetLogicalSize(pcWM);
|
|
|
|
LogicalMargin pcBorder =
|
|
|
|
aPlaceholderContainer->GetLogicalUsedBorder(pcWM);
|
|
|
|
alignAreaSize -= pcBorder.Size(pcWM);
|
|
|
|
}
|
2016-10-31 18:58:18 +03:00
|
|
|
} else {
|
|
|
|
NS_ERROR("Unsupported container for abpsos CSS Box Alignment");
|
|
|
|
return 0; // (leave the child at the start of its alignment container)
|
|
|
|
}
|
|
|
|
|
|
|
|
nscoord alignAreaSizeInAxis = (pcAxis == eLogicalAxisInline)
|
|
|
|
? alignAreaSize.ISize(pcWM)
|
|
|
|
: alignAreaSize.BSize(pcWM);
|
|
|
|
|
2016-10-31 18:59:40 +03:00
|
|
|
AlignJustifyFlags flags = AlignJustifyFlags::eIgnoreAutoMargins;
|
2016-10-31 18:58:18 +03:00
|
|
|
uint16_t alignConst =
|
|
|
|
aPlaceholderContainer->CSSAlignmentForAbsPosChild(aKidReflowInput, pcAxis);
|
2016-10-31 18:59:40 +03:00
|
|
|
// XXXdholbert: Handle <overflow-position> in bug 1311892 (by conditionally
|
|
|
|
// setting AlignJustifyFlags::eOverflowSafe in |flags|.) For now, we behave
|
|
|
|
// as if "unsafe" was the specified value (which is basically equivalent to
|
|
|
|
// the default behavior, when no value is specified -- though the default
|
|
|
|
// behavior also has some [at-risk] extra nuance about scroll containers...)
|
|
|
|
// For now we ignore & strip off <overflow-position> bits, until bug 1311892.
|
2016-10-31 18:58:18 +03:00
|
|
|
alignConst &= ~NS_STYLE_ALIGN_FLAG_BITS;
|
|
|
|
|
|
|
|
// Find out if placeholder-container & the OOF child have the same start-sides
|
|
|
|
// in the placeholder-container's pcAxis.
|
|
|
|
WritingMode kidWM = aKidReflowInput.GetWritingMode();
|
2016-10-31 18:59:40 +03:00
|
|
|
if (pcWM.ParallelAxisStartsOnSameSide(pcAxis, kidWM)) {
|
|
|
|
flags |= AlignJustifyFlags::eSameSide;
|
|
|
|
}
|
2016-10-31 18:58:18 +03:00
|
|
|
|
|
|
|
// (baselineAdjust is unused. CSSAlignmentForAbsPosChild() should've
|
2016-11-05 04:57:07 +03:00
|
|
|
// converted 'baseline'/'last baseline' enums to their fallback values.)
|
2016-10-31 18:58:18 +03:00
|
|
|
const nscoord baselineAdjust = nscoord(0);
|
|
|
|
|
|
|
|
// AlignJustifySelf operates in the kid's writing mode, so we need to
|
|
|
|
// represent the child's size and the desired axis in that writing mode:
|
|
|
|
LogicalSize kidSizeInOwnWM = aKidSizeInAbsPosCBWM.ConvertTo(kidWM,
|
|
|
|
aAbsPosCBWM);
|
|
|
|
LogicalAxis kidAxis = (kidWM.IsOrthogonalTo(aAbsPosCBWM)
|
|
|
|
? GetOrthogonalAxis(aAbsPosCBAxis)
|
|
|
|
: aAbsPosCBAxis);
|
|
|
|
|
|
|
|
nscoord offset =
|
2016-10-31 18:59:40 +03:00
|
|
|
CSSAlignUtils::AlignJustifySelf(alignConst, kidAxis, flags,
|
|
|
|
baselineAdjust, alignAreaSizeInAxis,
|
|
|
|
aKidReflowInput, kidSizeInOwnWM);
|
2016-10-31 18:58:18 +03:00
|
|
|
|
|
|
|
// "offset" is in terms of the CSS Box Alignment container (i.e. it's in
|
|
|
|
// terms of pcWM). But our return value needs to in terms of the containing
|
|
|
|
// block's writing mode, which might have the opposite directionality in the
|
|
|
|
// given axis. In that case, we just need to negate "offset" when returning,
|
|
|
|
// to make it have the right effect as an offset for coordinates in the
|
|
|
|
// containing block's writing mode.
|
|
|
|
if (!pcWM.ParallelAxisStartsOnSameSide(pcAxis, aAbsPosCBWM)) {
|
|
|
|
return -offset;
|
|
|
|
}
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2016-10-31 18:58:18 +03:00
|
|
|
void
|
|
|
|
nsAbsoluteContainingBlock::ResolveSizeDependentOffsets(
|
|
|
|
nsPresContext* aPresContext,
|
|
|
|
ReflowInput& aKidReflowInput,
|
|
|
|
const LogicalSize& aKidSize,
|
|
|
|
const LogicalMargin& aMargin,
|
|
|
|
LogicalMargin* aOffsets,
|
|
|
|
LogicalSize* aLogicalCBSize)
|
|
|
|
{
|
|
|
|
WritingMode wm = aKidReflowInput.GetWritingMode();
|
|
|
|
WritingMode outerWM = aKidReflowInput.mParentReflowInput->GetWritingMode();
|
|
|
|
|
2016-10-31 18:58:18 +03:00
|
|
|
// Now that we know the child's size, we resolve any sentinel values in its
|
|
|
|
// IStart/BStart offset coordinates that depend on that size.
|
|
|
|
// * NS_AUTOOFFSET indicates that the child's position in the given axis
|
|
|
|
// is determined by its end-wards offset property, combined with its size and
|
|
|
|
// available space. e.g.: "top: auto; height: auto; bottom: 50px"
|
|
|
|
// * m{I,B}OffsetsResolvedAfterSize indicate that the child is using its
|
|
|
|
// static position in that axis, *and* its static position is determined by
|
|
|
|
// the axis-appropriate css-align property (which may require the child's
|
|
|
|
// size, e.g. to center it within the parent).
|
2016-10-31 18:58:18 +03:00
|
|
|
if ((NS_AUTOOFFSET == aOffsets->IStart(outerWM)) ||
|
2016-10-31 18:58:18 +03:00
|
|
|
(NS_AUTOOFFSET == aOffsets->BStart(outerWM)) ||
|
|
|
|
aKidReflowInput.mFlags.mIOffsetsNeedCSSAlign ||
|
|
|
|
aKidReflowInput.mFlags.mBOffsetsNeedCSSAlign) {
|
2016-10-31 18:58:18 +03:00
|
|
|
if (-1 == aLogicalCBSize->ISize(wm)) {
|
|
|
|
// Get the containing block width/height
|
|
|
|
const ReflowInput* parentRI = aKidReflowInput.mParentReflowInput;
|
|
|
|
*aLogicalCBSize =
|
|
|
|
aKidReflowInput.ComputeContainingBlockRectangle(aPresContext,
|
|
|
|
parentRI);
|
|
|
|
}
|
|
|
|
|
2016-10-31 18:58:18 +03:00
|
|
|
const LogicalSize logicalCBSizeOuterWM = aLogicalCBSize->ConvertTo(outerWM,
|
|
|
|
wm);
|
|
|
|
|
|
|
|
// placeholderContainer is used in each of the m{I,B}OffsetsNeedCSSAlign
|
|
|
|
// clauses. We declare it at this scope so we can avoid having to look
|
|
|
|
// it up twice (and only look it up if it's needed).
|
|
|
|
nsContainerFrame* placeholderContainer = nullptr;
|
|
|
|
|
2016-10-31 18:58:18 +03:00
|
|
|
if (NS_AUTOOFFSET == aOffsets->IStart(outerWM)) {
|
|
|
|
NS_ASSERTION(NS_AUTOOFFSET != aOffsets->IEnd(outerWM),
|
|
|
|
"Can't solve for both start and end");
|
|
|
|
aOffsets->IStart(outerWM) =
|
2016-10-31 18:58:18 +03:00
|
|
|
logicalCBSizeOuterWM.ISize(outerWM) -
|
2016-10-31 18:58:18 +03:00
|
|
|
aOffsets->IEnd(outerWM) - aMargin.IStartEnd(outerWM) -
|
|
|
|
aKidSize.ISize(outerWM);
|
2016-10-31 18:58:18 +03:00
|
|
|
} else if (aKidReflowInput.mFlags.mIOffsetsNeedCSSAlign) {
|
2017-05-31 22:29:49 +03:00
|
|
|
placeholderContainer = GetPlaceholderContainer(aKidReflowInput.mFrame);
|
2016-10-31 18:58:18 +03:00
|
|
|
nscoord offset = OffsetToAlignedStaticPos(aKidReflowInput, aKidSize,
|
2016-11-09 03:30:00 +03:00
|
|
|
logicalCBSizeOuterWM,
|
2016-10-31 18:58:18 +03:00
|
|
|
placeholderContainer,
|
|
|
|
outerWM, eLogicalAxisInline);
|
|
|
|
// Shift IStart from its current position (at start corner of the
|
|
|
|
// alignment container) by the returned offset. And set IEnd to the
|
|
|
|
// distance between the kid's end edge to containing block's end edge.
|
|
|
|
aOffsets->IStart(outerWM) += offset;
|
|
|
|
aOffsets->IEnd(outerWM) =
|
|
|
|
logicalCBSizeOuterWM.ISize(outerWM) -
|
|
|
|
(aOffsets->IStart(outerWM) + aKidSize.ISize(outerWM));
|
2016-10-31 18:58:18 +03:00
|
|
|
}
|
2016-10-31 18:58:18 +03:00
|
|
|
|
2016-10-31 18:58:18 +03:00
|
|
|
if (NS_AUTOOFFSET == aOffsets->BStart(outerWM)) {
|
|
|
|
aOffsets->BStart(outerWM) =
|
2016-10-31 18:58:18 +03:00
|
|
|
logicalCBSizeOuterWM.BSize(outerWM) -
|
2016-10-31 18:58:18 +03:00
|
|
|
aOffsets->BEnd(outerWM) - aMargin.BStartEnd(outerWM) -
|
|
|
|
aKidSize.BSize(outerWM);
|
2016-10-31 18:58:18 +03:00
|
|
|
} else if (aKidReflowInput.mFlags.mBOffsetsNeedCSSAlign) {
|
|
|
|
if (!placeholderContainer) {
|
2017-05-31 22:29:49 +03:00
|
|
|
placeholderContainer = GetPlaceholderContainer(aKidReflowInput.mFrame);
|
2016-10-31 18:58:18 +03:00
|
|
|
}
|
|
|
|
nscoord offset = OffsetToAlignedStaticPos(aKidReflowInput, aKidSize,
|
2016-11-09 03:30:00 +03:00
|
|
|
logicalCBSizeOuterWM,
|
2016-10-31 18:58:18 +03:00
|
|
|
placeholderContainer,
|
|
|
|
outerWM, eLogicalAxisBlock);
|
|
|
|
// Shift BStart from its current position (at start corner of the
|
|
|
|
// alignment container) by the returned offset. And set BEnd to the
|
|
|
|
// distance between the kid's end edge to containing block's end edge.
|
|
|
|
aOffsets->BStart(outerWM) += offset;
|
|
|
|
aOffsets->BEnd(outerWM) =
|
|
|
|
logicalCBSizeOuterWM.BSize(outerWM) -
|
|
|
|
(aOffsets->BStart(outerWM) + aKidSize.BSize(outerWM));
|
2016-10-31 18:58:18 +03:00
|
|
|
}
|
|
|
|
aKidReflowInput.SetComputedLogicalOffsets(aOffsets->ConvertTo(wm, outerWM));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
2017-07-06 15:00:35 +03:00
|
|
|
// When bug 154892 is checked in, make sure that when
|
2013-04-01 19:26:01 +04:00
|
|
|
// mChildListID == kFixedList, the height is unconstrained.
|
2003-01-20 21:04:34 +03:00
|
|
|
// since we don't allow replicated frames to split.
|
|
|
|
|
2014-05-13 04:47:52 +04:00
|
|
|
void
|
1999-07-24 06:37:45 +04:00
|
|
|
nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegatingFrame,
|
2013-04-15 12:31:45 +04:00
|
|
|
nsPresContext* aPresContext,
|
2016-07-21 13:36:39 +03:00
|
|
|
const ReflowInput& aReflowInput,
|
2013-04-15 12:31:45 +04:00
|
|
|
const nsRect& aContainingBlock,
|
2015-12-23 01:03:16 +03:00
|
|
|
AbsPosReflowFlags aFlags,
|
1999-04-16 05:39:45 +04:00
|
|
|
nsIFrame* aKidFrame,
|
2007-07-16 22:55:24 +04:00
|
|
|
nsReflowStatus& aStatus,
|
2010-10-07 08:25:45 +04:00
|
|
|
nsOverflowAreas* aOverflowAreas)
|
1999-04-16 05:39:45 +04:00
|
|
|
{
|
2017-09-14 06:33:36 +03:00
|
|
|
MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!");
|
|
|
|
|
2002-11-16 13:41:10 +03:00
|
|
|
#ifdef DEBUG
|
|
|
|
if (nsBlockFrame::gNoisyReflow) {
|
|
|
|
nsFrame::IndentBy(stdout,nsBlockFrame::gNoiseIndent);
|
|
|
|
printf("abs pos ");
|
2016-01-05 08:20:00 +03:00
|
|
|
nsAutoString name;
|
|
|
|
aKidFrame->GetFrameName(name);
|
|
|
|
printf("%s ", NS_LossyConvertUTF16toASCII(name).get());
|
2002-11-16 13:41:10 +03:00
|
|
|
|
|
|
|
char width[16];
|
|
|
|
char height[16];
|
2016-07-21 13:36:39 +03:00
|
|
|
PrettyUC(aReflowInput.AvailableWidth(), width, 16);
|
|
|
|
PrettyUC(aReflowInput.AvailableHeight(), height, 16);
|
2002-11-16 13:41:10 +03:00
|
|
|
printf(" a=%s,%s ", width, height);
|
2016-07-21 13:36:39 +03:00
|
|
|
PrettyUC(aReflowInput.ComputedWidth(), width, 16);
|
|
|
|
PrettyUC(aReflowInput.ComputedHeight(), height, 16);
|
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
|
|
|
|
|
2014-07-24 12:28:46 +04:00
|
|
|
WritingMode wm = aKidFrame->GetWritingMode();
|
2015-06-04 13:43:02 +03:00
|
|
|
LogicalSize logicalCBSize(wm, aContainingBlock.Size());
|
|
|
|
nscoord availISize = logicalCBSize.ISize(wm);
|
2014-07-24 12:28:46 +04:00
|
|
|
if (availISize == -1) {
|
2016-07-21 13:36:39 +03:00
|
|
|
NS_ASSERTION(aReflowInput.ComputedSize(wm).ISize(wm) !=
|
2014-07-24 12:28:46 +04:00
|
|
|
NS_UNCONSTRAINEDSIZE,
|
|
|
|
"Must have a useful inline-size _somewhere_");
|
|
|
|
availISize =
|
2016-07-21 13:36:39 +03:00
|
|
|
aReflowInput.ComputedSizeWithPadding(wm).ISize(wm);
|
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
|
|
|
}
|
2012-10-10 09:00:05 +04:00
|
|
|
|
2015-12-23 01:03:16 +03:00
|
|
|
uint32_t rsFlags = 0;
|
|
|
|
if (aFlags & AbsPosReflowFlags::eIsGridContainerCB) {
|
|
|
|
// When a grid container generates the abs.pos. CB for a *child* then
|
2016-11-09 03:30:00 +03:00
|
|
|
// the static position is determined via CSS Box Alignment within the
|
|
|
|
// abs.pos. CB (a grid area, i.e. a piece of the grid). In this scenario,
|
|
|
|
// due to the multiple coordinate spaces in play, we use a convenience flag
|
|
|
|
// to simply have the child's ReflowInput give it a static position at its
|
|
|
|
// abs.pos. CB origin, and then we'll align & offset it from there.
|
2017-05-31 22:29:49 +03:00
|
|
|
nsIFrame* placeholder = aKidFrame->GetPlaceholderFrame();
|
2015-12-23 01:03:16 +03:00
|
|
|
if (placeholder && placeholder->GetParent() == aDelegatingFrame) {
|
2016-07-21 13:36:35 +03:00
|
|
|
rsFlags |= ReflowInput::STATIC_POS_IS_CB_ORIGIN;
|
2015-12-23 01:03:16 +03:00
|
|
|
}
|
|
|
|
}
|
2016-07-21 13:36:39 +03:00
|
|
|
ReflowInput kidReflowInput(aPresContext, aReflowInput, aKidFrame,
|
2014-07-24 12:28:46 +04:00
|
|
|
LogicalSize(wm, availISize,
|
|
|
|
NS_UNCONSTRAINEDSIZE),
|
2015-12-23 01:03:16 +03:00
|
|
|
&logicalCBSize, rsFlags);
|
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
|
|
|
|
2013-04-15 12:31:45 +04:00
|
|
|
// Get the border values
|
2016-07-21 13:36:39 +03:00
|
|
|
WritingMode outerWM = aReflowInput.GetWritingMode();
|
2017-08-07 21:31:00 +03:00
|
|
|
const LogicalMargin border(outerWM, aDelegatingFrame->GetUsedBorder());
|
|
|
|
|
2016-10-31 18:59:40 +03:00
|
|
|
LogicalMargin margin =
|
2016-07-21 13:36:39 +03:00
|
|
|
kidReflowInput.ComputedLogicalMargin().ConvertTo(outerWM, wm);
|
2016-10-31 18:59:40 +03:00
|
|
|
|
|
|
|
// If we're doing CSS Box Alignment in either axis, that will apply the
|
|
|
|
// margin for us in that axis (since the thing that's aligned is the margin
|
|
|
|
// box). So, we clear out the margin here to avoid applying it twice.
|
|
|
|
if (kidReflowInput.mFlags.mIOffsetsNeedCSSAlign) {
|
|
|
|
margin.IStart(outerWM) = margin.IEnd(outerWM) = 0;
|
|
|
|
}
|
|
|
|
if (kidReflowInput.mFlags.mBOffsetsNeedCSSAlign) {
|
|
|
|
margin.BStart(outerWM) = margin.BEnd(outerWM) = 0;
|
|
|
|
}
|
|
|
|
|
2016-07-21 13:36:39 +03:00
|
|
|
bool constrainBSize = (aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE)
|
2015-12-23 01:03:16 +03:00
|
|
|
&& (aFlags & AbsPosReflowFlags::eConstrainHeight)
|
2007-10-02 12:29:23 +04:00
|
|
|
// Don't split if told not to (e.g. for fixed frames)
|
2017-04-30 18:30:08 +03:00
|
|
|
&& !aDelegatingFrame->IsInlineFrame()
|
2007-10-02 09:57:45 +04:00
|
|
|
//XXX we don't handle splitting frames for inline absolute containing blocks yet
|
2015-07-16 12:07:57 +03:00
|
|
|
&& (aKidFrame->GetLogicalRect(aContainingBlock.Size()).BStart(wm) <=
|
2016-07-21 13:36:39 +03:00
|
|
|
aReflowInput.AvailableBSize());
|
2007-10-02 09:57:45 +04:00
|
|
|
// 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.
|
2015-06-05 10:47:09 +03:00
|
|
|
if (constrainBSize) {
|
2016-07-21 13:36:39 +03:00
|
|
|
kidReflowInput.AvailableBSize() =
|
|
|
|
aReflowInput.AvailableBSize() - border.ConvertTo(wm, outerWM).BStart(wm) -
|
|
|
|
kidReflowInput.ComputedLogicalMargin().BStart(wm);
|
|
|
|
if (NS_AUTOOFFSET != kidReflowInput.ComputedLogicalOffsets().BStart(wm)) {
|
|
|
|
kidReflowInput.AvailableBSize() -=
|
|
|
|
kidReflowInput.ComputedLogicalOffsets().BStart(wm);
|
2015-06-05 10:47:09 +03:00
|
|
|
}
|
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
|
2016-07-21 13:36:39 +03:00
|
|
|
ReflowOutput kidDesiredSize(kidReflowInput);
|
|
|
|
aKidFrame->Reflow(aPresContext, kidDesiredSize, kidReflowInput, aStatus);
|
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
|
|
|
|
2015-06-05 10:47:09 +03:00
|
|
|
const LogicalSize kidSize = kidDesiredSize.Size(wm).ConvertTo(outerWM, wm);
|
2013-04-15 12:31:45 +04:00
|
|
|
|
2015-06-05 10:47:09 +03:00
|
|
|
LogicalMargin offsets =
|
2016-07-21 13:36:39 +03:00
|
|
|
kidReflowInput.ComputedLogicalOffsets().ConvertTo(outerWM, wm);
|
2015-06-05 10:47:09 +03:00
|
|
|
|
|
|
|
// If we're solving for start in either inline or block direction,
|
|
|
|
// then compute it now that we know the dimensions.
|
2016-10-31 18:58:18 +03:00
|
|
|
ResolveSizeDependentOffsets(aPresContext, kidReflowInput, kidSize, margin,
|
|
|
|
&offsets, &logicalCBSize);
|
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
|
2015-06-05 10:47:09 +03:00
|
|
|
LogicalRect rect(outerWM,
|
|
|
|
border.IStart(outerWM) + offsets.IStart(outerWM) +
|
|
|
|
margin.IStart(outerWM),
|
|
|
|
border.BStart(outerWM) + offsets.BStart(outerWM) +
|
|
|
|
margin.BStart(outerWM),
|
|
|
|
kidSize.ISize(outerWM), kidSize.BSize(outerWM));
|
|
|
|
nsRect r =
|
2015-07-16 12:07:57 +03:00
|
|
|
rect.GetPhysicalRect(outerWM, logicalCBSize.GetPhysicalSize(wm) +
|
|
|
|
border.Size(outerWM).GetPhysicalSize(outerWM));
|
2013-04-15 12:31:45 +04:00
|
|
|
|
|
|
|
// Offset the frame rect by the given origin of the absolute containing block.
|
|
|
|
// If the frame is auto-positioned on both sides of an axis, it will be
|
2015-12-23 01:03:16 +03:00
|
|
|
// positioned based on its containing block and we don't need to offset
|
|
|
|
// (unless the caller demands it (the STATIC_POS_IS_CB_ORIGIN case)).
|
2013-04-15 12:31:45 +04:00
|
|
|
if (aContainingBlock.TopLeft() != nsPoint(0, 0)) {
|
2016-07-21 13:36:39 +03:00
|
|
|
const nsStyleSides& offsets = kidReflowInput.mStylePosition->mOffset;
|
2015-06-05 10:47:09 +03:00
|
|
|
if (!(offsets.GetLeftUnit() == eStyleUnit_Auto &&
|
2015-12-23 01:03:16 +03:00
|
|
|
offsets.GetRightUnit() == eStyleUnit_Auto) ||
|
2016-07-21 13:36:35 +03:00
|
|
|
(rsFlags & ReflowInput::STATIC_POS_IS_CB_ORIGIN)) {
|
2015-06-05 10:47:09 +03:00
|
|
|
r.x += aContainingBlock.x;
|
2013-04-15 12:31:45 +04:00
|
|
|
}
|
2015-06-05 10:47:09 +03:00
|
|
|
if (!(offsets.GetTopUnit() == eStyleUnit_Auto &&
|
2015-12-23 01:03:16 +03:00
|
|
|
offsets.GetBottomUnit() == eStyleUnit_Auto) ||
|
2016-07-21 13:36:35 +03:00
|
|
|
(rsFlags & ReflowInput::STATIC_POS_IS_CB_ORIGIN)) {
|
2015-06-05 10:47:09 +03:00
|
|
|
r.y += aContainingBlock.y;
|
2013-04-15 12:31:45 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-05 10:47:09 +03:00
|
|
|
aKidFrame->SetRect(r);
|
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
|
|
|
|
2013-01-03 17:23:11 +04:00
|
|
|
nsView* view = aKidFrame->GetView();
|
2007-05-02 04:07:51 +04:00
|
|
|
if (view) {
|
|
|
|
// Size and position the view and set its opacity, visibility, content
|
|
|
|
// transparency, and clip
|
2010-10-07 08:25:45 +04:00
|
|
|
nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, aKidFrame, view,
|
|
|
|
kidDesiredSize.VisualOverflow());
|
2007-05-02 04:07:51 +04:00
|
|
|
} else {
|
|
|
|
nsContainerFrame::PositionChildViews(aKidFrame);
|
|
|
|
}
|
2007-02-26 17:00:21 +03:00
|
|
|
|
2016-07-21 13:36:39 +03:00
|
|
|
aKidFrame->DidReflow(aPresContext, &kidReflowInput,
|
2015-06-05 10:47:09 +03:00
|
|
|
nsDidReflowStatus::FINISHED);
|
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
|
|
|
|
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 ");
|
2016-01-05 08:20:00 +03:00
|
|
|
nsAutoString name;
|
|
|
|
aKidFrame->GetFrameName(name);
|
|
|
|
printf("%s ", NS_LossyConvertUTF16toASCII(name).get());
|
2009-09-18 15:09:35 +04:00
|
|
|
printf("%p rect=%d,%d,%d,%d\n", static_cast<void*>(aKidFrame),
|
2015-06-05 10:47:09 +03:00
|
|
|
r.x, r.y, r.width, r.height);
|
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
|
|
|
}
|
2002-11-16 13:41:10 +03:00
|
|
|
#endif
|
2004-11-27 02:28:09 +03:00
|
|
|
|
2010-10-07 08:25:45 +04:00
|
|
|
if (aOverflowAreas) {
|
2015-06-05 10:47:09 +03:00
|
|
|
aOverflowAreas->UnionWith(kidDesiredSize.mOverflowAreas + r.TopLeft());
|
2010-10-07 08:25:45 +04:00
|
|
|
}
|
1999-04-16 05:39:45 +04:00
|
|
|
}
|