diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-03-13 08:33:26 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-13 08:33:26 -0400 |
commit | c12e341c0ce9fcd8c3f71905b9b379af802bff04 (patch) | |
tree | b9133dcc1b560b29ee505c69b02c135d2ac6b6e6 | |
parent | e96a5ae37e9e002de83e547ded2f237615363ed0 (diff) | |
parent | 39c652ed1385ef8cdb8d7d2eccf7429c42dfdecf (diff) | |
download | servo-c12e341c0ce9fcd8c3f71905b9b379af802bff04.tar.gz servo-c12e341c0ce9fcd8c3f71905b9b379af802bff04.zip |
Auto merge of #23007 - BartGitHub:remove-pipeline-visibility-checks, r=jdm
Remove pipeline visibility checks
<!-- Please describe your changes on the following line: -->
This includes the following changes/clean-ups:
- Remove ```is_visible``` field from ```Pipeline``` struct
- Remove ```SetVisible``` script message, and related message sending/handling.
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22986
<!-- Either: -->
- [x] These changes do not require tests because the issue description states having a passing build is enough for a pull request.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23007)
<!-- Reviewable:end -->
-rw-r--r-- | components/constellation/constellation.rs | 35 | ||||
-rw-r--r-- | components/script/dom/htmliframeelement.rs | 10 | ||||
-rw-r--r-- | components/script_traits/script_msg.rs | 3 |
3 files changed, 0 insertions, 48 deletions
diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index 076204cd0c7..e4120579912 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -1322,9 +1322,6 @@ where } } }, - FromScriptMsg::SetVisible(is_visible) => { - self.handle_set_visible_msg(source_pipeline_id, is_visible); - }, FromScriptMsg::VisibilityChangeComplete(is_visible) => { self.handle_visibility_change_complete(source_pipeline_id, is_visible); }, @@ -3036,38 +3033,6 @@ where 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) { let browsing_context_id = match self.pipelines.get(&pipeline_id) { Some(pipeline) => pipeline.browsing_context_id, diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index 3a01d36beeb..822484a7991 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -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 pub fn iframe_load_event_steps(&self, loaded_pipeline: PipelineId) { // TODO(#9592): assert that the load blocker is present at all times when we diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs index 2ad62849c68..33cc94d0128 100644 --- a/components/script_traits/script_msg.rs +++ b/components/script_traits/script_msg.rs @@ -175,8 +175,6 @@ pub enum ScriptMsg { /// Notification that this iframe should be removed. /// Returns a list of pipelines which were closed. RemoveIFrame(BrowsingContextId, IpcSender<Vec<PipelineId>>), - /// Change pipeline visibility - SetVisible(bool), /// Notifies constellation that an iframe's visibility has been changed. VisibilityChangeComplete(bool), /// A load has been requested in an IFrame. @@ -243,7 +241,6 @@ impl fmt::Debug for ScriptMsg { ReplaceHistoryState(..) => "ReplaceHistoryState", JointSessionHistoryLength(..) => "JointSessionHistoryLength", RemoveIFrame(..) => "RemoveIFrame", - SetVisible(..) => "SetVisible", VisibilityChangeComplete(..) => "VisibilityChangeComplete", ScriptLoadedURLInIFrame(..) => "ScriptLoadedURLInIFrame", ScriptNewIFrame(..) => "ScriptNewIFrame", |