mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-14 19:27:30 +09:00
Bug 1209697: Cache flex measuring reflows to avoid exponential behavior
This commit is contained in:
parent
b706df90da
commit
95b1132e04
2 changed files with 114 additions and 39 deletions
|
|
@ -56,6 +56,7 @@ public:
|
|||
class FlexLine;
|
||||
class FlexboxAxisTracker;
|
||||
struct StrutInfo;
|
||||
struct CachedMeasuringReflowResult;
|
||||
|
||||
// nsIFrame overrides
|
||||
void Init(nsIContent* aContent,
|
||||
|
|
@ -66,6 +67,8 @@ public:
|
|||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists) override;
|
||||
|
||||
void MarkIntrinsicISizesDirty() override;
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
ReflowOutput& aDesiredSize,
|
||||
const ReflowInput& aReflowInput,
|
||||
|
|
@ -194,6 +197,18 @@ protected:
|
|||
const ReflowInput& aParentReflowInput,
|
||||
const FlexboxAxisTracker& aAxisTracker);
|
||||
|
||||
/**
|
||||
* This method gets a cached measuring reflow for a flex item, or does it and
|
||||
* caches it.
|
||||
*
|
||||
* This avoids exponential reflows, see the comment on
|
||||
* CachedMeasuringReflowResult.
|
||||
*/
|
||||
const CachedMeasuringReflowResult& MeasureAscentAndHeightForFlexItem(
|
||||
FlexItem& aItem,
|
||||
nsPresContext* aPresContext,
|
||||
ReflowInput& aChildReflowInput);
|
||||
|
||||
/**
|
||||
* This method performs a "measuring" reflow to get the content height of
|
||||
* aFlexItem.Frame() (treating it as if it had auto-height), & returns the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue