Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement `z-index` #781
Implement `z-index` #781
Comments
|
Needed for #1366. |
|
mentor @metajack |
|
More than just the |
|
#1538 will be required once we implement stacking context identification from the CSS appendix listed above. |
|
Proposal for z-index / stacking contexts implementation:
The interface we expect from a DisplayList currently:
Algorithm:
@pcwalton @SimonSapin please let me know your feedback on this idea. Especially about the iteration part and the clipping part: should we have display items nested under ClipDisplayItem or should we flatten them? @pcwalton What are the other requirements from the Display List data structure? The above algo will preserve all current behaviour, but you had mentioned something about animations and wanting to deal with z-index elements in a separate layer. |
Requirements
These tags are a hint for later stages in a pipeline for which DisplayLists (the active ones) we should avoid rendering into the same underlying layer as other content because the active content would cause us to unnecessarily repaint inactive content. You do not need to compute these now, but we anticipate that we would set active at least when there is a CSS transition or animation property defined on an element in that DisplayList.
Note that stacking contexts can come from at least one other place than just a new z-index and positioned elements: opacity.
One idea we’d like to follow up on is culling of occluded parts of the page, which is a technique that has worked well on low-power devices. We also need to be able to tell when we want to merge multiple layers based on available HW resources. Implementation feedbackWhen I was talking at the workweek with @pcwalton and @nick29581, and we were hoping that instead of a tree of stacking contexts (which is admittedly easier to build!) we could instead produce a flattened list of DisplayLists that is in proper painting order and does not expose the stacking context or z-index information to the rest of the pipeline, so that all of the decisions that had to be made (i.e., ordering of the DisplayLists in terms of the zindex spec and ordering of the items within the DisplayList in tree order) are implicit in the data structure passed on and do not need to be recomputed by later stages. Note that you may still want to build up the nested stacking contexts per your implementation design and just deliver the flattened DisplayLists to the rest of the pipeline. @pcwalton, @SimonSapin, does this accurately capture some of our prior discussions on this front? |
|
@nical How does this look to you? |
|
Hi, I am not a display list expert (Matt Woodrow would be the go-to person for this), so on this topic I can just advise you guys to make the layerization heuristics (deciding what's active and what is not) as flexible as possible because tuning these heuristics will affect performance a lot. I can relate to how this has been affecting b2g and still does. I suspect marking an item active depends on more than what is presented in this thread (if you want to have very efficient layerization). |
|
Fixed. |
Needed for the Acid2 introduction message.