Skip to content

Commit cada8c7

Browse files
committed
will-change: transform should affect nested position:fixed
https://bugs.webkit.org/show_bug.cgi?id=167600 Reviewed by Alan Bujtas. "will-change transform" should make an element a container for position:fixed, just as a transform does. LayoutTests/imported/w3c: * web-platform-tests/css/css-position/position-absolute-dynamic-containing-block-expected.txt: Source/WebCore: Test: fast/css/will-change/will-change-transform-contains-fixed.html * rendering/RenderElement.h: (WebCore::RenderElement::canContainFixedPositionObjects): LayoutTests: * fast/css/will-change/will-change-transform-contains-fixed-expected.html: Added. * fast/css/will-change/will-change-transform-contains-fixed.html: Added. Canonical link: https://commits.webkit.org/236853@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276377 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 0e2f7f2 commit cada8c7

7 files changed

Lines changed: 114 additions & 4 deletions

File tree

LayoutTests/ChangeLog

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2021-04-21 Simon Fraser <simon.fraser@apple.com>
2+
3+
will-change: transform should affect nested position:fixed
4+
https://bugs.webkit.org/show_bug.cgi?id=167600
5+
6+
Reviewed by Alan Bujtas.
7+
8+
"will-change transform" should make an element a container for position:fixed,
9+
just as a transform does.
10+
11+
* fast/css/will-change/will-change-transform-contains-fixed-expected.html: Added.
12+
* fast/css/will-change/will-change-transform-contains-fixed.html: Added.
13+
114
2021-04-21 Chris Lord <clord@igalia.com>
215

316
DOMException should be Serializable
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
3+
<html>
4+
<head>
5+
<style>
6+
.container {
7+
position: relative;
8+
height: 200px;
9+
width: 200px;
10+
margin: 20px;
11+
border: 5px solid blue;
12+
}
13+
.box {
14+
height: 100px;
15+
width: 100px;
16+
}
17+
.absolute {
18+
position: absolute;
19+
background-color: green;
20+
left: 50px;
21+
top: 50px;
22+
}
23+
</style>
24+
</head>
25+
<body>
26+
<div class="container">
27+
<div class="absolute box"></div>
28+
</div>
29+
30+
<div class="container" style="transform: translateZ(0);">
31+
<div class="absolute box"></div>
32+
</div>
33+
</body>
34+
</html>
35+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE html>
2+
3+
<html>
4+
<head>
5+
<style>
6+
.container {
7+
height: 200px;
8+
width: 200px;
9+
margin: 20px;
10+
border: 5px solid blue;
11+
}
12+
.box {
13+
height: 100px;
14+
width: 100px;
15+
}
16+
.fixed {
17+
position: fixed;
18+
background-color: green;
19+
left: 50px;
20+
top: 50px;
21+
}
22+
</style>
23+
</head>
24+
<body>
25+
<div class="container" style="transform: translateX(0)">
26+
<div class="fixed box"></div>
27+
</div>
28+
29+
<div class="container" style="will-change: transform">
30+
<div class="fixed box"></div>
31+
</div>
32+
</body>
33+
</html>
34+

LayoutTests/imported/w3c/ChangeLog

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2021-04-21 Simon Fraser <simon.fraser@apple.com>
2+
3+
will-change: transform should affect nested position:fixed
4+
https://bugs.webkit.org/show_bug.cgi?id=167600
5+
6+
Reviewed by Alan Bujtas.
7+
8+
"will-change transform" should make an element a container for position:fixed,
9+
just as a transform does.
10+
11+
* web-platform-tests/css/css-position/position-absolute-dynamic-containing-block-expected.txt:
12+
113
2021-04-21 Antoine Quint <graouts@webkit.org>
214

315
Add discrete animation support for several background CSS properties

LayoutTests/imported/w3c/web-platform-tests/css/css-position/position-absolute-dynamic-containing-block-expected.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ PASS abs containing block moves from outer to intermediate
44
PASS abs containing block moves from intermediate to outer
55
PASS target is no longer absolute
66
PASS target becomes absolute
7-
FAIL fixed containing block moves from outer to intermediate assert_equals: expected 310 but got 600
8-
FAIL fixed containing block moves from intermediate to outer assert_equals: expected 210 but got 600
9-
FAIL target is no longer fixed assert_equals: expected 310 but got 600
10-
FAIL target becomes fixed assert_equals: expected 310 but got 600
7+
FAIL fixed containing block moves from outer to intermediate assert_equals: expected 210 but got 310
8+
FAIL fixed containing block moves from intermediate to outer assert_equals: expected 310 but got 210
9+
PASS target is no longer fixed
10+
PASS target becomes fixed
1111

Source/WebCore/ChangeLog

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
2021-04-21 Simon Fraser <simon.fraser@apple.com>
2+
3+
will-change: transform should affect nested position:fixed
4+
https://bugs.webkit.org/show_bug.cgi?id=167600
5+
6+
Reviewed by Alan Bujtas.
7+
8+
"will-change transform" should make an element a container for position:fixed,
9+
just as a transform does.
10+
11+
Test: fast/css/will-change/will-change-transform-contains-fixed.html
12+
13+
* rendering/RenderElement.h:
14+
(WebCore::RenderElement::canContainFixedPositionObjects):
15+
116
2021-04-21 Antoine Quint <graouts@webkit.org>
217

318
Add discrete animation support for several background CSS properties

Source/WebCore/rendering/RenderElement.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ inline bool RenderElement::canContainFixedPositionObjects() const
428428
{
429429
return isRenderView()
430430
|| (hasTransform() && isRenderBlock())
431+
|| (style().willChange() && style().willChange()->containsProperty(CSSPropertyTransform))
431432
|| isSVGForeignObject()
432433
|| shouldApplyLayoutContainment(*this)
433434
|| isOutOfFlowRenderFragmentedFlow();

0 commit comments

Comments
 (0)