mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
No more headless compositor. Just the normal one.
This changes headless operation to strictly be a runtime option, rather than a compile-time one. Note that the old headless version still relied on a display server to support WebGL, while it now requires one all the time. Fixes #8573
This commit is contained in:
parent
f2f05869d6
commit
c9cb4839e4
25 changed files with 119 additions and 474 deletions
|
@ -28,6 +28,7 @@ use dom::node::{Node, UnbindContext, window_from_node, document_from_node};
|
|||
use dom::urlhelper::UrlHelper;
|
||||
use dom::virtualmethods::VirtualMethods;
|
||||
use dom::window::{ReflowReason, Window};
|
||||
use ipc_channel::ipc;
|
||||
use js::jsapi::{JSAutoCompartment, JSAutoRequest, RootedValue, JSContext, MutableHandleValue};
|
||||
use js::jsval::{UndefinedValue, NullValue};
|
||||
use layout_interface::ReflowQueryType;
|
||||
|
@ -559,9 +560,30 @@ impl VirtualMethods for HTMLIFrameElement {
|
|||
let window = window_from_node(self);
|
||||
let window = window.r();
|
||||
|
||||
// The only reason we're waiting for the iframe to be totally
|
||||
// removed is to ensure the script thread can't add iframes faster
|
||||
// than the compositor can remove them.
|
||||
//
|
||||
// Since most of this cleanup doesn't happen on same-origin
|
||||
// iframes, and since that would cause a deadlock, don't do it.
|
||||
let ConstellationChan(ref chan) = window.constellation_chan();
|
||||
let msg = ConstellationMsg::RemoveIFrame(pipeline_id);
|
||||
let same_origin = if let Some(self_url) = self.get_url() {
|
||||
let win_url = window_from_node(self).get_url();
|
||||
UrlHelper::SameOrigin(&self_url, &win_url)
|
||||
} else {
|
||||
false
|
||||
};
|
||||
let (sender, receiver) = if same_origin {
|
||||
(None, None)
|
||||
} else {
|
||||
let (sender, receiver) = ipc::channel().unwrap();
|
||||
(Some(sender), Some(receiver))
|
||||
};
|
||||
let msg = ConstellationMsg::RemoveIFrame(pipeline_id, sender);
|
||||
chan.send(msg).unwrap();
|
||||
if let Some(receiver) = receiver {
|
||||
receiver.recv().unwrap()
|
||||
}
|
||||
|
||||
// Resetting the subpage id to None is required here so that
|
||||
// if this iframe is subsequently re-added to the document
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue