clippy: Fix redundant field names warnings (#31793)

This commit is contained in:
Oluwatobi Sofela 2024-03-21 00:05:29 +01:00 committed by GitHub
parent f55d1d288e
commit 2789e98876
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
97 changed files with 285 additions and 314 deletions

View file

@ -46,9 +46,9 @@ impl BluetoothRemoteGATTDescriptor {
BluetoothRemoteGATTDescriptor {
reflector_: Reflector::new(),
characteristic: Dom::from_ref(characteristic),
uuid: uuid,
uuid,
value: DomRefCell::new(None),
instance_id: instance_id,
instance_id,
}
}

View file

@ -36,7 +36,7 @@ impl CanvasGradient {
fn new_inherited(style: CanvasGradientStyle) -> CanvasGradient {
CanvasGradient {
reflector_: Reflector::new(),
style: style,
style,
stops: DomRefCell::new(Vec::new()),
}
}
@ -60,7 +60,7 @@ impl CanvasGradientMethods for CanvasGradient {
self.stops.borrow_mut().push(CanvasGradientStop {
offset: (*offset) as f64,
color: color,
color,
});
Ok(())
}

View file

@ -61,7 +61,7 @@ impl CompositionEvent {
let ev = reflect_dom_object_with_proto(
Box::new(CompositionEvent {
uievent: UIEvent::new_inherited(),
data: data,
data,
}),
window,
proto,

View file

@ -29,7 +29,7 @@ impl CSSFontFaceRule {
) -> CSSFontFaceRule {
CSSFontFaceRule {
cssrule: CSSRule::new_inherited(parent_stylesheet),
fontfacerule: fontfacerule,
fontfacerule,
}
}

View file

@ -34,7 +34,7 @@ impl CSSGroupingRule {
) -> CSSGroupingRule {
CSSGroupingRule {
cssrule: CSSRule::new_inherited(parent_stylesheet),
rules: rules,
rules,
rulelist: MutNullableDom::new(None),
}
}

View file

@ -32,7 +32,7 @@ impl CSSImportRule {
) -> Self {
CSSImportRule {
cssrule: CSSRule::new_inherited(parent_stylesheet),
import_rule: import_rule,
import_rule,
}
}

View file

@ -33,7 +33,7 @@ impl CSSKeyframeRule {
) -> CSSKeyframeRule {
CSSKeyframeRule {
cssrule: CSSRule::new_inherited(parent_stylesheet),
keyframerule: keyframerule,
keyframerule,
style_decl: Default::default(),
}
}

View file

@ -37,7 +37,7 @@ impl CSSKeyframesRule {
) -> CSSKeyframesRule {
CSSKeyframesRule {
cssrule: CSSRule::new_inherited(parent_stylesheet),
keyframesrule: keyframesrule,
keyframesrule,
rulelist: MutNullableDom::new(None),
}
}

View file

@ -32,7 +32,7 @@ impl CSSMediaRule {
let list = mediarule.rules.clone();
CSSMediaRule {
cssconditionrule: CSSConditionRule::new_inherited(parent_stylesheet, list),
mediarule: mediarule,
mediarule,
medialist: MutNullableDom::new(None),
}
}

View file

@ -30,7 +30,7 @@ impl CSSNamespaceRule {
) -> CSSNamespaceRule {
CSSNamespaceRule {
cssrule: CSSRule::new_inherited(parent_stylesheet),
namespacerule: namespacerule,
namespacerule,
}
}

View file

@ -73,7 +73,7 @@ impl CSSRuleList {
CSSRuleList {
reflector_: Reflector::new(),
parent_stylesheet: Dom::from_ref(parent_stylesheet),
rules: rules,
rules,
dom_rules: DomRefCell::new(dom_rules),
}
}

View file

@ -223,9 +223,9 @@ impl CSSStyleDeclaration {
) -> CSSStyleDeclaration {
CSSStyleDeclaration {
reflector_: Reflector::new(),
owner: owner,
owner,
readonly: modification_access == CSSModificationAccess::Readonly,
pseudo: pseudo,
pseudo,
}
}

View file

@ -39,7 +39,7 @@ impl CSSStyleRule {
) -> CSSStyleRule {
CSSStyleRule {
cssrule: CSSRule::new_inherited(parent_stylesheet),
stylerule: stylerule,
stylerule,
style_decl: Default::default(),
}
}

View file

@ -22,7 +22,7 @@ impl CSSStyleValue {
fn new_inherited(value: String) -> CSSStyleValue {
CSSStyleValue {
reflector: Reflector::new(),
value: value,
value,
}
}

View file

@ -32,7 +32,7 @@ impl CSSSupportsRule {
let list = supportsrule.rules.clone();
CSSSupportsRule {
cssconditionrule: CSSConditionRule::new_inherited(parent_stylesheet, list),
supportsrule: supportsrule,
supportsrule,
}
}

View file

@ -526,11 +526,11 @@ impl CustomElementDefinition {
callbacks: LifecycleCallbacks,
) -> CustomElementDefinition {
CustomElementDefinition {
name: name,
local_name: local_name,
constructor: constructor,
observed_attributes: observed_attributes,
callbacks: callbacks,
name,
local_name,
constructor,
observed_attributes,
callbacks,
construction_stack: Default::default(),
}
}

View file

@ -78,7 +78,7 @@ impl<'a> AutoWorkerReset<'a> {
worker: TrustedWorkerAddress,
) -> AutoWorkerReset<'a> {
AutoWorkerReset {
workerscope: workerscope,
workerscope,
old_worker: replace(&mut *workerscope.worker.borrow_mut(), Some(worker)),
}
}
@ -268,10 +268,10 @@ impl DedicatedWorkerGlobalScope {
gpu_id_hub,
),
task_queue: TaskQueue::new(receiver, own_sender.clone()),
own_sender: own_sender,
parent_sender: parent_sender,
own_sender,
parent_sender,
worker: DomRefCell::new(None),
image_cache: image_cache,
image_cache,
browsing_context,
control_receiver,
}

View file

@ -239,7 +239,7 @@ impl DissimilarOriginWindow {
source: incumbent.pipeline_id(),
source_origin,
target_origin,
data: data,
data,
};
// Step 8
let _ = incumbent.script_to_constellation_chan().send(msg);

View file

@ -3118,7 +3118,7 @@ impl Document {
has_browsing_context,
implementation: Default::default(),
content_type,
last_modified: last_modified,
last_modified,
url: DomRefCell::new(url),
// https://dom.spec.whatwg.org/#concept-document-quirks
quirks_mode: Cell::new(QuirksMode::NoQuirks),
@ -3188,8 +3188,8 @@ impl Document {
unload_event_start: Cell::new(Default::default()),
unload_event_end: Cell::new(Default::default()),
https_state: Cell::new(HttpsState::None),
origin: origin,
referrer: referrer,
origin,
referrer,
referrer_policy: Cell::new(referrer_policy),
target_element: MutNullableDom::new(None),
last_click_info: DomRefCell::new(None),
@ -3201,7 +3201,7 @@ impl Document {
form_id_listener_map: Default::default(),
interactive_time: DomRefCell::new(interactive_time),
tti_window: DomRefCell::new(InteractiveWindow::default()),
canceller: canceller,
canceller,
throw_on_dynamic_markup_insertion_counter: Cell::new(0),
page_showing: Cell::new(false),
salvageable: Cell::new(true),

View file

@ -32,7 +32,7 @@ impl DocumentType {
) -> DocumentType {
DocumentType {
node: Node::new_inherited(document),
name: name,
name,
public_id: public_id.unwrap_or_default(),
system_id: system_id.unwrap_or_default(),
}

View file

@ -35,8 +35,8 @@ impl DOMTokenList {
DOMTokenList {
reflector_: Reflector::new(),
element: Dom::from_ref(element),
local_name: local_name,
supported_tokens: supported_tokens,
local_name,
supported_tokens,
}
}

View file

@ -289,9 +289,9 @@ impl Element {
) -> Element {
Element {
node: Node::new_inherited(document),
local_name: local_name,
local_name,
tag_name: TagName::new(),
namespace: namespace,
namespace,
prefix: DomRefCell::new(prefix),
attrs: DomRefCell::new(vec![]),
id_attribute: DomRefCell::new(None),
@ -1299,7 +1299,7 @@ impl Element {
&mut writer,
&self.upcast::<Node>(),
SerializeOpts {
traversal_scope: traversal_scope,
traversal_scope,
..Default::default()
},
) {
@ -1316,7 +1316,7 @@ impl Element {
&mut writer,
&self.upcast::<Node>(),
XmlSerializeOpts {
traversal_scope: traversal_scope,
traversal_scope,
..Default::default()
},
) {
@ -3840,9 +3840,9 @@ impl ElementPerformFullscreenEnter {
error: bool,
) -> Box<ElementPerformFullscreenEnter> {
Box::new(ElementPerformFullscreenEnter {
element: element,
promise: promise,
error: error,
element,
promise,
error,
})
}
}
@ -3891,10 +3891,7 @@ impl ElementPerformFullscreenExit {
element: Trusted<Element>,
promise: TrustedPromise,
) -> Box<ElementPerformFullscreenExit> {
Box::new(ElementPerformFullscreenExit {
element: element,
promise: promise,
})
Box::new(ElementPerformFullscreenExit { element, promise })
}
}

View file

@ -453,14 +453,14 @@ impl EventSource {
fn new_inherited(url: ServoUrl, with_credentials: bool) -> EventSource {
EventSource {
eventtarget: EventTarget::new_inherited(),
url: url,
url,
request: DomRefCell::new(None),
last_event_id: DomRefCell::new(DOMString::from("")),
reconnection_time: Cell::new(DEFAULT_RECONNECTION_TIME),
generation_id: Cell::new(GenerationId(0)),
ready_state: Cell::new(ReadyState::Connecting),
with_credentials: with_credentials,
with_credentials,
canceller: DomRefCell::new(Default::default()),
}
}

View file

@ -468,11 +468,7 @@ impl EventTarget {
ty: &str,
source: DOMString,
) {
let handler = InternalRawUncompiledHandler {
source: source,
line: line,
url: url,
};
let handler = InternalRawUncompiledHandler { source, line, url };
self.set_inline_event_listener(
Atom::from(ty),
Some(InlineEventListener::Uncompiled(handler)),
@ -722,7 +718,7 @@ impl EventTarget {
ListenerPhase::Bubbling
};
let new_entry = EventListenerEntry {
phase: phase,
phase,
listener: EventListenerType::Additive(listener),
once: options.once,
};
@ -751,7 +747,7 @@ impl EventTarget {
ListenerPhase::Bubbling
};
let old_entry = EventListenerEntry {
phase: phase,
phase,
listener: EventListenerType::Additive(listener.clone()),
once: false,
};

View file

@ -54,8 +54,8 @@ impl ExtendableMessageEvent {
ExtendableMessageEvent {
event: ExtendableEvent::new_inherited(),
data: Heap::default(),
origin: origin,
lastEventId: lastEventId,
origin,
lastEventId,
ports: ports
.into_iter()
.map(|port| Dom::from_ref(&*port))

View file

@ -31,7 +31,7 @@ impl File {
fn new_inherited(blob_impl: &BlobImpl, name: DOMString, modified: Option<i64>) -> File {
File {
blob: Blob::new_inherited(blob_impl),
name: name,
name,
// https://w3c.github.io/FileAPI/#dfn-lastModified
modified: match modified {
Some(m) => m,

View file

@ -62,9 +62,9 @@ impl ReadMetaData {
function: FileReaderFunction,
) -> ReadMetaData {
ReadMetaData {
blobtype: blobtype,
label: label,
function: function,
blobtype,
label,
function,
}
}
}

View file

@ -67,18 +67,18 @@ impl Gamepad {
) -> Gamepad {
Self {
reflector_: Reflector::new(),
gamepad_id: gamepad_id,
id: id,
gamepad_id,
id,
index: Cell::new(index),
connected: Cell::new(connected),
timestamp: Cell::new(timestamp),
mapping_type: mapping_type,
mapping_type,
axes: HeapBufferSource::default(),
buttons: Dom::from_ref(buttons),
pose: pose.map(Dom::from_ref),
hand: hand,
axis_bounds: axis_bounds,
button_bounds: button_bounds,
hand,
axis_bounds,
button_bounds,
exposed: Cell::new(false),
}
}

View file

@ -2122,7 +2122,7 @@ impl GlobalScope {
.push(AutoCloseWorker {
closing,
join_handle: Some(join_handle),
control_sender: control_sender,
control_sender,
context,
});
}
@ -2762,7 +2762,7 @@ impl GlobalScope {
pub fn queue_function_as_microtask(&self, callback: Rc<VoidFunction>) {
self.enqueue_microtask(Microtask::User(UserMicrotask {
callback: callback,
callback,
pipeline: self.pipeline_id(),
}))
}

View file

@ -499,7 +499,7 @@ impl GPUDeviceMethods for GPUDevice {
wgt::BindGroupLayoutEntry {
binding: bind.binding,
visibility: visibility,
visibility,
ty,
count: None,
}

View file

@ -29,8 +29,8 @@ impl HashChangeEvent {
fn new_inherited(old_url: String, new_url: String) -> HashChangeEvent {
HashChangeEvent {
event: Event::new_inherited(),
old_url: old_url,
new_url: new_url,
old_url,
new_url,
}
}

View file

@ -55,7 +55,7 @@ impl History {
History {
reflector_: Reflector::new(),
window: Dom::from_ref(&window),
state: state,
state,
state_id: Cell::new(None),
}
}

View file

@ -214,7 +214,7 @@ impl Area {
Area::Circle { left, top, radius } => Area::Circle {
left: (left + p.x),
top: (top + p.y),
radius: radius,
radius,
},
Area::Polygon { ref points } => {
// let new_points = Vec::new();

View file

@ -215,8 +215,8 @@ impl HTMLButtonElement {
// Step 3.9
Some(FormDatum {
ty: ty,
name: name,
ty,
name,
value: FormDatumValue::String(self.Value()),
})
}

View file

@ -161,7 +161,7 @@ impl LayoutHTMLCanvasElementHelpers for LayoutDom<'_, HTMLCanvasElement> {
.upcast::<Element>()
.get_attr_for_layout(&ns!(), &local_name!("height"));
HTMLCanvasData {
source: source,
source,
width: width_attr.map_or(DEFAULT_WIDTH, |val| val.as_uint()),
height: height_attr.map_or(DEFAULT_HEIGHT, |val| val.as_uint()),
canvas_id: self.get_canvas_id_for_layout(),

View file

@ -43,7 +43,7 @@ impl OptionU32 {
fn some(bits: u32) -> OptionU32 {
assert_ne!(bits, u32::max_value());
OptionU32 { bits: bits }
OptionU32 { bits }
}
fn none() -> OptionU32 {
@ -77,7 +77,7 @@ impl HTMLCollection {
HTMLCollection {
reflector_: Reflector::new(),
root: Dom::from_ref(root),
filter: filter,
filter,
// Default values for the cache
cached_version: Cell::new(root.inclusive_descendants_version()),
cached_cursor_element: MutNullableDom::new(None),
@ -185,7 +185,7 @@ impl HTMLCollection {
let filter = HtmlDocumentFilter {
ascii_lower_qualified_name: qualified_name.to_ascii_lowercase(),
qualified_name: qualified_name,
qualified_name,
};
HTMLCollection::create(window, root, Box::new(filter))
}
@ -230,7 +230,7 @@ impl HTMLCollection {
(self.qname.local == *elem.local_name()))
}
}
let filter = TagNameNSFilter { qname: qname };
let filter = TagNameNSFilter { qname };
HTMLCollection::create(window, root, Box::new(filter))
}
@ -269,7 +269,7 @@ impl HTMLCollection {
return HTMLCollection::always_empty(window, root);
}
let filter = ClassNameFilter { classes: classes };
let filter = ClassNameFilter { classes };
HTMLCollection::create(window, root, Box::new(filter))
}

View file

@ -1145,7 +1145,7 @@ impl HTMLFormElement {
if !name.is_empty() {
data_set.push(FormDatum {
ty: textarea.Type(),
name: name,
name,
value: FormDatumValue::String(textarea.Value()),
});
}

View file

@ -36,7 +36,7 @@ impl HTMLHeadingElement {
) -> HTMLHeadingElement {
HTMLHeadingElement {
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
level: level,
level,
}
}

View file

@ -182,12 +182,12 @@ impl HTMLIFrameElement {
let global_scope = window.upcast::<GlobalScope>();
let load_info = IFrameLoadInfo {
parent_pipeline_id: global_scope.pipeline_id(),
browsing_context_id: browsing_context_id,
top_level_browsing_context_id: top_level_browsing_context_id,
new_pipeline_id: new_pipeline_id,
browsing_context_id,
top_level_browsing_context_id,
new_pipeline_id,
is_private: false, // FIXME
inherited_secure_context: load_data.inherited_secure_context,
replace: replace,
replace,
};
let window_size = WindowSizeData {
@ -204,7 +204,7 @@ impl HTMLIFrameElement {
let load_info = IFrameLoadInfoWithData {
info: load_info,
load_data: load_data.clone(),
old_pipeline_id: old_pipeline_id,
old_pipeline_id,
sandbox: sandboxed,
window_size,
};
@ -215,11 +215,11 @@ impl HTMLIFrameElement {
let new_layout_info = NewLayoutInfo {
parent_info: Some(global_scope.pipeline_id()),
new_pipeline_id: new_pipeline_id,
browsing_context_id: browsing_context_id,
top_level_browsing_context_id: top_level_browsing_context_id,
new_pipeline_id,
browsing_context_id,
top_level_browsing_context_id,
opener: None,
load_data: load_data,
load_data,
window_size,
};
@ -229,8 +229,8 @@ impl HTMLIFrameElement {
PipelineType::Navigation => {
let load_info = IFrameLoadInfoWithData {
info: load_info,
load_data: load_data,
old_pipeline_id: old_pipeline_id,
load_data,
old_pipeline_id,
sandbox: sandboxed,
window_size,
};

View file

@ -367,7 +367,7 @@ impl HTMLImageElement {
let context = Arc::new(Mutex::new(ImageContext {
image_cache: window.image_cache(),
status: Ok(()),
id: id,
id,
aborted: false,
doc: Trusted::new(&document),
resource_timing: ResourceFetchTiming::new(ResourceTimingType::Resource),
@ -1972,10 +1972,7 @@ pub fn parse_a_srcset_attribute(input: &str) -> Vec<ImageSource> {
wid: width,
den: density,
};
let image_source = ImageSource {
url: url,
descriptor: descriptor,
};
let image_source = ImageSource { url, descriptor };
candidates.push(image_source);
}
}

View file

@ -1765,7 +1765,7 @@ impl HTMLInputElement {
if name.to_ascii_lowercase() == "_charset_" {
return vec![FormDatum {
ty: ty.clone(),
name: name,
name,
value: FormDatumValue::String(match encoding {
None => DOMString::from("UTF-8"),
Some(enc) => DOMString::from(enc.name()),
@ -1785,7 +1785,7 @@ impl HTMLInputElement {
// Step 5.12
vec![FormDatum {
ty: ty.clone(),
name: name,
name,
value: FormDatumValue::String(self.Value()),
}]
}

View file

@ -134,7 +134,7 @@ unsafe extern "C" fn off_thread_compilation_callback(
code,
url: final_url,
external: true,
fetch_options: fetch_options,
fetch_options,
type_: ScriptType::Classic,
})
};
@ -276,7 +276,7 @@ impl ScriptOrigin {
) -> ScriptOrigin {
ScriptOrigin {
code: SourceCode::Text(text),
url: url,
url,
external: false,
fetch_options,
type_,
@ -291,7 +291,7 @@ impl ScriptOrigin {
) -> ScriptOrigin {
ScriptOrigin {
code: SourceCode::Text(text),
url: url,
url,
external: true,
fetch_options,
type_,
@ -549,8 +549,8 @@ fn fetch_a_classic_script(
let context = Arc::new(Mutex::new(ClassicContext {
elem: Trusted::new(script),
kind: kind,
character_encoding: character_encoding,
kind,
character_encoding,
data: vec![],
metadata: None,
url: url.clone(),

View file

@ -96,8 +96,8 @@ impl ImageData {
let imagedata = Box::new(ImageData {
reflector_: Reflector::new(),
width: width,
height: height,
width,
height,
data: heap_typed_array,
});
@ -126,8 +126,8 @@ impl ImageData {
};
let imagedata = Box::new(ImageData {
reflector_: Reflector::new(),
width: width,
height: height,
width,
height,
data: heap_typed_array,
});

View file

@ -36,8 +36,8 @@ impl InputEvent {
let ev = reflect_dom_object_with_proto(
Box::new(InputEvent {
uievent: UIEvent::new_inherited(),
data: data,
is_composing: is_composing,
data,
is_composing,
}),
window,
proto,

View file

@ -20,7 +20,7 @@ impl MediaError {
fn new_inherited(code: u16) -> MediaError {
MediaError {
reflector_: Reflector::new(),
code: code,
code,
}
}

View file

@ -37,7 +37,7 @@ impl MediaList {
MediaList {
parent_stylesheet: Dom::from_ref(parent_stylesheet),
reflector_: Reflector::new(),
media_queries: media_queries,
media_queries,
}
}

View file

@ -40,7 +40,7 @@ impl MediaQueryList {
MediaQueryList {
eventtarget: EventTarget::new_inherited(),
document: Dom::from_ref(document),
media_query_list: media_query_list,
media_query_list,
last_match_state: Cell::new(None),
}
}

View file

@ -38,7 +38,7 @@ impl MediaQueryListEvent {
) -> DomRoot<MediaQueryListEvent> {
let ev = Box::new(MediaQueryListEvent {
event: Event::new_inherited(),
media: media,
media,
matches: Cell::new(matches),
});
reflect_dom_object_with_proto(ev, global, proto)

View file

@ -80,7 +80,7 @@ impl MutationObserver {
fn new_inherited(callback: Rc<MutationCallback>) -> MutationObserver {
MutationObserver {
reflector_: Reflector::new(),
callback: callback,
callback,
record_queue: DomRefCell::new(vec![]),
node_list: DomRefCell::new(vec![]),
}

View file

@ -111,9 +111,9 @@ impl MutationRecord {
reflector_: Reflector::new(),
record_type: DOMString::from(record_type),
target: Dom::from_ref(target),
attribute_name: attribute_name,
attribute_namespace: attribute_namespace,
old_value: old_value,
attribute_name,
attribute_namespace,
old_value,
added_nodes: MutNullableDom::new(added_nodes),
removed_nodes: MutNullableDom::new(removed_nodes),
next_sibling: next_sibling.map(Dom::from_ref),

View file

@ -457,7 +457,7 @@ pub struct QuerySelectorIterator {
impl<'a> QuerySelectorIterator {
fn new(iter: TreeIterator, selectors: SelectorList<SelectorImpl>) -> QuerySelectorIterator {
QuerySelectorIterator {
selectors: selectors,
selectors,
iterator: iter,
}
}
@ -3247,21 +3247,11 @@ impl<'a> ChildrenMutation<'a> {
match (prev, next) {
(None, None) => ChildrenMutation::ReplaceAll {
removed: &[],
added: added,
},
(Some(prev), None) => ChildrenMutation::Append {
prev: prev,
added: added,
},
(None, Some(next)) => ChildrenMutation::Prepend {
added: added,
next: next,
},
(Some(prev), Some(next)) => ChildrenMutation::Insert {
prev: prev,
added: added,
next: next,
added,
},
(Some(prev), None) => ChildrenMutation::Append { prev, added },
(None, Some(next)) => ChildrenMutation::Prepend { added, next },
(Some(prev), Some(next)) => ChildrenMutation::Insert { prev, added, next },
}
}
@ -3275,14 +3265,14 @@ impl<'a> ChildrenMutation<'a> {
if let (None, None) = (prev, next) {
ChildrenMutation::ReplaceAll {
removed: from_ref(removed),
added: added,
added,
}
} else {
ChildrenMutation::Replace {
prev: prev,
prev,
removed: *removed,
added: added,
next: next,
added,
next,
}
}
} else {
@ -3291,10 +3281,7 @@ impl<'a> ChildrenMutation<'a> {
}
fn replace_all(removed: &'a [&'a Node], added: &'a [&'a Node]) -> ChildrenMutation<'a> {
ChildrenMutation::ReplaceAll {
removed: removed,
added: added,
}
ChildrenMutation::ReplaceAll { removed, added }
}
/// Get the child that follows the added or removed children.
@ -3414,9 +3401,9 @@ impl<'a> UnbindContext<'a> {
) -> Self {
UnbindContext {
index: Cell::new(cached_index),
parent: parent,
prev_sibling: prev_sibling,
next_sibling: next_sibling,
parent,
prev_sibling,
next_sibling,
tree_connected: parent.is_connected(),
tree_in_doc: parent.is_in_doc(),
}

View file

@ -37,8 +37,8 @@ impl NodeIterator {
root_node: Dom::from_ref(root_node),
reference_node: MutDom::new(root_node),
pointer_before_reference_node: Cell::new(true),
what_to_show: what_to_show,
filter: filter,
what_to_show,
filter,
active: Cell::new(false),
}
}

View file

@ -40,7 +40,7 @@ impl NodeList {
pub fn new_inherited(list_type: NodeListType) -> NodeList {
NodeList {
reflector_: Reflector::new(),
list_type: list_type,
list_type,
}
}
@ -402,8 +402,8 @@ impl RadioList {
pub fn new(form: &HTMLFormElement, mode: RadioListMode, name: Atom) -> RadioList {
RadioList {
form: Dom::from_ref(form),
mode: mode,
name: name,
mode,
name,
}
}
@ -427,7 +427,7 @@ impl ElementsByNameList {
pub fn new(document: &Document, name: DOMString) -> ElementsByNameList {
ElementsByNameList {
document: Dom::from_ref(document),
name: name,
name,
}
}

View file

@ -366,8 +366,8 @@ impl PaintWorkletGlobalScope {
width: size_in_dpx.width,
height: size_in_dpx.height,
format: PixelFormat::BGRA8,
image_key: image_key,
missing_image_urls: missing_image_urls,
image_key,
missing_image_urls,
}
}
@ -383,7 +383,7 @@ impl PaintWorkletGlobalScope {
height: size.height as u32,
format: PixelFormat::BGRA8,
image_key: None,
missing_image_urls: missing_image_urls,
missing_image_urls,
}
}
@ -439,7 +439,7 @@ impl PaintWorkletGlobalScope {
}
}
Box::new(WorkletPainter {
name: name,
name,
executor: Mutex::new(self.worklet_global.executor()),
})
}
@ -492,7 +492,7 @@ impl PaintDefinition {
paint_function: Heap::default(),
constructor_valid_flag: Cell::new(true),
context_alpha_flag: alpha,
input_arguments_len: input_arguments_len,
input_arguments_len,
context: Dom::from_ref(context),
});
result.class_constructor.set(class_constructor.get());

View file

@ -80,12 +80,12 @@ impl PerformanceResourceTiming {
0.,
0.,
),
initiator_type: initiator_type,
next_hop: next_hop,
initiator_type,
next_hop,
worker_start: 0.,
redirect_start: 0.,
redirect_end: 0.,
fetch_start: fetch_start,
fetch_start,
domain_lookup_end: 0.,
domain_lookup_start: 0.,
connect_start: 0.,
@ -115,8 +115,8 @@ impl PerformanceResourceTiming {
resource_timing.start_time as f64,
resource_timing.response_end as f64 - resource_timing.start_time as f64,
),
initiator_type: initiator_type,
next_hop: next_hop,
initiator_type,
next_hop,
worker_start: 0.,
redirect_start: resource_timing.redirect_start as f64,
redirect_end: resource_timing.redirect_end as f64,

View file

@ -26,7 +26,7 @@ impl ProcessingInstruction {
) -> ProcessingInstruction {
ProcessingInstruction {
characterdata: CharacterData::new_inherited(data, document),
target: target,
target,
}
}

View file

@ -29,9 +29,9 @@ impl ProgressEvent {
fn new_inherited(length_computable: bool, loaded: u64, total: u64) -> ProgressEvent {
ProgressEvent {
event: Event::new_inherited(),
length_computable: length_computable,
loaded: loaded,
total: total,
length_computable,
loaded,
total,
}
}

View file

@ -34,8 +34,8 @@ impl PromiseNativeHandler {
reflect_dom_object(
Box::new(PromiseNativeHandler {
reflector: Reflector::new(),
resolve: resolve,
reject: reject,
resolve,
reject,
}),
global,
)

View file

@ -67,7 +67,7 @@ impl ReadableStream {
js_stream: Heap::default(),
js_reader: Heap::default(),
has_reader: Default::default(),
external_underlying_source: external_underlying_source,
external_underlying_source,
}
}

View file

@ -53,7 +53,7 @@ impl ServiceWorker {
eventtarget: EventTarget::new_inherited(),
script_url: DomRefCell::new(String::from(script_url)),
state: Cell::new(ServiceWorkerState::Installing),
scope_url: scope_url,
scope_url,
worker_id,
}
}

View file

@ -247,10 +247,10 @@ impl ServiceWorkerGlobalScope {
Arc::new(Mutex::new(Identities::new())),
),
task_queue: TaskQueue::new(receiver, own_sender.clone()),
own_sender: own_sender,
own_sender,
time_out_port,
swmanager_sender: swmanager_sender,
scope_url: scope_url,
swmanager_sender,
scope_url,
control_receiver,
}
}

View file

@ -52,7 +52,7 @@ impl ServiceWorkerRegistration {
installing: DomRefCell::new(None),
waiting: DomRefCell::new(None),
navigation_preload: MutNullableDom::new(None),
scope: scope,
scope,
navigation_preload_enabled: Cell::new(false),
navigation_preload_header_value: DomRefCell::new(None),
update_via_cache: ServiceWorkerUpdateViaCache::Imports,
@ -121,11 +121,11 @@ impl ServiceWorkerRegistration {
let devtools_chan = global.devtools_chan().cloned();
let init = prepare_workerscope_init(global, None, None);
ScopeThings {
script_url: script_url,
init: init,
worker_load_origin: worker_load_origin,
devtools_chan: devtools_chan,
worker_id: worker_id,
script_url,
init,
worker_load_origin,
devtools_chan,
worker_id,
}
}

View file

@ -241,7 +241,7 @@ impl Tokenizer {
receiver: tokenizer_receiver,
html_tokenizer_sender: to_html_tokenizer_sender,
nodes: HashMap::new(),
url: url,
url,
parsing_algorithm: algorithm,
};
tokenizer.insert_node(0, Dom::from_ref(document.upcast()));
@ -627,7 +627,7 @@ impl Sink {
id: 0,
qual_name: None,
},
sender: sender,
sender,
};
let data = ParseNodeData::default();
sink.insert_parse_node_data(0, data);
@ -640,7 +640,7 @@ impl Sink {
self.insert_parse_node_data(id, data);
self.next_parse_node_id.set(id + 1);
ParseNode {
id: id,
id,
qual_name: None,
}
}

View file

@ -49,7 +49,7 @@ impl Tokenizer {
document: Dom::from_ref(document),
current_line: 1,
script: Default::default(),
parsing_algorithm: parsing_algorithm,
parsing_algorithm,
};
let options = TreeBuilderOpts {
@ -75,7 +75,7 @@ impl Tokenizer {
HtmlTokenizer::new(TreeBuilder::new(sink, options), Default::default())
};
Tokenizer { inner: inner }
Tokenizer { inner }
}
#[must_use]

View file

@ -147,10 +147,7 @@ pub enum ParsingAlgorithm {
impl ElementAttribute {
pub fn new(name: QualName, value: DOMString) -> ElementAttribute {
ElementAttribute {
name: name,
value: value,
}
ElementAttribute { name, value }
}
}
@ -765,8 +762,8 @@ impl ParserContext {
ParserContext {
parser: None,
is_synthesized_document: false,
id: id,
url: url,
id,
url,
resource_timing: ResourceFetchTiming::new(ResourceTimingType::Navigation),
pushed_entry_index: None,
}

View file

@ -33,7 +33,7 @@ impl Storage {
fn new_inherited(storage_type: StorageType) -> Storage {
Storage {
reflector_: Reflector::new(),
storage_type: storage_type,
storage_type,
}
}

View file

@ -30,9 +30,9 @@ impl StyleSheet {
) -> StyleSheet {
StyleSheet {
reflector_: Reflector::new(),
type_: type_,
href: href,
title: title,
type_,
href,
title,
}
}
}

View file

@ -29,7 +29,7 @@ impl SubmitEvent {
fn new_inherited(submitter: Option<DomRoot<HTMLElement>>) -> SubmitEvent {
SubmitEvent {
event: Event::new_inherited(),
submitter: submitter,
submitter,
}
}

View file

@ -980,7 +980,7 @@ impl TestBindingMethods for TestBinding {
let promise = p.duplicate();
let cb = TestBindingCallback {
promise: TrustedPromise::new(promise),
value: value,
value,
};
let _ = self.global().schedule_callback(
OneshotTimerCallback::TestBindingCallback(cb),

View file

@ -40,9 +40,9 @@ impl TextDecoder {
fn new_inherited(encoding: &'static Encoding, fatal: bool, ignoreBOM: bool) -> TextDecoder {
TextDecoder {
reflector_: Reflector::new(),
encoding: encoding,
fatal: fatal,
ignoreBOM: ignoreBOM,
encoding,
fatal,
ignoreBOM,
decoder: RefCell::new(if ignoreBOM {
encoding.new_decoder()
} else {

View file

@ -43,7 +43,7 @@ impl TextTrack {
) -> TextTrack {
TextTrack {
eventtarget: EventTarget::new_inherited(),
kind: kind,
kind,
label: label.into(),
language: language.into(),
id: id.into(),

View file

@ -37,7 +37,7 @@ impl Touch {
) -> Touch {
Touch {
reflector_: Reflector::new(),
identifier: identifier,
identifier,
target: MutDom::new(target),
screen_x: *screen_x,
screen_y: *screen_y,

View file

@ -35,8 +35,8 @@ impl TreeWalker {
reflector_: Reflector::new(),
root_node: Dom::from_ref(root_node),
current_node: MutDom::new(root_node),
what_to_show: what_to_show,
filter: filter,
what_to_show,
filter,
active: Cell::new(false),
}
}

View file

@ -160,7 +160,7 @@ impl WebGL2RenderingContext {
base: Dom::from_ref(&*base),
occlusion_query: MutNullableDom::new(None),
primitives_query: MutNullableDom::new(None),
samplers: samplers,
samplers,
bound_copy_read_buffer: MutNullableDom::new(None),
bound_copy_write_buffer: MutNullableDom::new(None),
bound_pixel_pack_buffer: MutNullableDom::new(None),

View file

@ -214,12 +214,12 @@ impl<'a> WebGLValidator for CommonTexImage2DValidator<'a> {
}
Ok(CommonTexImage2DValidatorResult {
texture: texture,
target: target,
level: level,
internal_format: internal_format,
width: width,
height: height,
texture,
target,
level,
internal_format,
width,
height,
border: self.border as u32,
})
}
@ -236,13 +236,13 @@ impl<'a> CommonTexImage2DValidator<'a> {
border: i32,
) -> Self {
CommonTexImage2DValidator {
context: context,
target: target,
level: level,
internal_format: internal_format,
width: width,
height: height,
border: border,
context,
target,
level,
internal_format,
width,
height,
border,
}
}
}
@ -276,8 +276,8 @@ impl<'a> TexImage2DValidator<'a> {
height,
border,
),
format: format,
data_type: data_type,
format,
data_type,
}
}
}
@ -367,15 +367,15 @@ impl<'a> WebGLValidator for TexImage2DValidator<'a> {
}
Ok(TexImage2DValidatorResult {
width: width,
height: height,
level: level,
border: border,
texture: texture,
target: target,
internal_format: internal_format,
format: format,
data_type: data_type,
width,
height,
level,
border,
texture,
target,
internal_format,
format,
data_type,
})
}
}

View file

@ -24,9 +24,9 @@ impl WebGLActiveInfo {
fn new_inherited(size: i32, ty: u32, name: DOMString) -> WebGLActiveInfo {
WebGLActiveInfo {
reflector_: Reflector::new(),
size: size,
ty: ty,
name: name,
size,
ty,
name,
}
}

View file

@ -40,7 +40,7 @@ impl WebGLContextEvent {
fn new_inherited(status_message: DOMString) -> WebGLContextEvent {
WebGLContextEvent {
event: Event::new_inherited(),
status_message: status_message,
status_message,
}
}

View file

@ -116,7 +116,7 @@ impl WebGLFramebuffer {
Self {
webgl_object: WebGLObject::new_inherited(context),
webgl_version: context.webgl_version(),
id: id,
id,
target: Cell::new(None),
is_deleted: Cell::new(false),
size: Cell::new(None),
@ -715,7 +715,7 @@ impl WebGLFramebuffer {
Some(texture) => {
*binding.borrow_mut() = Some(WebGLFramebufferAttachment::Texture {
texture: Dom::from_ref(texture),
level: level,
level,
});
texture.attach_to_framebuffer(self);
@ -780,7 +780,7 @@ impl WebGLFramebuffer {
*binding.borrow_mut() = Some(WebGLFramebufferAttachment::Texture {
texture: Dom::from_ref(texture),
level: level,
level,
});
texture.attach_to_framebuffer(self);

View file

@ -51,7 +51,7 @@ impl WebGLProgram {
fn new_inherited(context: &WebGLRenderingContext, id: WebGLProgramId) -> Self {
Self {
webgl_object: WebGLObject::new_inherited(context),
id: id,
id,
is_in_use: Default::default(),
marked_for_deletion: Default::default(),
link_called: Default::default(),

View file

@ -38,7 +38,7 @@ impl WebGLRenderbuffer {
fn new_inherited(context: &WebGLRenderingContext, id: WebGLRenderbufferId) -> Self {
Self {
webgl_object: WebGLObject::new_inherited(context),
id: id,
id,
ever_bound: Cell::new(false),
is_deleted: Cell::new(false),
internal_format: Cell::new(None),

View file

@ -53,7 +53,7 @@ impl WebGLShader {
GLSLANG_INITIALIZATION.call_once(|| ::mozangle::shaders::initialize().unwrap());
Self {
webgl_object: WebGLObject::new_inherited(context),
id: id,
id,
gl_type: shader_type,
source: Default::default(),
info_log: Default::default(),

View file

@ -24,9 +24,9 @@ impl WebGLShaderPrecisionFormat {
fn new_inherited(range_min: i32, range_max: i32, precision: i32) -> WebGLShaderPrecisionFormat {
WebGLShaderPrecisionFormat {
reflector_: Reflector::new(),
range_min: range_min,
range_max: range_max,
precision: precision,
range_min,
range_max,
precision,
}
}

View file

@ -75,7 +75,7 @@ impl WebGLTexture {
) -> Self {
Self {
webgl_object: WebGLObject::new_inherited(context),
id: id,
id,
target: Cell::new(None),
is_deleted: Cell::new(false),
owner: owner
@ -163,11 +163,11 @@ impl WebGLTexture {
data_type: Option<TexDataType>,
) -> WebGLResult<()> {
let image_info = ImageInfo {
width: width,
height: height,
depth: depth,
internal_format: internal_format,
data_type: data_type,
width,
height,
depth,
internal_format,
data_type,
};
let face_index = self.face_index_for_target(&target);

View file

@ -78,9 +78,9 @@ fn close_the_websocket_connection(
reason: String,
) {
let close_task = CloseTask {
address: address,
address,
failed: false,
code: code,
code,
reason: Some(reason),
};
let _ = task_source.queue_with_canceller(close_task, canceller);
@ -92,7 +92,7 @@ fn fail_the_websocket_connection(
canceller: &TaskCanceller,
) {
let close_task = CloseTask {
address: address,
address,
failed: true,
code: Some(close_code::ABNORMAL),
reason: None,
@ -119,11 +119,11 @@ impl WebSocket {
fn new_inherited(url: ServoUrl, sender: IpcSender<WebSocketDomAction>) -> WebSocket {
WebSocket {
eventtarget: EventTarget::new_inherited(),
url: url,
url,
ready_state: Cell::new(WebSocketRequestState::Connecting),
buffered_amount: Cell::new(0),
clearing_buffer: Cell::new(false),
sender: sender,
sender,
binary_type: Cell::new(BinaryType::Blob),
protocol: DomRefCell::new("".to_owned()),
}
@ -231,7 +231,7 @@ impl WebSocket {
WebSocketNetworkEvent::MessageReceived(message) => {
let message_thread = MessageReceivedTask {
address: address.clone(),
message: message,
message,
};
let _ = task_source.queue_with_canceller(message_thread, &canceller);
},
@ -278,7 +278,7 @@ impl WebSocket {
if !self.clearing_buffer.get() && self.ready_state.get() == WebSocketRequestState::Open {
self.clearing_buffer.set(true);
let task = Box::new(BufferedAmountTask { address: address });
let task = Box::new(BufferedAmountTask { address });
let pipeline_id = self.global().pipeline_id();
self.global()

View file

@ -140,8 +140,8 @@ impl WindowProxy {
});
WindowProxy {
reflector: Reflector::new(),
browsing_context_id: browsing_context_id,
top_level_browsing_context_id: top_level_browsing_context_id,
browsing_context_id,
top_level_browsing_context_id,
name: DomRefCell::new(name),
currently_active: Cell::new(currently_active),
discarded: Cell::new(false),
@ -318,18 +318,18 @@ impl WindowProxy {
let load_info = AuxiliaryBrowsingContextLoadInfo {
load_data: load_data.clone(),
opener_pipeline_id: self.currently_active.get().unwrap(),
new_browsing_context_id: new_browsing_context_id,
new_top_level_browsing_context_id: new_top_level_browsing_context_id,
new_pipeline_id: new_pipeline_id,
new_browsing_context_id,
new_top_level_browsing_context_id,
new_pipeline_id,
};
let new_layout_info = NewLayoutInfo {
parent_info: None,
new_pipeline_id: new_pipeline_id,
new_pipeline_id,
browsing_context_id: new_browsing_context_id,
top_level_browsing_context_id: new_top_level_browsing_context_id,
opener: Some(self.browsing_context_id),
load_data: load_data,
load_data,
window_size: window.window_size(),
};
let constellation_msg = ScriptMsg::ScriptNewAuxiliary(load_info);

View file

@ -62,8 +62,8 @@ impl Worker {
fn new_inherited(sender: Sender<DedicatedWorkerScriptMsg>, closing: Arc<AtomicBool>) -> Worker {
Worker {
eventtarget: EventTarget::new_inherited(),
sender: sender,
closing: closing,
sender,
closing,
terminated: Cell::new(false),
context_for_interrupt: Default::default(),
}
@ -123,7 +123,7 @@ impl Worker {
let title = format!("Worker for {}", worker_url);
if let Some(browsing_context) = browsing_context {
let page_info = DevtoolsPageInfo {
title: title,
title,
url: worker_url.clone(),
};
let _ = chan.send(ScriptToDevtoolsControlMsg::NewGlobal(

View file

@ -24,7 +24,7 @@ impl WorkerLocation {
fn new_inherited(url: ServoUrl) -> WorkerLocation {
WorkerLocation {
reflector_: Reflector::new(),
url: url,
url,
}
}

View file

@ -403,8 +403,8 @@ impl WorkletThreadRole {
fn new(is_hot_backup: bool, is_cold_backup: bool) -> WorkletThreadRole {
let (sender, receiver) = unbounded();
WorkletThreadRole {
sender: sender,
receiver: receiver,
sender,
receiver,
is_hot_backup,
is_cold_backup,
}

View file

@ -214,7 +214,7 @@ impl XMLHttpRequest {
generation_id: Cell::new(GenerationId(0)),
response_status: Cell::new(Ok(())),
referrer: global.get_referrer(),
referrer_policy: referrer_policy,
referrer_policy,
canceller: DomRefCell::new(Default::default()),
}
}
@ -311,8 +311,8 @@ impl XMLHttpRequest {
let (action_sender, action_receiver) = ipc::channel().unwrap();
let listener = NetworkListener {
context: context,
task_source: task_source,
context,
task_source,
canceller: Some(global.task_canceller(TaskSourceName::Networking)),
};
ROUTER.add_route(

View file

@ -71,7 +71,7 @@ impl<Listener: PreInvoke + Send + 'static> NetworkListener<Listener> {
pub fn notify<A: Action<Listener> + Send + 'static>(&self, action: A) {
let task = ListenerTask {
context: self.context.clone(),
action: action,
action,
};
let result = if let Some(ref canceller) = self.canceller {
self.task_source.queue_with_canceller(task, canceller)

View file

@ -701,8 +701,8 @@ pub fn get_reports(cx: *mut RawJSContext, path_seg: String) -> Vec<Report> {
let mut path = path![path_seg, "js"];
path.append(&mut path_suffix);
reports.push(Report {
path: path,
kind: kind,
path,
kind,
size: size as usize,
})
};

View file

@ -244,19 +244,19 @@ impl InProgressLoad {
let navigation_start_precise = precise_time_ns();
InProgressLoad {
pipeline_id: id,
browsing_context_id: browsing_context_id,
top_level_browsing_context_id: top_level_browsing_context_id,
parent_info: parent_info,
opener: opener,
window_size: window_size,
browsing_context_id,
top_level_browsing_context_id,
parent_info,
opener,
window_size,
activity: DocumentActivity::FullyActive,
is_visible: true,
url: url,
origin: origin,
url,
origin,
navigation_start: navigation_start as u64,
navigation_start_precise: navigation_start_precise,
navigation_start_precise,
canceller: Default::default(),
inherited_secure_context: inherited_secure_context,
inherited_secure_context,
}
}
}
@ -1349,8 +1349,8 @@ impl ScriptThread {
incomplete_parser_contexts: IncompleteParserContexts(RefCell::new(vec![])),
image_cache: state.image_cache.clone(),
image_cache_channel: image_cache_channel,
image_cache_port: image_cache_port,
image_cache_channel,
image_cache_port,
resource_threads: state.resource_threads,
bluetooth_thread: state.bluetooth_thread,
@ -1375,13 +1375,13 @@ impl ScriptThread {
history_traversal_task_sender: chan.clone(),
control_chan: state.control_chan,
control_port: control_port,
control_port,
script_sender: state.script_to_constellation_chan.sender.clone(),
time_profiler_chan: state.time_profiler_chan.clone(),
mem_profiler_chan: state.mem_profiler_chan,
devtools_chan: state.devtools_chan,
devtools_port: devtools_port,
devtools_port,
devtools_sender: ipc_devtools_sender,
microtask_queue: runtime.microtask_queue.clone(),
@ -3451,7 +3451,7 @@ impl ScriptThread {
if let Some(ref chan) = self.devtools_chan {
let page_info = DevtoolsPageInfo {
title: String::from(title),
url: url,
url,
};
chan.send(ScriptToDevtoolsControlMsg::NewGlobal(
(bc, p, w),
@ -3963,10 +3963,10 @@ impl ScriptThread {
if let Some(global) = self.documents.borrow().find_global(pipeline_id) {
if global.live_devtools_updates() {
let css_error = CSSError {
filename: filename,
line: line,
column: column,
msg: msg,
filename,
line,
column,
msg,
};
let message = ScriptToDevtoolsControlMsg::ReportCSSError(pipeline_id, css_error);
sender.send(message).unwrap();

View file

@ -234,7 +234,7 @@ impl ServiceWorkerManager {
ServiceWorkerManager {
registrations: HashMap::new(),
own_sender: own_sender,
own_sender,
own_port: from_constellation_receiver,
resource_receiver: resource_port,
_constellation_sender: constellation_sender,

View file

@ -277,7 +277,7 @@ impl<'a> StylesheetLoader<'a> {
.map(HTMLLinkElement::get_request_generation_id);
let context = ::std::sync::Arc::new(Mutex::new(StylesheetContext {
elem: Trusted::new(self.elem),
source: source,
source,
url: url.clone(),
metadata: None,
data: vec![],
@ -381,7 +381,7 @@ impl<'a> StyleStylesheetLoader for StylesheetLoader<'a> {
context.url_data.clone(),
context.quirks_mode,
),
media: media,
media,
shared_lock: lock.clone(),
disabled: AtomicBool::new(false),
});

View file

@ -61,10 +61,10 @@ impl DOMManipulationTaskSource {
) {
let target = Trusted::new(target);
let task = EventTask {
target: target,
name: name,
bubbles: bubbles,
cancelable: cancelable,
target,
name,
bubbles,
cancelable,
};
let _ = self.queue(task, window.upcast());
}

View file

@ -270,10 +270,10 @@ impl<T: ClipboardProvider> TextInput<T> {
edit_point: Default::default(),
selection_origin: None,
multiline: lines == Lines::Multiple,
clipboard_provider: clipboard_provider,
max_length: max_length,
min_length: min_length,
selection_direction: selection_direction,
clipboard_provider,
max_length,
min_length,
selection_direction,
was_last_change_by_set_content: true,
};
i.set_content(initial);
@ -1093,10 +1093,7 @@ impl<T: ClipboardProvider> TextInput<T> {
}
});
TextPoint {
line: line,
index: index,
}
TextPoint { line, index }
}
pub fn set_selection_range(&mut self, start: u32, end: u32, direction: SelectionDirection) {

View file

@ -133,7 +133,7 @@ impl OneshotTimers {
OneshotTimers {
js_timers: JsTimers::new(),
timer_event_chan: DomRefCell::new(None),
scheduler_chan: scheduler_chan,
scheduler_chan,
next_timer_handle: Cell::new(OneshotTimerHandle(1)),
timers: DomRefCell::new(Vec::new()),
suspended_since: Cell::new(None),
@ -162,9 +162,9 @@ impl OneshotTimers {
let timer = OneshotTimer {
handle: new_handle,
source: source,
callback: callback,
scheduled_for: scheduled_for,
source,
callback,
scheduled_for,
};
{
@ -468,9 +468,9 @@ impl JsTimers {
// step 4
let mut task = JsTimerTask {
handle: JsTimerHandle(new_handle),
source: source,
callback: callback,
is_interval: is_interval,
source,
callback,
is_interval,
is_user_interacting: ScriptThread::is_user_interacting(),
nesting_level: 0,
duration: Length::new(0),