summaryrefslogtreecommitdiff
path: root/layout/generic
diff options
context:
space:
mode:
Diffstat (limited to 'layout/generic')
-rw-r--r--layout/generic/ReflowInput.cpp11
-rw-r--r--layout/generic/ReflowInput.h5
2 files changed, 16 insertions, 0 deletions
diff --git a/layout/generic/ReflowInput.cpp b/layout/generic/ReflowInput.cpp
index f308ebcdf5..01f36cc9db 100644
--- a/layout/generic/ReflowInput.cpp
+++ b/layout/generic/ReflowInput.cpp
@@ -2813,6 +2813,17 @@ nscoord ReflowInput::GetLineHeight() const {
nsLayoutUtils::FontSizeInflationFor(mFrame));
}
+void ReflowInput::SetLineHeight(nscoord aLineHeight) {
+ MOZ_ASSERT(aLineHeight >= 0, "aLineHeight must be >= 0!");
+
+ if (mLineHeight != aLineHeight) {
+ mLineHeight = aLineHeight;
+ // Setting used line height can change a frame's block-size if mFrame's
+ // block-size behaves as auto.
+ InitResizeFlags(mFrame->PresContext(), mFrame->GetType());
+ }
+}
+
/* static */ nscoord
ReflowInput::CalcLineHeight(nsIContent* aContent,
nsStyleContext* aStyleContext,
diff --git a/layout/generic/ReflowInput.h b/layout/generic/ReflowInput.h
index d8e0518399..a70549d8eb 100644
--- a/layout/generic/ReflowInput.h
+++ b/layout/generic/ReflowInput.h
@@ -747,6 +747,11 @@ public:
* Get the used line-height property. The return value will be >= 0.
*/
nscoord GetLineHeight() const;
+
+ /**
+ * Set the used line-height. aLineHeight must be >= 0.
+ */
+ void SetLineHeight(nscoord aLineHeight);
/**
* Calculate the used line-height property without a reflow input instance.