diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 1ea54c68f5ea..b93e44a7681d 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -3844,7 +3844,10 @@ nsBaseIBFrame::Paint(nsIPresContext& aPresContext, mStyleContext->GetStyleData(eStyleStruct_Display); // Only paint the border and background if we're visible - if ((eFramePaintLayer_Underlay == aWhichLayer) && disp->mVisible) { + if (disp->mVisible && + (((0 != (BLOCK_IS_INLINE & mFlags)) && + (eFramePaintLayer_Content == aWhichLayer)) || + (eFramePaintLayer_Underlay == aWhichLayer))) { PRIntn skipSides = GetSkipSides(); const nsStyleColor* color = (const nsStyleColor*) mStyleContext->GetStyleData(eStyleStruct_Color); diff --git a/layout/generic/nsBlockReflowState.cpp b/layout/generic/nsBlockReflowState.cpp index 1ea54c68f5ea..b93e44a7681d 100644 --- a/layout/generic/nsBlockReflowState.cpp +++ b/layout/generic/nsBlockReflowState.cpp @@ -3844,7 +3844,10 @@ nsBaseIBFrame::Paint(nsIPresContext& aPresContext, mStyleContext->GetStyleData(eStyleStruct_Display); // Only paint the border and background if we're visible - if ((eFramePaintLayer_Underlay == aWhichLayer) && disp->mVisible) { + if (disp->mVisible && + (((0 != (BLOCK_IS_INLINE & mFlags)) && + (eFramePaintLayer_Content == aWhichLayer)) || + (eFramePaintLayer_Underlay == aWhichLayer))) { PRIntn skipSides = GetSkipSides(); const nsStyleColor* color = (const nsStyleColor*) mStyleContext->GetStyleData(eStyleStruct_Color); diff --git a/layout/generic/nsBlockReflowState.h b/layout/generic/nsBlockReflowState.h index 1ea54c68f5ea..b93e44a7681d 100644 --- a/layout/generic/nsBlockReflowState.h +++ b/layout/generic/nsBlockReflowState.h @@ -3844,7 +3844,10 @@ nsBaseIBFrame::Paint(nsIPresContext& aPresContext, mStyleContext->GetStyleData(eStyleStruct_Display); // Only paint the border and background if we're visible - if ((eFramePaintLayer_Underlay == aWhichLayer) && disp->mVisible) { + if (disp->mVisible && + (((0 != (BLOCK_IS_INLINE & mFlags)) && + (eFramePaintLayer_Content == aWhichLayer)) || + (eFramePaintLayer_Underlay == aWhichLayer))) { PRIntn skipSides = GetSkipSides(); const nsStyleColor* color = (const nsStyleColor*) mStyleContext->GetStyleData(eStyleStruct_Color); diff --git a/layout/html/base/src/nsBlockFrame.cpp b/layout/html/base/src/nsBlockFrame.cpp index 1ea54c68f5ea..b93e44a7681d 100644 --- a/layout/html/base/src/nsBlockFrame.cpp +++ b/layout/html/base/src/nsBlockFrame.cpp @@ -3844,7 +3844,10 @@ nsBaseIBFrame::Paint(nsIPresContext& aPresContext, mStyleContext->GetStyleData(eStyleStruct_Display); // Only paint the border and background if we're visible - if ((eFramePaintLayer_Underlay == aWhichLayer) && disp->mVisible) { + if (disp->mVisible && + (((0 != (BLOCK_IS_INLINE & mFlags)) && + (eFramePaintLayer_Content == aWhichLayer)) || + (eFramePaintLayer_Underlay == aWhichLayer))) { PRIntn skipSides = GetSkipSides(); const nsStyleColor* color = (const nsStyleColor*) mStyleContext->GetStyleData(eStyleStruct_Color); diff --git a/layout/html/base/src/nsBlockReflowState.cpp b/layout/html/base/src/nsBlockReflowState.cpp index 1ea54c68f5ea..b93e44a7681d 100644 --- a/layout/html/base/src/nsBlockReflowState.cpp +++ b/layout/html/base/src/nsBlockReflowState.cpp @@ -3844,7 +3844,10 @@ nsBaseIBFrame::Paint(nsIPresContext& aPresContext, mStyleContext->GetStyleData(eStyleStruct_Display); // Only paint the border and background if we're visible - if ((eFramePaintLayer_Underlay == aWhichLayer) && disp->mVisible) { + if (disp->mVisible && + (((0 != (BLOCK_IS_INLINE & mFlags)) && + (eFramePaintLayer_Content == aWhichLayer)) || + (eFramePaintLayer_Underlay == aWhichLayer))) { PRIntn skipSides = GetSkipSides(); const nsStyleColor* color = (const nsStyleColor*) mStyleContext->GetStyleData(eStyleStruct_Color); diff --git a/layout/html/base/src/nsBlockReflowState.h b/layout/html/base/src/nsBlockReflowState.h index 1ea54c68f5ea..b93e44a7681d 100644 --- a/layout/html/base/src/nsBlockReflowState.h +++ b/layout/html/base/src/nsBlockReflowState.h @@ -3844,7 +3844,10 @@ nsBaseIBFrame::Paint(nsIPresContext& aPresContext, mStyleContext->GetStyleData(eStyleStruct_Display); // Only paint the border and background if we're visible - if ((eFramePaintLayer_Underlay == aWhichLayer) && disp->mVisible) { + if (disp->mVisible && + (((0 != (BLOCK_IS_INLINE & mFlags)) && + (eFramePaintLayer_Content == aWhichLayer)) || + (eFramePaintLayer_Underlay == aWhichLayer))) { PRIntn skipSides = GetSkipSides(); const nsStyleColor* color = (const nsStyleColor*) mStyleContext->GetStyleData(eStyleStruct_Color);