[webkit-changes] [WebKit/WebKit] d4e801: REGRESSION(265135 at main): CSS filter is not applied...

Kiet Ho noreply at github.com
Thu Aug 24 11:28:58 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d4e801ecf045fd89d0fe6b4f7e1f27f8648dbea0
      https://github.com/WebKit/WebKit/commit/d4e801ecf045fd89d0fe6b4f7e1f27f8648dbea0
  Author: Kiet Ho <tho22 at apple.com>
  Date:   2023-08-24 (Thu, 24 Aug 2023)

  Changed paths:
    A LayoutTests/svg/filters/css-filter-specified-on-svg-root-expected.html
    A LayoutTests/svg/filters/css-filter-specified-on-svg-root.html
    M Source/WebCore/rendering/RenderLayer.cpp
    M Source/WebCore/rendering/svg/SVGRenderingContext.cpp

  Log Message:
  -----------
  REGRESSION(265135 at main): CSS filter is not applied on SVG element
https://bugs.webkit.org/show_bug.cgi?id=260152
rdar://114204485

Reviewed by Said Abou-Hallawa.

Before 265135 at main, an SVG root with a filter specified as presentation attribute
(e.g: <svg filter="...">) was filtered twice instead of once: once by SVGRenderingContext,
and another by RenderLayer. 265135 at main attempted to fix this by instructing RenderLayer
not to apply filters when rendering an SVG root. This caused a regression where an SVG root
with a filter specified using CSS filter property is not filtered, because SVGRenderingContext
is not responsible for apply CSS filters, and RenderLayer refuses to filter because it's an
SVG root. Fix the previous attempt by fixing SVGRenderingContext to not filter when rendering
an SVG root, so RenderLayer is now solely responsible for filtering SVG roots.

Test: LayoutTests/svg/filters/css-filter-specified-on-svg-root.html

* LayoutTests/svg/filters/css-filter-specified-on-svg-root-expected.html: Added.
* LayoutTests/svg/filters/css-filter-specified-on-svg-root.html: Added.
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintsWithFilters const):
(WebCore::RenderLayer::calculateClipRects const):
* Source/WebCore/rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::prepareToRenderSVGContent):

Canonical link: https://commits.webkit.org/267236@main




More information about the webkit-changes mailing list