-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RenderBox::applyVisualEffectOverflow() and RenderBox::outlineBoundsFo…
…rRepaint() use different ways of computing outline/shadow extent https://bugs.webkit.org/show_bug.cgi?id=264625 rdar://118582062 Reviewed by Alan Baradlay. The logic in `ShadowData::adjustRectForShadow()` to compute the impact of box-shadow and outline on a rect was wrong; the outline is not shadowed, so outline and shadow have independent effects on the repaint rect. The correct implementation is to just compute their effects separately, and take the union of the result, which is what `RenderBox::applyVisualEffectOverflow()` already does. So remove the outline argument from `ShadowData::adjustRectForShadow()` and delete `RenderObject::adjustRectForOutlineAndShadow()`. `RenderBox::outlineBoundsForRepaint()` now just calls `applyVisualEffectOverflow()`, and LegacyRenderSVGModelObject gets its own copy of the old code because it's not clear how shadows and outlines interact in SVG. There was also code duplication between `RenderStyle::shadowExtent()` and code in ShadowData, so remove the RenderStyle code and have it call into ShadowData. * LayoutTests/fast/box-shadow/negative-shadow-box-expand-expected.txt: * LayoutTests/fast/box-shadow/negative-shadow-box-shrink-expected.txt: * LayoutTests/fast/repaint/outline-and-shadow-repaint-expected.txt: Added. * LayoutTests/fast/repaint/outline-and-shadow-repaint.html: Added. * LayoutTests/platform/gtk/fast/repaint/4776765-expected.txt: * LayoutTests/platform/mac-monterey-wk2/fast/repaint/4776765-expected.txt: * LayoutTests/platform/mac-ventura-wk2/fast/repaint/4776765-expected.txt: * LayoutTests/platform/mac-wk1/fast/repaint/4776765-expected.txt: * LayoutTests/platform/mac/fast/repaint/4776765-expected.txt: * Source/WebCore/display/css/DisplayBoxModelBox.cpp: (WebCore::Display::BoxModelBox::absolutePaintingExtent const): * Source/WebCore/rendering/RenderBox.cpp: (WebCore::RenderBox::outlineBoundsForRepaint const): * Source/WebCore/rendering/RenderObject.cpp: (WebCore::RenderObject::adjustRectForOutlineAndShadow const): Deleted. * Source/WebCore/rendering/RenderObject.h: * Source/WebCore/rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::shadowExtent): Deleted. (WebCore::RenderStyle::shadowInsetExtent): Deleted. * Source/WebCore/rendering/style/RenderStyle.h: * Source/WebCore/rendering/style/RenderStyleInlines.h: (WebCore::RenderStyle::boxShadowExtent const): (WebCore::RenderStyle::boxShadowInsetExtent const): (WebCore::RenderStyle::textShadowExtent const): * Source/WebCore/rendering/style/ShadowData.cpp: (WebCore::ShadowData::shadowOutsetExtent const): (WebCore::ShadowData::shadowInsetExtent const): (WebCore::ShadowData::adjustRectForShadow const): (WebCore::calculateShadowExtent): Deleted. * Source/WebCore/rendering/style/ShadowData.h: (WebCore::ShadowData::shadowOutsetExtent): (WebCore::ShadowData::shadowInsetExtent): * Source/WebCore/rendering/svg/legacy/LegacyRenderSVGModelObject.cpp: (WebCore::adjustRectForOutlineAndShadow): (WebCore::LegacyRenderSVGModelObject::outlineBoundsForRepaint const): Canonical link: https://commits.webkit.org/271254@main
- Loading branch information
Showing
19 changed files
with
147 additions
and
104 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
LayoutTests/fast/box-shadow/negative-shadow-box-expand-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
LayoutTests/fast/box-shadow/negative-shadow-box-shrink-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
LayoutTests/fast/repaint/outline-and-shadow-repaint-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
(repaint rects | ||
(rect 88 80 388 390) | ||
(rect 8 370 784 100) | ||
(rect 8 304 784 66) | ||
(rect 0 404 800 100) | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
.box { | ||
width: 300px; | ||
height: 300px; | ||
margin: 100px; | ||
border: 2px solid black; | ||
outline: 20px solid rgba(0, 128, 0, 0.5); | ||
box-shadow: 30px 32px 10px 20px black; | ||
} | ||
|
||
body.changed .box { | ||
height: 200px; | ||
} | ||
</style> | ||
<script src="resources/text-based-repaint.js"></script> | ||
<script> | ||
function repaintTest() | ||
{ | ||
document.body.classList.add('changed'); | ||
} | ||
|
||
window.addEventListener('load', runRepaintTest, false); | ||
</script> | ||
</head> | ||
<body> | ||
<div class="box"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,6 @@ | |
(rect 1 37 798 32) | ||
(rect 8 44 784 18) | ||
(rect 1 51 798 18) | ||
(rect 1 44 798 7) | ||
(rect 8 37 784 14) | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.