mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 735898. Part 4: Create Inner/Outer box-shadow items only if we actually have inset/outset shadows. r=mattwoodrow
This commit is contained in:
parent
c32be66d57
commit
c205a2f3ae
@ -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);
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user