[webkit-changes] [WebKit/WebKit] 6c8fe3: [LBSE] Fix visual overflow computation

Nikolas Zimmermann noreply at github.com
Fri Oct 6 04:08:29 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6c8fe3a7b838afa10d1655859e8515e8ed034fa7
      https://github.com/WebKit/WebKit/commit/6c8fe3a7b838afa10d1655859e8515e8ed034fa7
  Author: Nikolas Zimmermann <nzimmermann at igalia.com>
  Date:   2023-10-06 (Fri, 06 Oct 2023)

  Changed paths:
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/TestExpectations
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/W3C-SVG-1.1/coords-viewattr-01-b-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/W3C-SVG-1.1/masking-path-03-b-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/foreign-object-skew-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/foreignObject-crash-on-hover-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/use-on-disallowed-foreign-object-1-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/use-on-disallowed-foreign-object-2-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/use-on-disallowed-foreign-object-4-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/use-on-disallowed-foreign-object-5-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/use-on-disallowed-foreign-object-6-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/use-on-non-svg-namespaced-element-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/foreignObject/body-background-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/foreignObject/multiple-foreign-objects-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/foreignObject/svg-document-as-direct-child-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/hixie/mixed/008-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/overflow/overflow-on-foreignObject-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/repaint/mask-clip-target-transform-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/text/foreignObject-repaint-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/text/foreignObject-text-clipping-bug-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/text/text-rescale-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/page/zoom-coords-viewattr-01-b-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/page/zoom-foreignObject-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/page/zoom-hixie-mixed-008-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/text/zoom-coords-viewattr-01-b-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/text/zoom-foreignObject-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/text/zoom-hixie-mixed-008-expected.txt
    M LayoutTests/platform/mac-ventura-wk2-pixel/svg/overflow/overflow-on-foreignObject-expected.png
    M LayoutTests/svg/overflow/overflow-on-foreignObject.svg
    M Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
    M Source/WebCore/rendering/svg/RenderSVGForeignObject.h
    M Source/WebCore/rendering/svg/SVGBoundingBoxComputation.h

  Log Message:
  -----------
  [LBSE] Fix visual overflow computation
https://bugs.webkit.org/show_bug.cgi?id=262694

Reviewed by Rob Buis.

Fix computation of visual overflow rect in SVGBoundingBoxComputation.
Stop taking transformations into account -- the layout related geometry excludes
transformations (CSS/HTML transformations do not influence layout, only paint).

LBSE was changed in 2022 to follow that (https://trac.webkit.org/changeset/293504/webkit)
but we failed to adapt visual overflow handling after this change.

Fixing computeVisualOverflowRect() resolve the issue in general, but broke <foreignObject>
repainting in LBSE. This only uncovered that overflow handling in general is broken for
<foreignObject> (and has always been in WebKit since its introduction in 2010). Stop handling
x/y via transformations, but instead move the block itself along x/y direction.

This change therefore fixes both visual overflow in general, and specifically for <foreignObject>.

Covered by existing tests (svg/overflow/overflow-on-foreignObject.svg fixed in LBSE only).

* LayoutTests/platform/mac-ventura-wk2-lbse-text/TestExpectations:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/W3C-SVG-1.1/coords-viewattr-01-b-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/W3C-SVG-1.1/masking-path-03-b-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/foreign-object-skew-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/foreignObject-crash-on-hover-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/use-on-disallowed-foreign-object-1-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/use-on-disallowed-foreign-object-2-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/use-on-disallowed-foreign-object-4-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/use-on-disallowed-foreign-object-5-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/use-on-disallowed-foreign-object-6-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/custom/use-on-non-svg-namespaced-element-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/foreignObject/body-background-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/foreignObject/multiple-foreign-objects-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/foreignObject/svg-document-as-direct-child-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/hixie/mixed/008-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/overflow/overflow-on-foreignObject-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/repaint/mask-clip-target-transform-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/text/foreignObject-repaint-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/text/foreignObject-text-clipping-bug-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/text/text-rescale-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/page/zoom-coords-viewattr-01-b-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/page/zoom-foreignObject-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/page/zoom-hixie-mixed-008-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/text/zoom-coords-viewattr-01-b-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/text/zoom-foreignObject-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/text/zoom-hixie-mixed-008-expected.txt:
* LayoutTests/platform/mac-ventura-wk2-pixel/svg/overflow/overflow-on-foreignObject-expected.png:
* LayoutTests/svg/overflow/overflow-on-foreignObject.svg:
* Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::paint):
(WebCore::RenderSVGForeignObject::layout):
(WebCore::RenderSVGForeignObject::overflowClipRect const):
(WebCore::RenderSVGForeignObject::applyTransform const):
* Source/WebCore/rendering/svg/RenderSVGForeignObject.h:
* Source/WebCore/rendering/svg/SVGBoundingBoxComputation.h:
(WebCore::SVGBoundingBoxComputation::computeVisualOverflowRect):

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




More information about the webkit-changes mailing list