Ensure unique LayerIds for pseudo-elements

Currently pseudo-elements, like the fragments created for ::before and
::after, with layers will have the same LayerId as the body of their
owning fragments. Instead all LayerIds should be unique.

Fixes #2010.
This commit is contained in:
Martin Robinson 2015-09-08 18:59:30 -07:00
parent 1b6d4daf85
commit 1e6f797268
9 changed files with 128 additions and 41 deletions

View file

@ -692,7 +692,7 @@ impl StackingContextLayerCreator {
fn finish_building_current_layer(&mut self, stacking_context: &mut StackingContext) {
if let Some(display_list) = self.display_list_for_next_layer.take() {
let next_layer_id =
stacking_context.display_list.layered_children.back().unwrap().id.next_layer_id();
stacking_context.display_list.layered_children.back().unwrap().id.companion_layer_id();
let child_stacking_context =
Arc::new(stacking_context.create_layered_child(next_layer_id, display_list));
stacking_context.display_list.layered_children.push_back(