mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Remove empty lines following braces.
This commit is contained in:
parent
4ebc065cba
commit
3cb8af20c2
69 changed files with 3 additions and 162 deletions
|
@ -122,11 +122,9 @@ impl CORSRequest {
|
|||
// framework right now. It would be worth redesigning http_fetch to do this properly.
|
||||
impl AsyncResponseListener for CORSContext {
|
||||
fn headers_available(&mut self, _metadata: Result<Metadata, NetworkError>) {
|
||||
|
||||
}
|
||||
|
||||
fn data_available(&mut self, _payload: Vec<u8>) {
|
||||
|
||||
}
|
||||
|
||||
fn response_complete(&mut self, _status: Result<(), NetworkError>) {
|
||||
|
|
|
@ -94,7 +94,6 @@ pub struct Blob {
|
|||
}
|
||||
|
||||
impl Blob {
|
||||
|
||||
pub fn new(global: GlobalRef, slice: DataSlice, typeString: &str) -> Root<Blob> {
|
||||
let boxed_blob = box Blob::new_inherited(slice, typeString);
|
||||
reflect_dom_object(boxed_blob, global, BlobBinding::Wrap)
|
||||
|
@ -114,7 +113,6 @@ impl Blob {
|
|||
blobParts: Option<Vec<BlobOrString>>,
|
||||
blobPropertyBag: &BlobBinding::BlobPropertyBag)
|
||||
-> Fallible<Root<Blob>> {
|
||||
|
||||
// TODO: accept other blobParts types - ArrayBuffer or ArrayBufferView
|
||||
let bytes: Vec<u8> = match blobParts {
|
||||
None => Vec::new(),
|
||||
|
@ -160,7 +158,6 @@ impl BlobMethods for Blob {
|
|||
end: Option<i64>,
|
||||
contentType: Option<DOMString>)
|
||||
-> Root<Blob> {
|
||||
|
||||
let relativeContentType = match contentType {
|
||||
None => DOMString::new(),
|
||||
Some(mut str) => {
|
||||
|
|
|
@ -128,7 +128,6 @@ fn convert_request_device_options(options: &RequestDeviceOptions,
|
|||
}
|
||||
|
||||
impl BluetoothMethods for Bluetooth {
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetooth-requestdevice
|
||||
fn RequestDevice(&self, option: &RequestDeviceOptions) -> Fallible<Root<BluetoothDevice>> {
|
||||
let (sender, receiver) = ipc::channel().unwrap();
|
||||
|
|
|
@ -49,7 +49,6 @@ impl BluetoothDevice {
|
|||
}
|
||||
|
||||
impl BluetoothDeviceMethods for BluetoothDevice {
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-id
|
||||
fn Id(&self) -> DOMString {
|
||||
self.id.clone()
|
||||
|
|
|
@ -75,7 +75,6 @@ impl BluetoothRemoteGATTCharacteristic {
|
|||
}
|
||||
|
||||
impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteristic {
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-properties
|
||||
fn Properties(&self) -> Root<BluetoothCharacteristicProperties> {
|
||||
self.properties.get()
|
||||
|
|
|
@ -68,7 +68,6 @@ impl BluetoothRemoteGATTDescriptor {
|
|||
}
|
||||
|
||||
impl BluetoothRemoteGATTDescriptorMethods for BluetoothRemoteGATTDescriptor {
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattdescriptor-characteristic
|
||||
fn Characteristic(&self) -> Root<BluetoothRemoteGATTCharacteristic> {
|
||||
self.characteristic.get()
|
||||
|
|
|
@ -49,7 +49,6 @@ impl BluetoothRemoteGATTServer {
|
|||
}
|
||||
|
||||
impl BluetoothRemoteGATTServerMethods for BluetoothRemoteGATTServer {
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-device
|
||||
fn Device(&self) -> Root<BluetoothDevice> {
|
||||
self.device.get()
|
||||
|
|
|
@ -270,7 +270,6 @@ const DESCRIPTOR_PREFIX: &'static str = "org.bluetooth.descriptor";
|
|||
const VALID_UUID_REGEX: &'static str = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
|
||||
|
||||
impl BluetoothUUID {
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothuuid-canonicaluuid
|
||||
pub fn CanonicalUUID(_: GlobalRef, alias: u32) -> UUID {
|
||||
DOMString::from(format!("{:08x}", &alias) + BASE_UUID)
|
||||
|
|
|
@ -1040,7 +1040,6 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
|
|||
sw: Finite<f64>,
|
||||
sh: Finite<f64>)
|
||||
-> Fallible<Root<ImageData>> {
|
||||
|
||||
if !self.origin_is_clean() {
|
||||
return Err(Error::Security)
|
||||
}
|
||||
|
|
|
@ -182,7 +182,6 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
|
|||
if shorthand.longhands().iter()
|
||||
.map(|&longhand| self.GetPropertyPriority(DOMString::from(longhand)))
|
||||
.all(|priority| priority == "important") {
|
||||
|
||||
return DOMString::from("important");
|
||||
}
|
||||
// Step 3
|
||||
|
|
|
@ -167,7 +167,6 @@ impl DedicatedWorkerGlobalScope {
|
|||
timer_event_chan: IpcSender<TimerEvent>,
|
||||
timer_event_port: Receiver<(TrustedWorkerAddress, TimerEvent)>)
|
||||
-> DedicatedWorkerGlobalScope {
|
||||
|
||||
DedicatedWorkerGlobalScope {
|
||||
workerglobalscope: WorkerGlobalScope::new_inherited(init,
|
||||
worker_url,
|
||||
|
|
|
@ -600,7 +600,6 @@ impl Document {
|
|||
/// Reassign the focus context to the element that last requested focus during this
|
||||
/// transaction, or none if no elements requested it.
|
||||
pub fn commit_focus_transaction(&self, focus_type: FocusType) {
|
||||
|
||||
if let Some(ref elem) = self.focused.get() {
|
||||
let node = elem.upcast::<Node>();
|
||||
elem.set_focus_state(false);
|
||||
|
@ -755,7 +754,6 @@ impl Document {
|
|||
client_point: Point2D<f32>,
|
||||
pressure: f32,
|
||||
phase_now: TouchpadPressurePhase) {
|
||||
|
||||
let phase_before = self.touchpad_pressure_phase.get();
|
||||
self.touchpad_pressure_phase.set(phase_now);
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ impl DOMQuad {
|
|||
p3: &DOMPoint,
|
||||
p4: &DOMPoint)
|
||||
-> DOMQuad {
|
||||
|
||||
DOMQuad {
|
||||
reflector_: Reflector::new(),
|
||||
p1: JS::from_ref(p1),
|
||||
|
|
|
@ -758,7 +758,6 @@ impl Element {
|
|||
pub fn update_inline_style(&self,
|
||||
declarations: Vec<PropertyDeclaration>,
|
||||
style_priority: StylePriority) {
|
||||
|
||||
fn update(element: &Element, mut declarations: Vec<PropertyDeclaration>, style_priority: StylePriority) {
|
||||
let mut inline_declarations = element.style_attribute().borrow_mut();
|
||||
if let &mut Some(ref mut existing_declarations) = &mut *inline_declarations {
|
||||
|
@ -1285,7 +1284,6 @@ impl Element {
|
|||
|
||||
// https://drafts.csswg.org/cssom-view/#dom-element-scroll
|
||||
pub fn scroll(&self, x_: f64, y_: f64, behavior: ScrollBehavior) {
|
||||
|
||||
// Step 1.2 or 2.3
|
||||
let x = if x_.is_finite() { x_ } else { 0.0f64 };
|
||||
let y = if y_.is_finite() { y_ } else { 0.0f64 };
|
||||
|
@ -1476,7 +1474,6 @@ impl ElementMethods for Element {
|
|||
});
|
||||
|
||||
if let Some(position) = position {
|
||||
|
||||
let old_attr = Root::from_ref(&*self.attrs.borrow()[position]);
|
||||
|
||||
// Step 3.
|
||||
|
|
|
@ -80,7 +80,6 @@ impl File {
|
|||
}
|
||||
|
||||
impl FileMethods for File {
|
||||
|
||||
// https://w3c.github.io/FileAPI/#dfn-name
|
||||
fn Name(&self) -> DOMString {
|
||||
self.name.clone()
|
||||
|
|
|
@ -79,7 +79,7 @@ pub struct FileReader {
|
|||
impl FileReader {
|
||||
pub fn new_inherited() -> FileReader {
|
||||
FileReader {
|
||||
eventtarget: EventTarget::new_inherited(),//?
|
||||
eventtarget: EventTarget::new_inherited(),
|
||||
ready_state: Cell::new(FileReaderReadyState::Empty),
|
||||
error: MutNullableHeap::new(None),
|
||||
result: DOMRefCell::new(None),
|
||||
|
@ -201,7 +201,6 @@ impl FileReader {
|
|||
// https://w3c.github.io/FileAPI/#dfn-readAsText
|
||||
fn perform_readastext(data: ReadMetaData, blob_bytes: &[u8])
|
||||
-> DOMString {
|
||||
|
||||
let blob_label = &data.label;
|
||||
let blob_type = &data.blobtype;
|
||||
|
||||
|
@ -319,7 +318,6 @@ impl FileReaderMethods for FileReader {
|
|||
|
||||
impl FileReader {
|
||||
fn dispatch_progress_event(&self, type_: Atom, loaded: u64, total: Option<u64>) {
|
||||
|
||||
let global = self.global();
|
||||
let progressevent = ProgressEvent::new(global.r(),
|
||||
type_, EventBubbles::DoesNotBubble, EventCancelable::NotCancelable,
|
||||
|
|
|
@ -39,7 +39,6 @@ impl ForceTouchEvent {
|
|||
}
|
||||
|
||||
impl<'a> ForceTouchEventMethods for &'a ForceTouchEvent {
|
||||
|
||||
fn ServoForce(&self) -> Finite<f32> {
|
||||
Finite::wrap(self.force)
|
||||
}
|
||||
|
|
|
@ -516,7 +516,6 @@ impl Activatable for HTMLAnchorElement {
|
|||
let mut ismap_suffix = None;
|
||||
if let Some(element) = target.downcast::<Element>() {
|
||||
if target.is::<HTMLImageElement>() && element.has_attribute(&atom!("ismap")) {
|
||||
|
||||
let target_node = element.upcast::<Node>();
|
||||
let rect = window_from_node(target_node).content_box_query(
|
||||
target_node.to_trusted_node_address());
|
||||
|
|
|
@ -254,7 +254,6 @@ impl HTMLCanvasElementMethods for HTMLCanvasElement {
|
|||
_context: *mut JSContext,
|
||||
_mime_type: Option<DOMString>,
|
||||
_arguments: Vec<HandleValue>) -> Fallible<DOMString> {
|
||||
|
||||
// Step 1.
|
||||
if let Some(CanvasContext::Context2d(ref context)) = *self.context.borrow() {
|
||||
if !context.origin_is_clean() {
|
||||
|
|
|
@ -270,7 +270,6 @@ impl LayoutHTMLInputElementHelpers for LayoutJS<HTMLInputElement> {
|
|||
}
|
||||
|
||||
impl HTMLInputElementMethods for HTMLInputElement {
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-input-accept
|
||||
make_getter!(Accept, "accept");
|
||||
|
||||
|
@ -786,7 +785,6 @@ impl VirtualMethods for HTMLInputElement {
|
|||
let new_value_mode = self.value_mode();
|
||||
|
||||
match (&old_value_mode, old_idl_value.is_empty(), new_value_mode) {
|
||||
|
||||
// Step 1
|
||||
(&ValueMode::Value, false, ValueMode::Default) |
|
||||
(&ValueMode::Value, false, ValueMode::DefaultOn) => {
|
||||
|
|
|
@ -1638,7 +1638,6 @@ impl Node {
|
|||
// https://dom.spec.whatwg.org/#concept-node-clone
|
||||
pub fn clone(node: &Node, maybe_doc: Option<&Document>,
|
||||
clone_children: CloneChildrenFlag) -> Root<Node> {
|
||||
|
||||
// Step 1.
|
||||
let document = match maybe_doc {
|
||||
Some(doc) => Root::from_ref(doc),
|
||||
|
@ -1994,7 +1993,6 @@ impl NodeMethods for Node {
|
|||
|
||||
// https://dom.spec.whatwg.org/#concept-node-replace
|
||||
fn ReplaceChild(&self, node: &Node, child: &Node) -> Fallible<Root<Node>> {
|
||||
|
||||
// Step 1.
|
||||
match self.type_id() {
|
||||
NodeTypeId::Document(_) |
|
||||
|
|
|
@ -166,7 +166,6 @@ impl NodeIteratorMethods for NodeIterator {
|
|||
|
||||
// Step 3-1.
|
||||
for preceding_node in node.preceding_nodes(&self.root_node) {
|
||||
|
||||
// Step 3-2.
|
||||
let result = try!(self.accept_node(preceding_node.r()));
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ impl PerformanceTiming {
|
|||
navigation_start: u64,
|
||||
navigation_start_precise: f64)
|
||||
-> Root<PerformanceTiming> {
|
||||
|
||||
let timing = PerformanceTiming::new_inherited(navigation_start,
|
||||
navigation_start_precise,
|
||||
window.Document().r());
|
||||
|
|
|
@ -32,7 +32,6 @@ impl PluginArray {
|
|||
impl PluginArrayMethods for PluginArray {
|
||||
// https://html.spec.whatwg.org/multipage/#dom-pluginarray-refresh
|
||||
fn Refresh(&self, _reload: bool) {
|
||||
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-pluginarray-length
|
||||
|
|
|
@ -53,7 +53,6 @@ impl ValidityState {
|
|||
}
|
||||
|
||||
impl ValidityStateMethods for ValidityState {
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-validitystate-valuemissing
|
||||
fn ValueMissing(&self) -> bool {
|
||||
false
|
||||
|
|
|
@ -382,7 +382,6 @@ impl WebSocketMethods for WebSocket {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-websocket-send
|
||||
fn Send(&self, data: USVString) -> ErrorResult {
|
||||
|
||||
let data_byte_len = data.0.as_bytes().len() as u64;
|
||||
let send_data = try!(self.send_impl(data_byte_len));
|
||||
|
||||
|
@ -397,7 +396,6 @@ impl WebSocketMethods for WebSocket {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-websocket-send
|
||||
fn Send_(&self, blob: &Blob) -> ErrorResult {
|
||||
|
||||
/* As per https://html.spec.whatwg.org/multipage/#websocket
|
||||
the buffered amount needs to be clamped to u32, even though Blob.Size() is u64
|
||||
If the buffer limit is reached in the first place, there are likely other major problems
|
||||
|
|
|
@ -1197,7 +1197,6 @@ impl Window {
|
|||
// https://drafts.csswg.org/cssom-view/#dom-element-scroll
|
||||
pub fn scroll_node(&self, node: TrustedNodeAddress,
|
||||
x_: f64, y_: f64, behavior: ScrollBehavior) {
|
||||
|
||||
self.reflow(ReflowGoal::ForScriptQuery,
|
||||
ReflowQueryType::NodeLayerIdQuery(node),
|
||||
ReflowReason::Query);
|
||||
|
|
|
@ -835,7 +835,6 @@ impl ScriptThread {
|
|||
|
||||
fn profile_event<F, R>(&self, category: ScriptThreadEventCategory, f: F) -> R
|
||||
where F: FnOnce() -> R {
|
||||
|
||||
if opts::get().profile_script_events {
|
||||
let profiler_cat = match category {
|
||||
ScriptThreadEventCategory::AttachLayout => ProfilerCategory::ScriptAttachLayout,
|
||||
|
@ -1693,7 +1692,6 @@ impl ScriptThread {
|
|||
///
|
||||
/// TODO: Actually perform DOM event dispatch.
|
||||
fn handle_event(&self, pipeline_id: PipelineId, event: CompositorEvent) {
|
||||
|
||||
// DOM events can only be handled if there's a root browsing context.
|
||||
if !self.root_browsing_context_exists() {
|
||||
return;
|
||||
|
|
|
@ -264,7 +264,6 @@ impl OneshotTimers {
|
|||
is_interval: IsInterval,
|
||||
source: TimerSource)
|
||||
-> i32 {
|
||||
|
||||
self.js_timers.set_timeout_or_interval(global,
|
||||
callback,
|
||||
arguments,
|
||||
|
@ -478,7 +477,6 @@ impl JsTimerTask {
|
|||
// reschedule repeating timers when they were not canceled as part of step 4.2.
|
||||
if self.is_interval == IsInterval::Interval &&
|
||||
timers.active_timers.borrow().contains_key(&self.handle) {
|
||||
|
||||
timers.initialize_and_schedule(this.global().r(), self);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue