auto merge of #4852 : jdm/servo/buffermessages, r=jdm

Rebased and squashed version of #4191.
This commit is contained in:
bors-servo 2015-02-05 12:36:45 -07:00
commit 0a2bde1b6e
5 changed files with 17 additions and 1 deletions

View file

@ -108,3 +108,8 @@ pub fn handle_modify_attribute(page: &Rc<Page>, pipeline: PipelineId, node_id: S
}
}
}
pub fn handle_wants_live_notifications(page: &Rc<Page>, pipeline_id: PipelineId, send_notifications: bool) {
let page = get_page(&*page, pipeline_id);
page.devtools_wants_updates.set(send_notifications);
}

View file

@ -96,6 +96,10 @@ pub struct Page {
/// An enlarged rectangle around the page contents visible in the viewport, used
/// to prevent creating display list items for content that is far away from the viewport.
pub page_clip_rect: Cell<Rect<Au>>,
/// A flag to indicate whether the developer tools have requested live updates of
/// page changes.
pub devtools_wants_updates: Cell<bool>,
}
pub struct PageIterator {
@ -161,6 +165,7 @@ impl Page {
constellation_chan: constellation_chan,
children: DOMRefCell::new(vec!()),
page_clip_rect: Cell::new(MAX_RECT),
devtools_wants_updates: Cell::new(false),
}
}

View file

@ -41,7 +41,7 @@ use devtools;
use devtools_traits::{DevtoolsControlChan, DevtoolsControlPort, NewGlobal, GetRootNode, DevtoolsPageInfo};
use devtools_traits::{DevtoolScriptControlMsg, EvaluateJS, GetDocumentElement};
use devtools_traits::{GetChildren, GetLayout, ModifyAttribute};
use devtools_traits::{GetChildren, GetLayout, ModifyAttribute, WantsLiveNotifications};
use script_traits::CompositorEvent;
use script_traits::CompositorEvent::{ResizeEvent, ReflowEvent, ClickEvent};
use script_traits::CompositorEvent::{MouseDownEvent, MouseUpEvent};
@ -637,6 +637,8 @@ impl ScriptTask {
devtools::handle_get_layout(&*self.page.borrow(), id, node_id, reply),
ModifyAttribute(id, node_id, modifications) =>
devtools::handle_modify_attribute(&*self.page.borrow(), id, node_id, modifications),
WantsLiveNotifications(pipeline_id, to_send) =>
devtools::handle_wants_live_notifications(&*self.page.borrow(), pipeline_id, to_send),
}
}