servo/components/layout
bors-servo 397d8138e7 auto merge of #3990 : pcwalton/servo/stacking-contexts, r=glennw
This implements the scheme described here:

    https://groups.google.com/forum/#!topic/mozilla.dev.servo/sZVPSfPVfkg

This commit changes Servo to generate one display list per stacking
context instead of one display list per layer. This is purely a
refactoring; there are no functional changes. Performance is essentially
the same as before. However, there should be numerous future benefits
that this is intended to allow for:

* It makes the code simpler to understand because the "new layer needed"
  vs. "no new layer needed" code paths are more consolidated.

* It makes it easy to support CSS properties that did not fit into our
  previous flat display list model (without unconditionally layerizing
  them):

  o `opacity` should be easy to support because the stacking context
    provides the higher-level grouping of display items to which opacity
    is to be applied.

  o `transform` can be easily supported because the stacking context
    provides a place to stash the transformation matrix. This has the side
    benefit of nicely separating the transformation matrix from the
    clipping regions.

* The `flatten` logic is now O(1) instead of O(n) and now only needs to
  be invoked for pseudo-stacking contexts (right now: just floats),
  instead of for every stacking context.

* Layers are now a proper tree instead of a flat list as far as layout
  is concerned, bringing us closer to a production-quality
  compositing/layers framework.

* This commit opens the door to incremental display list construction at
  the level of stacking contexts.

Future performance improvements could come from optimizing allocation of
display list items, and, of course, incremental display list
construction.

r? @glennw
f? @mrobinson @cgaebel
2014-11-16 16:39:27 -07:00
..
css Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
block.rs gfx: Rewrite display list construction to make stacking-contexts more 2014-11-14 17:31:15 -08:00
Cargo.toml Eliminate servo_util::atom 2014-09-29 18:39:36 -07:00
construct.rs Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
context.rs Use opts as a global, to avoid cloning and passing the struct all over the code. 2014-10-20 10:48:47 +10:00
display_list_builder.rs gfx: Rewrite display list construction to make stacking-contexts more 2014-11-14 17:31:15 -08:00
floats.rs Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
flow.rs gfx: Rewrite display list construction to make stacking-contexts more 2014-11-14 17:31:15 -08:00
flow_list.rs Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
flow_ref.rs Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
fragment.rs gfx: Rewrite display list construction to make stacking-contexts more 2014-11-14 17:31:15 -08:00
incremental.rs Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
inline.rs gfx: Rewrite display list construction to make stacking-contexts more 2014-11-14 17:31:15 -08:00
layout_debug.rs Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
layout_task.rs gfx: Rewrite display list construction to make stacking-contexts more 2014-11-14 17:31:15 -08:00
lib.rs Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
model.rs Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
parallel.rs Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
sequential.rs Have ContentBox(es)Queries consult the flow tree 2014-11-03 10:30:28 -08:00
table.rs Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
table_caption.rs Fix Table Caption infinite recursion. 2014-11-15 09:37:44 -08:00
table_cell.rs Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
table_colgroup.rs Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
table_row.rs Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
table_rowgroup.rs Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
table_wrapper.rs Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
text.rs Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
traversal.rs Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
util.rs Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
wrapper.rs Use RefCell in DOMRefCell to reduce duplicated code. 2014-11-14 21:18:43 +01:00