mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Excise SubpageId and use only PipelineIds
SubpageId was originally introduced in 2013 to help iframes keep track of their associated (children) pipelines. However, since each pipeline already has a PipelineId, and those are unique, those are sufficient to keep track of children.
This commit is contained in:
parent
b9b25b6f82
commit
56fbfd46a4
12 changed files with 145 additions and 217 deletions
|
@ -94,7 +94,7 @@ use js::jsapi::{JSContext, JSObject, JSRuntime};
|
|||
use js::jsapi::JS_GetRuntime;
|
||||
use msg::constellation_msg::{ALT, CONTROL, SHIFT, SUPER};
|
||||
use msg::constellation_msg::{Key, KeyModifiers, KeyState};
|
||||
use msg::constellation_msg::{PipelineId, ReferrerPolicy, SubpageId};
|
||||
use msg::constellation_msg::{PipelineId, ReferrerPolicy};
|
||||
use net_traits::{AsyncResponseTarget, IpcSend, PendingAsyncLoad};
|
||||
use net_traits::CookieSource::NonHTTP;
|
||||
use net_traits::CoreResourceMsg::{GetCookiesForUrl, SetCookiesForUrl};
|
||||
|
@ -1342,9 +1342,9 @@ impl Document {
|
|||
|
||||
pub fn trigger_mozbrowser_event(&self, event: MozBrowserEvent) {
|
||||
if PREFS.is_mozbrowser_enabled() {
|
||||
if let Some((parent_pipeline_id, subpage_id, _)) = self.window.parent_info() {
|
||||
if let Some((parent_pipeline_id, _)) = self.window.parent_info() {
|
||||
let event = ConstellationMsg::MozBrowserEvent(parent_pipeline_id,
|
||||
Some(subpage_id),
|
||||
Some(self.window.pipeline_id()),
|
||||
event);
|
||||
self.window.constellation_chan().send(event).unwrap();
|
||||
}
|
||||
|
@ -1581,15 +1581,7 @@ impl Document {
|
|||
}
|
||||
|
||||
/// Find an iframe element in the document.
|
||||
pub fn find_iframe(&self, subpage_id: SubpageId) -> Option<Root<HTMLIFrameElement>> {
|
||||
self.upcast::<Node>()
|
||||
.traverse_preorder()
|
||||
.filter_map(Root::downcast::<HTMLIFrameElement>)
|
||||
.find(|node| node.subpage_id() == Some(subpage_id))
|
||||
}
|
||||
|
||||
/// Find an iframe element in the document.
|
||||
pub fn find_iframe_by_pipeline(&self, pipeline: PipelineId) -> Option<Root<HTMLIFrameElement>> {
|
||||
pub fn find_iframe(&self, pipeline: PipelineId) -> Option<Root<HTMLIFrameElement>> {
|
||||
self.upcast::<Node>()
|
||||
.traverse_preorder()
|
||||
.filter_map(Root::downcast::<HTMLIFrameElement>)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue