зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1520584 part 2 - s/aReflowInput/aCBReflowInput/ for clarity. r=dholbert
This commit is contained in:
Родитель
07692ebbce
Коммит
d254f778b7
|
@ -1338,12 +1338,12 @@ static bool AreAllEarlierInFlowFramesEmpty(nsIFrame* aFrame,
|
|||
// containing block. The writing-mode of the hypothetical box position will
|
||||
// have the same block direction as the absolute containing block, but may
|
||||
// differ in inline-bidi direction.
|
||||
// In the code below, |aReflowInput->frame| is the absolute containing block,
|
||||
// In the code below, |aCBReflowInput->frame| is the absolute containing block,
|
||||
// while |containingBlock| is the nearest block container of the placeholder
|
||||
// frame, which may be different from the absolute containing block.
|
||||
void ReflowInput::CalculateHypotheticalPosition(
|
||||
nsPresContext* aPresContext, nsPlaceholderFrame* aPlaceholderFrame,
|
||||
const ReflowInput* aReflowInput, nsHypotheticalPosition& aHypotheticalPos,
|
||||
const ReflowInput* aCBReflowInput, nsHypotheticalPosition& aHypotheticalPos,
|
||||
LayoutFrameType aFrameType) const {
|
||||
NS_ASSERTION(mStyleDisplay->mOriginalDisplay != StyleDisplay::None,
|
||||
"mOriginalDisplay has not been properly initialized");
|
||||
|
@ -1353,7 +1353,7 @@ void ReflowInput::CalculateHypotheticalPosition(
|
|||
nscoord blockIStartContentEdge;
|
||||
// Dummy writing mode for blockContentSize, will be changed as needed by
|
||||
// GetHypotheticalBoxContainer.
|
||||
WritingMode cbwm = aReflowInput->GetWritingMode();
|
||||
WritingMode cbwm = aCBReflowInput->GetWritingMode();
|
||||
LogicalSize blockContentSize(cbwm);
|
||||
nsIFrame* containingBlock = GetHypotheticalBoxContainer(
|
||||
aPlaceholderFrame, blockIStartContentEdge, blockContentSize);
|
||||
|
@ -1425,7 +1425,7 @@ void ReflowInput::CalculateHypotheticalPosition(
|
|||
// relatively positioned...
|
||||
nsSize containerSize =
|
||||
containingBlock->GetStateBits() & NS_FRAME_IN_REFLOW
|
||||
? aReflowInput->ComputedSizeAsContainerIfConstrained()
|
||||
? aCBReflowInput->ComputedSizeAsContainerIfConstrained()
|
||||
: containingBlock->GetSize();
|
||||
LogicalPoint placeholderOffset(
|
||||
wm, aPlaceholderFrame->GetOffsetToIgnoringScrolling(containingBlock),
|
||||
|
@ -1540,9 +1540,9 @@ void ReflowInput::CalculateHypotheticalPosition(
|
|||
// placeholder. Convert to the coordinate space of the absolute containing
|
||||
// block.
|
||||
nsPoint cbOffset =
|
||||
containingBlock->GetOffsetToIgnoringScrolling(aReflowInput->mFrame);
|
||||
containingBlock->GetOffsetToIgnoringScrolling(aCBReflowInput->mFrame);
|
||||
|
||||
nsSize reflowSize = aReflowInput->ComputedSizeAsContainerIfConstrained();
|
||||
nsSize reflowSize = aCBReflowInput->ComputedSizeAsContainerIfConstrained();
|
||||
LogicalPoint logCBOffs(wm, cbOffset, reflowSize - containerSize);
|
||||
aHypotheticalPos.mIStart += logCBOffs.I(wm);
|
||||
aHypotheticalPos.mBStart += logCBOffs.B(wm);
|
||||
|
@ -1550,9 +1550,9 @@ void ReflowInput::CalculateHypotheticalPosition(
|
|||
// The specified offsets are relative to the absolute containing block's
|
||||
// padding edge and our current values are relative to the border edge, so
|
||||
// translate.
|
||||
LogicalMargin border = aReflowInput->ComputedLogicalBorderPadding() -
|
||||
aReflowInput->ComputedLogicalPadding();
|
||||
border = border.ConvertTo(wm, aReflowInput->GetWritingMode());
|
||||
LogicalMargin border = aCBReflowInput->ComputedLogicalBorderPadding() -
|
||||
aCBReflowInput->ComputedLogicalPadding();
|
||||
border = border.ConvertTo(wm, aCBReflowInput->GetWritingMode());
|
||||
aHypotheticalPos.mIStart -= border.IStart(wm);
|
||||
aHypotheticalPos.mBStart -= border.BStart(wm);
|
||||
|
||||
|
@ -1618,11 +1618,11 @@ void ReflowInput::CalculateHypotheticalPosition(
|
|||
}
|
||||
|
||||
void ReflowInput::InitAbsoluteConstraints(nsPresContext* aPresContext,
|
||||
const ReflowInput* aReflowInput,
|
||||
const ReflowInput* aCBReflowInput,
|
||||
const LogicalSize& aCBSize,
|
||||
LayoutFrameType aFrameType) {
|
||||
WritingMode wm = GetWritingMode();
|
||||
WritingMode cbwm = aReflowInput->GetWritingMode();
|
||||
WritingMode cbwm = aCBReflowInput->GetWritingMode();
|
||||
NS_WARNING_ASSERTION(aCBSize.BSize(cbwm) != NS_AUTOHEIGHT,
|
||||
"containing block bsize must be constrained");
|
||||
|
||||
|
@ -1666,8 +1666,9 @@ void ReflowInput::InitAbsoluteConstraints(nsPresContext* aPresContext,
|
|||
} else {
|
||||
// XXXmats all this is broken for orthogonal writing-modes: bug 1521988.
|
||||
CalculateHypotheticalPosition(aPresContext, placeholderFrame,
|
||||
aReflowInput, hypotheticalPos, aFrameType);
|
||||
if (aReflowInput->mFrame->IsGridContainerFrame()) {
|
||||
aCBReflowInput, hypotheticalPos,
|
||||
aFrameType);
|
||||
if (aCBReflowInput->mFrame->IsGridContainerFrame()) {
|
||||
// 'hypotheticalPos' is relative to the padding rect of the CB *frame*.
|
||||
// In grid layout the CB is the grid area rectangle, so we translate
|
||||
// 'hypotheticalPos' to be relative that rectangle here.
|
||||
|
@ -1677,8 +1678,8 @@ void ReflowInput::InitAbsoluteConstraints(nsPresContext* aPresContext,
|
|||
if (cbwm.IsBidiLTR()) {
|
||||
left = cb.X();
|
||||
} else {
|
||||
right = aReflowInput->ComputedWidth() +
|
||||
aReflowInput->ComputedPhysicalPadding().LeftRight() -
|
||||
right = aCBReflowInput->ComputedWidth() +
|
||||
aCBReflowInput->ComputedPhysicalPadding().LeftRight() -
|
||||
cb.XMost();
|
||||
}
|
||||
LogicalMargin offsets(cbwm, nsMargin(cb.Y(), right, nscoord(0), left));
|
||||
|
|
|
@ -1002,15 +1002,15 @@ struct ReflowInput : public SizeComputationInput {
|
|||
// (for a position:fixed/absolute element) would have been placed if it were
|
||||
// positioned statically. The hypothetical box position will have a writing
|
||||
// mode with the same block direction as the absolute containing block
|
||||
// (aReflowInput->frame), though it may differ in inline direction.
|
||||
// (aCBReflowInput->frame), though it may differ in inline direction.
|
||||
void CalculateHypotheticalPosition(nsPresContext* aPresContext,
|
||||
nsPlaceholderFrame* aPlaceholderFrame,
|
||||
const ReflowInput* aReflowInput,
|
||||
const ReflowInput* aCBReflowInput,
|
||||
nsHypotheticalPosition& aHypotheticalPos,
|
||||
mozilla::LayoutFrameType aFrameType) const;
|
||||
|
||||
void InitAbsoluteConstraints(nsPresContext* aPresContext,
|
||||
const ReflowInput* aReflowInput,
|
||||
const ReflowInput* aCBReflowInput,
|
||||
const mozilla::LogicalSize& aContainingBlockSize,
|
||||
mozilla::LayoutFrameType aFrameType);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче