mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
compositing: In borderless mode, don't show the window until the page
has loaded. This avoids a flash of unstyled content, which looks especially bad in browser.html since unstyled content is white and browser.html has a transparent background. Closes #9996.
This commit is contained in:
parent
1a60e07ee8
commit
c2581d5cef
7 changed files with 23 additions and 13 deletions
|
@ -592,7 +592,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
self.window.load_start(back, forward);
|
||||
}
|
||||
|
||||
(Msg::LoadComplete(back, forward), ShutdownState::NotShuttingDown) => {
|
||||
(Msg::LoadComplete(back, forward, root), ShutdownState::NotShuttingDown) => {
|
||||
self.got_load_complete_message = true;
|
||||
|
||||
// If we're painting in headless mode, schedule a recomposite.
|
||||
|
@ -603,7 +603,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
// Inform the embedder that the load has finished.
|
||||
//
|
||||
// TODO(pcwalton): Specify which frame's load completed.
|
||||
self.window.load_end(back, forward);
|
||||
self.window.load_end(back, forward, root);
|
||||
}
|
||||
|
||||
(Msg::DelayedCompositionTimeout(timestamp), ShutdownState::NotShuttingDown) => {
|
||||
|
|
|
@ -195,8 +195,8 @@ pub enum Msg {
|
|||
SetFrameTree(SendableFrameTree, IpcSender<()>, Sender<ConstellationMsg>),
|
||||
/// The load of a page has begun: (can go back, can go forward).
|
||||
LoadStart(bool, bool),
|
||||
/// The load of a page has completed: (can go back, can go forward).
|
||||
LoadComplete(bool, bool),
|
||||
/// The load of a page has completed: (can go back, can go forward, is root frame).
|
||||
LoadComplete(bool, bool, bool),
|
||||
/// We hit the delayed composition timeout. (See `delayed_composition.rs`.)
|
||||
DelayedCompositionTimeout(u64),
|
||||
/// Composite.
|
||||
|
|
|
@ -1005,11 +1005,11 @@ impl<LTF: LayoutThreadFactory, STF: ScriptThreadFactory> Constellation<LTF, STF>
|
|||
|
||||
let forward = !self.frame(frame_id).next.is_empty();
|
||||
let back = !self.frame(frame_id).prev.is_empty();
|
||||
self.compositor_proxy.send(ToCompositorMsg::LoadComplete(back, forward));
|
||||
let root = self.root_frame_id.is_none() || self.root_frame_id == Some(frame_id);
|
||||
self.compositor_proxy.send(ToCompositorMsg::LoadComplete(back, forward, root));
|
||||
}
|
||||
|
||||
fn handle_dom_load(&mut self,
|
||||
pipeline_id: PipelineId) {
|
||||
fn handle_dom_load(&mut self, pipeline_id: PipelineId) {
|
||||
let mut webdriver_reset = false;
|
||||
if let Some((expected_pipeline_id, ref reply_chan)) = self.webdriver.load_channel {
|
||||
debug!("Sending load to WebDriver");
|
||||
|
|
|
@ -125,7 +125,7 @@ pub trait WindowMethods {
|
|||
/// Called when the browser has started loading a frame.
|
||||
fn load_start(&self, back: bool, forward: bool);
|
||||
/// Called when the browser is done loading a frame.
|
||||
fn load_end(&self, back: bool, forward: bool);
|
||||
fn load_end(&self, back: bool, forward: bool, root: bool);
|
||||
/// Called when the browser encounters an error while loading a URL
|
||||
fn load_error(&self, code: NetError, url: String);
|
||||
/// Called when the <head> tag has finished parsing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue