Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3797ce8cd607e61062785e52afb0170fd9319640
      
https://github.com/WebKit/WebKit/commit/3797ce8cd607e61062785e52afb0170fd9319640
  Author: Nikolas Zimmermann <[email protected]>
  Date:   2026-08-17 (Mon, 17 Aug 2026)

  Changed paths:
    M LayoutTests/platform/mac-tahoe-wk2-lbse-text/TestExpectations
    M Source/WebCore/rendering/RenderLayerSVGAdditions.cpp
    M Source/WebCore/rendering/svg/RenderSVGViewportContainer.cpp
    M Source/WebCore/rendering/svg/RenderSVGViewportContainer.h
    M Source/WebCore/svg/SVGSVGElement.cpp
    M Source/WebCore/svg/SVGSVGElement.h

  Log Message:
  -----------
  [LBSE] An empty viewBox does not disable rendering of the outermost <svg>
https://bugs.webkit.org/show_bug.cgi?id=321883

Reviewed by Rob Buis.

A viewBox with a zero width or height disables painting of the element. Legacy
does that with an early return in LegacyRenderSVGRoot::paintReplaced() and
LegacyRenderSVGViewportContainer::paint(). LBSE has no equivalent: A nested 
<svg>
still rendered right, as its empty overflow clip drops the content, but the
outermost <svg> is clipped by RenderSVGRoot and kept painting.

Add SVGSVGElement::viewBoxDisablesPainting() and check for it during
in both RenderSVGViewportContainer::paint() and
RenderLayer::paintForegroundChildrenForSVG().
The latter is needed because collectChildrenInDOMOrderForSVG() can flatten a
container into the root layer's child list, which bypasses its own paint()...

The four WPT tests covering this no longer need an LBSE expectation.

* LayoutTests/platform/mac-tahoe-wk2-lbse-text/TestExpectations:
* Source/WebCore/rendering/RenderLayerSVGAdditions.cpp:
(WebCore::viewBoxDisablesPaintingForSVG):
(WebCore::RenderLayer::paintForegroundChildrenForSVG):
* Source/WebCore/rendering/svg/RenderSVGViewportContainer.cpp:
(WebCore::RenderSVGViewportContainer::updateLayerTransform):
(WebCore::RenderSVGViewportContainer::paint):
* Source/WebCore/rendering/svg/RenderSVGViewportContainer.h:
* Source/WebCore/svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::viewBoxDisablesPainting):
* Source/WebCore/svg/SVGSVGElement.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to