Skip to content

Commit 5d4e301

Browse files
committed
[css-contain] certain non-local paint effects affect paint optimizations
Solves w3c#6325
1 parent ffd428e commit 5d4e301

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

css-contain-1/Overview.bs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,9 +1164,17 @@ Paint Containment</h3>
11641164
Possible optimizations that can be enabled by <a>paint containment</a> include (but are not limited to):
11651165

11661166
1. If the [=paint containment box|containment box=] is off-screen or obscured,
1167-
the UA can directly skip trying to paint its contents,
1167+
the UA can usually skip trying to paint its contents,
11681168
as they're guaranteed to be off-screen/obscured as well.
11691169

1170+
Note: Some paint effects such as the ''blur()'' filter from [[FILTER-EFFECTS-1]]
1171+
have non local effects.
1172+
The user agent needs to keep track of these,
1173+
as it may need to repaint parts of an element with such a filter
1174+
when its descendents change,
1175+
even if they have [=paint containment=]
1176+
and could otherwise be skipped.
1177+
11701178
2. Unless the clipped content is made accessible via a separate mechanism
11711179
such as the 'overflow', 'resize', or 'text-overflow' properties,
11721180
the UA can reserve "canvas" space for the box exactly the box's size.
@@ -1287,6 +1295,9 @@ This appendix is <em>informative</em>.
12871295

12881296
<li>
12891297
terminology change: replace "containing box" with "containment box"
1298+
1299+
<li>
1300+
Note that paint effects with non-local effects can limit certain optimization opportunities.
12901301
</ul>
12911302
</ul>
12921303

css-contain-2/Overview.bs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,9 +1133,17 @@ Possible Paint-Containment Optimizations</h4>
11331133
Possible optimizations that can be enabled by <a>paint containment</a> include (but are not limited to):
11341134

11351135
1. If the [=paint containment box|containment box=] is off-screen or obscured,
1136-
the UA can directly skip trying to paint its contents,
1136+
the UA can usually skip trying to paint its contents,
11371137
as they're guaranteed to be off-screen/obscured as well.
11381138

1139+
Note: Some paint effects such as the ''blur()'' filter from [[FILTER-EFFECTS-1]]
1140+
have non local effects.
1141+
The user agent needs to keep track of these,
1142+
as it may need to repaint parts of an element with such a filter
1143+
when its descendents change,
1144+
even if they have [=paint containment=]
1145+
and could otherwise be skipped.
1146+
11391147
2. Unless the clipped content is made accessible via a separate mechanism
11401148
such as the 'overflow', 'resize', or 'text-overflow' properties,
11411149
the UA can reserve "canvas" space for the box exactly the box's size.
@@ -1982,6 +1990,7 @@ Changes from <a href="https://www.w3.org/TR/2020/WD-css-contain-2-20201216/">202
19821990
* Clarify that scrollIntoView() doesn't scroll to children of a ''content-visibility:hidden'' element
19831991
* Defined that elements having an ancestor with ''content-visibility: hidden'' don't generate boxes in the top layer
19841992
* Defined that being in the top-layer makes an element relevant to the user
1993+
* Noted that paint effects with non-local effects can limit certain optimization opportunities.
19851994

19861995
<h3 id="changes-since-2020-06-03">
19871996
Changes from <a href="https://www.w3.org/TR/2020/WD-css-contain-2-20200603/">2020-06-03 Working Draft</a>

0 commit comments

Comments
 (0)