Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kill browserhtml #19975

Merged
merged 5 commits into from Feb 13, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Some generated files are not rendered by default. Learn more.

@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>run-servo</string>
<string>servo</string>
<key>CFBundleGetInfoString</key>
<string>Servo</string>
<key>CFBundleIconFile</key>
@@ -253,11 +253,6 @@ Run Servo with the command:
./mach run https://www.google.com
```

Also, don't miss the info on the [browserhtml page](https://github.com/browserhtml/browserhtml) on how to run the Browser.html
full tech demo (it provides a more browser-like experience than just browsing a single
URL with servo).


### Commandline Arguments

- `-p INTERVAL` turns on the profiler and dumps info to the console every
@@ -18,10 +18,9 @@ use nonzero::NonZero;
use profile_traits::time::{self, ProfilerCategory, profile};
use script_traits::{AnimationState, AnimationTickType, ConstellationMsg, LayoutControlMsg};
use script_traits::{MouseButton, MouseEventType, ScrollState, TouchEventType, TouchId};
use script_traits::{TouchpadPressurePhase, UntrustedNodeAddress, WindowSizeData, WindowSizeType};
use script_traits::CompositorEvent::{MouseMoveEvent, MouseButtonEvent, TouchEvent, TouchpadPressureEvent};
use script_traits::{UntrustedNodeAddress, WindowSizeData, WindowSizeType};
use script_traits::CompositorEvent::{MouseMoveEvent, MouseButtonEvent, TouchEvent};
use servo_config::opts;
use servo_config::prefs::PREFS;
use servo_geometry::DeviceIndependentPixel;
use std::collections::HashMap;
use std::fs::File;
@@ -864,31 +863,6 @@ impl<Window: WindowMethods> IOCompositor<Window> {
self.send_touch_event(TouchEventType::Cancel, identifier, point);
}

pub fn on_touchpad_pressure_event(&self,
point: TypedPoint2D<f32, DevicePixel>,
pressure: f32,
phase: TouchpadPressurePhase) {
match PREFS.get("dom.forcetouch.enabled").as_boolean() {
Some(true) => {},
_ => return,
}

let results = self.hit_test_at_point(point);
if let Some(item) = results.items.first() {
let event = TouchpadPressureEvent(
item.point_in_viewport.to_untyped(),
pressure,
phase,
Some(UntrustedNodeAddress(item.tag.0 as *const c_void)),
);
let pipeline_id = PipelineId::from_webrender(item.pipeline);
let msg = ConstellationMsg::ForwardEvent(pipeline_id, event);
if let Err(e) = self.constellation_chan.send(msg) {
warn!("Sending event to constellation failed ({}).", e);
}
}
}

/// <http://w3c.github.io/touch-events/#mouse-events>
fn simulate_mouse_click(&mut self, p: TypedPoint2D<f32, DevicePixel>) {
let button = MouseButton::Left;
@@ -146,6 +146,8 @@ pub enum EmbedderMsg {
LoadStart(TopLevelBrowsingContextId),
/// The load of a page has completed
LoadComplete(TopLevelBrowsingContextId),
/// A pipeline panicked. First string is the reason, second one is the backtrace.
Panic(TopLevelBrowsingContextId, String, Option<String>),
}

/// Messages from the painting thread and the constellation thread to the compositor thread.
@@ -237,6 +239,7 @@ impl Debug for EmbedderMsg {
EmbedderMsg::SetFullscreenState(..) => write!(f, "SetFullscreenState"),
EmbedderMsg::LoadStart(..) => write!(f, "LoadStart"),
EmbedderMsg::LoadComplete(..) => write!(f, "LoadComplete"),
EmbedderMsg::Panic(..) => write!(f, "Panic"),
}
}
}
@@ -11,7 +11,7 @@ use gleam::gl;
use ipc_channel::ipc::IpcSender;
use msg::constellation_msg::{Key, KeyModifiers, KeyState, TopLevelBrowsingContextId, TraversalDirection};
use net_traits::net_error_list::NetError;
use script_traits::{LoadData, MouseButton, TouchEventType, TouchId, TouchpadPressurePhase};
use script_traits::{LoadData, MouseButton, TouchEventType, TouchId};
use servo_geometry::DeviceIndependentPixel;
use servo_url::ServoUrl;
use std::fmt::{Debug, Error, Formatter};
@@ -50,8 +50,6 @@ pub enum WindowEvent {
Refresh,
/// Sent when the window is resized.
Resize,
/// Touchpad Pressure
TouchpadPressure(TypedPoint2D<f32, DevicePixel>, f32, TouchpadPressurePhase),
/// Sent when a new URL is to be loaded.
LoadUrl(TopLevelBrowsingContextId, ServoUrl),
/// Sent when a mouse hit test is to be performed.
@@ -94,7 +92,6 @@ impl Debug for WindowEvent {
WindowEvent::Idle => write!(f, "Idle"),
WindowEvent::Refresh => write!(f, "Refresh"),
WindowEvent::Resize => write!(f, "Resize"),
WindowEvent::TouchpadPressure(..) => write!(f, "TouchpadPressure"),
WindowEvent::KeyEvent(..) => write!(f, "Key"),
WindowEvent::LoadUrl(..) => write!(f, "LoadUrl"),
WindowEvent::MouseWindowEventClass(..) => write!(f, "Mouse"),
@@ -192,4 +189,7 @@ pub trait WindowMethods {
/// will want to avoid blocking on UI events, and just
/// run the event loop at the vsync interval.
fn set_animation_state(&self, _state: AnimationState) {}

/// Called when a pipeline panics.
fn handle_panic(&self, browser_id: TopLevelBrowsingContextId, reason: String, backtrace: Option<String>);
}
@@ -609,7 +609,7 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult {
opts.optopt("", "content-process" , "Run as a content process and connect to the given pipe",
"servo-ipc-channel.abcdefg");
opts.optmulti("", "pref",
"A preference to set to enable", "dom.mozbrowser.enabled");
"A preference to set to enable", "dom.bluetooth.enabled");
opts.optflag("b", "no-native-titlebar", "Do not use native titlebar");
opts.optflag("w", "webrender", "Use webrender backend");
opts.optopt("G", "graphics", "Select graphics backend (gl or es2)", "gl");
@@ -228,10 +228,6 @@ impl Preferences {
self.0.read().unwrap().clone()
}

pub fn is_mozbrowser_enabled(&self) -> bool {
self.get("dom.mozbrowser.enabled").as_boolean().unwrap_or(false)
}

pub fn set(&self, name: &str, value: PrefValue) {
let mut prefs = self.0.write().unwrap();
if let Some(pref) = prefs.get_mut(name) {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.