Bug 1719555 Part 4 - Remove unused code subtracting block and padding from block-size for nsComboboxDisplayFrame. r=emilio
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 08 Jul 2021 17:58:43 +0000
changeset 585132 cf5570dac55e3cc41ded7df710ef4de80c473680
parent 585131 6471338e204480fa6f290e5e1c8db363fbdb3174
child 585133 11a9c2dc6854e422dea066a57f089505e8f107b5
push id146025
push useraethanyc@gmail.com
push dateThu, 08 Jul 2021 18:02:40 +0000
treeherderautoland@cf5570dac55e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1719555, 1571764, 1560824
milestone91.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1719555 Part 4 - Remove unused code subtracting block and padding from block-size for nsComboboxDisplayFrame. r=emilio This patch removed the unused code which introduced by Bug 1571764 because Bug 1560824 moves the `padding-block` style to <select>'s UA rule, so now `nsComboboxDisplayFrame` doesn't have any padding in the block axis. Differential Revision: https://phabricator.services.mozilla.com/D119342
layout/forms/nsComboboxControlFrame.cpp
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -1246,36 +1246,31 @@ NS_IMPL_FRAMEARENA_HELPERS(nsComboboxDis
 
 void nsComboboxDisplayFrame::Reflow(nsPresContext* aPresContext,
                                     ReflowOutput& aDesiredSize,
                                     const ReflowInput& aReflowInput,
                                     nsReflowStatus& aStatus) {
   MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!");
 
   ReflowInput state(aReflowInput);
-  WritingMode wm = aReflowInput.GetWritingMode();
-  LogicalMargin bp = state.ComputedLogicalBorderPadding(wm);
   if (state.ComputedBSize() == NS_UNCONSTRAINEDSIZE) {
     float inflation = nsLayoutUtils::FontSizeInflationFor(mComboBox);
     // We intentionally use the combobox frame's style here, which has
     // the 'line-height' specified by the author, if any.
     // (This frame has 'line-height: -moz-block-height' in the UA
     // sheet which is suitable when there's a specified block-size.)
     nscoord lh = ReflowInput::CalcLineHeight(mComboBox->GetContent(),
                                              mComboBox->Style(), aPresContext,
                                              NS_UNCONSTRAINEDSIZE, inflation);
-    if (!mComboBox->StyleText()->mLineHeight.IsNormal()) {
-      // If the author specified a different line-height than normal, or a
-      // different appearance, subtract the border-padding from the
-      // comboboxdisplay frame, so as to respect that line-height rather than
-      // that line-height + 2px (from the UA sheet).
-      lh = std::max(0, lh - bp.BStartEnd(wm));
-    }
     state.SetComputedBSize(lh);
   }
+  const WritingMode wm = aReflowInput.GetWritingMode();
+  const LogicalMargin bp = state.ComputedLogicalBorderPadding(wm);
+  MOZ_ASSERT(bp.BStartEnd(wm) == 0,
+             "We shouldn't have border and padding in the block axis in UA!");
   nscoord inlineBp = bp.IStartEnd(wm);
   nscoord computedISize = mComboBox->mDisplayISize - inlineBp;
 
   // Other UAs ignore padding in some (but not all) platforms for (themed only)
   // comboboxes. Instead of doing that, we prevent that padding if present from
   // clipping the display text, by enforcing the display text minimum size in
   // that situation.
   const bool shouldHonorMinISize =