diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index ba4a0531ad9..e88a5deb855 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -1436,8 +1436,8 @@ nsFrame::DisplayBorderBackgroundOutline(nsDisplayListBuilder* aBuilder, if (!IsVisibleForPainting(aBuilder)) return NS_OK; - bool hasBoxShadow = GetStyleBorder()->mBoxShadow != nsnull; - if (hasBoxShadow) { + nsCSSShadowArray* shadows = GetStyleBorder()->mBoxShadow; + if (shadows && shadows->HasShadowWithInset(false)) { nsresult rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder) nsDisplayBoxShadowOuter(aBuilder, this)); NS_ENSURE_SUCCESS(rv, rv); @@ -1448,7 +1448,7 @@ nsFrame::DisplayBorderBackgroundOutline(nsDisplayListBuilder* aBuilder, DisplayBackgroundUnconditional(aBuilder, aLists, aForceBackground, &bg); NS_ENSURE_SUCCESS(rv, rv); - if (hasBoxShadow) { + if (shadows && shadows->HasShadowWithInset(true)) { rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder) nsDisplayBoxShadowInner(aBuilder, this)); NS_ENSURE_SUCCESS(rv, rv); diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index 369eddc3a84..d3db6dbadd6 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -724,6 +724,14 @@ class nsCSSShadowArray { return &mArray[i]; } + bool HasShadowWithInset(bool aInset) { + for (PRUint32 i = 0; i < mLength; ++i) { + if (mArray[i].mInset == aInset) + return true; + } + return false; + } + NS_INLINE_DECL_REFCOUNTING(nsCSSShadowArray) private: