OLD | NEW |
1 # `Source/core/paint` | 1 # `Source/core/paint` |
2 | 2 |
3 This directory contains implementation of painters of layout objects. It covers | 3 This directory contains implementation of painters of layout objects. It covers |
4 the following document lifecycle states: | 4 the following document lifecycle states: |
5 | 5 |
6 * PaintInvalidation (`InPaintInvalidation` and `PaintInvalidationClean`) | 6 * PaintInvalidation (`InPaintInvalidation` and `PaintInvalidationClean`) |
7 * PrePaint (`InPrePaint` and `PrePaintClean`) | 7 * PrePaint (`InPrePaint` and `PrePaintClean`) |
8 * Paint (`InPaint` and `PaintClean`) | 8 * Paint (`InPaint` and `PaintClean`) |
9 | 9 |
10 ## Glossaries | 10 ## Glossaries |
11 | 11 |
12 ### Stacked elements and stacking contexts | 12 ### Stacked elements and stacking contexts |
13 | 13 |
14 This chapter is basically a clarification of [CSS 2.1 appendix E. Elaborate desc
ription | 14 This chapter is basically a clarification of [CSS 2.1 appendix E. Elaborate desc
ription |
15 of Stacking Contexts](http://www.w3.org/TR/CSS21/zindex.html). | 15 of Stacking Contexts](http://www.w3.org/TR/CSS21/zindex.html). |
16 | 16 |
17 Note: we use 'element' instead of 'object' in this chapter to keep consistency w
ith | 17 Note: we use 'element' instead of 'object' in this chapter to keep consistency w
ith |
18 the spec. We use 'object' in other places in this document. | 18 the spec. We use 'object' in other places in this document. |
19 | 19 |
20 According to the documentation, we can have the following types of elements that
are | 20 According to the documentation, we can have the following types of elements that
are |
21 treated in different ways during painting: | 21 treated in different ways during painting: |
22 | 22 |
23 * Stacked objects: objects that are z-ordered in stacking contexts, including: | 23 * Stacked objects: objects that are z-ordered in stacking contexts, including: |
24 | 24 |
25 * Stacking contexts: elements with non-auto z-indices. | 25 * Stacking contexts: elements with non-auto z-indices or other properties |
| 26 that affect stacking e.g. transform, opacity, blend-mode. |
26 | 27 |
27 * Elements that are not real stacking contexts but are treated as stacking | 28 * Elements that are not real stacking contexts but are treated as stacking |
28 contexts but don't manage other stacked elements. Their z-ordering are | 29 contexts but don't manage other stacked elements. Their z-ordering are |
29 managed by real stacking contexts. They are positioned elements with | 30 managed by real stacking contexts. They are positioned elements with |
30 `z-index: auto` (E.2.8 in the documentation). | 31 `z-index: auto` (E.2.8 in the documentation). |
31 | 32 |
32 They must be managed by the enclosing stacking context as stacked elemen
ts | 33 They must be managed by the enclosing stacking context as stacked elemen
ts |
33 because `z-index:auto` and `z-index:0` are considered equal for stacking | 34 because `z-index:auto` and `z-index:0` are considered equal for stacking |
34 context sorting and they may interleave by DOM order. | 35 context sorting and they may interleave by DOM order. |
35 | 36 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 | 254 |
254 When layer structure changes, and we are not invalidate paint of the changed sub
tree, | 255 When layer structure changes, and we are not invalidate paint of the changed sub
tree, |
255 we need to manually update the `needsPaintPhaseXXX` flags. For example, if an ob
ject changes | 256 we need to manually update the `needsPaintPhaseXXX` flags. For example, if an ob
ject changes |
256 style and creates a self-painting-layer, we copy the flags from its containing s
elf-painting | 257 style and creates a self-painting-layer, we copy the flags from its containing s
elf-painting |
257 layer to this layer, assuming that this layer needs all paint phases that its co
ntainer | 258 layer to this layer, assuming that this layer needs all paint phases that its co
ntainer |
258 self-painting layer needs. | 259 self-painting layer needs. |
259 | 260 |
260 We could update the `needsPaintPhaseXXX` flags in a separate tree walk, but that
would regress | 261 We could update the `needsPaintPhaseXXX` flags in a separate tree walk, but that
would regress |
261 performance of the first paint. For slimming paint v2, we can update the flags d
uring the | 262 performance of the first paint. For slimming paint v2, we can update the flags d
uring the |
262 pre-painting tree walk to simplify the logics. | 263 pre-painting tree walk to simplify the logics. |
OLD | NEW |