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, kidReflowState(aPresContext, aReflowState, kidFrame,
aReflowState.AvailableSize(kidFrame->GetWritingMode())); aReflowState.AvailableSize(kidFrame->GetWritingMode()));
if (aReflowState.IsBResize() && if (aReflowState.IsBResizeForWM(kidReflowState.GetWritingMode()) &&
(kidFrame->GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE)) { (kidFrame->GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE)) {
// Tell our kid it's being block-dir resized too. Bit of a // Tell our kid it's being block-dir resized too. Bit of a
// hack for framesets. // hack for framesets.

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

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

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

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

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

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