Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate iframes into the display list #7950

Merged
merged 1 commit into from Oct 20, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Integrate iframes into the display list

Instead of always promoting iframes to StackingContexts, integrate them
into the display list. This prevents stacking bugs when
non-stacking-context elements should be drawn on top of iframes.

To accomplish this, we add another step to ordering layer creation,
where LayeredItems in the DisplayList are added to layers described by
the LayerInfo structures collected at the end of the DisplayList.
Unlayered items that follow these layered items are added to
synthesized layers.

Another result of this change is that iframe layers can be positioned
directly at the location of the iframe fragment, eliminating the need
for the SubpageLayerInfo struct entirely.

Iframes are the first type of content treated this way, but this change
opens up the possibility to properly order canvas and all other layered
content that does not create a stacking context.

Fixes #7566.
Fixes #7796.
  • Loading branch information
mrobinson committed Oct 20, 2015
commit ac5525aeeb3df60a99b503fa75f919c93c50b43b
@@ -670,7 +670,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
scroll_policy: ScrollPolicy::Scrollable,
transform: Matrix4::identity(),
perspective: Matrix4::identity(),
subpage_layer_info: None,
subpage_pipeline_id: None,
establishes_3d_context: true,
scrolls_overflow_area: false,
};
@@ -819,18 +819,16 @@ impl<Window: WindowMethods> IOCompositor<Window> {
}

// If this layer contains a subpage, then create the root layer for that subpage now.
if let Some(ref subpage_layer_info) = layer_properties.subpage_layer_info {
if let Some(ref subpage_pipeline_id) = layer_properties.subpage_pipeline_id {
let subpage_layer_properties = LayerProperties {
id: LayerId::null(),
parent_id: None,
rect: Rect::new(Point2D::new(subpage_layer_info.origin.x.to_f32_px(),
subpage_layer_info.origin.y.to_f32_px()),
layer_properties.rect.size),
rect: Rect::new(Point2D::zero(), layer_properties.rect.size),
background_color: layer_properties.background_color,
scroll_policy: ScrollPolicy::Scrollable,
transform: Matrix4::identity(),
perspective: Matrix4::identity(),
subpage_layer_info: layer_properties.subpage_layer_info,
subpage_pipeline_id: layer_properties.subpage_pipeline_id,
establishes_3d_context: true,
scrolls_overflow_area: true,
};
@@ -840,13 +838,13 @@ impl<Window: WindowMethods> IOCompositor<Window> {
} else {
WantsScrollEventsFlag::DoesntWantScrollEvents
};
let subpage_layer = CompositorData::new_layer(subpage_layer_info.pipeline_id,
let subpage_layer = CompositorData::new_layer(*subpage_pipeline_id,
subpage_layer_properties,
wants_scroll_events,
new_layer.tile_size);
*subpage_layer.masks_to_bounds.borrow_mut() = true;
new_layer.add_child(subpage_layer);
self.pending_subpages.insert(subpage_layer_info.pipeline_id);
self.pending_subpages.insert(*subpage_pipeline_id);
}

parent_layer.add_child(new_layer.clone());
@@ -871,13 +869,13 @@ impl<Window: WindowMethods> IOCompositor<Window> {
/// Sends the size of the given subpage up to the constellation. This will often trigger a
/// reflow of that subpage.
fn update_subpage_size_if_necessary(&self, layer_properties: &LayerProperties) {
let subpage_layer_info = match layer_properties.subpage_layer_info {
Some(ref subpage_layer_info) => *subpage_layer_info,
let subpage_pipeline_id = match layer_properties.subpage_pipeline_id {
Some(ref subpage_pipeline_id) => subpage_pipeline_id,
None => return,
};

let ConstellationChan(ref chan) = self.constellation_chan;
chan.send(ConstellationMsg::FrameSize(subpage_layer_info.pipeline_id,
chan.send(ConstellationMsg::FrameSize(*subpage_pipeline_id,
layer_properties.rect.size)).unwrap();
}

@@ -61,9 +61,7 @@ impl CompositorData {
requested_epoch: Epoch(0),
painted_epoch: Epoch(0),
scroll_offset: Point2D::typed(0., 0.),
subpage_info: layer_properties.subpage_layer_info.map(|subpage_layer_info| {
subpage_layer_info.pipeline_id
}),
subpage_info: layer_properties.subpage_pipeline_id,
};

Rc::new(Layer::new(Rect::from_untyped(&layer_properties.rect),
@@ -480,8 +478,8 @@ impl RcCompositorLayer for Rc<Layer<CompositorData>> {
if let Some(layer_pipeline_id) = extra_data.subpage_info {
for layer_properties in new_layers.iter() {
// Keep this layer if a reference to it exists.
if let Some(ref subpage_layer_info) = layer_properties.subpage_layer_info {
if subpage_layer_info.pipeline_id == layer_pipeline_id {
if let Some(ref subpage_pipeline_id) = layer_properties.subpage_pipeline_id {
if *subpage_pipeline_id == layer_pipeline_id {
return true
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.