nsDisplayBoxShadowOuter's bounds aren't very accurate

RESOLVED FIXED in mozilla20

Status

()

Core
Layout
RESOLVED FIXED
6 years ago
3 years ago

People

(Reporter: mattwoodrow, Unassigned)

Tracking

unspecified
mozilla20
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
Created attachment 690546 [details] [diff] [review]
Compute the actual bounds

This is causing the fixed-position header layer on nzherald.co.nz to be much bigger than necessary.

This switches the bounds calculation to compute the actual pixels touched by the shadow, and caches them on display item creation.
Attachment #690546 - Flags: review?(roc)
Comment on attachment 690546 [details] [diff] [review]
Compute the actual bounds

Review of attachment 690546 [details] [diff] [review]:
-----------------------------------------------------------------

::: layout/base/nsDisplayList.cpp
@@ +2406,5 @@
> +    tmpRect.Inflate(shadow->mSpread);
> +    tmpRect.Inflate(
> +      nsContextBoxBlur::GetBlurRadiusMargin(shadow->mRadius, A2D));
> +    shadows.UnionRect(shadows, tmpRect);
> +  }

This code is identical to code in ComputeOutlineAndEffectsRect. Please share it via a helper function (could be in nsLayoutUtils).
Attachment #690546 - Flags: review?(roc) → review+
https://hg.mozilla.org/mozilla-central/rev/d843a43d7fad
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.