Get rid of nsIScrollableFrame
Categories
(Core :: Layout: Scrolling and Overflow, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox128 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
References
Details
Crash Data
Attachments
(14 files, 1 obsolete file)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Moved from bug 1824877 comment 1: per https://phabricator.services.mozilla.com/D201893#6924920, we should consider removing nsIScrollableFrame
since ScrollFrame
is the only class implementing nsIScrollableFrame
.
Updated•8 months ago
|
Comment hidden (obsolete) |
Updated•8 months ago
|
Comment hidden (obsolete) |
Assignee | ||
Comment 3•8 months ago
|
||
In theory, changing the return type from nsIFrame*
to ScrollContainerFrame*
exposes ScrollContainerFrame
to the callers who might not needed, but almost
all of the callers in cpp files are already exposed to nsIScrollableFrame
, as
demonstrated in this patch via replacing the #include from
"nsIScrollableFrame.h" to "ScrollContainerFrame.h", so this is OK.
Some callers can be simplified since we no longer need do_QueryFrame
to
nsIScrollableFrame
.
Assignee | ||
Comment 4•8 months ago
|
||
We are going to switch callers from nsIScrollableFrame
to
ScrollContainerFrame
, so we need ScrollContainerFrame
to have the same
interface as nsIScrollableFrame
, including the same default values on params
and the same access privilege of public/protected/private APIs.
This patch is a preparation for later parts so that the code builds
successfully.
Assignee | ||
Comment 5•8 months ago
|
||
Also, simplify some callers of GetScrollTargetFrame()
to drop
nsIScrollableFrame*
and unnecessary do_QueryFrame
. We'll continue removing
more nsIScrollableFrame*
in later parts.
Assignee | ||
Comment 6•8 months ago
|
||
This patch starts from renaming PresShell::GetScrollableFrameToScroll()
to
PresShell::GetScrollContainerFrameToScroll()
, making it return
ScrollContainerFrame*
, and then fixing other helpers until everything
compiles. As before, we can remove some do_QueryFrame
.
Assignee | ||
Comment 7•8 months ago
|
||
This is a preparation to remove #include "nsIScrollableFrame.h"
for
ScrollTimeline.cpp and ViewTimeline.cpp.
Move the implementation of nsListControlFrame::GetMultiple()
to cpp. Keeping
it inline requires adding #include "mozilla/dom/Element.h"
in the header, and
I don't feel the method is hot enough to be inlined.
Assignee | ||
Comment 8•8 months ago
|
||
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
Assignee | ||
Comment 9•8 months ago
|
||
PresShell::GetRootScrollFrameAsScrollable()
is equivalent to
PresShell::GetRootScrollContainerFrame()
.
In ScrollContainerFrame.h, DecideScrollableLayer()
has two versions, one has
four parameters, and the other has five parameters with the fifth parameter
aDirtyRectHasBeenOverriden
having a default value nullptr
. When we switch
the caller from nsIScrollableFrame
to ScrollContainerFrame
, we need to
remove the default value for the fifth parameter to avoid ambiguity.
Assignee | ||
Comment 10•8 months ago
|
||
Assignee | ||
Comment 11•8 months ago
|
||
Also, in EventStateManager, convert ComputeScrollTarget()
and
ComputeScrollTargetAndMayAdjustWheelEvent()
to return ScrollContainerFrame*
so that we can drop more unnecessarily do_QueryFrame
.
Due to removing nsIScrollableFrame
forward declaration in DOM headers, we have
to add nsIScrollableFrame
forward declaration temporarily in
nsMenuPopupFrame.h to make this patch compile, but we'll remove it once we
remove nsIScrollableFrame
under layout/.
Assignee | ||
Comment 12•8 months ago
|
||
Assignee | ||
Comment 13•8 months ago
|
||
Assignee | ||
Comment 14•8 months ago
|
||
The motivation of this patch is that we've now switched all the callers from
nsIScrollableFrame
to ScrollContainerFrame
, and it is better to audit the
access control of ScrollContainerFrame
's interface, and I notice almost all
the member variables are public!
This patch shuffle the interface so that there are only one public, protected,
and private section, and all the member variables are moved to the private
section.
AutoMinimumScaleSizeChangeDetector
and RemoveDisplayPortCallback
need to
access member variables, so by declaring them under ScrollContainerFrame
, they
have the privilege to do so.
Ideally, the caller only need to access what are already in
nsIScrollableFrame
, so currently we might expose more methods than necessary.
We can audit that in a later part.
Assignee | ||
Comment 15•8 months ago
|
||
This patch moves the documentation from nsIScrollableFrame.h
to
ScrollContainerFrame.h
. We keep methods in the original order as they were in
nsIScrollableFrame
.
Assignee | ||
Comment 16•8 months ago
|
||
Move nsIReflowCallback overridden methods to public section since
ScrollContainerFrame public inherits the interface.
Move reflow related helper methods to protected section.
Comment 17•8 months ago
|
||
Comment 18•8 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ea9ecb543e66
https://hg.mozilla.org/mozilla-central/rev/a2d37b98273c
https://hg.mozilla.org/mozilla-central/rev/b765169a7a8f
https://hg.mozilla.org/mozilla-central/rev/2f0817331dbe
https://hg.mozilla.org/mozilla-central/rev/717dac08b607
https://hg.mozilla.org/mozilla-central/rev/42e1bbe0ecb6
https://hg.mozilla.org/mozilla-central/rev/7b481b747b7a
https://hg.mozilla.org/mozilla-central/rev/c964fccd5180
https://hg.mozilla.org/mozilla-central/rev/997c9249dbed
https://hg.mozilla.org/mozilla-central/rev/6f7ab8adfa6e
https://hg.mozilla.org/mozilla-central/rev/f63b0c4335fe
https://hg.mozilla.org/mozilla-central/rev/3c06f22da72b
https://hg.mozilla.org/mozilla-central/rev/c8a6b0e526d6
https://hg.mozilla.org/mozilla-central/rev/2977ff81a23e
https://hg.mozilla.org/mozilla-central/rev/fd6904338812
Comment 19•8 months ago
|
||
Backed out for causing scrolling crashes on macOS:
https://hg.mozilla.org/mozilla-central/rev/e1da1893a0c56d2752be4e6eb1efa16c58723a55
There are crashes with [@ mozilla::ScrollContainerFrame::ScrollbarActivityStarted] e.g. bp-ada62b65-ccc2-40d7-94c5-e9a910240529
Assignee | ||
Comment 20•8 months ago
|
||
It is Part 9 - Remove nsIScrollableFrame usages under dom/ that causes the regression (bug 1899505). See https://phabricator.services.mozilla.com/D211496#7279371 for the root cause.
Comment 21•8 months ago
|
||
Comment 22•8 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8abd8c6ab1b6
https://hg.mozilla.org/mozilla-central/rev/852253304683
https://hg.mozilla.org/mozilla-central/rev/09981021ee35
https://hg.mozilla.org/mozilla-central/rev/0ee9d3315ed6
https://hg.mozilla.org/mozilla-central/rev/dd540ee6e824
https://hg.mozilla.org/mozilla-central/rev/1eac71cfc6a0
https://hg.mozilla.org/mozilla-central/rev/1ad8f3d267ae
https://hg.mozilla.org/mozilla-central/rev/9a67eb7c4248
https://hg.mozilla.org/mozilla-central/rev/35b0ec410b2d
https://hg.mozilla.org/mozilla-central/rev/fa4d373ad546
https://hg.mozilla.org/mozilla-central/rev/2eac8c029b4b
https://hg.mozilla.org/mozilla-central/rev/7e98e19cb506
https://hg.mozilla.org/mozilla-central/rev/e6f0167db347
https://hg.mozilla.org/mozilla-central/rev/fd11ccb1e883
https://hg.mozilla.org/mozilla-central/rev/5eab81fcdd7c
Description
•