[webkit-changes] [WebKit/WebKit] 4d88a0: Only special-case document element outermost `svg`...

Ahmad Saleem noreply at github.com
Mon Jul 24 09:37:10 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4d88a0a85b71cfcf3ddba9e1fbfd7eeb6aeff4ec
      https://github.com/WebKit/WebKit/commit/4d88a0a85b71cfcf3ddba9e1fbfd7eeb6aeff4ec
  Author: Ahmad Saleem <ahmad.saleem792+github at gmail.com>
  Date:   2023-07-24 (Mon, 24 Jul 2023)

  Changed paths:
    A LayoutTests/imported/w3c/web-platform-tests/svg/extensibility/foreignObject/foreign-object-containing-svg-in-svg-in-object-expected.html
    A LayoutTests/imported/w3c/web-platform-tests/svg/extensibility/foreignObject/foreign-object-containing-svg-in-svg-in-object.html
    M Source/WebCore/rendering/svg/LegacyRenderSVGRoot.cpp
    M Source/WebCore/rendering/svg/RenderSVGRoot.cpp

  Log Message:
  -----------
  Only special-case document element outermost `svg` embedded via a frame

https://bugs.webkit.org/show_bug.cgi?id=259313

Reviewed by Simon Fraser.

This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.

Merge: https://chromium-review.googlesource.com/c/chromium/src/+/4681730

In Legacy & LBSE *RenderSVGRoot::IsEmbeddedThroughFrameContainingSVGDocument(), it
wasn't considered whether the `svg` was the document element or not, and
thus the special layout rules would be applied for all outermost `svg`
elements. This lead to incorrect layout results being calculated in some
of these cases.

Return false from said function if the *RenderSVGRoot is not associated
with the document element.

* Source/WebCore/rendering/svg/LegacyRenderSVGRoot.cpp:
(LegacyRenderSVGRoot::isEmbeddedThroughFrameContainingSVGDocument): As above
* Source/WebCore/rendering/svg/RenderSVGRoot.cpp:
(RenderSVGRoot::isEmbeddedThroughFrameContainingSVGDocument): As above
* LayoutTests/imported/w3c/web-platform-tests/svg/extensibility/foreignObject/foreign-object-containing-svg-in-svg-in-object.html: Add Test Case (manually)
* LayoutTests/imported/w3c/web-platform-tests/svg/extensibility/foreignObject/foreign-object-containing-svg-in-svg-in-object-expected.html: Add Test Case Expectation

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




More information about the webkit-changes mailing list