haikuwebkit/LayoutTests/svg/foreignObject
commit-queue@webkit.org 773545e7c7 Crash in RenderBlock::addOverflowFromChildren
https://bugs.webkit.org/show_bug.cgi?id=223539

Patch by Frédéric Wang <fwang@igalia.com> on 2021-04-14
Reviewed by Ryosuke Niwa.

Source/WebCore:

For an <svg> element that is a direct child of a <foreignObject>, a RenderSVGRoot is
generally created. However, a RenderSVGViewportContainer is currently created instead if
the element is inside a shadow tree. This is leading to bad state during the layout of
the foreign object, causing a debug assertion and a nullptr crash. This patch fixes this
issue by always treating direct <svg> child of <foreignObject> as an outermost SVG element.

Tests: svg/foreignObject/svg-child-of-foreign-object-in-shadow-tree-crash.html
       svg/outermost-svg-root.html

* svg/SVGElement.cpp:
(WebCore::SVGElement::isOutermostSVGSVGElement const): Lower down the priority of the rule
"is in shadow tree".

LayoutTests:

Add regressions tests for the crash and for isOutermostSVGSVGElement().

* svg/foreignObject/svg-child-of-foreign-object-in-shadow-tree-crash-expected.txt: Added.
* svg/foreignObject/svg-child-of-foreign-object-in-shadow-tree-crash.html: Added.
* svg/outermost-svg-root-expected.txt: Added.
* svg/outermost-svg-root.html: Added.

Canonical link: https://commits.webkit.org/236506@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275944 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-14 15:13:36 +00:00
..
absolute-position-foreign-object-child-crash-expected.txt
absolute-position-foreign-object-child-crash.html
background-render-phase-expected.png
background-render-phase-expected.txt
background-render-phase.html
body-background-expected.png
body-background-expected.txt
body-background.svg
clip-expected.png
clip-expected.txt
clip.html
disallowed-svg-nodes-as-direct-children-expected.png
disallowed-svg-nodes-as-direct-children-expected.txt
disallowed-svg-nodes-as-direct-children.svg
fO-display-none-expected.png
fO-display-none-expected.txt
fO-display-none-with-relative-pos-content-expected.png
fO-display-none-with-relative-pos-content-expected.txt
fO-display-none-with-relative-pos-content.svg
fO-display-none.svg
fO-fixed-position-crash-expected.txt
fO-fixed-position-crash.html
fO-parent-display-changes-expected.png
fO-parent-display-changes-expected.txt
fO-parent-display-changes.svg
fO-parent-display-none-expected.png
fO-parent-display-none-expected.txt
fO-parent-display-none-with-relative-pos-content-expected.png
fO-parent-display-none-with-relative-pos-content-expected.txt
fO-parent-display-none-with-relative-pos-content.svg
fO-parent-display-none.svg
fO-parent-of-parent-display-none-expected.png
fO-parent-of-parent-display-none-expected.txt
fO-parent-of-parent-display-none-with-relative-pos-content-expected.png
fO-parent-of-parent-display-none-with-relative-pos-content-expected.txt
fO-parent-of-parent-display-none-with-relative-pos-content.svg
fO-parent-of-parent-display-none.svg
filter-expected.png
filter-expected.txt
filter.html
fixed-position-expected.svg
fixed-position.svg
foreign-object-defs-crash-expected.txt
foreign-object-defs-crash.svg
foreign-object-dynamic-parsing-expected.svg
foreign-object-dynamic-parsing.svg
mask-expected.png
mask-expected.txt
mask.html
multiple-foreign-objects-expected.png
multiple-foreign-objects-expected.txt
multiple-foreign-objects.html
no-crash-with-svg-content-in-html-document-expected.png
no-crash-with-svg-content-in-html-document.svg
repaint-rect-coordinates-expected.html
repaint-rect-coordinates.html
svg-child-of-foreign-object-in-shadow-tree-crash-expected.txt
svg-child-of-foreign-object-in-shadow-tree-crash.html
svg-document-as-direct-child-expected.png
svg-document-as-direct-child-expected.txt
svg-document-as-direct-child.svg
svg-document-in-html-document.svg
text-tref-02-b-expected.txt
text-tref-02-b.svg
viewport-foreignobject-crash-expected.html
viewport-foreignobject-crash.html