diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp
index 30c2db4ab84..4e6bf01ed85 100644
--- a/layout/generic/nsHTMLReflowState.cpp
+++ b/layout/generic/nsHTMLReflowState.cpp
@@ -440,7 +440,8 @@ GetNearestContainingBlock(nsIFrame* aFrame, nsMargin& aContentArea)
PRBool isBlock;
aFrame->GetFrameType(&frameType);
- isBlock = frameType == nsLayoutAtoms::blockFrame;
+ isBlock = (frameType == nsLayoutAtoms::blockFrame) ||
+ (frameType == nsLayoutAtoms::areaFrame);
NS_IF_RELEASE(frameType);
if (isBlock) {
diff --git a/layout/html/base/src/nsHTMLReflowState.cpp b/layout/html/base/src/nsHTMLReflowState.cpp
index 30c2db4ab84..4e6bf01ed85 100644
--- a/layout/html/base/src/nsHTMLReflowState.cpp
+++ b/layout/html/base/src/nsHTMLReflowState.cpp
@@ -440,7 +440,8 @@ GetNearestContainingBlock(nsIFrame* aFrame, nsMargin& aContentArea)
PRBool isBlock;
aFrame->GetFrameType(&frameType);
- isBlock = frameType == nsLayoutAtoms::blockFrame;
+ isBlock = (frameType == nsLayoutAtoms::blockFrame) ||
+ (frameType == nsLayoutAtoms::areaFrame);
NS_IF_RELEASE(frameType);
if (isBlock) {