COMMIT_MESSAGE

 1REGRESSION (299603@main): Inset box-shadow not rendered when spread is larger than element
 2https://bugs.webkit.org/show_bug.cgi?id=300477
 3<rdar://problem/162373297>
 4
 5Reviewed by NOBODY (OOPS!).
 6
 7When the inset shadow fully covers the box (i.e., the inner hole rect becomes zero),
 8we should paint the outer shape (the full rect) rather than the zero rect.
 9(Note that the inner rect is never the (inset) shadow itself).
 10
 11Test: fast/box-shadow/inset-shadow-large-spread2.html
 12
 13* LayoutTests/fast/box-shadow/inset-shadow-large-spread2-expected.html: Added.
 14* LayoutTests/fast/box-shadow/inset-shadow-large-spread2.html: Added.
 15* Source/WebCore/rendering/BackgroundPainter.cpp:
 16(WebCore::BackgroundPainter::paintBoxShadow const):

Source/WebCore/rendering/BackgroundPainter.cpp

@@void BackgroundPainter::paintBoxShadow(const LayoutRect& paintRect, const Render
981981
982982 auto shapeForInnerHole = BorderShape(outerRectExpandedToObscureOpenEdges, borderWidthsWithSpread, borderShape.radii());
983983 if (shapeForInnerHole.snappedInnerRect(deviceScaleFactor).isEmpty()) {
984  shapeForInnerHole.fillInnerShape(context, shadowColor, deviceScaleFactor);
 984 shapeForInnerHole.fillOuterShape(context, shadowColor, deviceScaleFactor);
985985 continue;
986986 }
987987

LayoutTests/fast/box-shadow/inset-shadow-large-spread2-expected.html

 1<style>
 2div {
 3 width: 40px;
 4 height: 30px;
 5 background-color: green;
 6 margin: 10px;
 7}
 8</style>
 9<div></div>
 10<div></div>
 11<div></div>
 12<div></div>
 13<div><div style="background-color: blue; width: 12px; height: 2px; position: relative; left: 4px; top: 14px;"></div></div>

LayoutTests/fast/box-shadow/inset-shadow-large-spread2.html

 1<style>
 2div {
 3 width: 40px;
 4 height: 30px;
 5 background-color: blue;
 6 margin: 10px;
 7}
 8</style>
 9<div style="box-shadow: inset 40px 0px 0px 0px green"></div>
 10<div style="box-shadow: inset 0px 30px 0px 0px green"></div>
 11<div style="box-shadow: inset 0px 0px 0px 20px green"></div>
 12<div style="box-shadow: inset 0px 0px 0px 15px green"></div>
 13
 14<!-- inset shadow does not cover the box in this case -->
 15<div style="box-shadow: inset 0px 0px 0px 14px green"></div>