diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-24 20:18:05 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-24 20:18:05 +0200 |
commit | 2f87463ea3c3ac36250d4028af0baddf725f6ecf (patch) | |
tree | 10dda99452b1b0e8d7a416829cbd400d839c1250 /layout/generic/nsFlexContainerFrame.h | |
parent | 401a0e12afcaaf3aebc2e8161545ce0166e3d5bd (diff) | |
download | uxp-2f87463ea3c3ac36250d4028af0baddf725f6ecf.tar.gz |
Bug 1209697: Cache flex measuring reflows to avoid exponential behavior
Diffstat (limited to 'layout/generic/nsFlexContainerFrame.h')
-rw-r--r-- | layout/generic/nsFlexContainerFrame.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/layout/generic/nsFlexContainerFrame.h b/layout/generic/nsFlexContainerFrame.h index 22b420d85b..d9cac89301 100644 --- a/layout/generic/nsFlexContainerFrame.h +++ b/layout/generic/nsFlexContainerFrame.h @@ -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, @@ -195,6 +198,18 @@ protected: 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 * resulting height. |