Bug
1802415 [wpt PR 37155] - SVG: Ignore foreign-namespace elements even with display:contents, a=testonly
Automatic update from web-platform-tests
SVG: Ignore foreign-namespace elements even with display:contents
SVG containers such as <svg> and <g> drop subtrees in foreign-
namespace elements. For example,
<svg>
<div>
<rect/>
</div>
...
The <div> subtree is not used to render the <svg>.
We should do it even for elements with display:contents.
<svg>
<div style="display:contents">
<rect/>
</div>
...
We failed to do it because the drop is handled with a LayoutObject
tree. This CL fixes it by checking DOM nodes in IsChildAllowed().
* Implementation
- Introduce SVGContentContainer::IsChildAllowed() to share
the IsChildAllowed() logic in LayoutSVGModelObject and LayoutSVGRoot.
It reject SVG LayoutObject child if its parent element is not a SVG.
- Update *CullRectUpdaterTest. svg1 doesn't have a LayoutObject
after this CL.
Bug:
1393223
Change-Id: I6061b629fba2a0f45dcd8d902640be2aef75b168
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/
4054303
Auto-Submit: Kent Tamura <tkent@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/main@{#
1075693}
--
wpt-commits:
58eba72745d997d6409722902a6d169ae41b7114
wpt-pr: 37155