haikuwebkit/LayoutTests/css3/filters/css-opacity-with-drop-shado...

34 lines
859 B
HTML
Raw Permalink Normal View History

[CSS Filters] CSS opacity property clips filter outsets https://bugs.webkit.org/show_bug.cgi?id=106549 Reviewed by Dirk Schulze. Source/WebCore: Expand the transparencyClipBox for filter outsets and pass the filter output rect instead of the input rect to beginTransparencyLayers for clipping. Details below. Test: css3/filters/css-opacity-with-drop-shadow.html * rendering/RenderLayer.cpp: (WebCore): (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect): Replace filter outset calcuation with a call to expandRectForFilterOutsets. (WebCore::expandRectForFilterOutsets): New method to factor out repeated filter outset calculation code. (WebCore::transparencyClipBox): After expanding the clip rect for descendants and reflection, expand it for filter outsets, so they don't get clipped when we begin a transparency layer. (WebCore::RenderLayer::paintLayerContents): Pass paintingInfo.paintDirtyRect instead of localPaintingInfo.paintDirtyRect to beginTransparencyLayers for clipping. localPaintingInfo.paintDirtyRect (aka the filter input rect) does not contain filter outsets, so they would get clipped. Now, we pass paintingInfo.paintDirtyRect (the filter output rect), which includes the filter outsets. (WebCore::RenderLayer::calculateLayerBounds): Replace filter outset calcuation with a call to expandRectForFilterOutsets. * rendering/RenderLayer.h: (RenderLayer): LayoutTests: Add a reftest to verify that an element's drop shadow filter is not clipped when a CSS opacity property is not applied. * css3/filters/css-opacity-with-drop-shadow-expected.html: Added. * css3/filters/css-opacity-with-drop-shadow.html: Added. Canonical link: https://commits.webkit.org/126027@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@140702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-01-24 19:35:17 +00:00
<!DOCTYPE html>
<html>
<head>
<title>This test verifies that an element's drop shadow filter is not clipped when a CSS opacity property is applied.</title>
<!--
This is the reference file for the the test.
If the associated test passes, you should see a gray square and a light green square.
-->
<style>
body {
margin: 0;
}
#filtered {
background-color: black;
opacity: 0.5;
width: 100px;
height: 100px;
}
#drop-shadow {
background-color: #0f0;
opacity: 0.5;
position: absolute;
top: 110px;
left: 110px;
width: 100px;
height: 100px;
}
</style>
</head>
<body>
<div id="filtered"></div>
<div id="drop-shadow"></div>
</body>