diff options
author | Kamal Umudlu <kamalumudlu17@gmail.com> | 2019-03-08 00:18:22 -0500 |
---|---|---|
committer | Kamal Umudlu <kamalumudlu17@gmail.com> | 2019-04-01 18:29:02 -0400 |
commit | a8995fbf1aab58eda9ecd1018d74734344daa5eb (patch) | |
tree | 4e830aa8d493445e178b242e95089fcdac64a2b3 /components/script | |
parent | e27653ceae291f7506b6ca1cfe266033bd35ecdc (diff) | |
download | servo-a8995fbf1aab58eda9ecd1018d74734344daa5eb.tar.gz servo-a8995fbf1aab58eda9ecd1018d74734344daa5eb.zip |
Bug: #22853 - Make Window::set_fullscreen pass a non-None value when entering fullscreen is fixed and SetFullscreenState in exit_fullscreen changed to False
Added patch for bug:22853
Added implementation to exit from fullscreen mode by pressing ESC button
Added patch that supports to exit from fullscreen mode by pressing ESC
Deleted patch files
Added all requested changes on project
Removed the loop over self.pending_changes in switch_fullscreen_mode function
Bug #22853 - Make Window::set_fullscreen pass a non-None value when entering fullscreen is fixed and SetFullscreenState in exit_fullscreen changed to False
Added missing bracket in constellation.rs file to fix build issue
Bug: #22853 --> Make Window::set_fullscreen pass a non-None value when entering fullscreen is fixed and SetFullscreenState in exit_fullscreen changed to False
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/document.rs | 2 | ||||
-rw-r--r-- | components/script/script_thread.rs | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index b59f9502d63..b3f08964502 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -3211,7 +3211,7 @@ impl Document { let window = self.window(); // Step 8 - let event = EmbedderMsg::SetFullscreenState(true); + let event = EmbedderMsg::SetFullscreenState(false); self.send_to_embedder(event); // Step 9 diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 41a7192e70a..78b7a8606b0 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -1304,6 +1304,10 @@ impl ScriptThread { // An event came-in from a document that is not fully-active, it has been stored by the task-queue. // Continue without adding it to "sequential". }, + FromConstellation(ConstellationControlMsg::ExitFullScreen(id)) => self + .profile_event(ScriptThreadEventCategory::ExitFullscreen, Some(id), || { + self.handle_exit_fullscreen(id); + }), _ => { sequential.push(event); }, @@ -1500,6 +1504,7 @@ impl ScriptThread { Reload(id, ..) => Some(id), WebVREvents(id, ..) => Some(id), PaintMetric(..) => None, + ExitFullScreen(id, ..) => Some(id), } }, MixedMessage::FromDevtools(_) => None, @@ -1731,6 +1736,7 @@ impl ScriptThread { msg @ ConstellationControlMsg::Viewport(..) | msg @ ConstellationControlMsg::SetScrollState(..) | msg @ ConstellationControlMsg::Resize(..) | + msg @ ConstellationControlMsg::ExitFullScreen(..) | msg @ ConstellationControlMsg::ExitScriptThread => { panic!("should have handled {:?} already", msg) }, @@ -1953,6 +1959,19 @@ impl ScriptThread { warn!("resize sent to nonexistent pipeline"); } + // exit_fullscreen creates a new JS promise object, so we need to have entered a compartment + fn handle_exit_fullscreen(&self, id: PipelineId) { + let document = self.documents.borrow().find_document(id); + if let Some(document) = document { + let _ac = JSAutoCompartment::new( + document.global().get_cx(), + document.reflector().get_jsobject().get(), + ); + document.exit_fullscreen(); + return; + } + } + fn handle_viewport(&self, id: PipelineId, rect: Rect<f32>) { let document = self.documents.borrow().find_document(id); if let Some(document) = document { |