aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <release+servo@mozilla.com>2013-07-31 21:57:33 -0700
committerbors-servo <release+servo@mozilla.com>2013-07-31 21:57:33 -0700
commit13afd25679a3d39692a3dc745339d978a6d133b7 (patch)
tree740e3a6476a121f9a877d3a6b2f7eb7021a8cc2a
parent288eee073f1934d1888744f353ff30b2b544bb02 (diff)
parente661ce66b62f084b3e4dc962fa0e9fe99fb5a648 (diff)
downloadservo-13afd25679a3d39692a3dc745339d978a6d133b7.tar.gz
servo-13afd25679a3d39692a3dc745339d978a6d133b7.zip
auto merge of #656 : kmcallister/servo/dynamic-freeze, r=jdm
Fixes #455 (for now) Also add a comment about how what we're doing here is unsafe (for reasons that are mostly unrelated to the warning) r? @tkuehn
-rw-r--r--src/components/script/script_task.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs
index f769e4b282a..33c99683a03 100644
--- a/src/components/script/script_task.rs
+++ b/src/components/script/script_task.rs
@@ -608,7 +608,16 @@ impl ScriptTask {
let HtmlParserResult {root, js_port, style_port, iframe_port} = html_parsing_result;
// Create the window and document objects.
- let window = Window::new(&mut *page, self.chan.clone(), self.compositor);
+ let window = {
+ // Need an extra block here due to Rust #6248
+ //
+ // FIXME(Servo #655): Unrelated to the Rust #6248 warning, this is fundamentally
+ // unsafe because the box could go away or get moved while we're holding this raw
+ // pointer. We think it's safe here because the main task will hold onto the box,
+ // and because the current refcounting implementation of @ doesn't move.
+ let page = &mut *page;
+ Window::new(page, self.chan.clone(), self.compositor)
+ };
let document = HTMLDocument::new(root, Some(window));
// Tie the root into the document.