Auto merge of #13307 - bubbles231:code_refactor, r=Manishearth

Code refactoring

<!-- Please describe your changes on the following line: -->
The code was refactored to follow Rust naming conventions better.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes help fix #12379.

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because logic was not changed.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13307)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-09-18 22:57:59 -05:00 committed by GitHub
commit 5457b80233
90 changed files with 485 additions and 485 deletions

View file

@ -31,7 +31,7 @@ pub trait Activatable {
fn activation_behavior(&self, event: &Event, target: &EventTarget); fn activation_behavior(&self, event: &Event, target: &EventTarget);
// https://html.spec.whatwg.org/multipage/#implicit-submission // https://html.spec.whatwg.org/multipage/#implicit-submission
fn implicit_submission(&self, ctrlKey: bool, shiftKey: bool, altKey: bool, metaKey: bool); fn implicit_submission(&self, ctrl_key: bool, shift_key: bool, alt_key: bool, meta_key: bool);
// https://html.spec.whatwg.org/multipage/#concept-selector-active // https://html.spec.whatwg.org/multipage/#concept-selector-active
fn enter_formal_activation_state(&self) { fn enter_formal_activation_state(&self) {
@ -62,10 +62,10 @@ pub enum ActivationSource {
// https://html.spec.whatwg.org/multipage/#run-synthetic-click-activation-steps // https://html.spec.whatwg.org/multipage/#run-synthetic-click-activation-steps
pub fn synthetic_click_activation(element: &Element, pub fn synthetic_click_activation(element: &Element,
ctrlKey: bool, ctrl_key: bool,
shiftKey: bool, shift_key: bool,
altKey: bool, alt_key: bool,
metaKey: bool, meta_key: bool,
source: ActivationSource) { source: ActivationSource) {
// Step 1 // Step 1
if element.click_in_progress() { if element.click_in_progress() {
@ -93,10 +93,10 @@ pub fn synthetic_click_activation(element: &Element,
0, 0,
0, 0,
0, 0,
ctrlKey, ctrl_key,
shiftKey, shift_key,
altKey, alt_key,
metaKey, meta_key,
0, 0,
None); None);
let event = mouse.upcast::<Event>(); let event = mouse.upcast::<Event>();

View file

@ -73,8 +73,8 @@ pub struct Blob {
#[ignore_heap_size_of = "No clear owner"] #[ignore_heap_size_of = "No clear owner"]
blob_impl: DOMRefCell<BlobImpl>, blob_impl: DOMRefCell<BlobImpl>,
/// content-type string /// content-type string
typeString: String, type_string: String,
isClosed_: Cell<bool>, is_closed: Cell<bool>,
} }
impl Blob { impl Blob {
@ -85,20 +85,20 @@ impl Blob {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new_inherited(blob_impl: BlobImpl, typeString: String) -> Blob { pub fn new_inherited(blob_impl: BlobImpl, type_string: String) -> Blob {
Blob { Blob {
reflector_: Reflector::new(), reflector_: Reflector::new(),
blob_impl: DOMRefCell::new(blob_impl), blob_impl: DOMRefCell::new(blob_impl),
// NOTE: Guarding the format correctness here, // NOTE: Guarding the format correctness here,
// https://w3c.github.io/FileAPI/#dfn-type // https://w3c.github.io/FileAPI/#dfn-type
typeString: normalize_type_string(&typeString), type_string: normalize_type_string(&type_string),
isClosed_: Cell::new(false), is_closed: Cell::new(false),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
fn new_sliced(parent: &Blob, rel_pos: RelativePos, fn new_sliced(parent: &Blob, rel_pos: RelativePos,
relativeContentType: DOMString) -> Root<Blob> { relative_content_type: DOMString) -> Root<Blob> {
let global = parent.global(); let global = parent.global();
let blob_impl = match *parent.blob_impl.borrow() { let blob_impl = match *parent.blob_impl.borrow() {
BlobImpl::File(_) => { BlobImpl::File(_) => {
@ -115,7 +115,7 @@ impl Blob {
} }
}; };
Blob::new(global.r(), blob_impl, relativeContentType.into()) Blob::new(global.r(), blob_impl, relative_content_type.into())
} }
// https://w3c.github.io/FileAPI/#constructorBlob // https://w3c.github.io/FileAPI/#constructorBlob
@ -222,7 +222,7 @@ impl Blob {
let blob_buf = BlobBuf { let blob_buf = BlobBuf {
filename: None, filename: None,
type_string: self.typeString.clone(), type_string: self.type_string.clone(),
size: bytes.len() as u64, size: bytes.len() as u64,
bytes: bytes.to_vec(), bytes: bytes.to_vec(),
}; };
@ -366,33 +366,33 @@ impl BlobMethods for Blob {
// https://w3c.github.io/FileAPI/#dfn-type // https://w3c.github.io/FileAPI/#dfn-type
fn Type(&self) -> DOMString { fn Type(&self) -> DOMString {
DOMString::from(self.typeString.clone()) DOMString::from(self.type_string.clone())
} }
// https://w3c.github.io/FileAPI/#slice-method-algo // https://w3c.github.io/FileAPI/#slice-method-algo
fn Slice(&self, fn Slice(&self,
start: Option<i64>, start: Option<i64>,
end: Option<i64>, end: Option<i64>,
contentType: Option<DOMString>) content_type: Option<DOMString>)
-> Root<Blob> { -> Root<Blob> {
let rel_pos = RelativePos::from_opts(start, end); let rel_pos = RelativePos::from_opts(start, end);
Blob::new_sliced(self, rel_pos, contentType.unwrap_or(DOMString::from(""))) Blob::new_sliced(self, rel_pos, content_type.unwrap_or(DOMString::from("")))
} }
// https://w3c.github.io/FileAPI/#dfn-isClosed // https://w3c.github.io/FileAPI/#dfn-isClosed
fn IsClosed(&self) -> bool { fn IsClosed(&self) -> bool {
self.isClosed_.get() self.is_closed.get()
} }
// https://w3c.github.io/FileAPI/#dfn-close // https://w3c.github.io/FileAPI/#dfn-close
fn Close(&self) { fn Close(&self) {
// Step 1 // Step 1
if self.isClosed_.get() { if self.is_closed.get() {
return; return;
} }
// Step 2 // Step 2
self.isClosed_.set(true); self.is_closed.set(true);
// Step 3 // Step 3
self.clean_up_file_resource(); self.clean_up_file_resource();

View file

@ -13,19 +13,19 @@ use dom::bindings::reflector::{Reflector, reflect_dom_object};
pub struct BluetoothAdvertisingData { pub struct BluetoothAdvertisingData {
reflector_: Reflector, reflector_: Reflector,
appearance: Option<u16>, appearance: Option<u16>,
txPower: Option<i8>, tx_power: Option<i8>,
rssi: Option<i8>, rssi: Option<i8>,
} }
impl BluetoothAdvertisingData { impl BluetoothAdvertisingData {
pub fn new_inherited(appearance: Option<u16>, pub fn new_inherited(appearance: Option<u16>,
txPower: Option<i8>, tx_power: Option<i8>,
rssi: Option<i8>) rssi: Option<i8>)
-> BluetoothAdvertisingData { -> BluetoothAdvertisingData {
BluetoothAdvertisingData { BluetoothAdvertisingData {
reflector_: Reflector::new(), reflector_: Reflector::new(),
appearance: appearance, appearance: appearance,
txPower: txPower, tx_power: tx_power,
rssi: rssi, rssi: rssi,
} }
} }
@ -51,7 +51,7 @@ impl BluetoothAdvertisingDataMethods for BluetoothAdvertisingData {
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothadvertisingdata-txpower // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothadvertisingdata-txpower
fn GetTxPower(&self) -> Option<i8> { fn GetTxPower(&self) -> Option<i8> {
self.txPower self.tx_power
} }
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothadvertisingdata-rssi // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothadvertisingdata-rssi

View file

@ -15,37 +15,37 @@ pub struct BluetoothCharacteristicProperties {
reflector_: Reflector, reflector_: Reflector,
broadcast: bool, broadcast: bool,
read: bool, read: bool,
writeWithoutResponse: bool, write_without_response: bool,
write: bool, write: bool,
notify: bool, notify: bool,
indicate: bool, indicate: bool,
authenticatedSignedWrites: bool, authenticated_signed_writes: bool,
reliableWrite: bool, reliable_write: bool,
writableAuxiliaries: bool, writable_auxiliaries: bool,
} }
impl BluetoothCharacteristicProperties { impl BluetoothCharacteristicProperties {
pub fn new_inherited(broadcast: bool, pub fn new_inherited(broadcast: bool,
read: bool, read: bool,
writeWithoutResponse: bool, write_without_response: bool,
write: bool, write: bool,
notify: bool, notify: bool,
indicate: bool, indicate: bool,
authenticatedSignedWrites: bool, authenticated_signed_writes: bool,
reliableWrite: bool, reliable_write: bool,
writableAuxiliaries: bool) writable_auxiliaries: bool)
-> BluetoothCharacteristicProperties { -> BluetoothCharacteristicProperties {
BluetoothCharacteristicProperties { BluetoothCharacteristicProperties {
reflector_: Reflector::new(), reflector_: Reflector::new(),
broadcast: broadcast, broadcast: broadcast,
read: read, read: read,
writeWithoutResponse: writeWithoutResponse, write_without_response: write_without_response,
write: write, write: write,
notify: notify, notify: notify,
indicate: indicate, indicate: indicate,
authenticatedSignedWrites: authenticatedSignedWrites, authenticated_signed_writes: authenticated_signed_writes,
reliableWrite: reliableWrite, reliable_write: reliable_write,
writableAuxiliaries: writableAuxiliaries, writable_auxiliaries: writable_auxiliaries,
} }
} }
@ -87,7 +87,7 @@ impl BluetoothCharacteristicPropertiesMethods for BluetoothCharacteristicPropert
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-writewithoutresponse // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-writewithoutresponse
fn WriteWithoutResponse(&self) -> bool { fn WriteWithoutResponse(&self) -> bool {
self.writeWithoutResponse self.write_without_response
} }
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-write // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-write
@ -107,16 +107,16 @@ impl BluetoothCharacteristicPropertiesMethods for BluetoothCharacteristicPropert
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-authenticatedsignedwrites // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-authenticatedsignedwrites
fn AuthenticatedSignedWrites(&self) -> bool { fn AuthenticatedSignedWrites(&self) -> bool {
self.authenticatedSignedWrites self.authenticated_signed_writes
} }
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-reliablewrite // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-reliablewrite
fn ReliableWrite(&self) -> bool { fn ReliableWrite(&self) -> bool {
self.reliableWrite self.reliable_write
} }
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-writableauxiliaries // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-writableauxiliaries
fn WritableAuxiliaries(&self) -> bool { fn WritableAuxiliaries(&self) -> bool {
self.writableAuxiliaries self.writable_auxiliaries
} }
} }

View file

@ -17,20 +17,20 @@ pub struct BluetoothDevice {
reflector_: Reflector, reflector_: Reflector,
id: DOMString, id: DOMString,
name: Option<DOMString>, name: Option<DOMString>,
adData: MutHeap<JS<BluetoothAdvertisingData>>, ad_data: MutHeap<JS<BluetoothAdvertisingData>>,
gatt: MutNullableHeap<JS<BluetoothRemoteGATTServer>>, gatt: MutNullableHeap<JS<BluetoothRemoteGATTServer>>,
} }
impl BluetoothDevice { impl BluetoothDevice {
pub fn new_inherited(id: DOMString, pub fn new_inherited(id: DOMString,
name: Option<DOMString>, name: Option<DOMString>,
adData: &BluetoothAdvertisingData) ad_data: &BluetoothAdvertisingData)
-> BluetoothDevice { -> BluetoothDevice {
BluetoothDevice { BluetoothDevice {
reflector_: Reflector::new(), reflector_: Reflector::new(),
id: id, id: id,
name: name, name: name,
adData: MutHeap::new(adData), ad_data: MutHeap::new(ad_data),
gatt: Default::default(), gatt: Default::default(),
} }
} }
@ -61,7 +61,7 @@ impl BluetoothDeviceMethods for BluetoothDevice {
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-addata // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-addata
fn AdData(&self) -> Root<BluetoothAdvertisingData> { fn AdData(&self) -> Root<BluetoothAdvertisingData> {
self.adData.get() self.ad_data.get()
} }
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-gatt // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-gatt

View file

@ -37,14 +37,14 @@ pub struct BluetoothRemoteGATTCharacteristic {
uuid: DOMString, uuid: DOMString,
properties: MutHeap<JS<BluetoothCharacteristicProperties>>, properties: MutHeap<JS<BluetoothCharacteristicProperties>>,
value: DOMRefCell<Option<ByteString>>, value: DOMRefCell<Option<ByteString>>,
instanceID: String, instance_id: String,
} }
impl BluetoothRemoteGATTCharacteristic { impl BluetoothRemoteGATTCharacteristic {
pub fn new_inherited(service: &BluetoothRemoteGATTService, pub fn new_inherited(service: &BluetoothRemoteGATTService,
uuid: DOMString, uuid: DOMString,
properties: &BluetoothCharacteristicProperties, properties: &BluetoothCharacteristicProperties,
instanceID: String) instance_id: String)
-> BluetoothRemoteGATTCharacteristic { -> BluetoothRemoteGATTCharacteristic {
BluetoothRemoteGATTCharacteristic { BluetoothRemoteGATTCharacteristic {
reflector_: Reflector::new(), reflector_: Reflector::new(),
@ -52,7 +52,7 @@ impl BluetoothRemoteGATTCharacteristic {
uuid: uuid, uuid: uuid,
properties: MutHeap::new(properties), properties: MutHeap::new(properties),
value: DOMRefCell::new(None), value: DOMRefCell::new(None),
instanceID: instanceID, instance_id: instance_id,
} }
} }
@ -77,7 +77,7 @@ impl BluetoothRemoteGATTCharacteristic {
} }
fn get_instance_id(&self) -> String { fn get_instance_id(&self) -> String {
self.instanceID.clone() self.instance_id.clone()
} }
} }

View file

@ -28,20 +28,20 @@ pub struct BluetoothRemoteGATTDescriptor {
characteristic: MutHeap<JS<BluetoothRemoteGATTCharacteristic>>, characteristic: MutHeap<JS<BluetoothRemoteGATTCharacteristic>>,
uuid: DOMString, uuid: DOMString,
value: DOMRefCell<Option<ByteString>>, value: DOMRefCell<Option<ByteString>>,
instanceID: String, instance_id: String,
} }
impl BluetoothRemoteGATTDescriptor { impl BluetoothRemoteGATTDescriptor {
pub fn new_inherited(characteristic: &BluetoothRemoteGATTCharacteristic, pub fn new_inherited(characteristic: &BluetoothRemoteGATTCharacteristic,
uuid: DOMString, uuid: DOMString,
instanceID: String) instance_id: String)
-> BluetoothRemoteGATTDescriptor { -> BluetoothRemoteGATTDescriptor {
BluetoothRemoteGATTDescriptor { BluetoothRemoteGATTDescriptor {
reflector_: Reflector::new(), reflector_: Reflector::new(),
characteristic: MutHeap::new(characteristic), characteristic: MutHeap::new(characteristic),
uuid: uuid, uuid: uuid,
value: DOMRefCell::new(None), value: DOMRefCell::new(None),
instanceID: instanceID, instance_id: instance_id,
} }
} }
@ -64,7 +64,7 @@ impl BluetoothRemoteGATTDescriptor {
} }
fn get_instance_id(&self) -> String { fn get_instance_id(&self) -> String {
self.instanceID.clone() self.instance_id.clone()
} }
} }

View file

@ -24,22 +24,22 @@ pub struct BluetoothRemoteGATTService {
reflector_: Reflector, reflector_: Reflector,
device: MutHeap<JS<BluetoothDevice>>, device: MutHeap<JS<BluetoothDevice>>,
uuid: DOMString, uuid: DOMString,
isPrimary: bool, is_primary: bool,
instanceID: String, instance_id: String,
} }
impl BluetoothRemoteGATTService { impl BluetoothRemoteGATTService {
pub fn new_inherited(device: &BluetoothDevice, pub fn new_inherited(device: &BluetoothDevice,
uuid: DOMString, uuid: DOMString,
isPrimary: bool, is_primary: bool,
instanceID: String) instance_id: String)
-> BluetoothRemoteGATTService { -> BluetoothRemoteGATTService {
BluetoothRemoteGATTService { BluetoothRemoteGATTService {
reflector_: Reflector::new(), reflector_: Reflector::new(),
device: MutHeap::new(device), device: MutHeap::new(device),
uuid: uuid, uuid: uuid,
isPrimary: isPrimary, is_primary: is_primary,
instanceID: instanceID, instance_id: instance_id,
} }
} }
@ -64,7 +64,7 @@ impl BluetoothRemoteGATTService {
} }
fn get_instance_id(&self) -> String { fn get_instance_id(&self) -> String {
self.instanceID.clone() self.instance_id.clone()
} }
} }
@ -76,7 +76,7 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService {
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-isprimary // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-isprimary
fn IsPrimary(&self) -> bool { fn IsPrimary(&self) -> bool {
self.isPrimary self.is_primary
} }
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-uuid // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-uuid

View file

@ -1096,16 +1096,16 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
imagedata: &ImageData, imagedata: &ImageData,
dx: Finite<f64>, dx: Finite<f64>,
dy: Finite<f64>, dy: Finite<f64>,
dirtyX: Finite<f64>, dirty_x: Finite<f64>,
dirtyY: Finite<f64>, dirty_y: Finite<f64>,
dirtyWidth: Finite<f64>, dirty_width: Finite<f64>,
dirtyHeight: Finite<f64>) { dirty_height: Finite<f64>) {
let data = imagedata.get_data_array(); let data = imagedata.get_data_array();
let offset = Point2D::new(*dx, *dy); let offset = Point2D::new(*dx, *dy);
let image_data_size = Size2D::new(imagedata.Width() as f64, imagedata.Height() as f64); let image_data_size = Size2D::new(imagedata.Width() as f64, imagedata.Height() as f64);
let dirty_rect = Rect::new(Point2D::new(*dirtyX, *dirtyY), let dirty_rect = Rect::new(Point2D::new(*dirty_x, *dirty_y),
Size2D::new(*dirtyWidth, *dirtyHeight)); Size2D::new(*dirty_width, *dirty_height));
let msg = CanvasMsg::Canvas2d(Canvas2dMsg::PutImageData(data, let msg = CanvasMsg::Canvas2d(Canvas2dMsg::PutImageData(data,
offset, offset,
image_data_size, image_data_size,

View file

@ -17,16 +17,16 @@ use string_cache::Atom;
#[dom_struct] #[dom_struct]
pub struct CloseEvent { pub struct CloseEvent {
event: Event, event: Event,
wasClean: bool, was_clean: bool,
code: u16, code: u16,
reason: DOMString, reason: DOMString,
} }
impl CloseEvent { impl CloseEvent {
pub fn new_inherited(wasClean: bool, code: u16, reason: DOMString) -> CloseEvent { pub fn new_inherited(was_clean: bool, code: u16, reason: DOMString) -> CloseEvent {
CloseEvent { CloseEvent {
event: Event::new_inherited(), event: Event::new_inherited(),
wasClean: wasClean, was_clean: was_clean,
code: code, code: code,
reason: reason, reason: reason,
} }
@ -77,7 +77,7 @@ impl CloseEvent {
impl CloseEventMethods for CloseEvent { impl CloseEventMethods for CloseEvent {
// https://html.spec.whatwg.org/multipage/#dom-closeevent-wasclean // https://html.spec.whatwg.org/multipage/#dom-closeevent-wasclean
fn WasClean(&self) -> bool { fn WasClean(&self) -> bool {
self.wasClean self.was_clean
} }
// https://html.spec.whatwg.org/multipage/#dom-closeevent-code // https://html.spec.whatwg.org/multipage/#dom-closeevent-code

View file

@ -101,11 +101,11 @@ fn timestamp_in_ms(time: Timespec) -> u64 {
(time.sec * 1000 + (time.nsec / 1000000) as i64) as u64 (time.sec * 1000 + (time.nsec / 1000000) as i64) as u64
} }
fn prepare_message(logLevel: LogLevel, message: DOMString) -> ConsoleMessage { fn prepare_message(log_level: LogLevel, message: DOMString) -> ConsoleMessage {
// TODO: Sending fake values for filename, lineNumber and columnNumber in LogMessage; adjust later // TODO: Sending fake values for filename, lineNumber and columnNumber in LogMessage; adjust later
ConsoleMessage { ConsoleMessage {
message: String::from(message), message: String::from(message),
logLevel: logLevel, logLevel: log_level,
filename: "test".to_owned(), filename: "test".to_owned(),
lineNumber: 1, lineNumber: 1,
columnNumber: 1, columnNumber: 1,

View file

@ -733,13 +733,13 @@ impl Document {
// https://w3c.github.io/uievents/#event-type-click // https://w3c.github.io/uievents/#event-type-click
let client_x = client_point.x as i32; let client_x = client_point.x as i32;
let client_y = client_point.y as i32; let client_y = client_point.y as i32;
let clickCount = 1; let click_count = 1;
let event = MouseEvent::new(&self.window, let event = MouseEvent::new(&self.window,
DOMString::from(mouse_event_type_string), DOMString::from(mouse_event_type_string),
EventBubbles::Bubbles, EventBubbles::Bubbles,
EventCancelable::Cancelable, EventCancelable::Cancelable,
Some(&self.window), Some(&self.window),
clickCount, click_count,
client_x, client_x,
client_y, client_y,
client_x, client_x,
@ -804,7 +804,7 @@ impl Document {
if now.duration_since(last_time) < DBL_CLICK_TIMEOUT && if now.duration_since(last_time) < DBL_CLICK_TIMEOUT &&
dist < DBL_CLICK_DIST_THRESHOLD as f64 { dist < DBL_CLICK_DIST_THRESHOLD as f64 {
// A double click has occurred if this click is within a certain time and dist. of previous click. // A double click has occurred if this click is within a certain time and dist. of previous click.
let clickCount = 2; let click_count = 2;
let client_x = click_pos.x as i32; let client_x = click_pos.x as i32;
let client_y = click_pos.y as i32; let client_y = click_pos.y as i32;
@ -813,7 +813,7 @@ impl Document {
EventBubbles::Bubbles, EventBubbles::Bubbles,
EventCancelable::Cancelable, EventCancelable::Cancelable,
Some(&self.window), Some(&self.window),
clickCount, click_count,
client_x, client_x,
client_y, client_y,
client_x, client_x,
@ -1617,7 +1617,7 @@ impl Document {
} }
// https://html.spec.whatwg.org/multipage/#fire-a-focus-event // https://html.spec.whatwg.org/multipage/#fire-a-focus-event
fn fire_focus_event(&self, focus_event_type: FocusEventType, node: &Node, relatedTarget: Option<&EventTarget>) { fn fire_focus_event(&self, focus_event_type: FocusEventType, node: &Node, related_target: Option<&EventTarget>) {
let (event_name, does_bubble) = match focus_event_type { let (event_name, does_bubble) = match focus_event_type {
FocusEventType::Focus => (DOMString::from("focus"), EventBubbles::DoesNotBubble), FocusEventType::Focus => (DOMString::from("focus"), EventBubbles::DoesNotBubble),
FocusEventType::Blur => (DOMString::from("blur"), EventBubbles::DoesNotBubble), FocusEventType::Blur => (DOMString::from("blur"), EventBubbles::DoesNotBubble),
@ -1628,7 +1628,7 @@ impl Document {
EventCancelable::NotCancelable, EventCancelable::NotCancelable,
Some(&self.window), Some(&self.window),
0i32, 0i32,
relatedTarget); related_target);
let event = event.upcast::<Event>(); let event = event.upcast::<Event>();
event.set_trusted(true); event.set_trusted(true);
let target = node.upcast(); let target = node.upcast();
@ -2380,10 +2380,10 @@ impl DocumentMethods for Document {
// https://dom.spec.whatwg.org/#dom-document-createnodeiteratorroot-whattoshow-filter // https://dom.spec.whatwg.org/#dom-document-createnodeiteratorroot-whattoshow-filter
fn CreateNodeIterator(&self, fn CreateNodeIterator(&self,
root: &Node, root: &Node,
whatToShow: u32, what_to_show: u32,
filter: Option<Rc<NodeFilter>>) filter: Option<Rc<NodeFilter>>)
-> Root<NodeIterator> { -> Root<NodeIterator> {
NodeIterator::new(self, root, whatToShow, filter) NodeIterator::new(self, root, what_to_show, filter)
} }
// https://w3c.github.io/touch-events/#idl-def-Document // https://w3c.github.io/touch-events/#idl-def-Document
@ -2391,22 +2391,22 @@ impl DocumentMethods for Document {
window: &Window, window: &Window,
target: &EventTarget, target: &EventTarget,
identifier: i32, identifier: i32,
pageX: Finite<f64>, page_x: Finite<f64>,
pageY: Finite<f64>, page_y: Finite<f64>,
screenX: Finite<f64>, screen_x: Finite<f64>,
screenY: Finite<f64>) screen_y: Finite<f64>)
-> Root<Touch> { -> Root<Touch> {
let clientX = Finite::wrap(*pageX - window.PageXOffset() as f64); let client_x = Finite::wrap(*page_x - window.PageXOffset() as f64);
let clientY = Finite::wrap(*pageY - window.PageYOffset() as f64); let client_y = Finite::wrap(*page_y - window.PageYOffset() as f64);
Touch::new(window, Touch::new(window,
identifier, identifier,
target, target,
screenX, screen_x,
screenY, screen_y,
clientX, client_x,
clientY, client_y,
pageX, page_x,
pageY) page_y)
} }
// https://w3c.github.io/touch-events/#idl-def-document-createtouchlist(touch...) // https://w3c.github.io/touch-events/#idl-def-document-createtouchlist(touch...)
@ -2417,10 +2417,10 @@ impl DocumentMethods for Document {
// https://dom.spec.whatwg.org/#dom-document-createtreewalker // https://dom.spec.whatwg.org/#dom-document-createtreewalker
fn CreateTreeWalker(&self, fn CreateTreeWalker(&self,
root: &Node, root: &Node,
whatToShow: u32, what_to_show: u32,
filter: Option<Rc<NodeFilter>>) filter: Option<Rc<NodeFilter>>)
-> Root<TreeWalker> { -> Root<TreeWalker> {
TreeWalker::new(self, root, whatToShow, filter) TreeWalker::new(self, root, what_to_show, filter)
} }
// https://html.spec.whatwg.org/multipage/#document.title // https://html.spec.whatwg.org/multipage/#document.title

View file

@ -25,9 +25,9 @@ pub struct File {
impl File { impl File {
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
fn new_inherited(blob_impl: BlobImpl, name: DOMString, fn new_inherited(blob_impl: BlobImpl, name: DOMString,
modified: Option<i64>, typeString: &str) -> File { modified: Option<i64>, type_string: &str) -> File {
File { File {
blob: Blob::new_inherited(blob_impl, typeString.to_owned()), blob: Blob::new_inherited(blob_impl, type_string.to_owned()),
name: name, name: name,
// https://w3c.github.io/FileAPI/#dfn-lastModified // https://w3c.github.io/FileAPI/#dfn-lastModified
modified: match modified { modified: match modified {

View file

@ -39,22 +39,22 @@ pub struct HTMLAnchorElement {
} }
impl HTMLAnchorElement { impl HTMLAnchorElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLAnchorElement { document: &Document) -> HTMLAnchorElement {
HTMLAnchorElement { HTMLAnchorElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document), HTMLElement::new_inherited(local_name, prefix, document),
rel_list: Default::default(), rel_list: Default::default(),
url: DOMRefCell::new(None), url: DOMRefCell::new(None),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLAnchorElement> { document: &Document) -> Root<HTMLAnchorElement> {
Node::reflect_node(box HTMLAnchorElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLAnchorElement::new_inherited(local_name, prefix, document),
document, document,
HTMLAnchorElementBinding::Wrap) HTMLAnchorElementBinding::Wrap)
} }
@ -540,7 +540,7 @@ impl Activatable for HTMLAnchorElement {
} }
//TODO:https://html.spec.whatwg.org/multipage/#the-a-element //TODO:https://html.spec.whatwg.org/multipage/#the-a-element
fn implicit_submission(&self, _ctrlKey: bool, _shiftKey: bool, _altKey: bool, _metaKey: bool) { fn implicit_submission(&self, _ctrl_key: bool, _shift_key: bool, _alt_key: bool, _meta_key: bool) {
} }
} }

View file

@ -20,20 +20,20 @@ pub struct HTMLAppletElement {
} }
impl HTMLAppletElement { impl HTMLAppletElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLAppletElement { document: &Document) -> HTMLAppletElement {
HTMLAppletElement { HTMLAppletElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLAppletElement> { document: &Document) -> Root<HTMLAppletElement> {
Node::reflect_node(box HTMLAppletElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLAppletElement::new_inherited(local_name, prefix, document),
document, document,
HTMLAppletElementBinding::Wrap) HTMLAppletElementBinding::Wrap)
} }

View file

@ -23,18 +23,18 @@ pub struct HTMLAreaElement {
} }
impl HTMLAreaElement { impl HTMLAreaElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLAreaElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLAreaElement {
HTMLAreaElement { HTMLAreaElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
rel_list: Default::default(), rel_list: Default::default(),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLAreaElement> { document: &Document) -> Root<HTMLAreaElement> {
Node::reflect_node(box HTMLAreaElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLAreaElement::new_inherited(local_name, prefix, document),
document, document,
HTMLAreaElementBinding::Wrap) HTMLAreaElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLAudioElement {
} }
impl HTMLAudioElement { impl HTMLAudioElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLAudioElement { document: &Document) -> HTMLAudioElement {
HTMLAudioElement { HTMLAudioElement {
htmlmediaelement: htmlmediaelement:
HTMLMediaElement::new_inherited(localName, prefix, document) HTMLMediaElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLAudioElement> { document: &Document) -> Root<HTMLAudioElement> {
Node::reflect_node(box HTMLAudioElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLAudioElement::new_inherited(local_name, prefix, document),
document, document,
HTMLAudioElementBinding::Wrap) HTMLAudioElementBinding::Wrap)
} }

View file

@ -23,17 +23,17 @@ pub struct HTMLBaseElement {
} }
impl HTMLBaseElement { impl HTMLBaseElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLBaseElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLBaseElement {
HTMLBaseElement { HTMLBaseElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLBaseElement> { document: &Document) -> Root<HTMLBaseElement> {
Node::reflect_node(box HTMLBaseElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLBaseElement::new_inherited(local_name, prefix, document),
document, document,
HTMLBaseElementBinding::Wrap) HTMLBaseElementBinding::Wrap)
} }

View file

@ -32,17 +32,17 @@ pub struct HTMLBodyElement {
} }
impl HTMLBodyElement { impl HTMLBodyElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document)
-> HTMLBodyElement { -> HTMLBodyElement {
HTMLBodyElement { HTMLBodyElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document) pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document)
-> Root<HTMLBodyElement> { -> Root<HTMLBodyElement> {
Node::reflect_node(box HTMLBodyElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLBodyElement::new_inherited(local_name, prefix, document),
document, document,
HTMLBodyElementBinding::Wrap) HTMLBodyElementBinding::Wrap)
} }

View file

@ -16,17 +16,17 @@ pub struct HTMLBRElement {
} }
impl HTMLBRElement { impl HTMLBRElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLBRElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLBRElement {
HTMLBRElement { HTMLBRElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLBRElement> { document: &Document) -> Root<HTMLBRElement> {
Node::reflect_node(box HTMLBRElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLBRElement::new_inherited(local_name, prefix, document),
document, document,
HTMLBRElementBinding::Wrap) HTMLBRElementBinding::Wrap)
} }

View file

@ -43,22 +43,22 @@ pub struct HTMLButtonElement {
} }
impl HTMLButtonElement { impl HTMLButtonElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLButtonElement { document: &Document) -> HTMLButtonElement {
HTMLButtonElement { HTMLButtonElement {
htmlelement: htmlelement:
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE, HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
localName, prefix, document), local_name, prefix, document),
button_type: Cell::new(ButtonType::Submit) button_type: Cell::new(ButtonType::Submit)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLButtonElement> { document: &Document) -> Root<HTMLButtonElement> {
Node::reflect_node(box HTMLButtonElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLButtonElement::new_inherited(local_name, prefix, document),
document, document,
HTMLButtonElementBinding::Wrap) HTMLButtonElementBinding::Wrap)
} }
@ -283,7 +283,7 @@ impl Activatable for HTMLButtonElement {
// https://html.spec.whatwg.org/multipage/#implicit-submission // https://html.spec.whatwg.org/multipage/#implicit-submission
#[allow(unsafe_code)] #[allow(unsafe_code)]
fn implicit_submission(&self, ctrlKey: bool, shiftKey: bool, altKey: bool, metaKey: bool) { fn implicit_submission(&self, ctrl_key: bool, shift_key: bool, alt_key: bool, meta_key: bool) {
let doc = document_from_node(self); let doc = document_from_node(self);
let node = doc.upcast::<Node>(); let node = doc.upcast::<Node>();
let owner = self.form_owner(); let owner = self.form_owner();
@ -294,10 +294,10 @@ impl Activatable for HTMLButtonElement {
.filter_map(Root::downcast::<HTMLButtonElement>) .filter_map(Root::downcast::<HTMLButtonElement>)
.find(|r| r.form_owner() == owner) .find(|r| r.form_owner() == owner)
.map(|s| synthetic_click_activation(s.r().as_element(), .map(|s| synthetic_click_activation(s.r().as_element(),
ctrlKey, ctrl_key,
shiftKey, shift_key,
altKey, alt_key,
metaKey, meta_key,
ActivationSource::NotFromClick)); ActivationSource::NotFromClick));
} }
} }

View file

@ -56,20 +56,20 @@ pub struct HTMLCanvasElement {
} }
impl HTMLCanvasElement { impl HTMLCanvasElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLCanvasElement { document: &Document) -> HTMLCanvasElement {
HTMLCanvasElement { HTMLCanvasElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
context: DOMRefCell::new(None), context: DOMRefCell::new(None),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLCanvasElement> { document: &Document) -> Root<HTMLCanvasElement> {
Node::reflect_node(box HTMLCanvasElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLCanvasElement::new_inherited(local_name, prefix, document),
document, document,
HTMLCanvasElementBinding::Wrap) HTMLCanvasElementBinding::Wrap)
} }

View file

@ -17,19 +17,19 @@ pub struct HTMLDataElement {
} }
impl HTMLDataElement { impl HTMLDataElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLDataElement { document: &Document) -> HTMLDataElement {
HTMLDataElement { HTMLDataElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLDataElement> { document: &Document) -> Root<HTMLDataElement> {
Node::reflect_node(box HTMLDataElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLDataElement::new_inherited(local_name, prefix, document),
document, document,
HTMLDataElementBinding::Wrap) HTMLDataElementBinding::Wrap)
} }

View file

@ -21,20 +21,20 @@ pub struct HTMLDataListElement {
} }
impl HTMLDataListElement { impl HTMLDataListElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLDataListElement { document: &Document) -> HTMLDataListElement {
HTMLDataListElement { HTMLDataListElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLDataListElement> { document: &Document) -> Root<HTMLDataListElement> {
Node::reflect_node(box HTMLDataListElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLDataListElement::new_inherited(local_name, prefix, document),
document, document,
HTMLDataListElementBinding::Wrap) HTMLDataListElementBinding::Wrap)
} }

View file

@ -28,21 +28,21 @@ pub struct HTMLDetailsElement {
} }
impl HTMLDetailsElement { impl HTMLDetailsElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLDetailsElement { document: &Document) -> HTMLDetailsElement {
HTMLDetailsElement { HTMLDetailsElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document), HTMLElement::new_inherited(local_name, prefix, document),
toggle_counter: Cell::new(0) toggle_counter: Cell::new(0)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLDetailsElement> { document: &Document) -> Root<HTMLDetailsElement> {
Node::reflect_node(box HTMLDetailsElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLDetailsElement::new_inherited(local_name, prefix, document),
document, document,
HTMLDetailsElementBinding::Wrap) HTMLDetailsElementBinding::Wrap)
} }

View file

@ -22,21 +22,21 @@ pub struct HTMLDialogElement {
} }
impl HTMLDialogElement { impl HTMLDialogElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLDialogElement { document: &Document) -> HTMLDialogElement {
HTMLDialogElement { HTMLDialogElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document), HTMLElement::new_inherited(local_name, prefix, document),
return_value: DOMRefCell::new(DOMString::new()), return_value: DOMRefCell::new(DOMString::new()),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLDialogElement> { document: &Document) -> Root<HTMLDialogElement> {
Node::reflect_node(box HTMLDialogElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLDialogElement::new_inherited(local_name, prefix, document),
document, document,
HTMLDialogElementBinding::Wrap) HTMLDialogElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLDirectoryElement {
} }
impl HTMLDirectoryElement { impl HTMLDirectoryElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLDirectoryElement { document: &Document) -> HTMLDirectoryElement {
HTMLDirectoryElement { HTMLDirectoryElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLDirectoryElement> { document: &Document) -> Root<HTMLDirectoryElement> {
Node::reflect_node(box HTMLDirectoryElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLDirectoryElement::new_inherited(local_name, prefix, document),
document, document,
HTMLDirectoryElementBinding::Wrap) HTMLDirectoryElementBinding::Wrap)
} }

View file

@ -16,19 +16,19 @@ pub struct HTMLDivElement {
} }
impl HTMLDivElement { impl HTMLDivElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLDivElement { document: &Document) -> HTMLDivElement {
HTMLDivElement { HTMLDivElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLDivElement> { document: &Document) -> Root<HTMLDivElement> {
Node::reflect_node(box HTMLDivElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLDivElement::new_inherited(local_name, prefix, document),
document, document,
HTMLDivElementBinding::Wrap) HTMLDivElementBinding::Wrap)
} }

View file

@ -16,18 +16,18 @@ pub struct HTMLDListElement {
} }
impl HTMLDListElement { impl HTMLDListElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLDListElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLDListElement {
HTMLDListElement { HTMLDListElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLDListElement> { document: &Document) -> Root<HTMLDListElement> {
Node::reflect_node(box HTMLDListElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLDListElement::new_inherited(local_name, prefix, document),
document, document,
HTMLDListElementBinding::Wrap) HTMLDListElementBinding::Wrap)
} }

View file

@ -62,8 +62,8 @@ impl HTMLElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document) -> Root<HTMLElement> { pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> Root<HTMLElement> {
Node::reflect_node(box HTMLElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLElement::new_inherited(local_name, prefix, document),
document, document,
HTMLElementBinding::Wrap) HTMLElementBinding::Wrap)
} }

View file

@ -16,17 +16,17 @@ pub struct HTMLEmbedElement {
} }
impl HTMLEmbedElement { impl HTMLEmbedElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLEmbedElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLEmbedElement {
HTMLEmbedElement { HTMLEmbedElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLEmbedElement> { document: &Document) -> Root<HTMLEmbedElement> {
Node::reflect_node(box HTMLEmbedElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLEmbedElement::new_inherited(local_name, prefix, document),
document, document,
HTMLEmbedElementBinding::Wrap) HTMLEmbedElementBinding::Wrap)
} }

View file

@ -26,21 +26,21 @@ pub struct HTMLFieldSetElement {
} }
impl HTMLFieldSetElement { impl HTMLFieldSetElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLFieldSetElement { document: &Document) -> HTMLFieldSetElement {
HTMLFieldSetElement { HTMLFieldSetElement {
htmlelement: htmlelement:
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE, HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
localName, prefix, document) local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLFieldSetElement> { document: &Document) -> Root<HTMLFieldSetElement> {
Node::reflect_node(box HTMLFieldSetElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLFieldSetElement::new_inherited(local_name, prefix, document),
document, document,
HTMLFieldSetElementBinding::Wrap) HTMLFieldSetElementBinding::Wrap)
} }

View file

@ -25,17 +25,17 @@ pub struct HTMLFontElement {
impl HTMLFontElement { impl HTMLFontElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLFontElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLFontElement {
HTMLFontElement { HTMLFontElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLFontElement> { document: &Document) -> Root<HTMLFontElement> {
Node::reflect_node(box HTMLFontElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLFontElement::new_inherited(local_name, prefix, document),
document, document,
HTMLFontElementBinding::Wrap) HTMLFontElementBinding::Wrap)
} }

View file

@ -65,11 +65,11 @@ pub struct HTMLFormElement {
} }
impl HTMLFormElement { impl HTMLFormElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLFormElement { document: &Document) -> HTMLFormElement {
HTMLFormElement { HTMLFormElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
marked_for_reset: Cell::new(false), marked_for_reset: Cell::new(false),
elements: Default::default(), elements: Default::default(),
generation_id: Cell::new(GenerationId(0)) generation_id: Cell::new(GenerationId(0))
@ -77,10 +77,10 @@ impl HTMLFormElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLFormElement> { document: &Document) -> Root<HTMLFormElement> {
Node::reflect_node(box HTMLFormElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLFormElement::new_inherited(local_name, prefix, document),
document, document,
HTMLFormElementBinding::Wrap) HTMLFormElementBinding::Wrap)
} }

View file

@ -16,17 +16,17 @@ pub struct HTMLFrameElement {
} }
impl HTMLFrameElement { impl HTMLFrameElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLFrameElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLFrameElement {
HTMLFrameElement { HTMLFrameElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLFrameElement> { document: &Document) -> Root<HTMLFrameElement> {
Node::reflect_node(box HTMLFrameElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLFrameElement::new_inherited(local_name, prefix, document),
document, document,
HTMLFrameElementBinding::Wrap) HTMLFrameElementBinding::Wrap)
} }

View file

@ -19,20 +19,20 @@ pub struct HTMLFrameSetElement {
} }
impl HTMLFrameSetElement { impl HTMLFrameSetElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLFrameSetElement { document: &Document) -> HTMLFrameSetElement {
HTMLFrameSetElement { HTMLFrameSetElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLFrameSetElement> { document: &Document) -> Root<HTMLFrameSetElement> {
Node::reflect_node(box HTMLFrameSetElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLFrameSetElement::new_inherited(local_name, prefix, document),
document, document,
HTMLFrameSetElementBinding::Wrap) HTMLFrameSetElementBinding::Wrap)
} }

View file

@ -22,19 +22,19 @@ pub struct HTMLHeadElement {
} }
impl HTMLHeadElement { impl HTMLHeadElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLHeadElement { document: &Document) -> HTMLHeadElement {
HTMLHeadElement { HTMLHeadElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLHeadElement> { document: &Document) -> Root<HTMLHeadElement> {
Node::reflect_node(box HTMLHeadElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLHeadElement::new_inherited(local_name, prefix, document),
document, document,
HTMLHeadElementBinding::Wrap) HTMLHeadElementBinding::Wrap)
} }

View file

@ -27,23 +27,23 @@ pub struct HTMLHeadingElement {
} }
impl HTMLHeadingElement { impl HTMLHeadingElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document, document: &Document,
level: HeadingLevel) -> HTMLHeadingElement { level: HeadingLevel) -> HTMLHeadingElement {
HTMLHeadingElement { HTMLHeadingElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document), HTMLElement::new_inherited(local_name, prefix, document),
level: level, level: level,
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document, document: &Document,
level: HeadingLevel) -> Root<HTMLHeadingElement> { level: HeadingLevel) -> Root<HTMLHeadingElement> {
Node::reflect_node(box HTMLHeadingElement::new_inherited(localName, prefix, document, level), Node::reflect_node(box HTMLHeadingElement::new_inherited(local_name, prefix, document, level),
document, document,
HTMLHeadingElementBinding::Wrap) HTMLHeadingElementBinding::Wrap)
} }

View file

@ -21,17 +21,17 @@ pub struct HTMLHRElement {
} }
impl HTMLHRElement { impl HTMLHRElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLHRElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLHRElement {
HTMLHRElement { HTMLHRElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLHRElement> { document: &Document) -> Root<HTMLHRElement> {
Node::reflect_node(box HTMLHRElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLHRElement::new_inherited(local_name, prefix, document),
document, document,
HTMLHRElementBinding::Wrap) HTMLHRElementBinding::Wrap)
} }

View file

@ -173,11 +173,11 @@ impl HTMLIFrameElement {
self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage); self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
} }
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLIFrameElement { document: &Document) -> HTMLIFrameElement {
HTMLIFrameElement { HTMLIFrameElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
pipeline_id: Cell::new(None), pipeline_id: Cell::new(None),
sandbox: Default::default(), sandbox: Default::default(),
sandbox_allowance: Cell::new(None), sandbox_allowance: Cell::new(None),
@ -187,10 +187,10 @@ impl HTMLIFrameElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLIFrameElement> { document: &Document) -> Root<HTMLIFrameElement> {
Node::reflect_node(box HTMLIFrameElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLIFrameElement::new_inherited(local_name, prefix, document),
document, document,
HTMLIFrameElementBinding::Wrap) HTMLIFrameElementBinding::Wrap)
} }
@ -488,7 +488,7 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement {
} }
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/reload // https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/reload
fn Reload(&self, _hardReload: bool) -> ErrorResult { fn Reload(&self, _hard_reload: bool) -> ErrorResult {
if self.Mozbrowser() { if self.Mozbrowser() {
if self.upcast::<Node>().is_in_doc() { if self.upcast::<Node>().is_in_doc() {
self.navigate_or_reload_child_browsing_context(None); self.navigate_or_reload_child_browsing_context(None);

View file

@ -194,9 +194,9 @@ impl HTMLImageElement {
} }
} }
} }
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLImageElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLImageElement {
HTMLImageElement { HTMLImageElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
current_request: DOMRefCell::new(ImageRequest { current_request: DOMRefCell::new(ImageRequest {
state: State::Unavailable, state: State::Unavailable,
parsed_url: None, parsed_url: None,
@ -215,10 +215,10 @@ impl HTMLImageElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLImageElement> { document: &Document) -> Root<HTMLImageElement> {
Node::reflect_node(box HTMLImageElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLImageElement::new_inherited(local_name, prefix, document),
document, document,
HTMLImageElementBinding::Wrap) HTMLImageElementBinding::Wrap)
} }

View file

@ -125,12 +125,12 @@ static DEFAULT_INPUT_SIZE: u32 = 20;
static DEFAULT_MAX_LENGTH: i32 = -1; static DEFAULT_MAX_LENGTH: i32 = -1;
impl HTMLInputElement { impl HTMLInputElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLInputElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLInputElement {
let chan = document.window().constellation_chan().clone(); let chan = document.window().constellation_chan().clone();
HTMLInputElement { HTMLInputElement {
htmlelement: htmlelement:
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE | IN_READ_WRITE_STATE, HTMLElement::new_inherited_with_state(IN_ENABLED_STATE | IN_READ_WRITE_STATE,
localName, prefix, document), local_name, prefix, document),
input_type: Cell::new(InputType::InputText), input_type: Cell::new(InputType::InputText),
placeholder: DOMRefCell::new(DOMString::new()), placeholder: DOMRefCell::new(DOMString::new()),
checked_changed: Cell::new(false), checked_changed: Cell::new(false),
@ -145,10 +145,10 @@ impl HTMLInputElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLInputElement> { document: &Document) -> Root<HTMLInputElement> {
Node::reflect_node(box HTMLInputElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLInputElement::new_inherited(local_name, prefix, document),
document, document,
HTMLInputElementBinding::Wrap) HTMLInputElementBinding::Wrap)
} }
@ -1275,7 +1275,7 @@ impl Activatable for HTMLInputElement {
// https://html.spec.whatwg.org/multipage/#implicit-submission // https://html.spec.whatwg.org/multipage/#implicit-submission
#[allow(unsafe_code)] #[allow(unsafe_code)]
fn implicit_submission(&self, ctrlKey: bool, shiftKey: bool, altKey: bool, metaKey: bool) { fn implicit_submission(&self, ctrl_key: bool, shift_key: bool, alt_key: bool, meta_key: bool) {
let doc = document_from_node(self); let doc = document_from_node(self);
let node = doc.upcast::<Node>(); let node = doc.upcast::<Node>();
let owner = self.form_owner(); let owner = self.form_owner();
@ -1295,10 +1295,10 @@ impl Activatable for HTMLInputElement {
Some(ref button) => { Some(ref button) => {
if button.is_instance_activatable() { if button.is_instance_activatable() {
synthetic_click_activation(button.as_element(), synthetic_click_activation(button.as_element(),
ctrlKey, ctrl_key,
shiftKey, shift_key,
altKey, alt_key,
metaKey, meta_key,
ActivationSource::NotFromClick) ActivationSource::NotFromClick)
} }
} }

View file

@ -25,20 +25,20 @@ pub struct HTMLLabelElement {
} }
impl HTMLLabelElement { impl HTMLLabelElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLLabelElement { document: &Document) -> HTMLLabelElement {
HTMLLabelElement { HTMLLabelElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLLabelElement> { document: &Document) -> Root<HTMLLabelElement> {
Node::reflect_node(box HTMLLabelElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLLabelElement::new_inherited(local_name, prefix, document),
document, document,
HTMLLabelElementBinding::Wrap) HTMLLabelElementBinding::Wrap)
} }
@ -76,7 +76,7 @@ impl Activatable for HTMLLabelElement {
} }
// https://html.spec.whatwg.org/multipage/#implicit-submission // https://html.spec.whatwg.org/multipage/#implicit-submission
fn implicit_submission(&self, _ctrlKey: bool, _shiftKey: bool, _altKey: bool, _metaKey: bool) { fn implicit_submission(&self, _ctrl_key: bool, _shift_key: bool, _alt_key: bool, _meta_key: bool) {
//FIXME: Investigate and implement implicit submission for label elements //FIXME: Investigate and implement implicit submission for label elements
// Issue filed at https://github.com/servo/servo/issues/8263 // Issue filed at https://github.com/servo/servo/issues/8263
} }

View file

@ -23,19 +23,19 @@ pub struct HTMLLegendElement {
} }
impl HTMLLegendElement { impl HTMLLegendElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) document: &Document)
-> HTMLLegendElement { -> HTMLLegendElement {
HTMLLegendElement { htmlelement: HTMLElement::new_inherited(localName, prefix, document) } HTMLLegendElement { htmlelement: HTMLElement::new_inherited(local_name, prefix, document) }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) document: &Document)
-> Root<HTMLLegendElement> { -> Root<HTMLLegendElement> {
Node::reflect_node(box HTMLLegendElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLLegendElement::new_inherited(local_name, prefix, document),
document, document,
HTMLLegendElementBinding::Wrap) HTMLLegendElementBinding::Wrap)
} }

View file

@ -20,17 +20,17 @@ pub struct HTMLLIElement {
} }
impl HTMLLIElement { impl HTMLLIElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLLIElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLLIElement {
HTMLLIElement { HTMLLIElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLLIElement> { document: &Document) -> Root<HTMLLIElement> {
Node::reflect_node(box HTMLLIElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLLIElement::new_inherited(local_name, prefix, document),
document, document,
HTMLLIElementBinding::Wrap) HTMLLIElementBinding::Wrap)
} }

View file

@ -57,10 +57,10 @@ pub struct HTMLLinkElement {
} }
impl HTMLLinkElement { impl HTMLLinkElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document, fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document,
creator: ElementCreator) -> HTMLLinkElement { creator: ElementCreator) -> HTMLLinkElement {
HTMLLinkElement { HTMLLinkElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
rel_list: Default::default(), rel_list: Default::default(),
parser_inserted: Cell::new(creator == ElementCreator::ParserCreated), parser_inserted: Cell::new(creator == ElementCreator::ParserCreated),
stylesheet: DOMRefCell::new(None), stylesheet: DOMRefCell::new(None),
@ -68,11 +68,11 @@ impl HTMLLinkElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document, document: &Document,
creator: ElementCreator) -> Root<HTMLLinkElement> { creator: ElementCreator) -> Root<HTMLLinkElement> {
Node::reflect_node(box HTMLLinkElement::new_inherited(localName, prefix, document, creator), Node::reflect_node(box HTMLLinkElement::new_inherited(local_name, prefix, document, creator),
document, document,
HTMLLinkElementBinding::Wrap) HTMLLinkElementBinding::Wrap)
} }

View file

@ -16,19 +16,19 @@ pub struct HTMLMapElement {
} }
impl HTMLMapElement { impl HTMLMapElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLMapElement { document: &Document) -> HTMLMapElement {
HTMLMapElement { HTMLMapElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLMapElement> { document: &Document) -> Root<HTMLMapElement> {
Node::reflect_node(box HTMLMapElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLMapElement::new_inherited(local_name, prefix, document),
document, document,
HTMLMapElementBinding::Wrap) HTMLMapElementBinding::Wrap)
} }

View file

@ -31,20 +31,20 @@ pub struct HTMLMetaElement {
} }
impl HTMLMetaElement { impl HTMLMetaElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLMetaElement { document: &Document) -> HTMLMetaElement {
HTMLMetaElement { HTMLMetaElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
stylesheet: DOMRefCell::new(None), stylesheet: DOMRefCell::new(None),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLMetaElement> { document: &Document) -> Root<HTMLMetaElement> {
Node::reflect_node(box HTMLMetaElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLMetaElement::new_inherited(local_name, prefix, document),
document, document,
HTMLMetaElementBinding::Wrap) HTMLMetaElementBinding::Wrap)
} }

View file

@ -18,19 +18,19 @@ pub struct HTMLMeterElement {
} }
impl HTMLMeterElement { impl HTMLMeterElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLMeterElement { document: &Document) -> HTMLMeterElement {
HTMLMeterElement { HTMLMeterElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLMeterElement> { document: &Document) -> Root<HTMLMeterElement> {
Node::reflect_node(box HTMLMeterElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLMeterElement::new_inherited(local_name, prefix, document),
document, document,
HTMLMeterElementBinding::Wrap) HTMLMeterElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLModElement {
} }
impl HTMLModElement { impl HTMLModElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLModElement { document: &Document) -> HTMLModElement {
HTMLModElement { HTMLModElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLModElement> { document: &Document) -> Root<HTMLModElement> {
Node::reflect_node(box HTMLModElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLModElement::new_inherited(local_name, prefix, document),
document, document,
HTMLModElementBinding::Wrap) HTMLModElementBinding::Wrap)
} }

View file

@ -28,21 +28,21 @@ pub struct HTMLObjectElement {
} }
impl HTMLObjectElement { impl HTMLObjectElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLObjectElement { document: &Document) -> HTMLObjectElement {
HTMLObjectElement { HTMLObjectElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document), HTMLElement::new_inherited(local_name, prefix, document),
image: DOMRefCell::new(None), image: DOMRefCell::new(None),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLObjectElement> { document: &Document) -> Root<HTMLObjectElement> {
Node::reflect_node(box HTMLObjectElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLObjectElement::new_inherited(local_name, prefix, document),
document, document,
HTMLObjectElementBinding::Wrap) HTMLObjectElementBinding::Wrap)
} }

View file

@ -16,19 +16,19 @@ pub struct HTMLOListElement {
} }
impl HTMLOListElement { impl HTMLOListElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLOListElement { document: &Document) -> HTMLOListElement {
HTMLOListElement { HTMLOListElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLOListElement> { document: &Document) -> Root<HTMLOListElement> {
Node::reflect_node(box HTMLOListElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLOListElement::new_inherited(local_name, prefix, document),
document, document,
HTMLOListElementBinding::Wrap) HTMLOListElementBinding::Wrap)
} }

View file

@ -23,21 +23,21 @@ pub struct HTMLOptGroupElement {
} }
impl HTMLOptGroupElement { impl HTMLOptGroupElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLOptGroupElement { document: &Document) -> HTMLOptGroupElement {
HTMLOptGroupElement { HTMLOptGroupElement {
htmlelement: htmlelement:
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE, HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
localName, prefix, document) local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLOptGroupElement> { document: &Document) -> Root<HTMLOptGroupElement> {
Node::reflect_node(box HTMLOptGroupElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLOptGroupElement::new_inherited(local_name, prefix, document),
document, document,
HTMLOptGroupElementBinding::Wrap) HTMLOptGroupElementBinding::Wrap)
} }

View file

@ -39,23 +39,23 @@ pub struct HTMLOptionElement {
} }
impl HTMLOptionElement { impl HTMLOptionElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLOptionElement { document: &Document) -> HTMLOptionElement {
HTMLOptionElement { HTMLOptionElement {
htmlelement: htmlelement:
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE, HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
localName, prefix, document), local_name, prefix, document),
selectedness: Cell::new(false), selectedness: Cell::new(false),
dirtiness: Cell::new(false), dirtiness: Cell::new(false),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLOptionElement> { document: &Document) -> Root<HTMLOptionElement> {
Node::reflect_node(box HTMLOptionElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLOptionElement::new_inherited(local_name, prefix, document),
document, document,
HTMLOptionElementBinding::Wrap) HTMLOptionElementBinding::Wrap)
} }

View file

@ -21,20 +21,20 @@ pub struct HTMLOutputElement {
} }
impl HTMLOutputElement { impl HTMLOutputElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLOutputElement { document: &Document) -> HTMLOutputElement {
HTMLOutputElement { HTMLOutputElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLOutputElement> { document: &Document) -> Root<HTMLOutputElement> {
Node::reflect_node(box HTMLOutputElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLOutputElement::new_inherited(local_name, prefix, document),
document, document,
HTMLOutputElementBinding::Wrap) HTMLOutputElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLParagraphElement {
} }
impl HTMLParagraphElement { impl HTMLParagraphElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLParagraphElement { document: &Document) -> HTMLParagraphElement {
HTMLParagraphElement { HTMLParagraphElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLParagraphElement> { document: &Document) -> Root<HTMLParagraphElement> {
Node::reflect_node(box HTMLParagraphElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLParagraphElement::new_inherited(local_name, prefix, document),
document, document,
HTMLParagraphElementBinding::Wrap) HTMLParagraphElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLParamElement {
} }
impl HTMLParamElement { impl HTMLParamElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLParamElement { document: &Document) -> HTMLParamElement {
HTMLParamElement { HTMLParamElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLParamElement> { document: &Document) -> Root<HTMLParamElement> {
Node::reflect_node(box HTMLParamElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLParamElement::new_inherited(local_name, prefix, document),
document, document,
HTMLParamElementBinding::Wrap) HTMLParamElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLPreElement {
} }
impl HTMLPreElement { impl HTMLPreElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLPreElement { document: &Document) -> HTMLPreElement {
HTMLPreElement { HTMLPreElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLPreElement> { document: &Document) -> Root<HTMLPreElement> {
Node::reflect_node(box HTMLPreElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLPreElement::new_inherited(local_name, prefix, document),
document, document,
HTMLPreElementBinding::Wrap) HTMLPreElementBinding::Wrap)
} }

View file

@ -18,20 +18,20 @@ pub struct HTMLProgressElement {
} }
impl HTMLProgressElement { impl HTMLProgressElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLProgressElement { document: &Document) -> HTMLProgressElement {
HTMLProgressElement { HTMLProgressElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLProgressElement> { document: &Document) -> Root<HTMLProgressElement> {
Node::reflect_node(box HTMLProgressElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLProgressElement::new_inherited(local_name, prefix, document),
document, document,
HTMLProgressElementBinding::Wrap) HTMLProgressElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLQuoteElement {
} }
impl HTMLQuoteElement { impl HTMLQuoteElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLQuoteElement { document: &Document) -> HTMLQuoteElement {
HTMLQuoteElement { HTMLQuoteElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLQuoteElement> { document: &Document) -> Root<HTMLQuoteElement> {
Node::reflect_node(box HTMLQuoteElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLQuoteElement::new_inherited(local_name, prefix, document),
document, document,
HTMLQuoteElementBinding::Wrap) HTMLQuoteElementBinding::Wrap)
} }

View file

@ -64,11 +64,11 @@ pub struct HTMLScriptElement {
} }
impl HTMLScriptElement { impl HTMLScriptElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document, fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document,
creator: ElementCreator) -> HTMLScriptElement { creator: ElementCreator) -> HTMLScriptElement {
HTMLScriptElement { HTMLScriptElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document), HTMLElement::new_inherited(local_name, prefix, document),
already_started: Cell::new(false), already_started: Cell::new(false),
parser_inserted: Cell::new(creator == ElementCreator::ParserCreated), parser_inserted: Cell::new(creator == ElementCreator::ParserCreated),
non_blocking: Cell::new(creator != ElementCreator::ParserCreated), non_blocking: Cell::new(creator != ElementCreator::ParserCreated),
@ -79,9 +79,9 @@ impl HTMLScriptElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document, pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document,
creator: ElementCreator) -> Root<HTMLScriptElement> { creator: ElementCreator) -> Root<HTMLScriptElement> {
Node::reflect_node(box HTMLScriptElement::new_inherited(localName, prefix, document, creator), Node::reflect_node(box HTMLScriptElement::new_inherited(local_name, prefix, document, creator),
document, document,
HTMLScriptElementBinding::Wrap) HTMLScriptElementBinding::Wrap)
} }

View file

@ -34,21 +34,21 @@ pub struct HTMLSelectElement {
static DEFAULT_SELECT_SIZE: u32 = 0; static DEFAULT_SELECT_SIZE: u32 = 0;
impl HTMLSelectElement { impl HTMLSelectElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLSelectElement { document: &Document) -> HTMLSelectElement {
HTMLSelectElement { HTMLSelectElement {
htmlelement: htmlelement:
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE, HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
localName, prefix, document) local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLSelectElement> { document: &Document) -> Root<HTMLSelectElement> {
Node::reflect_node(box HTMLSelectElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLSelectElement::new_inherited(local_name, prefix, document),
document, document,
HTMLSelectElementBinding::Wrap) HTMLSelectElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLSourceElement {
} }
impl HTMLSourceElement { impl HTMLSourceElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLSourceElement { document: &Document) -> HTMLSourceElement {
HTMLSourceElement { HTMLSourceElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLSourceElement> { document: &Document) -> Root<HTMLSourceElement> {
Node::reflect_node(box HTMLSourceElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLSourceElement::new_inherited(local_name, prefix, document),
document, document,
HTMLSourceElementBinding::Wrap) HTMLSourceElementBinding::Wrap)
} }

View file

@ -16,17 +16,17 @@ pub struct HTMLSpanElement {
} }
impl HTMLSpanElement { impl HTMLSpanElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLSpanElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLSpanElement {
HTMLSpanElement { HTMLSpanElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLSpanElement> { document: &Document) -> Root<HTMLSpanElement> {
Node::reflect_node(box HTMLSpanElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLSpanElement::new_inherited(local_name, prefix, document),
document, document,
HTMLSpanElementBinding::Wrap) HTMLSpanElementBinding::Wrap)
} }

View file

@ -28,20 +28,20 @@ pub struct HTMLStyleElement {
} }
impl HTMLStyleElement { impl HTMLStyleElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLStyleElement { document: &Document) -> HTMLStyleElement {
HTMLStyleElement { HTMLStyleElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
stylesheet: DOMRefCell::new(None), stylesheet: DOMRefCell::new(None),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLStyleElement> { document: &Document) -> Root<HTMLStyleElement> {
Node::reflect_node(box HTMLStyleElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLStyleElement::new_inherited(local_name, prefix, document),
document, document,
HTMLStyleElementBinding::Wrap) HTMLStyleElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLTableCaptionElement {
} }
impl HTMLTableCaptionElement { impl HTMLTableCaptionElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLTableCaptionElement { document: &Document) -> HTMLTableCaptionElement {
HTMLTableCaptionElement { HTMLTableCaptionElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTableCaptionElement> { document: &Document) -> Root<HTMLTableCaptionElement> {
Node::reflect_node(box HTMLTableCaptionElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTableCaptionElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTableCaptionElementBinding::Wrap) HTMLTableCaptionElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLTableColElement {
} }
impl HTMLTableColElement { impl HTMLTableColElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLTableColElement { document: &Document) -> HTMLTableColElement {
HTMLTableColElement { HTMLTableColElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTableColElement> { document: &Document) -> Root<HTMLTableColElement> {
Node::reflect_node(box HTMLTableColElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTableColElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTableColElementBinding::Wrap) HTMLTableColElementBinding::Wrap)
} }

View file

@ -16,19 +16,19 @@ pub struct HTMLTableDataCellElement {
} }
impl HTMLTableDataCellElement { impl HTMLTableDataCellElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLTableDataCellElement { document: &Document) -> HTMLTableDataCellElement {
HTMLTableDataCellElement { HTMLTableDataCellElement {
htmltablecellelement: htmltablecellelement:
HTMLTableCellElement::new_inherited(localName, prefix, document) HTMLTableCellElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document) pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document)
-> Root<HTMLTableDataCellElement> { -> Root<HTMLTableDataCellElement> {
Node::reflect_node(box HTMLTableDataCellElement::new_inherited(localName, Node::reflect_node(box HTMLTableDataCellElement::new_inherited(local_name,
prefix, prefix,
document), document),
document, document,

View file

@ -49,10 +49,10 @@ impl CollectionFilter for TableRowFilter {
} }
impl HTMLTableElement { impl HTMLTableElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document)
-> HTMLTableElement { -> HTMLTableElement {
HTMLTableElement { HTMLTableElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
border: Cell::new(None), border: Cell::new(None),
cellspacing: Cell::new(None), cellspacing: Cell::new(None),
tbodies: Default::default(), tbodies: Default::default(),
@ -60,9 +60,9 @@ impl HTMLTableElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document) pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document)
-> Root<HTMLTableElement> { -> Root<HTMLTableElement> {
Node::reflect_node(box HTMLTableElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTableElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTableElementBinding::Wrap) HTMLTableElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLTableHeaderCellElement {
} }
impl HTMLTableHeaderCellElement { impl HTMLTableHeaderCellElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLTableHeaderCellElement { document: &Document) -> HTMLTableHeaderCellElement {
HTMLTableHeaderCellElement { HTMLTableHeaderCellElement {
htmltablecellelement: htmltablecellelement:
HTMLTableCellElement::new_inherited(localName, prefix, document) HTMLTableCellElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTableHeaderCellElement> { document: &Document) -> Root<HTMLTableHeaderCellElement> {
Node::reflect_node(box HTMLTableHeaderCellElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTableHeaderCellElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTableHeaderCellElementBinding::Wrap) HTMLTableHeaderCellElementBinding::Wrap)
} }

View file

@ -40,18 +40,18 @@ pub struct HTMLTableRowElement {
} }
impl HTMLTableRowElement { impl HTMLTableRowElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document)
-> HTMLTableRowElement { -> HTMLTableRowElement {
HTMLTableRowElement { HTMLTableRowElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
cells: Default::default(), cells: Default::default(),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document) pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document)
-> Root<HTMLTableRowElement> { -> Root<HTMLTableRowElement> {
Node::reflect_node(box HTMLTableRowElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTableRowElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTableRowElementBinding::Wrap) HTMLTableRowElementBinding::Wrap)
} }

View file

@ -25,17 +25,17 @@ pub struct HTMLTableSectionElement {
} }
impl HTMLTableSectionElement { impl HTMLTableSectionElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document)
-> HTMLTableSectionElement { -> HTMLTableSectionElement {
HTMLTableSectionElement { HTMLTableSectionElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document) pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document)
-> Root<HTMLTableSectionElement> { -> Root<HTMLTableSectionElement> {
Node::reflect_node(box HTMLTableSectionElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTableSectionElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTableSectionElementBinding::Wrap) HTMLTableSectionElementBinding::Wrap)
} }

View file

@ -25,21 +25,21 @@ pub struct HTMLTemplateElement {
} }
impl HTMLTemplateElement { impl HTMLTemplateElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLTemplateElement { document: &Document) -> HTMLTemplateElement {
HTMLTemplateElement { HTMLTemplateElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document), HTMLElement::new_inherited(local_name, prefix, document),
contents: MutNullableHeap::new(None), contents: MutNullableHeap::new(None),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTemplateElement> { document: &Document) -> Root<HTMLTemplateElement> {
Node::reflect_node(box HTMLTemplateElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTemplateElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTemplateElementBinding::Wrap) HTMLTemplateElementBinding::Wrap)
} }

View file

@ -96,14 +96,14 @@ static DEFAULT_COLS: u32 = 20;
static DEFAULT_ROWS: u32 = 2; static DEFAULT_ROWS: u32 = 2;
impl HTMLTextAreaElement { impl HTMLTextAreaElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLTextAreaElement { document: &Document) -> HTMLTextAreaElement {
let chan = document.window().constellation_chan().clone(); let chan = document.window().constellation_chan().clone();
HTMLTextAreaElement { HTMLTextAreaElement {
htmlelement: htmlelement:
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE | IN_READ_WRITE_STATE, HTMLElement::new_inherited_with_state(IN_ENABLED_STATE | IN_READ_WRITE_STATE,
localName, prefix, document), local_name, prefix, document),
textinput: DOMRefCell::new(TextInput::new( textinput: DOMRefCell::new(TextInput::new(
Lines::Multiple, DOMString::new(), chan, None, SelectionDirection::None)), Lines::Multiple, DOMString::new(), chan, None, SelectionDirection::None)),
value_changed: Cell::new(false), value_changed: Cell::new(false),
@ -111,10 +111,10 @@ impl HTMLTextAreaElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTextAreaElement> { document: &Document) -> Root<HTMLTextAreaElement> {
Node::reflect_node(box HTMLTextAreaElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTextAreaElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTextAreaElementBinding::Wrap) HTMLTextAreaElementBinding::Wrap)
} }

View file

@ -16,17 +16,17 @@ pub struct HTMLTimeElement {
} }
impl HTMLTimeElement { impl HTMLTimeElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTimeElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTimeElement {
HTMLTimeElement { HTMLTimeElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTimeElement> { document: &Document) -> Root<HTMLTimeElement> {
Node::reflect_node(box HTMLTimeElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTimeElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTimeElementBinding::Wrap) HTMLTimeElementBinding::Wrap)
} }

View file

@ -22,17 +22,17 @@ pub struct HTMLTitleElement {
} }
impl HTMLTitleElement { impl HTMLTitleElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTitleElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTitleElement {
HTMLTitleElement { HTMLTitleElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTitleElement> { document: &Document) -> Root<HTMLTitleElement> {
Node::reflect_node(box HTMLTitleElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTitleElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTitleElementBinding::Wrap) HTMLTitleElementBinding::Wrap)
} }

View file

@ -16,17 +16,17 @@ pub struct HTMLTrackElement {
} }
impl HTMLTrackElement { impl HTMLTrackElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTrackElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTrackElement {
HTMLTrackElement { HTMLTrackElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTrackElement> { document: &Document) -> Root<HTMLTrackElement> {
Node::reflect_node(box HTMLTrackElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTrackElement::new_inherited(local_name, prefix, document),
document, document,
HTMLTrackElementBinding::Wrap) HTMLTrackElementBinding::Wrap)
} }

View file

@ -16,17 +16,17 @@ pub struct HTMLUListElement {
} }
impl HTMLUListElement { impl HTMLUListElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLUListElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLUListElement {
HTMLUListElement { HTMLUListElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLUListElement> { document: &Document) -> Root<HTMLUListElement> {
Node::reflect_node(box HTMLUListElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLUListElement::new_inherited(local_name, prefix, document),
document, document,
HTMLUListElementBinding::Wrap) HTMLUListElementBinding::Wrap)
} }

View file

@ -16,20 +16,20 @@ pub struct HTMLUnknownElement {
} }
impl HTMLUnknownElement { impl HTMLUnknownElement {
fn new_inherited(localName: Atom, fn new_inherited(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLUnknownElement { document: &Document) -> HTMLUnknownElement {
HTMLUnknownElement { HTMLUnknownElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLUnknownElement> { document: &Document) -> Root<HTMLUnknownElement> {
Node::reflect_node(box HTMLUnknownElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLUnknownElement::new_inherited(local_name, prefix, document),
document, document,
HTMLUnknownElementBinding::Wrap) HTMLUnknownElementBinding::Wrap)
} }

View file

@ -16,18 +16,18 @@ pub struct HTMLVideoElement {
} }
impl HTMLVideoElement { impl HTMLVideoElement {
fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLVideoElement { fn new_inherited(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLVideoElement {
HTMLVideoElement { HTMLVideoElement {
htmlmediaelement: htmlmediaelement:
HTMLMediaElement::new_inherited(localName, prefix, document) HTMLMediaElement::new_inherited(local_name, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: Atom, pub fn new(local_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLVideoElement> { document: &Document) -> Root<HTMLVideoElement> {
Node::reflect_node(box HTMLVideoElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLVideoElement::new_inherited(local_name, prefix, document),
document, document,
HTMLVideoElementBinding::Wrap) HTMLVideoElementBinding::Wrap)
} }

View file

@ -68,7 +68,7 @@ impl KeyboardEvent {
pub fn new(window: &Window, pub fn new(window: &Window,
type_: DOMString, type_: DOMString,
canBubble: bool, can_bubble: bool,
cancelable: bool, cancelable: bool,
view: Option<&Window>, view: Option<&Window>,
_detail: i32, _detail: i32,
@ -78,26 +78,26 @@ impl KeyboardEvent {
code: DOMString, code: DOMString,
location: u32, location: u32,
repeat: bool, repeat: bool,
isComposing: bool, is_composing: bool,
ctrlKey: bool, ctrl_key: bool,
altKey: bool, alt_key: bool,
shiftKey: bool, shift_key: bool,
metaKey: bool, meta_key: bool,
char_code: Option<u32>, char_code: Option<u32>,
key_code: u32) -> Root<KeyboardEvent> { key_code: u32) -> Root<KeyboardEvent> {
let ev = KeyboardEvent::new_uninitialized(window); let ev = KeyboardEvent::new_uninitialized(window);
ev.InitKeyboardEvent(type_, canBubble, cancelable, view, key_string, location, ev.InitKeyboardEvent(type_, can_bubble, cancelable, view, key_string, location,
DOMString::new(), repeat, DOMString::new()); DOMString::new(), repeat, DOMString::new());
ev.key.set(key); ev.key.set(key);
*ev.code.borrow_mut() = code; *ev.code.borrow_mut() = code;
ev.ctrl.set(ctrlKey); ev.ctrl.set(ctrl_key);
ev.alt.set(altKey); ev.alt.set(alt_key);
ev.shift.set(shiftKey); ev.shift.set(shift_key);
ev.meta.set(metaKey); ev.meta.set(meta_key);
ev.char_code.set(char_code); ev.char_code.set(char_code);
ev.printable.set(ch); ev.printable.set(ch);
ev.key_code.set(key_code); ev.key_code.set(key_code);
ev.is_composing.set(isComposing); ev.is_composing.set(is_composing);
ev ev
} }
@ -759,13 +759,13 @@ impl KeyEventProperties {
impl KeyboardEventMethods for KeyboardEvent { impl KeyboardEventMethods for KeyboardEvent {
// https://w3c.github.io/uievents/#widl-KeyboardEvent-initKeyboardEvent // https://w3c.github.io/uievents/#widl-KeyboardEvent-initKeyboardEvent
fn InitKeyboardEvent(&self, fn InitKeyboardEvent(&self,
typeArg: DOMString, type_arg: DOMString,
canBubbleArg: bool, can_bubble_arg: bool,
cancelableArg: bool, cancelable_arg: bool,
viewArg: Option<&Window>, view_arg: Option<&Window>,
keyArg: DOMString, key_arg: DOMString,
locationArg: u32, location_arg: u32,
_modifiersListArg: DOMString, _modifiers_list_arg: DOMString,
repeat: bool, repeat: bool,
_locale: DOMString) { _locale: DOMString) {
if self.upcast::<Event>().dispatching() { if self.upcast::<Event>().dispatching() {
@ -773,9 +773,9 @@ impl KeyboardEventMethods for KeyboardEvent {
} }
self.upcast::<UIEvent>() self.upcast::<UIEvent>()
.InitUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, 0); .InitUIEvent(type_arg, can_bubble_arg, cancelable_arg, view_arg, 0);
*self.key_string.borrow_mut() = keyArg; *self.key_string.borrow_mut() = key_arg;
self.location.set(locationArg); self.location.set(location_arg);
self.repeat.set(repeat); self.repeat.set(repeat);
} }
@ -825,8 +825,8 @@ impl KeyboardEventMethods for KeyboardEvent {
} }
// https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate // https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate
fn GetModifierState(&self, keyArg: DOMString) -> bool { fn GetModifierState(&self, key_arg: DOMString) -> bool {
match &*keyArg { match &*key_arg {
"Ctrl" => self.CtrlKey(), "Ctrl" => self.CtrlKey(),
"Alt" => self.AltKey(), "Alt" => self.AltKey(),
"Shift" => self.ShiftKey(), "Shift" => self.ShiftKey(),

View file

@ -59,26 +59,26 @@ impl MouseEvent {
pub fn new(window: &Window, pub fn new(window: &Window,
type_: DOMString, type_: DOMString,
canBubble: EventBubbles, can_bubble: EventBubbles,
cancelable: EventCancelable, cancelable: EventCancelable,
view: Option<&Window>, view: Option<&Window>,
detail: i32, detail: i32,
screenX: i32, screen_x: i32,
screenY: i32, screen_y: i32,
clientX: i32, client_x: i32,
clientY: i32, client_y: i32,
ctrlKey: bool, ctrl_key: bool,
altKey: bool, alt_key: bool,
shiftKey: bool, shift_key: bool,
metaKey: bool, meta_key: bool,
button: i16, button: i16,
relatedTarget: Option<&EventTarget>) -> Root<MouseEvent> { related_target: Option<&EventTarget>) -> Root<MouseEvent> {
let ev = MouseEvent::new_uninitialized(window); let ev = MouseEvent::new_uninitialized(window);
ev.InitMouseEvent(type_, bool::from(canBubble), bool::from(cancelable), ev.InitMouseEvent(type_, bool::from(can_bubble), bool::from(cancelable),
view, detail, view, detail,
screenX, screenY, clientX, clientY, screen_x, screen_y, client_x, client_y,
ctrlKey, altKey, shiftKey, metaKey, ctrl_key, alt_key, shift_key, meta_key,
button, relatedTarget); button, related_target);
ev ev
} }
@ -166,37 +166,37 @@ impl MouseEventMethods for MouseEvent {
// https://w3c.github.io/uievents/#widl-MouseEvent-initMouseEvent // https://w3c.github.io/uievents/#widl-MouseEvent-initMouseEvent
fn InitMouseEvent(&self, fn InitMouseEvent(&self,
typeArg: DOMString, type_arg: DOMString,
canBubbleArg: bool, can_bubble_arg: bool,
cancelableArg: bool, cancelable_arg: bool,
viewArg: Option<&Window>, view_arg: Option<&Window>,
detailArg: i32, detail_arg: i32,
screenXArg: i32, screen_x_arg: i32,
screenYArg: i32, screen_y_arg: i32,
clientXArg: i32, client_x_arg: i32,
clientYArg: i32, client_y_arg: i32,
ctrlKeyArg: bool, ctrl_key_arg: bool,
altKeyArg: bool, alt_key_arg: bool,
shiftKeyArg: bool, shift_key_arg: bool,
metaKeyArg: bool, meta_key_arg: bool,
buttonArg: i16, button_arg: i16,
relatedTargetArg: Option<&EventTarget>) { related_target_arg: Option<&EventTarget>) {
if self.upcast::<Event>().dispatching() { if self.upcast::<Event>().dispatching() {
return; return;
} }
self.upcast::<UIEvent>() self.upcast::<UIEvent>()
.InitUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg); .InitUIEvent(type_arg, can_bubble_arg, cancelable_arg, view_arg, detail_arg);
self.screen_x.set(screenXArg); self.screen_x.set(screen_x_arg);
self.screen_y.set(screenYArg); self.screen_y.set(screen_y_arg);
self.client_x.set(clientXArg); self.client_x.set(client_x_arg);
self.client_y.set(clientYArg); self.client_y.set(client_y_arg);
self.ctrl_key.set(ctrlKeyArg); self.ctrl_key.set(ctrl_key_arg);
self.alt_key.set(altKeyArg); self.alt_key.set(alt_key_arg);
self.shift_key.set(shiftKeyArg); self.shift_key.set(shift_key_arg);
self.meta_key.set(metaKeyArg); self.meta_key.set(meta_key_arg);
self.button.set(buttonArg); self.button.set(button_arg);
self.related_target.set(relatedTargetArg); self.related_target.set(related_target_arg);
} }
// https://dom.spec.whatwg.org/#dom-event-istrusted // https://dom.spec.whatwg.org/#dom-event-istrusted

View file

@ -21,7 +21,7 @@ pub struct Navigator {
bluetooth: MutNullableHeap<JS<Bluetooth>>, bluetooth: MutNullableHeap<JS<Bluetooth>>,
plugins: MutNullableHeap<JS<PluginArray>>, plugins: MutNullableHeap<JS<PluginArray>>,
mime_types: MutNullableHeap<JS<MimeTypeArray>>, mime_types: MutNullableHeap<JS<MimeTypeArray>>,
serviceWorker: MutNullableHeap<JS<ServiceWorkerContainer>>, service_worker: MutNullableHeap<JS<ServiceWorkerContainer>>,
} }
impl Navigator { impl Navigator {
@ -31,7 +31,7 @@ impl Navigator {
bluetooth: Default::default(), bluetooth: Default::default(),
plugins: Default::default(), plugins: Default::default(),
mime_types: Default::default(), mime_types: Default::default(),
serviceWorker: Default::default(), service_worker: Default::default(),
} }
} }
@ -105,7 +105,7 @@ impl NavigatorMethods for Navigator {
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#navigator-service-worker-attribute // https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#navigator-service-worker-attribute
fn ServiceWorker(&self) -> Root<ServiceWorkerContainer> { fn ServiceWorker(&self) -> Root<ServiceWorkerContainer> {
self.serviceWorker.or_init(|| ServiceWorkerContainer::new(self.global().r())) self.service_worker.or_init(|| ServiceWorkerContainer::new(self.global().r()))
} }
// https://html.spec.whatwg.org/multipage/#dom-navigator-cookieenabled // https://html.spec.whatwg.org/multipage/#dom-navigator-cookieenabled

View file

@ -796,10 +796,10 @@ impl Node {
} }
pub fn summarize(&self) -> NodeInfo { pub fn summarize(&self) -> NodeInfo {
let USVString(baseURI) = self.BaseURI(); let USVString(base_uri) = self.BaseURI();
NodeInfo { NodeInfo {
uniqueId: self.unique_id(), uniqueId: self.unique_id(),
baseURI: baseURI, baseURI: base_uri,
parent: self.GetParentNode().map_or("".to_owned(), |node| node.unique_id()), parent: self.GetParentNode().map_or("".to_owned(), |node| node.unique_id()),
nodeType: self.NodeType(), nodeType: self.NodeType(),
namespaceURI: String::new(), //FIXME namespaceURI: String::new(), //FIXME
@ -2296,8 +2296,8 @@ impl NodeMethods for Node {
} }
// https://dom.spec.whatwg.org/#dom-node-issamenode // https://dom.spec.whatwg.org/#dom-node-issamenode
fn IsSameNode(&self, otherNode: Option<&Node>) -> bool { fn IsSameNode(&self, other_node: Option<&Node>) -> bool {
match otherNode { match other_node {
Some(node) => self == node, Some(node) => self == node,
None => false, None => false,
} }

View file

@ -51,8 +51,8 @@ impl PerformanceMethods for Performance {
// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime/Overview.html#dom-performance-now // https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime/Overview.html#dom-performance-now
fn Now(&self) -> DOMHighResTimeStamp { fn Now(&self) -> DOMHighResTimeStamp {
let navStart = self.timing.NavigationStartPrecise(); let nav_start = self.timing.navigation_start_precise();
let now = (time::precise_time_ns() as f64 - navStart) / 1000000 as f64; let now = (time::precise_time_ns() as f64 - nav_start) / 1000000 as f64;
Finite::wrap(now) Finite::wrap(now)
} }
} }

View file

@ -14,20 +14,20 @@ use dom::window::Window;
#[dom_struct] #[dom_struct]
pub struct PerformanceTiming { pub struct PerformanceTiming {
reflector_: Reflector, reflector_: Reflector,
navigationStart: u64, navigation_start: u64,
navigationStartPrecise: f64, navigation_start_precise: f64,
document: JS<Document>, document: JS<Document>,
} }
impl PerformanceTiming { impl PerformanceTiming {
fn new_inherited(navStart: u64, fn new_inherited(nav_start: u64,
navStartPrecise: f64, nav_start_precise: f64,
document: &Document) document: &Document)
-> PerformanceTiming { -> PerformanceTiming {
PerformanceTiming { PerformanceTiming {
reflector_: Reflector::new(), reflector_: Reflector::new(),
navigationStart: navStart, navigation_start: nav_start,
navigationStartPrecise: navStartPrecise, navigation_start_precise: nav_start_precise,
document: JS::from_ref(document), document: JS::from_ref(document),
} }
} }
@ -48,7 +48,7 @@ impl PerformanceTiming {
impl PerformanceTimingMethods for PerformanceTiming { impl PerformanceTimingMethods for PerformanceTiming {
// https://w3c.github.io/navigation-timing/#widl-PerformanceTiming-navigationStart // https://w3c.github.io/navigation-timing/#widl-PerformanceTiming-navigationStart
fn NavigationStart(&self) -> u64 { fn NavigationStart(&self) -> u64 {
self.navigationStart self.navigation_start
} }
// https://w3c.github.io/navigation-timing/#widl-PerformanceTiming-domLoading // https://w3c.github.io/navigation-timing/#widl-PerformanceTiming-domLoading
@ -89,7 +89,7 @@ impl PerformanceTimingMethods for PerformanceTiming {
impl PerformanceTiming { impl PerformanceTiming {
pub fn NavigationStartPrecise(&self) -> f64 { pub fn navigation_start_precise(&self) -> f64 {
self.navigationStartPrecise self.navigation_start_precise
} }
} }

View file

@ -20,26 +20,26 @@ use string_cache::Atom;
pub struct StorageEvent { pub struct StorageEvent {
event: Event, event: Event,
key: Option<DOMString>, key: Option<DOMString>,
oldValue: Option<DOMString>, old_value: Option<DOMString>,
newValue: Option<DOMString>, new_value: Option<DOMString>,
url: DOMString, url: DOMString,
storageArea: MutNullableHeap<JS<Storage>> storage_area: MutNullableHeap<JS<Storage>>
} }
impl StorageEvent { impl StorageEvent {
pub fn new_inherited(key: Option<DOMString>, pub fn new_inherited(key: Option<DOMString>,
oldValue: Option<DOMString>, old_value: Option<DOMString>,
newValue: Option<DOMString>, new_value: Option<DOMString>,
url: DOMString, url: DOMString,
storageArea: Option<&Storage>) -> StorageEvent { storage_area: Option<&Storage>) -> StorageEvent {
StorageEvent { StorageEvent {
event: Event::new_inherited(), event: Event::new_inherited(),
key: key, key: key,
oldValue: oldValue, old_value: old_value,
newValue: newValue, new_value: new_value,
url: url, url: url,
storageArea: MutNullableHeap::new(storageArea) storage_area: MutNullableHeap::new(storage_area)
} }
} }
@ -96,12 +96,12 @@ impl StorageEventMethods for StorageEvent {
// https://html.spec.whatwg.org/multipage/#dom-storageevent-oldvalue // https://html.spec.whatwg.org/multipage/#dom-storageevent-oldvalue
fn GetOldValue(&self) -> Option<DOMString> { fn GetOldValue(&self) -> Option<DOMString> {
self.oldValue.clone() self.old_value.clone()
} }
// https://html.spec.whatwg.org/multipage/#dom-storageevent-newvalue // https://html.spec.whatwg.org/multipage/#dom-storageevent-newvalue
fn GetNewValue(&self) -> Option<DOMString> { fn GetNewValue(&self) -> Option<DOMString> {
self.newValue.clone() self.new_value.clone()
} }
// https://html.spec.whatwg.org/multipage/#dom-storageevent-url // https://html.spec.whatwg.org/multipage/#dom-storageevent-url
@ -111,7 +111,7 @@ impl StorageEventMethods for StorageEvent {
// https://html.spec.whatwg.org/multipage/#dom-storageevent-storagearea // https://html.spec.whatwg.org/multipage/#dom-storageevent-storagearea
fn GetStorageArea(&self) -> Option<Root<Storage>> { fn GetStorageArea(&self) -> Option<Root<Storage>> {
self.storageArea.get() self.storage_area.get()
} }
// https://dom.spec.whatwg.org/#dom-event-istrusted // https://dom.spec.whatwg.org/#dom-event-istrusted

View file

@ -55,26 +55,26 @@ impl TouchEvent {
pub fn new(window: &Window, pub fn new(window: &Window,
type_: DOMString, type_: DOMString,
canBubble: EventBubbles, can_bubble: EventBubbles,
cancelable: EventCancelable, cancelable: EventCancelable,
view: Option<&Window>, view: Option<&Window>,
detail: i32, detail: i32,
touches: &TouchList, touches: &TouchList,
changed_touches: &TouchList, changed_touches: &TouchList,
target_touches: &TouchList, target_touches: &TouchList,
ctrlKey: bool, ctrl_key: bool,
altKey: bool, alt_key: bool,
shiftKey: bool, shift_key: bool,
metaKey: bool) -> Root<TouchEvent> { meta_key: bool) -> Root<TouchEvent> {
let ev = TouchEvent::new_uninitialized(window, touches, changed_touches, target_touches); let ev = TouchEvent::new_uninitialized(window, touches, changed_touches, target_touches);
ev.upcast::<UIEvent>().InitUIEvent(type_, ev.upcast::<UIEvent>().InitUIEvent(type_,
bool::from(canBubble), bool::from(can_bubble),
bool::from(cancelable), bool::from(cancelable),
view, detail); view, detail);
ev.ctrl_key.set(ctrlKey); ev.ctrl_key.set(ctrl_key);
ev.alt_key.set(altKey); ev.alt_key.set(alt_key);
ev.shift_key.set(shiftKey); ev.shift_key.set(shift_key);
ev.meta_key.set(metaKey); ev.meta_key.set(meta_key);
ev ev
} }
} }

View file

@ -10,7 +10,7 @@ use url::{Url, quirks};
pub struct UrlHelper; pub struct UrlHelper;
impl UrlHelper { impl UrlHelper {
pub fn SameOrigin(urlA: &Url, urlB: &Url) -> bool { urlA.origin() == urlB.origin() } pub fn SameOrigin(url_a: &Url, url_b: &Url) -> bool { url_a.origin() == url_b.origin() }
pub fn Origin(url: &Url) -> USVString { USVString(quirks::origin(url)) } pub fn Origin(url: &Url) -> USVString { USVString(quirks::origin(url)) }
pub fn Href(url: &Url) -> USVString { USVString(quirks::href(url).to_owned()) } pub fn Href(url: &Url) -> USVString { USVString(quirks::href(url).to_owned()) }
pub fn Hash(url: &Url) -> USVString { USVString(quirks::hash(url).to_owned()) } pub fn Hash(url: &Url) -> USVString { USVString(quirks::hash(url).to_owned()) }

View file

@ -370,11 +370,11 @@ unsafe extern "C" fn gc_slice_callback(_rt: *mut JSRuntime, progress: GCProgress
}; };
if !desc.is_null() { if !desc.is_null() {
let desc: &GCDescription = &*desc; let desc: &GCDescription = &*desc;
let invocationKind = match desc.invocationKind_ { let invocation_kind = match desc.invocationKind_ {
JSGCInvocationKind::GC_NORMAL => "GC_NORMAL", JSGCInvocationKind::GC_NORMAL => "GC_NORMAL",
JSGCInvocationKind::GC_SHRINK => "GC_SHRINK", JSGCInvocationKind::GC_SHRINK => "GC_SHRINK",
}; };
println!(" isCompartment={}, invocationKind={}", desc.isCompartment_, invocationKind); println!(" isCompartment={}, invocation_kind={}", desc.isCompartment_, invocation_kind);
} }
let _ = stdout().flush(); let _ = stdout().flush();
} }