diff --git a/layout/generic/nsLineLayout.cpp b/layout/generic/nsLineLayout.cpp index 3cff643ffb8c..5adade353806 100644 --- a/layout/generic/nsLineLayout.cpp +++ b/layout/generic/nsLineLayout.cpp @@ -30,6 +30,7 @@ #include "nsCRT.h" #include "nsReflowCommand.h" #include "nsIFontMetrics.h" +#include "nsHTMLFrame.h" #undef NOISY_REFLOW @@ -1399,6 +1400,14 @@ nsLineLayout::CreateFrameFor(nsIContent* aKid) if (NS_OK != rv) { return rv; } + if (NS_OK == rv) { + // Wrap the frame in a view if necessary + rv = nsHTMLFrame::CreateViewForFrame(mPresContext, kidFrame, kidSC, + PR_FALSE); + if (NS_OK != rv) { + return rv; + } + } mState.mKidFrame = kidFrame; mNewFrames++; diff --git a/layout/html/base/src/nsLineLayout.cpp b/layout/html/base/src/nsLineLayout.cpp index 3cff643ffb8c..5adade353806 100644 --- a/layout/html/base/src/nsLineLayout.cpp +++ b/layout/html/base/src/nsLineLayout.cpp @@ -30,6 +30,7 @@ #include "nsCRT.h" #include "nsReflowCommand.h" #include "nsIFontMetrics.h" +#include "nsHTMLFrame.h" #undef NOISY_REFLOW @@ -1399,6 +1400,14 @@ nsLineLayout::CreateFrameFor(nsIContent* aKid) if (NS_OK != rv) { return rv; } + if (NS_OK == rv) { + // Wrap the frame in a view if necessary + rv = nsHTMLFrame::CreateViewForFrame(mPresContext, kidFrame, kidSC, + PR_FALSE); + if (NS_OK != rv) { + return rv; + } + } mState.mKidFrame = kidFrame; mNewFrames++;