diff --git a/mozilla/layout/generic/nsHTMLReflowState.cpp b/mozilla/layout/generic/nsHTMLReflowState.cpp
index b718325833b..9636fbb8038 100644
--- a/mozilla/layout/generic/nsHTMLReflowState.cpp
+++ b/mozilla/layout/generic/nsHTMLReflowState.cpp
@@ -2130,10 +2130,12 @@ ComputeLineHeight(nsIRenderingContext* aRenderingContext,
aRenderingContext->SetFont(font->mFont);
nsCOMPtr fm;
aRenderingContext->GetFontMetrics(*getter_AddRefs(fm));
+#ifdef NEW_FONT_HEIGHT_APIS
if (fm) {
fm->GetEmHeight(emHeight);
fm->GetNormalLineHeight(normalLineHeight);
}
+#endif
float factor;
if (eStyleUnit_Factor == unit) {
factor = text->mLineHeight.GetFactorValue();
@@ -2183,9 +2185,11 @@ nsHTMLReflowState::CalcLineHeight(nsIPresContext* aPresContext,
aRenderingContext->SetFont(font->mFont);
nsCOMPtr fm;
aRenderingContext->GetFontMetrics(*getter_AddRefs(fm));
+#ifdef NEW_FONT_HEIGHT_APIS
if (fm) {
fm->GetNormalLineHeight(lineHeight);
}
+#endif
}
}
return lineHeight;
diff --git a/mozilla/layout/html/base/src/nsHTMLReflowState.cpp b/mozilla/layout/html/base/src/nsHTMLReflowState.cpp
index b718325833b..9636fbb8038 100644
--- a/mozilla/layout/html/base/src/nsHTMLReflowState.cpp
+++ b/mozilla/layout/html/base/src/nsHTMLReflowState.cpp
@@ -2130,10 +2130,12 @@ ComputeLineHeight(nsIRenderingContext* aRenderingContext,
aRenderingContext->SetFont(font->mFont);
nsCOMPtr fm;
aRenderingContext->GetFontMetrics(*getter_AddRefs(fm));
+#ifdef NEW_FONT_HEIGHT_APIS
if (fm) {
fm->GetEmHeight(emHeight);
fm->GetNormalLineHeight(normalLineHeight);
}
+#endif
float factor;
if (eStyleUnit_Factor == unit) {
factor = text->mLineHeight.GetFactorValue();
@@ -2183,9 +2185,11 @@ nsHTMLReflowState::CalcLineHeight(nsIPresContext* aPresContext,
aRenderingContext->SetFont(font->mFont);
nsCOMPtr fm;
aRenderingContext->GetFontMetrics(*getter_AddRefs(fm));
+#ifdef NEW_FONT_HEIGHT_APIS
if (fm) {
fm->GetNormalLineHeight(lineHeight);
}
+#endif
}
}
return lineHeight;