зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #17726 - Remove WindowNavigateMsg (from paulrouget:rm_WindowNavigateMsg); r=jdm
Two reasons: - We want to be able to jump further in history from the embedder. - We don't want to have an extra translation step in the compositor, where `WindowNavigateMsg` is translated to `TraversalDirection` --- <!-- 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 - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 2913d65b755d2ebc12f89f8a5734b823d77f8b50 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 35db331aa61fb34c19324f1eaa750f0491a22566
This commit is contained in:
Родитель
6c4686768a
Коммит
c3363050da
|
@ -35,7 +35,7 @@ use time::{precise_time_ns, precise_time_s};
|
|||
use touch::{TouchHandler, TouchAction};
|
||||
use webrender;
|
||||
use webrender_api::{self, ClipId, LayoutPoint, LayoutVector2D, ScrollEventPhase, ScrollLocation, ScrollClamping};
|
||||
use windowing::{self, MouseWindowEvent, WindowEvent, WindowMethods, WindowNavigateMsg};
|
||||
use windowing::{self, MouseWindowEvent, WindowEvent, WindowMethods};
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
enum UnableToComposite {
|
||||
|
@ -1294,11 +1294,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
});
|
||||
}
|
||||
|
||||
fn on_navigation_window_event(&self, direction: WindowNavigateMsg) {
|
||||
let direction = match direction {
|
||||
windowing::WindowNavigateMsg::Forward => TraversalDirection::Forward(1),
|
||||
windowing::WindowNavigateMsg::Back => TraversalDirection::Back(1),
|
||||
};
|
||||
fn on_navigation_window_event(&self, direction: TraversalDirection) {
|
||||
let top_level_browsing_context_id = match self.root_pipeline {
|
||||
Some(ref pipeline) => pipeline.top_level_browsing_context_id,
|
||||
None => return warn!("Sending navigation to constellation with no root pipeline."),
|
||||
|
|
|
@ -8,7 +8,7 @@ use compositor_thread::EventLoopWaker;
|
|||
use euclid::{Point2D, Size2D};
|
||||
use euclid::{TypedPoint2D, TypedRect, ScaleFactor, TypedSize2D};
|
||||
use gleam::gl;
|
||||
use msg::constellation_msg::{Key, KeyModifiers, KeyState};
|
||||
use msg::constellation_msg::{Key, KeyModifiers, KeyState, TraversalDirection};
|
||||
use net_traits::net_error_list::NetError;
|
||||
use script_traits::{DevicePixel, LoadData, MouseButton, TouchEventType, TouchId, TouchpadPressurePhase};
|
||||
use servo_geometry::DeviceIndependentPixel;
|
||||
|
@ -25,12 +25,6 @@ pub enum MouseWindowEvent {
|
|||
MouseUp(MouseButton, TypedPoint2D<f32, DevicePixel>),
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub enum WindowNavigateMsg {
|
||||
Forward,
|
||||
Back,
|
||||
}
|
||||
|
||||
/// Events that the windowing system sends to Servo.
|
||||
#[derive(Clone)]
|
||||
pub enum WindowEvent {
|
||||
|
@ -66,7 +60,7 @@ pub enum WindowEvent {
|
|||
/// Sent when the user resets zoom to default.
|
||||
ResetZoom,
|
||||
/// Sent when the user uses chrome navigation (i.e. backspace or shift-backspace).
|
||||
Navigation(WindowNavigateMsg),
|
||||
Navigation(TraversalDirection),
|
||||
/// Sent when the user quits the application
|
||||
Quit,
|
||||
/// Sent when a key input state changes
|
||||
|
|
|
@ -8,13 +8,14 @@ use frame::{ServoCefFrame, ServoCefFrameExtensions};
|
|||
use interfaces::{CefBrowser, CefBrowserHost, CefClient, CefFrame, CefRequestContext};
|
||||
use interfaces::{cef_browser_t, cef_browser_host_t, cef_client_t, cef_frame_t};
|
||||
use interfaces::{cef_request_context_t};
|
||||
use msg::constellation_msg::TraversalDirection;
|
||||
use servo::Browser;
|
||||
use servo::servo_url::ServoUrl;
|
||||
use types::{cef_browser_settings_t, cef_string_t, cef_window_info_t, cef_window_handle_t};
|
||||
use window;
|
||||
use wrappers::CefWrap;
|
||||
|
||||
use compositing::windowing::{WindowNavigateMsg, WindowEvent};
|
||||
use compositing::windowing::WindowEvent;
|
||||
use glutin_app;
|
||||
use libc::c_int;
|
||||
use std::cell::{Cell, RefCell};
|
||||
|
@ -69,11 +70,11 @@ cef_class_impl! {
|
|||
}}
|
||||
|
||||
fn go_back(&this,) -> () {{
|
||||
this.send_window_event(WindowEvent::Navigation(WindowNavigateMsg::Back));
|
||||
this.send_window_event(WindowEvent::Navigation(TraversalDirection::Back(1)));
|
||||
}}
|
||||
|
||||
fn go_forward(&this,) -> () {{
|
||||
this.send_window_event(WindowEvent::Navigation(WindowNavigateMsg::Forward));
|
||||
this.send_window_event(WindowEvent::Navigation(TraversalDirection::Forward(1)));
|
||||
}}
|
||||
|
||||
// Returns the main (top-level) frame for the browser window.
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
use NestedEventLoopListener;
|
||||
use compositing::compositor_thread::EventLoopWaker;
|
||||
use compositing::windowing::{AnimationState, MouseWindowEvent, WindowNavigateMsg};
|
||||
use compositing::windowing::{AnimationState, MouseWindowEvent};
|
||||
use compositing::windowing::{WindowEvent, WindowMethods};
|
||||
use euclid::{Point2D, Size2D, TypedPoint2D, TypedVector2D, TypedRect, ScaleFactor, TypedSize2D};
|
||||
#[cfg(target_os = "windows")]
|
||||
|
@ -20,7 +20,7 @@ use glutin::TouchPhase;
|
|||
#[cfg(target_os = "macos")]
|
||||
use glutin::os::macos::{ActivationPolicy, WindowBuilderExt};
|
||||
use msg::constellation_msg::{self, Key};
|
||||
use msg::constellation_msg::{ALT, CONTROL, KeyState, NONE, SHIFT, SUPER};
|
||||
use msg::constellation_msg::{ALT, CONTROL, KeyState, NONE, SHIFT, SUPER, TraversalDirection};
|
||||
use net_traits::net_error_list::NetError;
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
use osmesa_sys;
|
||||
|
@ -930,10 +930,10 @@ impl Window {
|
|||
fn platform_handle_key(&self, key: Key, mods: constellation_msg::KeyModifiers) {
|
||||
match (mods, key) {
|
||||
(CMD_OR_CONTROL, Key::LeftBracket) => {
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(WindowNavigateMsg::Back));
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(TraversalDirection::Back(1)));
|
||||
}
|
||||
(CMD_OR_CONTROL, Key::RightBracket) => {
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(WindowNavigateMsg::Forward));
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(TraversalDirection::Forward(1)));
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
@ -1220,10 +1220,10 @@ impl WindowMethods for Window {
|
|||
}
|
||||
|
||||
(NONE, None, Key::NavigateForward) => {
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(WindowNavigateMsg::Forward));
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(TraversalDirection::Forward(1)));
|
||||
}
|
||||
(NONE, None, Key::NavigateBackward) => {
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(WindowNavigateMsg::Back));
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(TraversalDirection::Back(1)));
|
||||
}
|
||||
|
||||
(NONE, None, Key::Escape) => {
|
||||
|
@ -1233,10 +1233,10 @@ impl WindowMethods for Window {
|
|||
}
|
||||
|
||||
(CMD_OR_ALT, None, Key::Right) => {
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(WindowNavigateMsg::Forward));
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(TraversalDirection::Forward(1)));
|
||||
}
|
||||
(CMD_OR_ALT, None, Key::Left) => {
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(WindowNavigateMsg::Back));
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(TraversalDirection::Back(1)));
|
||||
}
|
||||
|
||||
(NONE, None, Key::PageDown) => {
|
||||
|
|
Загрузка…
Ссылка в новой задаче