mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Rustfmt has changed its default style :/
This commit is contained in:
parent
82fc6d9f49
commit
be69f9c3e6
207 changed files with 1200 additions and 1339 deletions
|
@ -4,8 +4,6 @@
|
|||
|
||||
//! Utilities to throw exceptions from Rust bindings.
|
||||
|
||||
#[cfg(feature = "js_backtrace")]
|
||||
use backtrace::Backtrace;
|
||||
#[cfg(feature = "js_backtrace")]
|
||||
use crate::dom::bindings::cell::DomRefCell;
|
||||
use crate::dom::bindings::codegen::Bindings::DOMExceptionBinding::DOMExceptionMethods;
|
||||
|
@ -17,6 +15,8 @@ use crate::dom::bindings::conversions::{
|
|||
use crate::dom::bindings::str::USVString;
|
||||
use crate::dom::domexception::{DOMErrorName, DOMException};
|
||||
use crate::dom::globalscope::GlobalScope;
|
||||
#[cfg(feature = "js_backtrace")]
|
||||
use backtrace::Backtrace;
|
||||
use js::error::{throw_range_error, throw_type_error};
|
||||
use js::jsapi::JSContext;
|
||||
use js::jsapi::JS_ClearPendingException;
|
||||
|
|
|
@ -105,7 +105,7 @@ where
|
|||
None => {
|
||||
return Err(Error::Type(
|
||||
"No custom element definition found for new.target".to_owned(),
|
||||
))
|
||||
));
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -734,10 +734,10 @@ fn parse_floating_point_number(input: &str) -> Result<f64, ()> {
|
|||
match input.trim().parse::<f64>() {
|
||||
Ok(val)
|
||||
if !(
|
||||
// A valid number is the same as what rust considers to be valid,
|
||||
// except for +1., NaN, and Infinity.
|
||||
val.is_infinite() || val.is_nan() || input.ends_with(".") || input.starts_with("+")
|
||||
) =>
|
||||
// A valid number is the same as what rust considers to be valid,
|
||||
// except for +1., NaN, and Infinity.
|
||||
val.is_infinite() || val.is_nan() || input.ends_with(".") || input.starts_with("+")
|
||||
) =>
|
||||
{
|
||||
// TODO(#19773): need consider `min`, `max`, `step`, when they are implemented
|
||||
Ok(val.round())
|
||||
|
|
|
@ -29,16 +29,6 @@
|
|||
//! The `unsafe_no_jsmanaged_fields!()` macro adds an empty implementation of
|
||||
//! `JSTraceable` to a datatype.
|
||||
|
||||
use app_units::Au;
|
||||
use canvas_traits::canvas::{
|
||||
CanvasGradientStop, CanvasId, LinearGradientStyle, RadialGradientStyle,
|
||||
};
|
||||
use canvas_traits::canvas::{CompositionOrBlending, LineCapStyle, LineJoinStyle, RepetitionStyle};
|
||||
use canvas_traits::webgl::{ActiveAttribInfo, ActiveUniformInfo, TexDataType, TexFormat};
|
||||
use canvas_traits::webgl::{WebGLBufferId, WebGLChan, WebGLContextShareMode, WebGLError};
|
||||
use canvas_traits::webgl::{WebGLFramebufferId, WebGLMsgSender, WebGLPipeline, WebGLProgramId};
|
||||
use canvas_traits::webgl::{WebGLReceiver, WebGLRenderbufferId, WebGLSLVersion, WebGLSender};
|
||||
use canvas_traits::webgl::{WebGLShaderId, WebGLTextureId, WebGLVersion, WebGLVertexArrayId};
|
||||
use crate::dom::bindings::cell::DomRefCell;
|
||||
use crate::dom::bindings::error::Error;
|
||||
use crate::dom::bindings::refcounted::{Trusted, TrustedPromise};
|
||||
|
@ -50,6 +40,16 @@ use crate::dom::document::PendingRestyle;
|
|||
use crate::dom::htmlimageelement::SourceSet;
|
||||
use crate::dom::htmlmediaelement::MediaFrameRenderer;
|
||||
use crate::task::TaskBox;
|
||||
use app_units::Au;
|
||||
use canvas_traits::canvas::{
|
||||
CanvasGradientStop, CanvasId, LinearGradientStyle, RadialGradientStyle,
|
||||
};
|
||||
use canvas_traits::canvas::{CompositionOrBlending, LineCapStyle, LineJoinStyle, RepetitionStyle};
|
||||
use canvas_traits::webgl::{ActiveAttribInfo, ActiveUniformInfo, TexDataType, TexFormat};
|
||||
use canvas_traits::webgl::{WebGLBufferId, WebGLChan, WebGLContextShareMode, WebGLError};
|
||||
use canvas_traits::webgl::{WebGLFramebufferId, WebGLMsgSender, WebGLPipeline, WebGLProgramId};
|
||||
use canvas_traits::webgl::{WebGLReceiver, WebGLRenderbufferId, WebGLSLVersion, WebGLSender};
|
||||
use canvas_traits::webgl::{WebGLShaderId, WebGLTextureId, WebGLVersion, WebGLVertexArrayId};
|
||||
use crossbeam_channel::{Receiver, Sender};
|
||||
use cssparser::RGBA;
|
||||
use devtools_traits::{CSSError, TimelineMarkerType, WorkerId};
|
||||
|
@ -769,8 +769,10 @@ struct RootedTraceableSet {
|
|||
set: Vec<*const dyn JSTraceable>,
|
||||
}
|
||||
|
||||
thread_local!(/// TLV Holds a set of JSTraceables that need to be rooted
|
||||
static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> = RefCell::new(RootedTraceableSet::new()););
|
||||
thread_local!(
|
||||
/// TLV Holds a set of JSTraceables that need to be rooted
|
||||
static ROOTED_TRACEABLES: RefCell<RootedTraceableSet> = RefCell::new(RootedTraceableSet::new());
|
||||
);
|
||||
|
||||
impl RootedTraceableSet {
|
||||
fn new() -> RootedTraceableSet {
|
||||
|
|
|
@ -116,12 +116,16 @@ pub fn xml_name_type(name: &str) -> XMLName {
|
|||
}
|
||||
|
||||
fn is_valid_continuation(c: char) -> bool {
|
||||
is_valid_start(c) || match c {
|
||||
'-' | '.' | '0'...'9' | '\u{B7}' | '\u{300}'...'\u{36F}' | '\u{203F}'...'\u{2040}' => {
|
||||
true
|
||||
},
|
||||
_ => false,
|
||||
}
|
||||
is_valid_start(c) ||
|
||||
match c {
|
||||
'-' |
|
||||
'.' |
|
||||
'0'...'9' |
|
||||
'\u{B7}' |
|
||||
'\u{300}'...'\u{36F}' |
|
||||
'\u{203F}'...'\u{2040}' => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
let mut iter = name.chars();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue