diff options
author | Alan Jeffrey <ajeffrey@mozilla.com> | 2017-05-22 09:40:17 -0500 |
---|---|---|
committer | Alan Jeffrey <ajeffrey@mozilla.com> | 2017-05-25 17:14:28 -0500 |
commit | 79743b5358c989da23c11c025509dd2c46dba48b (patch) | |
tree | f8a05416245fb9d5b56fbc6ac73fe56b20fddb4f /components/script_traits | |
parent | 3c267d7fddd036f6bcc9ebf000ed37665cf7496d (diff) | |
download | servo-79743b5358c989da23c11c025509dd2c46dba48b.tar.gz servo-79743b5358c989da23c11c025509dd2c46dba48b.zip |
Webdriver uses browsing context ids rather than pipeline ids.
Diffstat (limited to 'components/script_traits')
-rw-r--r-- | components/script_traits/lib.rs | 49 | ||||
-rw-r--r-- | components/script_traits/script_msg.rs | 6 | ||||
-rw-r--r-- | components/script_traits/webdriver_msg.rs | 4 |
3 files changed, 30 insertions, 29 deletions
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 98e66ab8044..c5e62b6ee81 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -602,7 +602,7 @@ pub enum MozBrowserEvent { /// Sent when the browser `<iframe>` starts to load a new page. LoadStart, /// Sent when a browser `<iframe>`'s location changes. - LocationChange(String, bool, bool), + LocationChange(ServoUrl, bool, bool), /// Sent when a new tab is opened within a browser `<iframe>` as a result of the user /// issuing a command to open a link target in a new tab (for example ctrl/cmd + click.) /// Includes the URL. @@ -715,21 +715,20 @@ pub enum WindowSizeType { #[derive(Deserialize, Serialize)] pub enum WebDriverCommandMsg { /// Get the window size. - GetWindowSize(PipelineId, IpcSender<WindowSizeData>), - /// Load a URL in the pipeline with the given ID. - LoadUrl(PipelineId, LoadData, IpcSender<LoadStatus>), - /// Refresh the pipeline with the given ID. - Refresh(PipelineId, IpcSender<LoadStatus>), - /// Pass a webdriver command to the script thread of the pipeline with the - /// given ID for execution. - ScriptCommand(PipelineId, WebDriverScriptCommand), - /// Act as if keys were pressed in the pipeline with the given ID. - SendKeys(PipelineId, Vec<(Key, KeyModifiers, KeyState)>), + GetWindowSize(TopLevelBrowsingContextId, IpcSender<WindowSizeData>), + /// Load a URL in the top-level browsing context with the given ID. + LoadUrl(TopLevelBrowsingContextId, LoadData, IpcSender<LoadStatus>), + /// Refresh the top-level browsing context with the given ID. + Refresh(TopLevelBrowsingContextId, IpcSender<LoadStatus>), + /// Pass a webdriver command to the script thread of the current pipeline + /// of a browsing context. + ScriptCommand(BrowsingContextId, WebDriverScriptCommand), + /// Act as if keys were pressed in the browsing context with the given ID. + SendKeys(BrowsingContextId, Vec<(Key, KeyModifiers, KeyState)>), /// Set the window size. - SetWindowSize(PipelineId, Size2D<u32>, IpcSender<WindowSizeData>), - /// Take a screenshot of the window, if the pipeline with the given ID is - /// the root pipeline. - TakeScreenshot(PipelineId, IpcSender<Option<Image>>), + SetWindowSize(TopLevelBrowsingContextId, Size2D<u32>, IpcSender<WindowSizeData>), + /// Take a screenshot of the window. + TakeScreenshot(TopLevelBrowsingContextId, IpcSender<Option<Image>>), } /// Messages to the constellation. @@ -740,10 +739,12 @@ pub enum ConstellationMsg { /// Request that the constellation send the BrowsingContextId corresponding to the document /// with the provided pipeline id GetBrowsingContext(PipelineId, IpcSender<Option<BrowsingContextId>>), - /// Request that the constellation send the current pipeline id for the provided frame - /// id, or for the root frame if this is None, over a provided channel. - /// Also returns a boolean saying whether the document has finished loading or not. - GetPipeline(Option<BrowsingContextId>, IpcSender<Option<PipelineId>>), + /// Request that the constellation send the current pipeline id for the provided + /// browsing context id, over a provided channel. + GetPipeline(BrowsingContextId, IpcSender<Option<PipelineId>>), + /// Request that the constellation send the current focused top-level browsing context id, + /// over a provided channel. + GetFocusTopLevelBrowsingContext(IpcSender<Option<TopLevelBrowsingContextId>>), /// Requests that the constellation inform the compositor of the title of the pipeline /// immediately. GetPipelineTitle(PipelineId), @@ -755,16 +756,16 @@ pub enum ConstellationMsg { KeyEvent(Option<char>, Key, KeyState, KeyModifiers), /// Request to load a page. LoadUrl(PipelineId, LoadData), - /// Request to traverse the joint session history. - TraverseHistory(Option<PipelineId>, TraversalDirection), + /// Request to traverse the joint session history of the provided browsing context. + TraverseHistory(TopLevelBrowsingContextId, TraversalDirection), /// Inform the constellation of a window being resized. - WindowSize(WindowSizeData, WindowSizeType), + WindowSize(TopLevelBrowsingContextId, WindowSizeData, WindowSizeType), /// Requests that the constellation instruct layout to begin a new tick of the animation. TickAnimation(PipelineId, AnimationTickType), /// Dispatch a webdriver command WebDriverCommand(WebDriverCommandMsg), - /// Reload the current page. - Reload, + /// Reload a top-level browsing context. + Reload(TopLevelBrowsingContextId), /// A log entry, with the top-level browsing context id and thread name LogEntry(Option<TopLevelBrowsingContextId>, Option<String>, LogEntry), /// Set the WebVR thread channel. diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs index 1ebe6c17b5f..9bb7053daa0 100644 --- a/components/script_traits/script_msg.rs +++ b/components/script_traits/script_msg.rs @@ -86,7 +86,7 @@ pub enum ScriptMsg { ForwardEvent(PipelineId, CompositorEvent), /// Requests that the constellation retrieve the current contents of the clipboard GetClipboardContents(IpcSender<String>), - /// Get the frame id for a given pipeline. + /// Get the browsing context id for a given pipeline. GetBrowsingContextId(PipelineId, IpcSender<Option<BrowsingContextId>>), /// Get the parent info for a given pipeline. GetParentInfo(PipelineId, IpcSender<Option<(PipelineId, FrameType)>>), @@ -104,9 +104,9 @@ pub enum ScriptMsg { /// The first PipelineId is for the parent, the second is for the originating pipeline. MozBrowserEvent(PipelineId, PipelineId, MozBrowserEvent), /// HTMLIFrameElement Forward or Back traversal. - TraverseHistory(Option<PipelineId>, TraversalDirection), + TraverseHistory(TopLevelBrowsingContextId, TraversalDirection), /// Gets the length of the joint session history from the constellation. - JointSessionHistoryLength(PipelineId, IpcSender<u32>), + JointSessionHistoryLength(TopLevelBrowsingContextId, IpcSender<u32>), /// Favicon detected NewFavicon(ServoUrl), /// Status message to be displayed in the chrome, eg. a link URL on mouseover. diff --git a/components/script_traits/webdriver_msg.rs b/components/script_traits/webdriver_msg.rs index b92e32ff65c..ed7f2ea8f18 100644 --- a/components/script_traits/webdriver_msg.rs +++ b/components/script_traits/webdriver_msg.rs @@ -8,7 +8,7 @@ use cookie_rs::Cookie; use euclid::rect::Rect; use hyper_serde::Serde; use ipc_channel::ipc::IpcSender; -use msg::constellation_msg::PipelineId; +use msg::constellation_msg::BrowsingContextId; use rustc_serialize::json::{Json, ToJson}; use servo_url::ServoUrl; @@ -31,7 +31,7 @@ pub enum WebDriverScriptCommand { GetElementRect(String, IpcSender<Result<Rect<f64>, ()>>), GetElementTagName(String, IpcSender<Result<String, ()>>), GetElementText(String, IpcSender<Result<String, ()>>), - GetPipelineId(WebDriverFrameId, IpcSender<Result<Option<PipelineId>, ()>>), + GetBrowsingContextId(WebDriverFrameId, IpcSender<Result<BrowsingContextId, ()>>), GetUrl(IpcSender<ServoUrl>), IsEnabled(String, IpcSender<Result<bool, ()>>), IsSelected(String, IpcSender<Result<bool, ()>>), |