Remove Float Cache
Categories
(Core :: Layout: Floats, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox107 | --- | fixed |
People
(Reporter: fantasai.bugs, Assigned: TYLin)
References
Details
Attachments
(2 files)
roc proposed to remove nsFloatCache &co and store the region on the float frame itself. A bit on nsLineBox would say whether float placeholders exist on the line, to optimize RecoverFloats and other lookups. RecoverFloats and the CheckPlaceholderInLine call seem to be the main places nsFloatCache is used. http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsBlockFrame.cpp#3997
Comment 1•2 years ago
|
||
The bug assignee is inactive on Bugzilla, so the assignee is being reset.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
Nowadays, nsFloatCache stores no extra information but nsIFrame*
, which makes
nsFloatCacheList and nsFloatCacheFreeList are just singly and Doubly linked
list of frames, respectively.
Most of this patch is a plain rewrite to use nsTArray APIs. There are two
rewrite that need more explanation.
-
BlockReflowState::mFloatCacheFreeList
is served as a temporarily list to
avoid extra allocations of nsFloatCache. It takes the ownership of floats
from a line via FreeFloats(), and later reuses the cache in AddFloat().
We don't need this anymore, so we remove it. -
In
PlaceBelowCurrentLineFloats()
, the old code removes a float which
needs to be pushed to next continuation frommBelowCurrentLineFloats
.
After looking through all of the floats, the remaining of
mBelowCurrentLineFloats
are moved to the line because they belong to the
line. In this patch, rather than removing the pushed floats one by one from
mBelowCurrentLineFloats
, I use a new list to collect the floats that need
to be added to the line, and just clearmBelowCurrentLineFloats
at the
end of the method.
Assignee | ||
Comment 3•2 years ago
|
||
Also, remove unused LINE_MAX_CHILD_COUNT
in nsLineBox.h
Depends on D157976
Updated•2 years ago
|
Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/9f2279973623 Part 1 - Use nsTArray<nsIFrame*> to store float list in nsLineBox and BlockReflowState. r=emilio https://hg.mozilla.org/integration/autoland/rev/cc8d417312b7 Part 2 - Remove unused nsFloatCache, nsFloatCacheList, and nsFloatCacheFreeList. r=emilio
Comment 5•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9f2279973623
https://hg.mozilla.org/mozilla-central/rev/cc8d417312b7
Description
•