Skip to content

Commit 5670df7

Browse files
progerschromium-wpt-export-bot
authored andcommitted
Fix 3d transform check in HasDistortingVisualEffects
https://crrev.com/1629048 relies on `HasDistortingVisualEffects` catching all cases where the target has a 3d transform. Unfortunately, this was not the case because `GeometryMapper::SourceToDestinationProjection` will flatten 3d transforms, so the following check is insufficient: ``` gfx::Transform projection = SourceToDestinationProjection( paint_properties.Transform(), root_properties.Transform()); if (!projection.Is2dProportionalUpscaleAndOr2dTranslation()) return true; ``` This patch fixes this issue by ensuring that the target and the root are coplanar before relying on the projection. Fixed: 517176673 Change-Id: Ia03596324a88252c054f0963f7aa08b60d1a5497 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7877217 Reviewed-by: Stefan Zager <szager@chromium.org> Auto-Submit: Philip Rogers <pdr@chromium.org> Commit-Queue: Philip Rogers <pdr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1637326}
1 parent 1038655 commit 5670df7

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<!DOCTYPE html>
2+
<meta name="viewport" content="width=device-width,initial-scale=1">
3+
<script src="/resources/testharness.js"></script>
4+
<script src="/resources/testharnessreport.js"></script>
5+
<style>
6+
#container {
7+
position: relative;
8+
transform: translateZ(-10px);
9+
transform-style: preserve-3d;
10+
width: 200px;
11+
height: 200px;
12+
background: blue;
13+
}
14+
#target {
15+
position: absolute;
16+
left: 0;
17+
top: 0;
18+
width: 100px;
19+
height: 100px;
20+
background: red;
21+
}
22+
#occluder {
23+
position: absolute;
24+
left: 0;
25+
top: 0;
26+
width: 100px;
27+
height: 100px;
28+
transform: translateZ(5px);
29+
background: green;
30+
pointer-events: none;
31+
}
32+
</style>
33+
<div id="container">
34+
<div id="target"></div>
35+
<div id="occluder"></div>
36+
</div>
37+
38+
<script>
39+
setup({ single_test: true });
40+
const target = document.getElementById("target");
41+
new IntersectionObserver(entries => {
42+
assert_false(entries[0].isVisible);
43+
done();
44+
}, {trackVisibility: true, delay: 100}).observe(target);
45+
</script>

0 commit comments

Comments
 (0)