Bug 1402060 - Don't create outset box-shadow wr items for inset box-shadows. r?mattwoodrow
MozReview-Commit-ID: EEKcXiy2WnK
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -5433,16 +5433,20 @@ nsDisplayBoxShadowOuter::CreateWebRender
for (uint32_t i = 0; i < rects.Length(); ++i) {
LayoutDeviceRect clipRect = LayoutDeviceRect::FromAppUnits(
rects[i], appUnitsPerDevPixel);
nsCSSShadowArray* shadows = mFrame->StyleEffects()->mBoxShadow;
MOZ_ASSERT(shadows);
for (uint32_t j = shadows->Length(); j > 0; j--) {
nsCSSShadowItem* shadow = shadows->ShadowAt(j - 1);
+ if (shadow->mInset) {
+ continue;
+ }
+
float blurRadius = float(shadow->mRadius) / float(appUnitsPerDevPixel);
gfx::Color shadowColor = nsCSSRendering::GetShadowColor(shadow,
mFrame,
mOpacity);
// We don't move the shadow rect here since WR does it for us
// Now translate everything to device pixels.
nsRect shadowRect = frameRect;
new file mode 100644
--- /dev/null
+++ b/layout/reftests/box-shadow/boxshadow-mixed-2-ref.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML>
+<title>Reference, bug 1402060</title>
+<style>
+
+.blackAtTop {
+ width: 100px;
+ height: 90px;
+ border-top: 10px solid black;
+}
+
+.blue {
+ width: 100px;
+ height: 100px;
+ background: blue;
+ margin-left: 10px;
+}
+
+.white {
+ width: 90px;
+ height: 90px;
+ background: white;
+}
+
+</style>
+
+<div class="blackAtTop"><div class="blue"><div class="white"></div></div></div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/box-shadow/boxshadow-mixed-2.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<title>Testcase, bug 1402060</title>
+<style>
+
+div {
+ width: 100px;
+ height: 100px;
+ box-shadow: inset 0 10px black, 10px 10px blue;
+}
+
+</style>
+
+<div></div>
--- a/layout/reftests/box-shadow/reftest.list
+++ b/layout/reftests/box-shadow/reftest.list
@@ -11,16 +11,17 @@ random != boxshadow-blur-2.html boxshado
== boxshadow-rounding.html boxshadow-rounding-ref.html
# One uses old path, one uses WR box shadow.
fails-if(Android) fuzzy-if(webrender,50,3310) == boxshadow-button.html boxshadow-button-ref.html
fuzzy-if(OSX==1010,1,24) fuzzy-if(d2d,16,908) fuzzy-if(webrender,18,2160) == boxshadow-large-border-radius.html boxshadow-large-border-radius-ref.html # Bug 1209649
fails-if(Android) == boxshadow-fileupload.html boxshadow-fileupload-ref.html
fuzzy-if(skiaContent,13,28) fuzzy-if(webrender,29-29,453-453) == boxshadow-inner-basic.html boxshadow-inner-basic-ref.svg
random-if(layersGPUAccelerated) == boxshadow-mixed.html boxshadow-mixed-ref.html
+== boxshadow-mixed-2.html boxshadow-mixed-2-ref.html
random-if(d2d) fuzzy-if(skiaContent,1,100) fuzzy-if(webrender,127,3528) == boxshadow-rounded-spread.html boxshadow-rounded-spread-ref.html
fuzzy-if(skiaContent,1,50) HTTP(..) == boxshadow-dynamic.xul boxshadow-dynamic-ref.xul
random-if(d2d) fails-if(webrender) == boxshadow-onecorner.html boxshadow-onecorner-ref.html
random-if(d2d) fails-if(webrender) == boxshadow-twocorners.html boxshadow-twocorners-ref.html
random-if(d2d) fails-if(webrender) == boxshadow-threecorners.html boxshadow-threecorners-ref.html
fuzzy(2,440) fuzzy-if(webrender,25,1300) == boxshadow-skiprect.html boxshadow-skiprect-ref.html
== boxshadow-opacity.html boxshadow-opacity-ref.html
== boxshadow-color-rounding.html boxshadow-color-rounding-ref.html