Bug 1762873 - Don't incorrectly add scrollbar size to select intrinsic size. r=jfkthame

In bug 1744009[1] I changed some code that looked like:

  * Get the dropdown frame intrinsic size.
  * If there's overlay scrollbars, add the non-overlay scrollbar size.

That code came from bug 869314. I misread the "if there's overlay
scrollbars" bit.

There's no need to explicitly add the scrollbar width to the intrinsic
size anymore. The dropdown frame no longer exists, and the button size
is split out from the scrollbar size nowadays. There's no reason
to artificially add any size to the content frame.

[1]: https://hg.mozilla.org/integration/autoland/rev/78130d73ca75#l24.652

Differential Revision: https://phabricator.services.mozilla.com/D142834
This commit is contained in:
Emilio Cobos Álvarez 2022-04-04 16:28:28 +00:00
Родитель 6526a2f222
Коммит 524448eb15
3 изменённых файлов: 4 добавлений и 7 удалений

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

@ -357,14 +357,8 @@ nscoord nsComboboxControlFrame::GetIntrinsicISize(gfxContext* aRenderingContext,
displayISize += maxOptionSize;
}
// Add room for the dropmarker button (if there is one) and scrollbar on the
// popup.
// Add room for the dropmarker button (if there is one).
displayISize += DropDownButtonISize();
nsPresContext* pc = PresContext();
if (!pc->UseOverlayScrollbars()) {
displayISize += nsIScrollableFrame::GetNondisappearingScrollbarWidth(
pc, GetWritingMode());
}
return displayISize;
}

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

@ -0,0 +1,2 @@
<!doctype html>
<select><option>ABC</option></select>

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

@ -20,3 +20,4 @@ skip-if(Android) == select-option-display-none-inline-size.html select-option-di
skip-if(Android||winWidget) == themed-select-padding-no-clip.html themed-select-padding-no-clip-ref.html
== select-scrollbar-width.html select-scrollbar-width-ref.html
test-pref(ui.useOverlayScrollbars,0) ref-pref(ui.useOverlayScrollbars,1) == intrinsic-size-scrollbar.html intrinsic-size-scrollbar.html