mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Remove SetVisible message from iframe
This commit is contained in:
parent
b006913e79
commit
39c652ed13
3 changed files with 0 additions and 48 deletions
|
@ -1322,9 +1322,6 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
FromScriptMsg::SetVisible(is_visible) => {
|
|
||||||
self.handle_set_visible_msg(source_pipeline_id, is_visible);
|
|
||||||
},
|
|
||||||
FromScriptMsg::VisibilityChangeComplete(is_visible) => {
|
FromScriptMsg::VisibilityChangeComplete(is_visible) => {
|
||||||
self.handle_visibility_change_complete(source_pipeline_id, is_visible);
|
self.handle_visibility_change_complete(source_pipeline_id, is_visible);
|
||||||
},
|
},
|
||||||
|
@ -3036,38 +3033,6 @@ where
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_set_visible_msg(&mut self, pipeline_id: PipelineId, is_visible: bool) {
|
|
||||||
let browsing_context_id = match self.pipelines.get(&pipeline_id) {
|
|
||||||
Some(pipeline) => pipeline.browsing_context_id,
|
|
||||||
None => {
|
|
||||||
return warn!(
|
|
||||||
"No browsing context associated with pipeline {:?}",
|
|
||||||
pipeline_id
|
|
||||||
);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
// TODO(mandreyel): can we make a mutable version of
|
|
||||||
// AllBrowsingContextsIterator to directly modify a browsing context
|
|
||||||
// without the need for this indirection?
|
|
||||||
let nested_ctx_ids: Vec<BrowsingContextId> = self
|
|
||||||
.all_descendant_browsing_contexts_iter(browsing_context_id)
|
|
||||||
.filter(|ctx| ctx.is_visible != is_visible)
|
|
||||||
.map(|ctx| ctx.id)
|
|
||||||
.collect();
|
|
||||||
|
|
||||||
for ctx_id in nested_ctx_ids {
|
|
||||||
if let Some(browsing_context) = self.browsing_contexts.get_mut(&ctx_id) {
|
|
||||||
browsing_context.is_visible = is_visible;
|
|
||||||
for pipeline_id in browsing_context.pipelines.iter() {
|
|
||||||
if let Some(pipeline) = self.pipelines.get_mut(&pipeline_id) {
|
|
||||||
pipeline.notify_visibility(is_visible);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn handle_visibility_change_complete(&mut self, pipeline_id: PipelineId, visibility: bool) {
|
fn handle_visibility_change_complete(&mut self, pipeline_id: PipelineId, visibility: bool) {
|
||||||
let browsing_context_id = match self.pipelines.get(&pipeline_id) {
|
let browsing_context_id = match self.pipelines.get(&pipeline_id) {
|
||||||
Some(pipeline) => pipeline.browsing_context_id,
|
Some(pipeline) => pipeline.browsing_context_id,
|
||||||
|
|
|
@ -397,16 +397,6 @@ impl HTMLIFrameElement {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_visible(&self, visible: bool) {
|
|
||||||
let msg = ScriptMsg::SetVisible(visible);
|
|
||||||
let window = window_from_node(self);
|
|
||||||
window
|
|
||||||
.upcast::<GlobalScope>()
|
|
||||||
.script_to_constellation_chan()
|
|
||||||
.send(msg)
|
|
||||||
.unwrap();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// https://html.spec.whatwg.org/multipage/#iframe-load-event-steps steps 1-4
|
/// https://html.spec.whatwg.org/multipage/#iframe-load-event-steps steps 1-4
|
||||||
pub fn iframe_load_event_steps(&self, loaded_pipeline: PipelineId) {
|
pub fn iframe_load_event_steps(&self, loaded_pipeline: PipelineId) {
|
||||||
// TODO(#9592): assert that the load blocker is present at all times when we
|
// TODO(#9592): assert that the load blocker is present at all times when we
|
||||||
|
|
|
@ -175,8 +175,6 @@ pub enum ScriptMsg {
|
||||||
/// Notification that this iframe should be removed.
|
/// Notification that this iframe should be removed.
|
||||||
/// Returns a list of pipelines which were closed.
|
/// Returns a list of pipelines which were closed.
|
||||||
RemoveIFrame(BrowsingContextId, IpcSender<Vec<PipelineId>>),
|
RemoveIFrame(BrowsingContextId, IpcSender<Vec<PipelineId>>),
|
||||||
/// Change pipeline visibility
|
|
||||||
SetVisible(bool),
|
|
||||||
/// Notifies constellation that an iframe's visibility has been changed.
|
/// Notifies constellation that an iframe's visibility has been changed.
|
||||||
VisibilityChangeComplete(bool),
|
VisibilityChangeComplete(bool),
|
||||||
/// A load has been requested in an IFrame.
|
/// A load has been requested in an IFrame.
|
||||||
|
@ -243,7 +241,6 @@ impl fmt::Debug for ScriptMsg {
|
||||||
ReplaceHistoryState(..) => "ReplaceHistoryState",
|
ReplaceHistoryState(..) => "ReplaceHistoryState",
|
||||||
JointSessionHistoryLength(..) => "JointSessionHistoryLength",
|
JointSessionHistoryLength(..) => "JointSessionHistoryLength",
|
||||||
RemoveIFrame(..) => "RemoveIFrame",
|
RemoveIFrame(..) => "RemoveIFrame",
|
||||||
SetVisible(..) => "SetVisible",
|
|
||||||
VisibilityChangeComplete(..) => "VisibilityChangeComplete",
|
VisibilityChangeComplete(..) => "VisibilityChangeComplete",
|
||||||
ScriptLoadedURLInIFrame(..) => "ScriptLoadedURLInIFrame",
|
ScriptLoadedURLInIFrame(..) => "ScriptLoadedURLInIFrame",
|
||||||
ScriptNewIFrame(..) => "ScriptNewIFrame",
|
ScriptNewIFrame(..) => "ScriptNewIFrame",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue