Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # `Source/core/paint` | 1 # `Source/core/paint` |
| 2 | 2 |
| 3 This directory contains implementation of painters of layout objects. | 3 This directory contains implementation of painters of layout objects. |
| 4 | 4 |
| 5 ## Stacked contents and stacking contexts | |
| 6 | |
| 7 This chapter is basically a clarification of [CSS 2.1 appendix E. Elaborate desc ription | |
| 8 of Stacking Contexts](http://www.w3.org/TR/CSS21/zindex.html). | |
| 9 | |
| 10 According to the documentation, we can have the following types of elements that are | |
| 11 treated in different ways during painting: | |
| 12 | |
| 13 * Stacked elements: elements that are z-ordered in stacking contexts. | |
| 14 | |
| 15 * Stacking contexts: elements with non-auto z-indices. | |
| 16 | |
| 17 * Elements that are not real stacking contexts but are treated as stacking | |
| 18 contexts and their z-ordering are managed by real stacking contexts. | |
| 19 They are positioned elements with `z-index: auto` (E.2.8 in the document ation). | |
|
chrishtr
2016/03/16 16:26:16
Add a paragraph below that explains what "treated
Xianzhu
2016/03/16 18:10:24
Done.
| |
| 20 They must be managed by the enclosing stacking context as stacked elemen ts | |
| 21 because `z-index:auto` and `z-index:0` are considered equal for stacking | |
| 22 context sorting and they may interleave by DOM order. | |
| 23 | |
| 24 They are painted as self-painting PaintLayers. | |
| 25 | |
| 26 * Non-stacked pseudo stacking contexts: elements that are not stacked, but pai nt | |
| 27 their descendants (excluding any stacked contents) as if they created stacki ng | |
| 28 contexts. This includes | |
| 29 | |
| 30 * inline blocks, inline tables, inline-level replaced elements | |
| 31 (E.2.7.2.1.4 in the documentation) | |
| 32 * non-positioned floating elements (E.2.5 in the documentation) | |
| 33 * [flex items](http://www.w3.org/TR/css-flexbox-1/#painting) | |
| 34 * [grid items](http://www.w3.org/TR/css-grid-1/#z-order) | |
| 35 * custom scrollbar parts | |
| 36 | |
| 37 They are painted as pseudo stacking contexts by `ObjectPainter::paintAsPseud oStackingContext()`. | |
|
pdr.
2016/03/16 02:22:53
Nit: update to be paintAllPhasesAtomically
Xianzhu
2016/03/16 18:10:24
Done.
| |
| 38 | |
| 39 * Other normal elements. | |
| 40 | |
| 41 "Stacked element" is not defined as a formal term in the documentation, but we f ound | |
| 42 it convenient to use this term to refer to any elements participating z-index or dering | |
| 43 in stacking contexts. | |
| 44 | |
| 5 ## Painters | 45 ## Painters |
| 6 | 46 |
| 7 ## Paint invalidation | 47 ## Paint invalidation |
| 8 | 48 |
| 9 Paint invalidation marks anything that need to be painted differently from the o riginal | 49 Paint invalidation marks anything that need to be painted differently from the o riginal |
| 10 cached painting. | 50 cached painting. |
| 11 | 51 |
| 12 ### Slimming paint v1 | 52 ### Slimming paint v1 |
| 13 | 53 |
| 14 Though described in this document, most of the actual paint invalidation code is under | 54 Though described in this document, most of the actual paint invalidation code is under |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 108 so we never clear the flags. Instead, we use another set of flags (`previousPain tPhaseXXXWasEmpty`) | 148 so we never clear the flags. Instead, we use another set of flags (`previousPain tPhaseXXXWasEmpty`) |
| 109 to record if a painting of a phase actually produced nothing. We'll skip the nex t | 149 to record if a painting of a phase actually produced nothing. We'll skip the nex t |
| 110 painting of the phase if the flag is set, regardless of the corresponding | 150 painting of the phase if the flag is set, regardless of the corresponding |
| 111 `needsPaintPhaseXXX` flag. We will clear the `previousPaintPhaseXXXWasEmpty` fla gs when | 151 `needsPaintPhaseXXX` flag. We will clear the `previousPaintPhaseXXXWasEmpty` fla gs when |
| 112 we paint with different clipping, scroll offset or interest rect from the previo us paint. | 152 we paint with different clipping, scroll offset or interest rect from the previo us paint. |
| 113 | 153 |
| 114 We don't clear the `previousPaintPhaseXXXWasEmpty` flags when the layer is marke d `needsRepaint`. | 154 We don't clear the `previousPaintPhaseXXXWasEmpty` flags when the layer is marke d `needsRepaint`. |
| 115 Instead we clear the flag when the corresponding `needsPaintPhaseXXX` is set. Th is ensures that | 155 Instead we clear the flag when the corresponding `needsPaintPhaseXXX` is set. Th is ensures that |
| 116 we won't clear `previousPaintPhaseXXXWasEmpty` flags when unrelated things chang ed which won't | 156 we won't clear `previousPaintPhaseXXXWasEmpty` flags when unrelated things chang ed which won't |
| 117 cause the paint phases to become non-empty. | 157 cause the paint phases to become non-empty. |
| OLD | NEW |