haikuwebkit/LayoutTests/fast/box-shadow/hidpi-box-shadow-expected.html

42 lines
1.0 KiB
HTML
Raw Permalink Normal View History

Box-shadow spread radius does not transition or animate correctly with CSS Transitions & Animations https://bugs.webkit.org/show_bug.cgi?id=202489 Reviewed by Zalan Bujtas. Source/WebCore: Fix box-shadow offset and spread to support subpixel values, and make the rendering subpixel-aware. This also makes animation of shadow spread and offset be smoother on Retina displays. Also make ShadowStyle an enum class. Test: fast/box-shadow/hidpi-box-shadow.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForShadow): (WebCore::ComputedStyleExtractor::valueForFilter): * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::computeLength const): * page/animation/CSSPropertyAnimation.cpp: (WebCore::blendFunc): (WebCore::shadowForBlending): * platform/animation/AnimationUtilities.h: (WebCore::blend): * platform/graphics/RoundedRect.h: * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::paintBoxDecorations): * rendering/RenderBox.cpp: (WebCore::RenderBox::paintBoxDecorations): * rendering/RenderBoxModelObject.cpp: (WebCore::applyBoxShadowForBackground): (WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground const): (WebCore::areaCastingShadowInHole): (WebCore::RenderBoxModelObject::paintBoxShadow): Move the snapping until after we've adjusted rects for offset and spread. The "extraOffset" computation makes the snapping a little more complex; we have to snap before and after applying shadowOffset, and give to GraphicsContext the delta between the snapped values. * rendering/RenderTable.cpp: (WebCore::RenderTable::paintBoxDecorations): * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::paintBoxDecorations): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::setTextShadow): (WebCore::RenderStyle::getShadowExtent const): (WebCore::RenderStyle::getShadowInsetExtent const): (WebCore::RenderStyle::getShadowHorizontalExtent const): (WebCore::RenderStyle::getShadowVerticalExtent const): * rendering/style/ShadowData.cpp: (WebCore::ShadowData::ShadowData): (WebCore::calculateShadowExtent): (WebCore::ShadowData::adjustRectForShadow const): * rendering/style/ShadowData.h: (WebCore::ShadowData::ShadowData): (WebCore::ShadowData::x const): (WebCore::ShadowData::y const): (WebCore::ShadowData::location const): (WebCore::ShadowData::paintingExtent const): (WebCore::ShadowData::spread const): * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyTextOrBoxShadowValue): LayoutTests: * fast/box-shadow/hidpi-box-shadow-expected.html: Added. * fast/box-shadow/hidpi-box-shadow.html: Added. Canonical link: https://commits.webkit.org/217267@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252161 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-11-07 00:39:24 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
.container {
position: relative;
width: 30px;
height: 30px;
margin: 20px;
border: 1px solid silver;
}
.box {
position: absolute;
background-color: gray;
}
.shadow {
position: absolute;
background-color: blue;
}
</style>
</head>
<body>
<div class="container">
<div class="shadow" style="left: 0; top: 0; width: 12px; height: 12px;"></div>
<div class="box" style="left: 1px; top: 1px; width: 10px; height: 10px;"></div>
</div>
<div class="container">
<div class="shadow" style="left: 0.5px; top: 0.5px; width: 11px; height: 11px;"></div>
<div class="box" style="left: 1px; top: 1px; width: 10px; height: 10px;"></div>
</div>
<div class="container">
<div class="shadow" style="left: 0.5px; top: 0.5px; width: 11.5px; height: 11.5px;"></div>
<div class="box" style="left: 1px; top: 1px; width: 10.5px; height: 10.5px;"></div>
</div>
</body>
</html>