Bug 1272997 - followup 1 - Check for orthogonal writing modes when propagating (logical) resize flags from parent to child. r=dholbert

This commit is contained in:
Jonathan Kew 2016-05-18 21:07:54 +01:00
Родитель 8883bbb6a6
Коммит bfdda7ee51
4 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -624,7 +624,7 @@ nsCanvasFrame::Reflow(nsPresContext* aPresContext,
kidReflowState(aPresContext, aReflowState, kidFrame,
aReflowState.AvailableSize(kidFrame->GetWritingMode()));
if (aReflowState.IsBResize() &&
if (aReflowState.IsBResizeForWM(kidReflowState.GetWritingMode()) &&
(kidFrame->GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE)) {
// Tell our kid it's being block-dir resized too. Bit of a
// hack for framesets.

Просмотреть файл

@ -522,7 +522,7 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowState* aState,
kidReflowState.SetComputedBSize(computedBSize);
kidReflowState.ComputedMinBSize() = computedMinBSize;
kidReflowState.ComputedMaxBSize() = computedMaxBSize;
if (aState->mReflowState.IsBResize()) {
if (aState->mReflowState.IsBResizeForWM(kidReflowState.GetWritingMode())) {
kidReflowState.SetBResize(true);
}

Просмотреть файл

@ -645,7 +645,7 @@ nsHTMLReflowState::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameT
// as containing block for absolutely positioned elements?
// Possibly; in that case we should at least be checking
// NS_SUBTREE_DIRTY, I'd think.
SetBResize(mCBReflowState->IsBResize());
SetBResize(mCBReflowState->IsBResizeForWM(wm));
} else if (mCBReflowState && !nsLayoutUtils::GetAsBlock(frame)) {
// Some non-block frames (e.g. table frames) aggressively optimize out their
// BSize recomputation when they don't have the BResize flag set. This
@ -665,14 +665,14 @@ nsHTMLReflowState::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameT
// Note that we _also_ need to set the BResize flag if we have auto
// ComputedBSize() and a dirty subtree, since that might require us to
// change BSize due to kids having been added or removed.
SetBResize(mCBReflowState->IsBResize());
SetBResize(mCBReflowState->IsBResizeForWM(wm));
if (ComputedBSize() == NS_AUTOHEIGHT) {
SetBResize(IsBResize() || NS_SUBTREE_DIRTY(frame));
}
} else if (ComputedBSize() == NS_AUTOHEIGHT) {
if (eCompatibility_NavQuirks == aPresContext->CompatibilityMode() &&
mCBReflowState) {
SetBResize(mCBReflowState->IsBResize());
SetBResize(mCBReflowState->IsBResizeForWM(wm));
} else {
SetBResize(IsIResize());
}

Просмотреть файл

@ -603,6 +603,9 @@ public:
bool IsBResize() const {
return mWritingMode.IsVertical() ? mFlags.mIsHResize : mFlags.mIsVResize;
}
bool IsBResizeForWM(mozilla::WritingMode aWM) const {
return aWM.IsVertical() ? mFlags.mIsHResize : mFlags.mIsVResize;
}
void SetHResize(bool aValue) {
mFlags.mIsHResize = aValue;
}