aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2016-03-23 17:49:03 -0700
committerPatrick Walton <pcwalton@mimiga.net>2016-04-28 10:53:13 -0700
commit7bd257089c38489ded7d8d84493406c321c1f16f (patch)
treed2be850caffa2862ec5bf9f73b4c368cb68f95af /components/script
parentc011c3197d61d64274d151d8bad85216d3b85041 (diff)
downloadservo-7bd257089c38489ded7d8d84493406c321c1f16f.tar.gz
servo-7bd257089c38489ded7d8d84493406c321c1f16f.zip
script: Make iframes know their pipeline IDs at all times, even after
navigation. Since WebRender uses the pipeline ID stored in the iframe element to determine which pipeline to display, it had better be kept up to date! Closes #9919.
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/htmliframeelement.rs10
-rw-r--r--components/script/script_thread.rs13
2 files changed, 17 insertions, 6 deletions
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs
index a9d5471d468..ad172fabb99 100644
--- a/components/script/dom/htmliframeelement.rs
+++ b/components/script/dom/htmliframeelement.rs
@@ -24,7 +24,7 @@ use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers};
use dom::event::Event;
use dom::eventtarget::EventTarget;
use dom::htmlelement::HTMLElement;
-use dom::node::{Node, UnbindContext, window_from_node, document_from_node};
+use dom::node::{Node, NodeDamage, UnbindContext, window_from_node, document_from_node};
use dom::urlhelper::UrlHelper;
use dom::virtualmethods::VirtualMethods;
use dom::window::{ReflowReason, Window};
@@ -177,8 +177,14 @@ impl HTMLIFrameElement {
}
}
- pub fn update_subpage_id(&self, new_subpage_id: SubpageId) {
+ pub fn update_subpage_id(&self, new_subpage_id: SubpageId, new_pipeline_id: PipelineId) {
self.subpage_id.set(Some(new_subpage_id));
+ self.pipeline_id.set(Some(new_pipeline_id));
+
+ let mut blocker = self.load_blocker.borrow_mut();
+ LoadBlocker::terminate(&mut blocker);
+
+ self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
}
fn new_inherited(localName: Atom,
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index e725d9cbbf8..c0753f897a7 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -883,8 +883,12 @@ impl ScriptThread {
event),
ConstellationControlMsg::UpdateSubpageId(containing_pipeline_id,
old_subpage_id,
- new_subpage_id) =>
- self.handle_update_subpage_id(containing_pipeline_id, old_subpage_id, new_subpage_id),
+ new_subpage_id,
+ new_pipeline_id) =>
+ self.handle_update_subpage_id(containing_pipeline_id,
+ old_subpage_id,
+ new_subpage_id,
+ new_pipeline_id),
ConstellationControlMsg::FocusIFrame(containing_pipeline_id, subpage_id) =>
self.handle_focus_iframe_msg(containing_pipeline_id, subpage_id),
ConstellationControlMsg::WebDriverScriptCommand(pipeline_id, msg) =>
@@ -1243,7 +1247,8 @@ impl ScriptThread {
fn handle_update_subpage_id(&self,
containing_pipeline_id: PipelineId,
old_subpage_id: SubpageId,
- new_subpage_id: SubpageId) {
+ new_subpage_id: SubpageId,
+ new_pipeline_id: PipelineId) {
let borrowed_page = self.root_page();
let frame_element = borrowed_page.find(containing_pipeline_id).and_then(|page| {
@@ -1251,7 +1256,7 @@ impl ScriptThread {
doc.find_iframe(old_subpage_id)
});
- frame_element.unwrap().update_subpage_id(new_subpage_id);
+ frame_element.unwrap().update_subpage_id(new_subpage_id, new_pipeline_id);
}
/// Window was resized, but this script was not active, so don't reflow yet