Auto merge of #15129 - cynicaldevil:iframe-resize, r=emilio

Refactor to send iframe resize messages directly from layout thread to constellation

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14682.
<!-- Either: -->

r? @jdm
passing tests:
tests/wpt/mozilla/tests/css/matchMedia.html, tests/wpt/mozilla/tests/mozilla/window_resize_not_triggered_on_load.html, tests/wpt/mozilla/tests/mozilla/iframe/resize_after_load.html, tests/wpt/mozilla/tests/css/meta_viewport_resize.html

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15129)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-01-23 06:08:02 -08:00 committed by GitHub
commit 7e2329ea4e
6 changed files with 54 additions and 44 deletions

View file

@ -342,15 +342,13 @@ fn initialize_png(width: usize, height: usize) -> RenderTargetInfo {
struct RenderNotifier {
compositor_proxy: Box<CompositorProxy>,
constellation_chan: Sender<ConstellationMsg>,
}
impl RenderNotifier {
fn new(compositor_proxy: Box<CompositorProxy>,
constellation_chan: Sender<ConstellationMsg>) -> RenderNotifier {
_: Sender<ConstellationMsg>) -> RenderNotifier {
RenderNotifier {
compositor_proxy: compositor_proxy,
constellation_chan: constellation_chan,
}
}
}
@ -365,16 +363,8 @@ impl webrender_traits::RenderNotifier for RenderNotifier {
}
fn pipeline_size_changed(&mut self,
pipeline_id: webrender_traits::PipelineId,
size: Option<webrender_traits::LayoutSize>) {
let pipeline_id = pipeline_id.from_webrender();
if let Some(size) = size {
let msg = ConstellationMsg::FrameSize(pipeline_id, size.to_untyped());
if let Err(e) = self.constellation_chan.send(msg) {
warn!("Compositor resize to constellation failed ({}).", e);
}
}
_: webrender_traits::PipelineId,
_: Option<webrender_traits::LayoutSize>) {
}
}