Auto merge of #17726 - paulrouget:rm_WindowNavigateMsg, r=jdm

Remove WindowNavigateMsg

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. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17726)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-07-14 07:16:18 -07:00 committed by GitHub
commit 2913d65b75
4 changed files with 16 additions and 25 deletions

View file

@ -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."),

View file

@ -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