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 { BluetoothRemoteGATTDescriptor {
reflector_: Reflector::new(), reflector_: Reflector::new(),
characteristic: Dom::from_ref(characteristic), characteristic: Dom::from_ref(characteristic),
uuid: uuid, uuid,
value: DomRefCell::new(None), value: DomRefCell::new(None),
instance_id: instance_id, instance_id,
} }
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -54,8 +54,8 @@ impl ExtendableMessageEvent {
ExtendableMessageEvent { ExtendableMessageEvent {
event: ExtendableEvent::new_inherited(), event: ExtendableEvent::new_inherited(),
data: Heap::default(), data: Heap::default(),
origin: origin, origin,
lastEventId: lastEventId, lastEventId,
ports: ports ports: ports
.into_iter() .into_iter()
.map(|port| Dom::from_ref(&*port)) .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 { fn new_inherited(blob_impl: &BlobImpl, name: DOMString, modified: Option<i64>) -> File {
File { File {
blob: Blob::new_inherited(blob_impl), blob: Blob::new_inherited(blob_impl),
name: name, name,
// https://w3c.github.io/FileAPI/#dfn-lastModified // https://w3c.github.io/FileAPI/#dfn-lastModified
modified: match modified { modified: match modified {
Some(m) => m, Some(m) => m,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -26,7 +26,7 @@ impl ProcessingInstruction {
) -> ProcessingInstruction { ) -> ProcessingInstruction {
ProcessingInstruction { ProcessingInstruction {
characterdata: CharacterData::new_inherited(data, document), 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 { fn new_inherited(length_computable: bool, loaded: u64, total: u64) -> ProgressEvent {
ProgressEvent { ProgressEvent {
event: Event::new_inherited(), event: Event::new_inherited(),
length_computable: length_computable, length_computable,
loaded: loaded, loaded,
total: total, total,
} }
} }

View file

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

View file

@ -67,7 +67,7 @@ impl ReadableStream {
js_stream: Heap::default(), js_stream: Heap::default(),
js_reader: Heap::default(), js_reader: Heap::default(),
has_reader: Default::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(), eventtarget: EventTarget::new_inherited(),
script_url: DomRefCell::new(String::from(script_url)), script_url: DomRefCell::new(String::from(script_url)),
state: Cell::new(ServiceWorkerState::Installing), state: Cell::new(ServiceWorkerState::Installing),
scope_url: scope_url, scope_url,
worker_id, worker_id,
} }
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -160,7 +160,7 @@ impl WebGL2RenderingContext {
base: Dom::from_ref(&*base), base: Dom::from_ref(&*base),
occlusion_query: MutNullableDom::new(None), occlusion_query: MutNullableDom::new(None),
primitives_query: MutNullableDom::new(None), primitives_query: MutNullableDom::new(None),
samplers: samplers, samplers,
bound_copy_read_buffer: MutNullableDom::new(None), bound_copy_read_buffer: MutNullableDom::new(None),
bound_copy_write_buffer: MutNullableDom::new(None), bound_copy_write_buffer: MutNullableDom::new(None),
bound_pixel_pack_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 { Ok(CommonTexImage2DValidatorResult {
texture: texture, texture,
target: target, target,
level: level, level,
internal_format: internal_format, internal_format,
width: width, width,
height: height, height,
border: self.border as u32, border: self.border as u32,
}) })
} }
@ -236,13 +236,13 @@ impl<'a> CommonTexImage2DValidator<'a> {
border: i32, border: i32,
) -> Self { ) -> Self {
CommonTexImage2DValidator { CommonTexImage2DValidator {
context: context, context,
target: target, target,
level: level, level,
internal_format: internal_format, internal_format,
width: width, width,
height: height, height,
border: border, border,
} }
} }
} }
@ -276,8 +276,8 @@ impl<'a> TexImage2DValidator<'a> {
height, height,
border, border,
), ),
format: format, format,
data_type: data_type, data_type,
} }
} }
} }
@ -367,15 +367,15 @@ impl<'a> WebGLValidator for TexImage2DValidator<'a> {
} }
Ok(TexImage2DValidatorResult { Ok(TexImage2DValidatorResult {
width: width, width,
height: height, height,
level: level, level,
border: border, border,
texture: texture, texture,
target: target, target,
internal_format: internal_format, internal_format,
format: format, format,
data_type: data_type, data_type,
}) })
} }
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -53,7 +53,7 @@ impl WebGLShader {
GLSLANG_INITIALIZATION.call_once(|| ::mozangle::shaders::initialize().unwrap()); GLSLANG_INITIALIZATION.call_once(|| ::mozangle::shaders::initialize().unwrap());
Self { Self {
webgl_object: WebGLObject::new_inherited(context), webgl_object: WebGLObject::new_inherited(context),
id: id, id,
gl_type: shader_type, gl_type: shader_type,
source: Default::default(), source: Default::default(),
info_log: 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 { fn new_inherited(range_min: i32, range_max: i32, precision: i32) -> WebGLShaderPrecisionFormat {
WebGLShaderPrecisionFormat { WebGLShaderPrecisionFormat {
reflector_: Reflector::new(), reflector_: Reflector::new(),
range_min: range_min, range_min,
range_max: range_max, range_max,
precision: precision, precision,
} }
} }

View file

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

View file

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

View file

@ -140,8 +140,8 @@ impl WindowProxy {
}); });
WindowProxy { WindowProxy {
reflector: Reflector::new(), reflector: Reflector::new(),
browsing_context_id: browsing_context_id, browsing_context_id,
top_level_browsing_context_id: top_level_browsing_context_id, top_level_browsing_context_id,
name: DomRefCell::new(name), name: DomRefCell::new(name),
currently_active: Cell::new(currently_active), currently_active: Cell::new(currently_active),
discarded: Cell::new(false), discarded: Cell::new(false),
@ -318,18 +318,18 @@ impl WindowProxy {
let load_info = AuxiliaryBrowsingContextLoadInfo { let load_info = AuxiliaryBrowsingContextLoadInfo {
load_data: load_data.clone(), load_data: load_data.clone(),
opener_pipeline_id: self.currently_active.get().unwrap(), opener_pipeline_id: self.currently_active.get().unwrap(),
new_browsing_context_id: new_browsing_context_id, new_browsing_context_id,
new_top_level_browsing_context_id: new_top_level_browsing_context_id, new_top_level_browsing_context_id,
new_pipeline_id: new_pipeline_id, new_pipeline_id,
}; };
let new_layout_info = NewLayoutInfo { let new_layout_info = NewLayoutInfo {
parent_info: None, parent_info: None,
new_pipeline_id: new_pipeline_id, new_pipeline_id,
browsing_context_id: new_browsing_context_id, browsing_context_id: new_browsing_context_id,
top_level_browsing_context_id: new_top_level_browsing_context_id, top_level_browsing_context_id: new_top_level_browsing_context_id,
opener: Some(self.browsing_context_id), opener: Some(self.browsing_context_id),
load_data: load_data, load_data,
window_size: window.window_size(), window_size: window.window_size(),
}; };
let constellation_msg = ScriptMsg::ScriptNewAuxiliary(load_info); 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 { fn new_inherited(sender: Sender<DedicatedWorkerScriptMsg>, closing: Arc<AtomicBool>) -> Worker {
Worker { Worker {
eventtarget: EventTarget::new_inherited(), eventtarget: EventTarget::new_inherited(),
sender: sender, sender,
closing: closing, closing,
terminated: Cell::new(false), terminated: Cell::new(false),
context_for_interrupt: Default::default(), context_for_interrupt: Default::default(),
} }
@ -123,7 +123,7 @@ impl Worker {
let title = format!("Worker for {}", worker_url); let title = format!("Worker for {}", worker_url);
if let Some(browsing_context) = browsing_context { if let Some(browsing_context) = browsing_context {
let page_info = DevtoolsPageInfo { let page_info = DevtoolsPageInfo {
title: title, title,
url: worker_url.clone(), url: worker_url.clone(),
}; };
let _ = chan.send(ScriptToDevtoolsControlMsg::NewGlobal( let _ = chan.send(ScriptToDevtoolsControlMsg::NewGlobal(

View file

@ -24,7 +24,7 @@ impl WorkerLocation {
fn new_inherited(url: ServoUrl) -> WorkerLocation { fn new_inherited(url: ServoUrl) -> WorkerLocation {
WorkerLocation { WorkerLocation {
reflector_: Reflector::new(), 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 { fn new(is_hot_backup: bool, is_cold_backup: bool) -> WorkletThreadRole {
let (sender, receiver) = unbounded(); let (sender, receiver) = unbounded();
WorkletThreadRole { WorkletThreadRole {
sender: sender, sender,
receiver: receiver, receiver,
is_hot_backup, is_hot_backup,
is_cold_backup, is_cold_backup,
} }

View file

@ -214,7 +214,7 @@ impl XMLHttpRequest {
generation_id: Cell::new(GenerationId(0)), generation_id: Cell::new(GenerationId(0)),
response_status: Cell::new(Ok(())), response_status: Cell::new(Ok(())),
referrer: global.get_referrer(), referrer: global.get_referrer(),
referrer_policy: referrer_policy, referrer_policy,
canceller: DomRefCell::new(Default::default()), canceller: DomRefCell::new(Default::default()),
} }
} }
@ -311,8 +311,8 @@ impl XMLHttpRequest {
let (action_sender, action_receiver) = ipc::channel().unwrap(); let (action_sender, action_receiver) = ipc::channel().unwrap();
let listener = NetworkListener { let listener = NetworkListener {
context: context, context,
task_source: task_source, task_source,
canceller: Some(global.task_canceller(TaskSourceName::Networking)), canceller: Some(global.task_canceller(TaskSourceName::Networking)),
}; };
ROUTER.add_route( 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) { pub fn notify<A: Action<Listener> + Send + 'static>(&self, action: A) {
let task = ListenerTask { let task = ListenerTask {
context: self.context.clone(), context: self.context.clone(),
action: action, action,
}; };
let result = if let Some(ref canceller) = self.canceller { let result = if let Some(ref canceller) = self.canceller {
self.task_source.queue_with_canceller(task, 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"]; let mut path = path![path_seg, "js"];
path.append(&mut path_suffix); path.append(&mut path_suffix);
reports.push(Report { reports.push(Report {
path: path, path,
kind: kind, kind,
size: size as usize, size: size as usize,
}) })
}; };

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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