diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index 459c6f7ecc..2d0395d7a1 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -1322,7 +1322,8 @@ nsComboboxDisplayFrame::Reflow(nsPresContext* aPresContext, // Note that the only way we can have a computed block size here is // if the combobox had a specified block size. If it didn't, size // based on what our rows look like, for lack of anything better. - state.SetComputedBSize(mComboBox->mListControlFrame->GetBSizeOfARow()); + //state.SetComputedBSize(mComboBox->mListControlFrame->GetBSizeOfARow()); + state.SetLineHeight(state.mParentReflowInput->GetLineHeight()); } WritingMode wm = aReflowInput.GetWritingMode(); nscoord computedISize = mComboBox->mDisplayISize - diff --git a/layout/forms/test/test_issue1970_manual.html b/layout/forms/test/test_issue1970_manual.html new file mode 100644 index 0000000000..b902ea86d0 --- /dev/null +++ b/layout/forms/test/test_issue1970_manual.html @@ -0,0 +1,35 @@ + + +
+ + + + +No clipping of the font glyphs should occur.
+ + + + + + + \ No newline at end of file diff --git a/layout/generic/ReflowInput.cpp b/layout/generic/ReflowInput.cpp index 8a295f4958..d76287de57 100644 --- a/layout/generic/ReflowInput.cpp +++ b/layout/generic/ReflowInput.cpp @@ -2817,6 +2817,17 @@ nscoord ReflowInput::GetLineHeight() const { nsLayoutUtils::FontSizeInflationFor(mFrame)); } +void ReflowInput::SetLineHeight(nscoord aLineHeight) { + MOZ_ASSERT(aLineHeight >= 0, "aLineHeight must be >= 0!"); + + if (mLineHeight != aLineHeight) { + mLineHeight = aLineHeight; + // Setting used line height can change a frame's block-size if mFrame's + // block-size behaves as auto. + InitResizeFlags(mFrame->PresContext(), mFrame->GetType()); + } +} + /* static */ nscoord ReflowInput::CalcLineHeight(nsIContent* aContent, nsStyleContext* aStyleContext, diff --git a/layout/generic/ReflowInput.h b/layout/generic/ReflowInput.h index d8e0518399..a70549d8eb 100644 --- a/layout/generic/ReflowInput.h +++ b/layout/generic/ReflowInput.h @@ -747,6 +747,11 @@ public: * Get the used line-height property. The return value will be >= 0. */ nscoord GetLineHeight() const; + + /** + * Set the used line-height. aLineHeight must be >= 0. + */ + void SetLineHeight(nscoord aLineHeight); /** * Calculate the used line-height property without a reflow input instance.