Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7d23d960d9a8207ff670e29a3bfd2eb631875cf0
      
https://github.com/WebKit/WebKit/commit/7d23d960d9a8207ff670e29a3bfd2eb631875cf0
  Author: Lily Spiniolas <[email protected]>
  Date:   2026-03-10 (Tue, 10 Mar 2026)

  Changed paths:
    A 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-expected.txt
    A 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-image-expected.txt
    A 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-image-with-layer-based-svg-engine-expected.txt
    A 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-image-with-layer-based-svg-engine.html
    A 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-image.html
    A 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-path-expected.txt
    A 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-path-with-layer-based-svg-engine-expected.txt
    A 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-path-with-layer-based-svg-engine.html
    A 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-path.html
    A 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-text-expected.txt
    A 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-text-with-layer-based-svg-engine-expected.txt
    A 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-text-with-layer-based-svg-engine.html
    A 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-text.html
    A 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-with-layer-based-svg-engine-expected.txt
    A 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-with-layer-based-svg-engine.html
    A LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg.html
    A LayoutTests/interaction-region/resources/image.png
    M LayoutTests/interaction-region/svg-expected.txt
    M LayoutTests/interaction-region/svg-luminance-expected.txt
    M LayoutTests/interaction-region/svg.html
    M Source/WebCore/rendering/RenderLayerModelObject.cpp
    M Source/WebCore/rendering/RenderLayerModelObject.h
    M Source/WebCore/rendering/RenderReplaced.cpp
    M Source/WebCore/rendering/svg/RenderSVGImage.cpp
    M Source/WebCore/rendering/svg/RenderSVGShape.cpp
    M Source/WebCore/rendering/svg/RenderSVGText.cpp
    M Source/WebCore/rendering/svg/legacy/LegacyRenderSVGImage.cpp
    M Source/WebCore/rendering/svg/legacy/LegacyRenderSVGShape.cpp

  Log Message:
  -----------
  Touch event regions may fail to generate correctly for SVGs
https://bugs.webkit.org/show_bug.cgi?id=309293
rdar://171703966

Reviewed by Abrar Rahman Protyasha and Etienne Segonzac.

Update our logic for painting SVG components to properly handle event regions.
Fixes are included for both the layer-based SVG engine (LBSE) and the
non-layer-based SVG engine.

LegacyRenderSVGImage::paint: If the phase is `PaintPhase::EventRegion`,
add the stroke bounding box to the current event region context.

LegacyRenderSVGShape::paint: Instead of adding the bounding box to
the current event region context, add the stroke bounding box.

RenderSVGImage::paint: If the phase is `PaintPhase::EventRegion`, call
`paintSVGEventRegion` (described below).

RenderSVGShape.cpp: If the phase is `PaintPhase::EventRegion`, call
`paintSVGEventRegion` (described below).

RenderSVGText.cpp: If the phase is `PaintPhase::EventRegion` and LBSE,
is enabled, call `paintSVGEventRegion` (described below). If LBSE
is disabled and the phase is `PaintPhase::EventRegion`, add the stroke
bounding box to the current event region context.

RenderLayerModelObject.[h/cpp]: Add method `paintSVGEventRegion` which
translates the stroke bounding box to the correct location in the current
context using the paint offset, and adds it to the event region context.

RenderReplaced.cpp: Stop gating `paintReplaced()` behind
`INTERACTION_REGIONS_IN_EVENT_REGION` so that event regions are generated on
non-visionOS platforms.

Tests: 
fast/events/touch/ios/touch-event-regions-layer-tree/svg-image-with-layer-based-svg-engine.html
       fast/events/touch/ios/touch-event-regions-layer-tree/svg-image.html
       
fast/events/touch/ios/touch-event-regions-layer-tree/svg-path-with-layer-based-svg-engine.html
       fast/events/touch/ios/touch-event-regions-layer-tree/svg-path.html
       
fast/events/touch/ios/touch-event-regions-layer-tree/svg-text-with-layer-based-svg-engine.html
       fast/events/touch/ios/touch-event-regions-layer-tree/svg-text.html
       
fast/events/touch/ios/touch-event-regions-layer-tree/svg-with-layer-based-svg-engine.html
       fast/events/touch/ios/touch-event-regions-layer-tree/svg.html

* 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-expected.txt:
 Added.
* 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-image-expected.txt:
 Added.
* 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-image-with-layer-based-svg-engine-expected.txt:
 Added.
* 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-image-with-layer-based-svg-engine.html:
 Added.
* 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-image.html:
 Added.
* 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-path-expected.txt:
 Added.
* 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-path-with-layer-based-svg-engine-expected.txt:
 Added.
* 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-path-with-layer-based-svg-engine.html:
 Added.
* 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-path.html: 
Added.
* 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-text-expected.txt:
 Added.
* 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-text-with-layer-based-svg-engine-expected.txt:
 Added.
* 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-text-with-layer-based-svg-engine.html:
 Added.
* 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-text.html: 
Added.
* 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-with-layer-based-svg-engine-expected.txt:
 Added.
* 
LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg-with-layer-based-svg-engine.html:
 Added.
* LayoutTests/fast/events/touch/ios/touch-event-regions-layer-tree/svg.html: 
Added.
* LayoutTests/interaction-region/resources/image.png: Added.
* LayoutTests/interaction-region/svg-expected.txt:
* LayoutTests/interaction-region/svg-luminance-expected.txt:
* LayoutTests/interaction-region/svg.html:
* Source/WebCore/rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::paintSVGEventRegion):
* Source/WebCore/rendering/RenderLayerModelObject.h:
* Source/WebCore/rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::paint):
* Source/WebCore/rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::paint):
* Source/WebCore/rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::paint):
* Source/WebCore/rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::paint):
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGImage.cpp:
(WebCore::LegacyRenderSVGImage::paint):
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGShape.cpp:
(WebCore::LegacyRenderSVGShape::paint):

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



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

Reply via email to