Closed Bug 1631568 Opened 5 years ago Closed 5 years ago

Improve the interface of nsLayoutUtils::GetFrameForPoint and fix callers that pass in an incorrect viewport type

Categories

(Core :: Panning and Zooming, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox75 --- unaffected
firefox76 --- unaffected
firefox77 --- unaffected
firefox78 --- fixed

People

(Reporter: botond, Assigned: botond)

References

Details

(Whiteboard: [apz:dtz:10:S])

Attachments

(2 files)

In bug 1556556, we added a new FrameForPointOption for nsLayoutUtils::GetFrameForPoint(), named IsRelativeToLayoutViewport.

Later in the patch series we introduce a RelativeTo structure which groups a frame with a viewport type that can be either layout or visual.

We can clean this up a bit by having GetFrameForPoint take a RelativeTo parameter, and replacing the IsRelativeToLayoutViewport flag with the use of ViewportType::Layout in that parameter.

Going through the call sites of this function has also turned up call sites that were passing in the incorrect viewport type, so this change may fix some correctness issues as well.

Type: task → defect
Summary: Improve the interface of nsLayoutUtils::GetFrameForPoint → Improve the interface of nsLayoutUtils::GetFrameForPoint and fix callers that pass in an incorrect viewport type

This allows headers which nsLayoutUtils.h includes to use these types without
creating a circular dependency.

As part of this change, the types are also moved into namespace mozilla.

This removes the need for FrameForPointOptions::IsRelativeToLayoutViewport,
and makes sure each call site of these functions indicates whether the
input point/rect is in visual or layout coordinates.

Several call sites were passing in layout coordinates without setting the
IsRelativeToLayoutViewport flag, which this patch corrects.

Depends on D71704

Pushed by bballo@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1cc0881e244b Move ViewportType and RelativeTo into a separate header. r=tnikkel https://hg.mozilla.org/integration/autoland/rev/edd529f7a9c5 Have nsLayoutUtils::GetFrameForPoint() and GetFramesForArea() take a RelativeTo parameter. r=tnikkel

For posterity this was backed out along with bug 1556556, see this comment.

Pushed by bballo@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b0a06e58b247 Move ViewportType and RelativeTo into a separate header. r=tnikkel https://hg.mozilla.org/integration/autoland/rev/cd5ab4e2f7a8 Have nsLayoutUtils::GetFrameForPoint() and GetFramesForArea() take a RelativeTo parameter. r=tnikkel
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
Whiteboard: [apz:dtz:10:S]
Regressions: 1647735
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: