diff --git a/content/html/style/src/nsHTMLStyleSheet.cpp b/content/html/style/src/nsHTMLStyleSheet.cpp
index 07cd660c1a34..2f97d5f7b58b 100644
--- a/content/html/style/src/nsHTMLStyleSheet.cpp
+++ b/content/html/style/src/nsHTMLStyleSheet.cpp
@@ -1988,11 +1988,12 @@ HTMLStyleSheetImpl::ConstructFrame(nsIPresContext* aPresContext,
if ((NS_STYLE_FLOAT_NONE != display->mFloats) ||
(NS_STYLE_POSITION_ABSOLUTE == position->mPosition)) {
- // If it can contain children then wrap it in a BODY frame
+ // If it can contain children then wrap it in a BODY frame.
+ // XxX Don't wrap tables...
PRBool isContainer;
aContent->CanContainChildren(isContainer);
- if (isContainer) {
+ if ((NS_STYLE_DISPLAY_TABLE != display->mDisplay) && isContainer) {
// The body wrapper frame gets the original style context
NS_NewBodyFrame(wrapperFrame, NS_BODY_SHRINK_WRAP);
wrapperFrame->Init(*aPresContext, aContent, aParentFrame, styleContext);
diff --git a/layout/html/style/src/nsHTMLStyleSheet.cpp b/layout/html/style/src/nsHTMLStyleSheet.cpp
index 07cd660c1a34..2f97d5f7b58b 100644
--- a/layout/html/style/src/nsHTMLStyleSheet.cpp
+++ b/layout/html/style/src/nsHTMLStyleSheet.cpp
@@ -1988,11 +1988,12 @@ HTMLStyleSheetImpl::ConstructFrame(nsIPresContext* aPresContext,
if ((NS_STYLE_FLOAT_NONE != display->mFloats) ||
(NS_STYLE_POSITION_ABSOLUTE == position->mPosition)) {
- // If it can contain children then wrap it in a BODY frame
+ // If it can contain children then wrap it in a BODY frame.
+ // XxX Don't wrap tables...
PRBool isContainer;
aContent->CanContainChildren(isContainer);
- if (isContainer) {
+ if ((NS_STYLE_DISPLAY_TABLE != display->mDisplay) && isContainer) {
// The body wrapper frame gets the original style context
NS_NewBodyFrame(wrapperFrame, NS_BODY_SHRINK_WRAP);
wrapperFrame->Init(*aPresContext, aContent, aParentFrame, styleContext);
diff --git a/layout/style/nsHTMLStyleSheet.cpp b/layout/style/nsHTMLStyleSheet.cpp
index 07cd660c1a34..2f97d5f7b58b 100644
--- a/layout/style/nsHTMLStyleSheet.cpp
+++ b/layout/style/nsHTMLStyleSheet.cpp
@@ -1988,11 +1988,12 @@ HTMLStyleSheetImpl::ConstructFrame(nsIPresContext* aPresContext,
if ((NS_STYLE_FLOAT_NONE != display->mFloats) ||
(NS_STYLE_POSITION_ABSOLUTE == position->mPosition)) {
- // If it can contain children then wrap it in a BODY frame
+ // If it can contain children then wrap it in a BODY frame.
+ // XxX Don't wrap tables...
PRBool isContainer;
aContent->CanContainChildren(isContainer);
- if (isContainer) {
+ if ((NS_STYLE_DISPLAY_TABLE != display->mDisplay) && isContainer) {
// The body wrapper frame gets the original style context
NS_NewBodyFrame(wrapperFrame, NS_BODY_SHRINK_WRAP);
wrapperFrame->Init(*aPresContext, aContent, aParentFrame, styleContext);