aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2018-12-20 17:12:13 -0500
committerJosh Matthews <josh@joshmatthews.net>2019-01-07 22:19:26 -0500
commit51ab14086cd635a3d2a7826e25ff96d679e265c7 (patch)
tree4cffcd2967ac9951b7b5617c1e8382d2c674f167 /components/script/script_thread.rs
parent45619db0ba0999d93b5715e1dae0ff49d1088ebe (diff)
downloadservo-51ab14086cd635a3d2a7826e25ff96d679e265c7.tar.gz
servo-51ab14086cd635a3d2a7826e25ff96d679e265c7.zip
Synchronously update the pipeline of same-origin iframe elements as soon as the child document begins parsing.
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r--components/script/script_thread.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 9ef684b96c4..9247ca6afba 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -2851,6 +2851,21 @@ impl ScriptThread {
window.init_document(&document);
+ // For any similar-origin iframe, ensure that the contentWindow/contentDocument
+ // APIs resolve to the new window/document as soon as parsing starts.
+ if let Some(frame) = window_proxy
+ .frame_element()
+ .and_then(|e| e.downcast::<HTMLIFrameElement>())
+ {
+ let parent_pipeline = frame.global().pipeline_id();
+ self.handle_update_pipeline_id(
+ parent_pipeline,
+ window_proxy.browsing_context_id(),
+ incomplete.pipeline_id,
+ UpdatePipelineIdReason::Navigation,
+ );
+ }
+
self.script_sender
.send((incomplete.pipeline_id, ScriptMsg::ActivateDocument))
.unwrap();