summaryrefslogtreecommitdiff
path: root/layout/generic/ReflowInput.h
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2022-07-23 23:35:18 +0000
committerMoonchild <moonchild@palemoon.org>2022-07-23 23:35:18 +0000
commit5487515bcab438ae29fa6342583b8b5c5bde6b92 (patch)
treef83b19123ed175060d2d2287b24ef38b0dd50152 /layout/generic/ReflowInput.h
parent5dace0043a35efaffb6ae30b612c613b008ff85a (diff)
downloaduxp-5487515bcab438ae29fa6342583b8b5c5bde6b92.tar.gz
Issue #1970 - Part 6: Rename CalcLineHeight(), and cache used line height
To better distinguish the calculation of line height (still present with args) and simply getting the line height without args, it's now called GetLineHeight() This also introduces `mLineHeight` to cache specifically calculated line heights that aren't "auto" (which is a magic value), and it opens up the possibility to override it in Part 7.
Diffstat (limited to 'layout/generic/ReflowInput.h')
-rw-r--r--layout/generic/ReflowInput.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/layout/generic/ReflowInput.h b/layout/generic/ReflowInput.h
index 1d2df6af68..d8e0518399 100644
--- a/layout/generic/ReflowInput.h
+++ b/layout/generic/ReflowInput.h
@@ -744,18 +744,19 @@ public:
nscoord GetContainingBlockContentISize(mozilla::WritingMode aWritingMode) const;
/**
- * Calculate the used line-height property. The return value will be >= 0.
+ * Get the used line-height property. The return value will be >= 0.
*/
- nscoord CalcLineHeight() const;
+ nscoord GetLineHeight() const;
/**
- * Same as CalcLineHeight() above, but doesn't need a reflow state.
+ * Calculate the used line-height property without a reflow input instance.
+ * The return value will be >= 0.
*
* @param aBlockBSize The computed block size of the content rect of the block
- * that the line should fill.
- * Only used with line-height:-moz-block-height.
- * NS_AUTOHEIGHT results in a normal line-height for
- * line-height:-moz-block-height.
+ * that the line should fill.
+ * Only used with line-height:-moz-block-height.
+ * NS_AUTOHEIGHT results in a normal line-height for
+ * line-height:-moz-block-height.
* @param aFontSizeInflation The result of the appropriate
* nsLayoutUtils::FontSizeInflationFor call,
* or 1.0 if during intrinsic size
@@ -1000,6 +1001,9 @@ protected:
nscoord* aOutsideBoxSizing) const;
void CalculateBlockSideMargins(nsIAtom* aFrameType);
+
+ // Cache the used line-height property.
+ mutable nscoord mLineHeight = NS_AUTOHEIGHT;
};
} // namespace mozilla