Diff
Modified: trunk/Source/WebCore/ChangeLog (281063 => 281064)
--- trunk/Source/WebCore/ChangeLog 2021-08-15 17:44:55 UTC (rev 281063)
+++ trunk/Source/WebCore/ChangeLog 2021-08-15 18:38:00 UTC (rev 281064)
@@ -1,3 +1,40 @@
+2021-08-15 Rob Buis <[email protected]>
+
+ Remove shadow related SVG functionality
+ https://bugs.webkit.org/show_bug.cgi?id=228870
+
+ Reviewed by Simon Fraser.
+
+ Remove shadow related SVG functionality since it was added
+ for the removed property -webkit-svg-shadow (see r238071).
+
+ * rendering/style/SVGRenderStyle.cpp:
+ (WebCore::SVGRenderStyle::SVGRenderStyle):
+ (WebCore::SVGRenderStyle::operator== const):
+ (WebCore::SVGRenderStyle::copyNonInheritedFrom):
+ (WebCore::SVGRenderStyle::diff const):
+ * rendering/style/SVGRenderStyle.h:
+ (WebCore::SVGRenderStyle::initialLightingColor):
+ (WebCore::SVGRenderStyle::baselineShiftValue const):
+ (WebCore::SVGRenderStyle::isolatesBlending const):
+ (WebCore::SVGRenderStyle::initialShadow): Deleted.
+ (WebCore::SVGRenderStyle::setShadow): Deleted.
+ (WebCore::SVGRenderStyle::shadow const): Deleted.
+ * rendering/svg/RenderSVGImage.cpp:
+ (WebCore::RenderSVGImage::layout):
+ * rendering/svg/RenderSVGImage.h:
+ * rendering/svg/RenderSVGRoot.cpp:
+ (WebCore::RenderSVGRoot::computeFloatVisibleRectInContainer const):
+ (WebCore::RenderSVGRoot::updateCachedBoundaries):
+ * rendering/svg/RenderSVGRoot.h:
+ * rendering/svg/SVGRenderSupport.cpp:
+ (WebCore::SVGRenderSupport::clippedOverflowRectForRepaint):
+ (WebCore::SVGRenderSupport::computeFloatVisibleRectInContainer):
+ * rendering/svg/SVGRenderingContext.cpp:
+ (WebCore::SVGRenderingContext::~SVGRenderingContext):
+ (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
+ * rendering/svg/SVGRenderingContext.h:
+
2021-08-15 Simon Fraser <[email protected]>
[LFC Display] Introduce type-safe rect types for the display tree
Modified: trunk/Source/WebCore/rendering/style/SVGRenderStyle.cpp (281063 => 281064)
--- trunk/Source/WebCore/rendering/style/SVGRenderStyle.cpp 2021-08-15 17:44:55 UTC (rev 281063)
+++ trunk/Source/WebCore/rendering/style/SVGRenderStyle.cpp 2021-08-15 18:38:00 UTC (rev 281064)
@@ -57,7 +57,6 @@
, m_inheritedResourceData(defaultSVGStyle().m_inheritedResourceData)
, m_stopData(defaultSVGStyle().m_stopData)
, m_miscData(defaultSVGStyle().m_miscData)
- , m_shadowData(defaultSVGStyle().m_shadowData)
, m_layoutData(defaultSVGStyle().m_layoutData)
, m_nonInheritedResourceData(defaultSVGStyle().m_nonInheritedResourceData)
{
@@ -71,7 +70,6 @@
, m_inheritedResourceData(StyleInheritedResourceData::create())
, m_stopData(StyleStopData::create())
, m_miscData(StyleMiscData::create())
- , m_shadowData(StyleShadowSVGData::create())
, m_layoutData(StyleLayoutData::create())
, m_nonInheritedResourceData(StyleResourceData::create())
{
@@ -88,7 +86,6 @@
, m_inheritedResourceData(other.m_inheritedResourceData)
, m_stopData(other.m_stopData)
, m_miscData(other.m_miscData)
- , m_shadowData(other.m_shadowData)
, m_layoutData(other.m_layoutData)
, m_nonInheritedResourceData(other.m_nonInheritedResourceData)
{
@@ -108,7 +105,6 @@
&& m_textData == other.m_textData
&& m_stopData == other.m_stopData
&& m_miscData == other.m_miscData
- && m_shadowData == other.m_shadowData
&& m_layoutData == other.m_layoutData
&& m_inheritedResourceData == other.m_inheritedResourceData
&& m_nonInheritedResourceData == other.m_nonInheritedResourceData
@@ -140,7 +136,6 @@
m_nonInheritedFlags = other.m_nonInheritedFlags;
m_stopData = other.m_stopData;
m_miscData = other.m_miscData;
- m_shadowData = other.m_shadowData;
m_layoutData = other.m_layoutData;
m_nonInheritedResourceData = other.m_nonInheritedResourceData;
}
@@ -175,10 +170,6 @@
if (miscNotEqual && m_miscData->baselineShiftValue != other.m_miscData->baselineShiftValue)
return StyleDifference::Layout;
- // Shadow changes require relayouts, as they affect the repaint rects.
- if (m_shadowData != other.m_shadowData)
- return StyleDifference::Layout;
-
// The x or y properties require relayout.
if (m_layoutData != other.m_layoutData)
return StyleDifference::Layout;
Modified: trunk/Source/WebCore/rendering/style/SVGRenderStyle.h (281063 => 281064)
--- trunk/Source/WebCore/rendering/style/SVGRenderStyle.h 2021-08-15 17:44:55 UTC (rev 281063)
+++ trunk/Source/WebCore/rendering/style/SVGRenderStyle.h 2021-08-15 18:38:00 UTC (rev 281064)
@@ -77,7 +77,6 @@
static float initialFloodOpacity() { return 1; }
static Color initialFloodColor() { return Color::black; }
static Color initialLightingColor() { return Color::white; }
- static ShadowData* initialShadow() { return nullptr; }
static String initialMaskerResource() { return String(); }
static String initialMarkerStartResource() { return String(); }
static String initialMarkerMidResource() { return String(); }
@@ -124,8 +123,6 @@
void setLightingColor(const Color&);
void setBaselineShiftValue(const SVGLengthValue&);
- void setShadow(std::unique_ptr<ShadowData>&& data) { m_shadowData.access().shadow = WTFMove(data); }
-
// Setters for non-inherited resources
void setMaskerResource(const String&);
@@ -166,7 +163,6 @@
const Color& floodColor() const { return m_miscData->floodColor; }
const Color& lightingColor() const { return m_miscData->lightingColor; }
SVGLengthValue baselineShiftValue() const { return m_miscData->baselineShiftValue; }
- ShadowData* shadow() const { return m_shadowData->shadow.get(); }
const Length& cx() const { return m_layoutData->cx; }
const Length& cy() const { return m_layoutData->cy; }
const Length& r() const { return m_layoutData->r; }
@@ -192,7 +188,7 @@
bool hasMarkers() const { return !markerStartResource().isEmpty() || !markerMidResource().isEmpty() || !markerEndResource().isEmpty(); }
bool hasStroke() const { return strokePaintType() != SVGPaintType::None; }
bool hasFill() const { return fillPaintType() != SVGPaintType::None; }
- bool isolatesBlending() const { return hasMasker() || shadow(); }
+ bool isolatesBlending() const { return hasMasker(); }
private:
SVGRenderStyle();
@@ -249,7 +245,6 @@
// non-inherited attributes
DataRef<StyleStopData> m_stopData;
DataRef<StyleMiscData> m_miscData;
- DataRef<StyleShadowSVGData> m_shadowData;
DataRef<StyleLayoutData> m_layoutData;
DataRef<StyleResourceData> m_nonInheritedResourceData;
};
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGImage.cpp (281063 => 281064)
--- trunk/Source/WebCore/rendering/svg/RenderSVGImage.cpp 2021-08-15 17:44:55 UTC (rev 281063)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGImage.cpp 2021-08-15 18:38:00 UTC (rev 281064)
@@ -144,11 +144,8 @@
}
if (m_needsBoundariesUpdate) {
- m_repaintBoundingBoxExcludingShadow = m_objectBoundingBox;
- SVGRenderSupport::intersectRepaintRectWithResources(*this, m_repaintBoundingBoxExcludingShadow);
-
- m_repaintBoundingBox = m_repaintBoundingBoxExcludingShadow;
-
+ m_repaintBoundingBox = m_objectBoundingBox;
+ SVGRenderSupport::intersectRepaintRectWithResources(*this, m_repaintBoundingBox);
m_needsBoundariesUpdate = false;
}
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGImage.h (281063 => 281064)
--- trunk/Source/WebCore/rendering/svg/RenderSVGImage.h 2021-08-15 17:44:55 UTC (rev 281063)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGImage.h 2021-08-15 18:38:00 UTC (rev 281064)
@@ -86,7 +86,6 @@
AffineTransform m_localTransform;
FloatRect m_objectBoundingBox;
FloatRect m_repaintBoundingBox;
- FloatRect m_repaintBoundingBoxExcludingShadow;
std::unique_ptr<RenderImageResource> m_imageResource;
RefPtr<ImageBuffer> m_bufferedForeground;
};
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp (281063 => 281064)
--- trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp 2021-08-15 17:44:55 UTC (rev 281063)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp 2021-08-15 18:38:00 UTC (rev 281064)
@@ -370,14 +370,10 @@
std::optional<FloatRect> RenderSVGRoot::computeFloatVisibleRectInContainer(const FloatRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const
{
- // Apply our local transforms (except for x/y translation), then our shadow,
- // and then call RenderBox's method to handle all the normal CSS Box model bits
+ // Apply our local transforms (except for x/y translation) and then call
+ // RenderBox's method to handle all the normal CSS Box model bits
FloatRect adjustedRect = m_localToBorderBoxTransform.mapRect(rect);
- const SVGRenderStyle& svgStyle = style().svgStyle();
- if (const ShadowData* shadow = svgStyle.shadow())
- shadow->adjustRectForShadow(adjustedRect);
-
// Apply initial viewport clip
if (shouldApplyViewportClip()) {
if (context.options.contains(VisibleRectContextOption::UseEdgeInclusiveIntersection)) {
@@ -417,11 +413,9 @@
void RenderSVGRoot::updateCachedBoundaries()
{
- SVGRenderSupport::computeContainerBoundingBoxes(*this, m_objectBoundingBox, m_objectBoundingBoxValid, m_strokeBoundingBox, m_repaintBoundingBoxExcludingShadow);
- SVGRenderSupport::intersectRepaintRectWithResources(*this, m_repaintBoundingBoxExcludingShadow);
- m_repaintBoundingBoxExcludingShadow.inflate(horizontalBorderAndPaddingExtent());
-
- m_repaintBoundingBox = m_repaintBoundingBoxExcludingShadow;
+ SVGRenderSupport::computeContainerBoundingBoxes(*this, m_objectBoundingBox, m_objectBoundingBoxValid, m_strokeBoundingBox, m_repaintBoundingBox);
+ SVGRenderSupport::intersectRepaintRectWithResources(*this, m_repaintBoundingBox);
+ m_repaintBoundingBox.inflate(horizontalBorderAndPaddingExtent());
}
bool RenderSVGRoot::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hitTestAction)
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h (281063 => 281064)
--- trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h 2021-08-15 17:44:55 UTC (rev 281063)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h 2021-08-15 18:38:00 UTC (rev 281064)
@@ -111,7 +111,6 @@
bool m_inLayout { false };
FloatRect m_strokeBoundingBox;
FloatRect m_repaintBoundingBox;
- FloatRect m_repaintBoundingBoxExcludingShadow;
mutable AffineTransform m_localToParentTransform;
AffineTransform m_localToBorderBoxTransform;
HashSet<RenderSVGResourceContainer*> m_resourcesNeedingToInvalidateClients;
Modified: trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp (281063 => 281064)
--- trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp 2021-08-15 17:44:55 UTC (rev 281063)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp 2021-08-15 18:38:00 UTC (rev 281064)
@@ -59,9 +59,6 @@
// Pass our local paint rect to computeFloatVisibleRectInContainer() which will
// map to parent coords and recurse up the parent chain.
FloatRect repaintRect = renderer.repaintRectInLocalCoordinates();
- const SVGRenderStyle& svgStyle = renderer.style().svgStyle();
- if (const ShadowData* shadow = svgStyle.shadow())
- shadow->adjustRectForShadow(repaintRect);
return enclosingLayoutRect(renderer.computeFloatRectForRepaint(repaintRect, repaintContainer));
}
@@ -74,9 +71,6 @@
return FloatRect();
FloatRect adjustedRect = rect;
- const SVGRenderStyle& svgStyle = renderer.style().svgStyle();
- if (const ShadowData* shadow = svgStyle.shadow())
- shadow->adjustRectForShadow(adjustedRect);
adjustedRect.inflate(renderer.style().outlineWidth());
// Translate to coords in our parent renderer, and then call computeFloatVisibleRectInContainer() on our parent.
Modified: trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp (281063 => 281064)
--- trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp 2021-08-15 17:44:55 UTC (rev 281063)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp 2021-08-15 18:38:00 UTC (rev 281064)
@@ -66,9 +66,6 @@
if (m_renderingFlags & EndOpacityLayer)
m_paintInfo->context().endTransparencyLayer();
- if (m_renderingFlags & EndShadowLayer)
- m_paintInfo->context().endTransparencyLayer();
-
if (m_renderingFlags & RestoreGraphicsContext)
m_paintInfo->context().restore();
}
@@ -99,7 +96,6 @@
bool isRenderingMask = isRenderingMaskImage(*m_renderer);
// RenderLayer takes care of root opacity.
float opacity = (renderer.isSVGRoot() || isRenderingMask) ? 1 : style.opacity();
- const ShadowData* shadow = svgStyle.shadow();
bool hasBlendMode = style.hasBlendMode();
bool hasIsolation = style.hasIsolation();
bool isolateMaskForBlending = false;
@@ -111,7 +107,7 @@
}
#endif
- if (opacity < 1 || shadow || hasBlendMode || isolateMaskForBlending || hasIsolation) {
+ if (opacity < 1 || hasBlendMode || isolateMaskForBlending || hasIsolation) {
FloatRect repaintRect = m_renderer->repaintRectInLocalCoordinates();
m_paintInfo->context().clip(repaintRect);
@@ -127,12 +123,6 @@
m_renderingFlags |= EndOpacityLayer;
}
-
- if (shadow) {
- m_paintInfo->context().setShadow(IntSize(roundToInt(shadow->x()), roundToInt(shadow->y())), shadow->radius(), shadow->color());
- m_paintInfo->context().beginTransparencyLayer(1);
- m_renderingFlags |= EndShadowLayer;
- }
}
ClipPathOperation* clipPathOperation = style.clipPath();
Modified: trunk/Source/WebCore/rendering/svg/SVGRenderingContext.h (281063 => 281064)
--- trunk/Source/WebCore/rendering/svg/SVGRenderingContext.h 2021-08-15 17:44:55 UTC (rev 281063)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderingContext.h 2021-08-15 18:38:00 UTC (rev 281064)
@@ -84,13 +84,12 @@
RenderingPrepared = 1,
RestoreGraphicsContext = 1 << 1,
EndOpacityLayer = 1 << 2,
- EndShadowLayer = 1 << 3,
- EndFilterLayer = 1 << 4,
- PrepareToRenderSVGContentWasCalled = 1 << 5
+ EndFilterLayer = 1 << 3,
+ PrepareToRenderSVGContentWasCalled = 1 << 4
};
// List of those flags which require actions during the destructor.
- static constexpr int ActionsNeeded = RestoreGraphicsContext | EndOpacityLayer | EndShadowLayer | EndFilterLayer;
+ static constexpr int ActionsNeeded = RestoreGraphicsContext | EndOpacityLayer | EndFilterLayer;
RenderElement* m_renderer { nullptr };
PaintInfo* m_paintInfo { nullptr };