From 4b773cefe9ffdecd04993e4652fb2e436bf57e08 Mon Sep 17 00:00:00 2001 From: apopiak Date: Mon, 11 Jan 2016 23:20:10 +0100 Subject: [PATCH] move MozBrowserEvent to script_traits (+ documentation) --- components/compositing/constellation.rs | 6 +-- components/compositing/pipeline.rs | 4 +- components/msg/constellation_msg.rs | 55 -------------------- components/script/dom/document.rs | 4 +- components/script/dom/htmliframeelement.rs | 5 +- components/script/dom/htmllinkelement.rs | 4 +- components/script/dom/window.rs | 6 +-- components/script/script_thread.rs | 4 +- components/script_traits/lib.rs | 59 +++++++++++++++++++++- components/script_traits/script_msg.rs | 4 +- 10 files changed, 74 insertions(+), 77 deletions(-) diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index 2daa652f6f4..90d244868ba 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -30,8 +30,7 @@ use msg::constellation_msg::AnimationState; use msg::constellation_msg::WebDriverCommandMsg; use msg::constellation_msg::{FrameId, PipelineId}; use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData}; -use msg::constellation_msg::{MozBrowserEvent, NavigationDirection}; -use msg::constellation_msg::{PipelineNamespace, PipelineNamespaceId}; +use msg::constellation_msg::{PipelineNamespace, PipelineNamespaceId, NavigationDirection}; use msg::constellation_msg::{SubpageId, WindowSizeData}; use msg::constellation_msg::{self, ConstellationChan, Failure}; use msg::webdriver_msg; @@ -44,9 +43,8 @@ use profile_traits::mem; use profile_traits::time; use sandboxing; use script_traits::{CompositorEvent, ConstellationControlMsg, DocumentState, LayoutControlMsg}; -use script_traits::{IFrameLoadInfo, IFrameSandboxState}; +use script_traits::{IFrameLoadInfo, IFrameSandboxState, MozBrowserEvent, TimerEventRequest}; use script_traits::{LayoutMsg as FromLayoutMsg, ScriptMsg as FromScriptMsg, ScriptThreadFactory}; -use script_traits::{TimerEventRequest}; use std::borrow::ToOwned; use std::collections::HashMap; use std::env; diff --git a/components/compositing/pipeline.rs b/components/compositing/pipeline.rs index 3c49bbf41db..2a4e3b1999e 100644 --- a/components/compositing/pipeline.rs +++ b/components/compositing/pipeline.rs @@ -16,14 +16,14 @@ use ipc_channel::router::ROUTER; use layers::geometry::DevicePixel; use layout_traits::{LayoutControlChan, LayoutThreadFactory}; use msg::constellation_msg::{ConstellationChan, Failure, FrameId, PipelineId, SubpageId}; -use msg::constellation_msg::{LoadData, MozBrowserEvent, WindowSizeData}; +use msg::constellation_msg::{LoadData, WindowSizeData}; use msg::constellation_msg::{PipelineNamespaceId}; use net_traits::ResourceThread; use net_traits::image_cache_thread::ImageCacheThread; use net_traits::storage_thread::StorageThread; use profile_traits::mem as profile_mem; use profile_traits::time; -use script_traits::{ConstellationControlMsg, InitialScriptState}; +use script_traits::{ConstellationControlMsg, InitialScriptState, MozBrowserEvent}; use script_traits::{LayoutControlMsg, LayoutMsg, NewLayoutInfo, ScriptMsg}; use script_traits::{ScriptToCompositorMsg, ScriptThreadFactory, TimerEventRequest}; use std::mem; diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs index d1e9b39b02b..46fda6511e0 100644 --- a/components/msg/constellation_msg.rs +++ b/components/msg/constellation_msg.rs @@ -219,61 +219,6 @@ pub enum AnimationState { NoAnimationCallbacksPresent, } -// https://developer.mozilla.org/en-US/docs/Web/API/Using_the_Browser_API#Events -#[derive(Deserialize, Serialize)] -pub enum MozBrowserEvent { - /// Sent when the scroll position within a browser `