mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
constellation: Stop using futures for frame sizes.
This will allow us to stop going to the DOM in order to handle iframe sizing. Instead we can just store the pipeline and frame IDs of iframes inside the flow tree itself.
This commit is contained in:
parent
499aa97fa4
commit
21e8c72a75
12 changed files with 243 additions and 197 deletions
|
@ -9,15 +9,11 @@ use dom::element::HTMLIframeElementTypeId;
|
|||
use dom::htmlelement::HTMLElement;
|
||||
use dom::node::{AbstractNode, Node, ScriptView};
|
||||
use dom::windowproxy::WindowProxy;
|
||||
use geom::size::Size2D;
|
||||
use geom::rect::Rect;
|
||||
|
||||
use servo_msg::constellation_msg::{ConstellationChan, FrameRectMsg, PipelineId, SubpageId};
|
||||
|
||||
use std::ascii::StrAsciiExt;
|
||||
use std::comm::ChanOne;
|
||||
use extra::url::Url;
|
||||
use std::util::replace;
|
||||
use geom::rect::Rect;
|
||||
use servo_msg::constellation_msg::{ConstellationChan, FrameRectMsg, PipelineId, SubpageId};
|
||||
use std::ascii::StrAsciiExt;
|
||||
|
||||
enum SandboxAllowance {
|
||||
AllowNothing = 0x00,
|
||||
|
@ -39,17 +35,11 @@ pub struct HTMLIFrameElement {
|
|||
struct IFrameSize {
|
||||
pipeline_id: PipelineId,
|
||||
subpage_id: SubpageId,
|
||||
future_chan: Option<ChanOne<Size2D<uint>>>,
|
||||
constellation_chan: ConstellationChan,
|
||||
}
|
||||
|
||||
impl IFrameSize {
|
||||
pub fn set_rect(&mut self, rect: Rect<f32>) {
|
||||
let future_chan = replace(&mut self.future_chan, None);
|
||||
do future_chan.map |future_chan| {
|
||||
let Size2D { width, height } = rect.size;
|
||||
future_chan.send(Size2D(width as uint, height as uint));
|
||||
};
|
||||
self.constellation_chan.send(FrameRectMsg(self.pipeline_id, self.subpage_id, rect));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue