[webkit-changes] [WebKit/WebKit] afa718: [Resize-observer] The `getBoundingBox` of a non-em...

cathiechen noreply at github.com
Mon Mar 27 06:24:35 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: afa718b1cfd97ca212d7b139751feb9ce1afcf5b
      https://github.com/WebKit/WebKit/commit/afa718b1cfd97ca212d7b139751feb9ce1afcf5b
  Author: Cathie Chen <cathiechen at igalia.com>
  Date:   2023-03-27 (Mon, 27 Mar 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/contain-intrinsic-size/auto-007-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/resize-observer/svg-with-css-box-001-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/resize-observer/svg-with-css-box-002-expected.txt
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/page/ResizeObservation.cpp
    M Source/WebCore/svg/SVGElement.cpp
    M Source/WebCore/svg/SVGElement.h

  Log Message:
  -----------
  [Resize-observer] The `getBoundingBox` of a non-empty SVG element is 0x0
https://bugs.webkit.org/show_bug.cgi?id=252903

Reviewed by Oriol Brufau and Nikolas Zimmermann.

Per [1], the specification updates that for SVG elements that do not have associated CSS layout boxes define bounding box
instead of a content box. Previously, all svg elements are using the bounding box. This patch adds Element::getBoundingBoxForSVGElement()
and reuses shouldObtainBoundsFromSVGModel to get the bounding box only for svg elements without associated CSS layout boxes.

* LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/contain-intrinsic-size/auto-007-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/resize-observer/svg-with-css-box-001-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/resize-observer/svg-with-css-box-002-expected.txt:
* Source/WebCore/dom/Element.cpp:
(WebCore::shouldObtainBoundsFromSVGModel):
* Source/WebCore/page/ResizeObservation.cpp:
(WebCore::ResizeObservation::computeObservedSizes const):
* Source/WebCore/svg/SVGElement.cpp:
(WebCore::SVGElement::hasAssociatedSVGLayoutBox const):
* Source/WebCore/svg/SVGElement.h:

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




More information about the webkit-changes mailing list