aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_traits
diff options
context:
space:
mode:
Diffstat (limited to 'components/script_traits')
-rw-r--r--components/script_traits/lib.rs27
-rw-r--r--components/script_traits/script_msg.rs5
2 files changed, 30 insertions, 2 deletions
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs
index a8905de4821..8c2c595a6a2 100644
--- a/components/script_traits/lib.rs
+++ b/components/script_traits/lib.rs
@@ -49,6 +49,7 @@ use net_traits::image_cache_thread::ImageCacheThread;
use net_traits::storage_thread::StorageThread;
use profile_traits::mem;
use std::any::Any;
+use url::Url;
use util::ipc::OptionalOpaqueIpcSender;
use util::mem::HeapSizeOf;
@@ -325,3 +326,29 @@ pub enum EventResult {
/// Prevented by web content
DefaultPrevented,
}
+
+/// Whether the sandbox attribute is present for an iframe element
+#[derive(PartialEq, Eq, Copy, Clone, Debug, Deserialize, Serialize)]
+pub enum IFrameSandboxState {
+ /// Sandbox attribute is present
+ IFrameSandboxed,
+ /// Sandbox attribute is not present
+ IFrameUnsandboxed
+}
+
+/// Specifies the information required to load a URL in an iframe.
+#[derive(Deserialize, Serialize)]
+pub struct IFrameLoadInfo {
+ /// Url to load
+ pub url: Option<Url>,
+ /// Pipeline ID of the parent of this iframe
+ pub containing_pipeline_id: PipelineId,
+ /// The new subpage ID for this load
+ pub new_subpage_id: SubpageId,
+ /// The old subpage ID for this iframe, if a page was previously loaded.
+ pub old_subpage_id: Option<SubpageId>,
+ /// The new pipeline ID that the iframe has generated.
+ pub new_pipeline_id: PipelineId,
+ /// Sandbox type of this iframe
+ pub sandbox: IFrameSandboxState,
+}
diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs
index d072231eca2..e88605e66ea 100644
--- a/components/script_traits/script_msg.rs
+++ b/components/script_traits/script_msg.rs
@@ -2,11 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+use IFrameLoadInfo;
use canvas_traits::CanvasMsg;
use euclid::point::Point2D;
use euclid::size::Size2D;
use ipc_channel::ipc::IpcSender;
-use msg::constellation_msg::{AnimationState, DocumentState, IframeLoadInfo, NavigationDirection};
+use msg::constellation_msg::{AnimationState, DocumentState, NavigationDirection};
use msg::constellation_msg::{Failure, MozBrowserEvent, PipelineId};
use msg::constellation_msg::{LoadData, SubpageId};
use msg::constellation_msg::{MouseButton, MouseEventType};
@@ -72,7 +73,7 @@ pub enum ScriptMsg {
/// Notification that this iframe should be removed.
RemoveIFrame(PipelineId),
/// A load has been requested in an IFrame.
- ScriptLoadedURLInIFrame(IframeLoadInfo),
+ ScriptLoadedURLInIFrame(IFrameLoadInfo),
/// Requests that the constellation set the contents of the clipboard
SetClipboardContents(String),
/// Mark a new document as active