fune/testing/web-platform/tests/css/css-view-transitions/clip-path-larger-than-border-box-on-child-of-named-element-ref.html
Khushal Sagar 9d6ffcc3ab Bug 1881861 [wpt PR 44763] - view-transition: Fix rendering of elements with clip-path on descendants, a=testonly
Automatic update from web-platform-tests
view-transition: Fix rendering of elements with clip-path on descendants

The visual overflow rect computation code in ViewTransition assumes that
if an element has a clip-path, its content will be sized to the bounds
of that clip-path. The clip-path extent can be larger than the contents
of that element.

The above assumption is only true if the element with the clip-path is
layerized. Otherwise the size of the overflow is an intersection of the
element's painted content with the clip-path. This leads to incorrect
overflow calculation for an element's overflow rect when its not
layerized.

Fix the above by forcing layerization on descendants of a named element
if it has a clip-path. This is easier than knowing whether the content
will be layerized by the paint step later.

Fixed: 324585402
Change-Id: Id35cf3aab2cb4e9f0d27dbe36afeaf37789d95dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5322398
Auto-Submit: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1265246}

--

wpt-commits: 0ad3dae083cabb967784aa1714092c7393475bec
wpt-pr: 44763
2024-03-01 20:10:20 +00:00

29 lines
595 B
HTML

<!DOCTYPE html>
<html>
<title>View transitions: clip-path larger than element bounds on child of a named element (ref)</title>
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/">
<link rel="author" href="mailto:khushalsagar@chromium.org">
<style>
body {
background: lightpink;
}
.target {
width: 100px;
height: 100px;
background: blue;
}
.child {
width: 10px;
height: 10px;
position: relative;
top: 100px;
left: 100px;
background: green;
clip-path: inset(-10px -100px -50px -20px);
}
</style>
<div class="target">
<div class="child"></div>
</div>