Remove Float Cache
Categories
(Core :: Layout: Floats, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox107 | --- | fixed |
People
(Reporter: fantasai.bugs, Assigned: TYLin)
References
Details
Attachments
(2 files)
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
|
Comment 5•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9f2279973623
https://hg.mozilla.org/mozilla-central/rev/cc8d417312b7
Description
•