Bug 1896516 Part 6 - Remove nsIScrollableFrame usages in nsLayoutUtils. r=layout-reviewers,emilio

Convert `nsIScrollableFrame` to `ScrollContainerFrame` for all the APIs in
nsLayoutUtils, and then adapt other callers until everything compiles.

In `nsLayoutUtils::CalculateBasicFrameMetrics()`'s documentation,
s/ComputeFrameMetrics/ComputeScrollMetadata/ because the method was renamed in
https://hg.mozilla.org/mozilla-central/rev/cb2023f50288

Differential Revision: https://phabricator.services.mozilla.com/D211493
This commit is contained in:
Ting-Yu Lin
2024-05-30 06:32:20 +00:00
parent f59e487e79
commit 76523f97b1
24 changed files with 365 additions and 347 deletions

View File

@@ -9366,15 +9366,15 @@ void PresShell::EventHandler::GetCurrentItemAndPositionForElement(
if (!istree) {
extra = frame->GetSize().height;
if (checkLineHeight) {
nsIScrollableFrame* scrollFrame =
nsLayoutUtils::GetNearestScrollableFrame(
ScrollContainerFrame* scrollContainerFrame =
nsLayoutUtils::GetNearestScrollContainerFrame(
frame, nsLayoutUtils::SCROLLABLE_INCLUDE_HIDDEN |
nsLayoutUtils::SCROLLABLE_FIXEDPOS_FINDS_ROOT);
if (scrollFrame) {
nsSize scrollAmount = scrollFrame->GetLineScrollAmount();
nsIFrame* f = do_QueryFrame(scrollFrame);
if (scrollContainerFrame) {
nsSize scrollAmount = scrollContainerFrame->GetLineScrollAmount();
int32_t APD = presContext->AppUnitsPerDevPixel();
int32_t scrollAPD = f->PresContext()->AppUnitsPerDevPixel();
int32_t scrollAPD =
scrollContainerFrame->PresContext()->AppUnitsPerDevPixel();
scrollAmount = scrollAmount.ScaleToOtherAppUnits(scrollAPD, APD);
if (extra > scrollAmount.height) {
extra = scrollAmount.height;