summaryrefslogtreecommitdiff
path: root/layout
diff options
context:
space:
mode:
authorJeremy Andrews <athenian200@outlook.com>2022-08-13 11:32:33 -0500
committerJeremy Andrews <athenian200@outlook.com>2022-08-13 11:44:09 -0500
commit50bd3acb5b664fab9a78e5cf160ad92cdb577a6e (patch)
tree24164e564865a01d905a666044f1de1ddfdae791 /layout
parent8fa66368a0e80d7476ca1876027b31f45f22b32e (diff)
downloaduxp-50bd3acb5b664fab9a78e5cf160ad92cdb577a6e.tar.gz
Issue #1970 - Follow-up: Better fix for Unix that works on newer GCC.
My previous fix apparently only worked with GCC 7. Having that return at the end doesn't seem to hurt anything on Windows, so I see no reason to ifdef it. I don't remember where I heard this, but I vaguely remember hearing that ending a function without a return statement may be undefined behavior that differs between compilers and operating systems. If so, that would explain why this has behaved so differently across platforms and compilers.
Diffstat (limited to 'layout')
-rw-r--r--layout/generic/ReflowInput.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/layout/generic/ReflowInput.cpp b/layout/generic/ReflowInput.cpp
index 84fcfe119c..1af7e798ef 100644
--- a/layout/generic/ReflowInput.cpp
+++ b/layout/generic/ReflowInput.cpp
@@ -2799,11 +2799,9 @@ ComputeLineHeight(nsStyleContext* aStyleContext,
}
nscoord ReflowInput::GetLineHeight() const {
-#ifdef XP_WIN
if (mLineHeight != NS_AUTOHEIGHT) {
return mLineHeight;
}
-#endif
nscoord blockBSize =
nsLayoutUtils::IsNonWrapperBlock(mFrame) ? ComputedBSize() :
@@ -2813,6 +2811,8 @@ nscoord ReflowInput::GetLineHeight() const {
mFrame->StyleContext(),
blockBSize,
nsLayoutUtils::FontSizeInflationFor(mFrame));
+
+ return mLineHeight;
}
void ReflowInput::SetLineHeight(nscoord aLineHeight) {