mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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:
commit
5457b80233
90 changed files with 485 additions and 485 deletions
|
@ -31,7 +31,7 @@ pub trait Activatable {
|
|||
fn activation_behavior(&self, event: &Event, target: &EventTarget);
|
||||
|
||||
// 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
|
||||
fn enter_formal_activation_state(&self) {
|
||||
|
@ -62,10 +62,10 @@ pub enum ActivationSource {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#run-synthetic-click-activation-steps
|
||||
pub fn synthetic_click_activation(element: &Element,
|
||||
ctrlKey: bool,
|
||||
shiftKey: bool,
|
||||
altKey: bool,
|
||||
metaKey: bool,
|
||||
ctrl_key: bool,
|
||||
shift_key: bool,
|
||||
alt_key: bool,
|
||||
meta_key: bool,
|
||||
source: ActivationSource) {
|
||||
// Step 1
|
||||
if element.click_in_progress() {
|
||||
|
@ -93,10 +93,10 @@ pub fn synthetic_click_activation(element: &Element,
|
|||
0,
|
||||
0,
|
||||
0,
|
||||
ctrlKey,
|
||||
shiftKey,
|
||||
altKey,
|
||||
metaKey,
|
||||
ctrl_key,
|
||||
shift_key,
|
||||
alt_key,
|
||||
meta_key,
|
||||
0,
|
||||
None);
|
||||
let event = mouse.upcast::<Event>();
|
||||
|
|
|
@ -73,8 +73,8 @@ pub struct Blob {
|
|||
#[ignore_heap_size_of = "No clear owner"]
|
||||
blob_impl: DOMRefCell<BlobImpl>,
|
||||
/// content-type string
|
||||
typeString: String,
|
||||
isClosed_: Cell<bool>,
|
||||
type_string: String,
|
||||
is_closed: Cell<bool>,
|
||||
}
|
||||
|
||||
impl Blob {
|
||||
|
@ -85,20 +85,20 @@ impl Blob {
|
|||
}
|
||||
|
||||
#[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 {
|
||||
reflector_: Reflector::new(),
|
||||
blob_impl: DOMRefCell::new(blob_impl),
|
||||
// NOTE: Guarding the format correctness here,
|
||||
// https://w3c.github.io/FileAPI/#dfn-type
|
||||
typeString: normalize_type_string(&typeString),
|
||||
isClosed_: Cell::new(false),
|
||||
type_string: normalize_type_string(&type_string),
|
||||
is_closed: Cell::new(false),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
fn new_sliced(parent: &Blob, rel_pos: RelativePos,
|
||||
relativeContentType: DOMString) -> Root<Blob> {
|
||||
relative_content_type: DOMString) -> Root<Blob> {
|
||||
let global = parent.global();
|
||||
let blob_impl = match *parent.blob_impl.borrow() {
|
||||
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
|
||||
|
@ -222,7 +222,7 @@ impl Blob {
|
|||
|
||||
let blob_buf = BlobBuf {
|
||||
filename: None,
|
||||
type_string: self.typeString.clone(),
|
||||
type_string: self.type_string.clone(),
|
||||
size: bytes.len() as u64,
|
||||
bytes: bytes.to_vec(),
|
||||
};
|
||||
|
@ -366,33 +366,33 @@ impl BlobMethods for Blob {
|
|||
|
||||
// https://w3c.github.io/FileAPI/#dfn-type
|
||||
fn Type(&self) -> DOMString {
|
||||
DOMString::from(self.typeString.clone())
|
||||
DOMString::from(self.type_string.clone())
|
||||
}
|
||||
|
||||
// https://w3c.github.io/FileAPI/#slice-method-algo
|
||||
fn Slice(&self,
|
||||
start: Option<i64>,
|
||||
end: Option<i64>,
|
||||
contentType: Option<DOMString>)
|
||||
content_type: Option<DOMString>)
|
||||
-> Root<Blob> {
|
||||
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
|
||||
fn IsClosed(&self) -> bool {
|
||||
self.isClosed_.get()
|
||||
self.is_closed.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/FileAPI/#dfn-close
|
||||
fn Close(&self) {
|
||||
// Step 1
|
||||
if self.isClosed_.get() {
|
||||
if self.is_closed.get() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Step 2
|
||||
self.isClosed_.set(true);
|
||||
self.is_closed.set(true);
|
||||
|
||||
// Step 3
|
||||
self.clean_up_file_resource();
|
||||
|
|
|
@ -13,19 +13,19 @@ use dom::bindings::reflector::{Reflector, reflect_dom_object};
|
|||
pub struct BluetoothAdvertisingData {
|
||||
reflector_: Reflector,
|
||||
appearance: Option<u16>,
|
||||
txPower: Option<i8>,
|
||||
tx_power: Option<i8>,
|
||||
rssi: Option<i8>,
|
||||
}
|
||||
|
||||
impl BluetoothAdvertisingData {
|
||||
pub fn new_inherited(appearance: Option<u16>,
|
||||
txPower: Option<i8>,
|
||||
tx_power: Option<i8>,
|
||||
rssi: Option<i8>)
|
||||
-> BluetoothAdvertisingData {
|
||||
BluetoothAdvertisingData {
|
||||
reflector_: Reflector::new(),
|
||||
appearance: appearance,
|
||||
txPower: txPower,
|
||||
tx_power: tx_power,
|
||||
rssi: rssi,
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ impl BluetoothAdvertisingDataMethods for BluetoothAdvertisingData {
|
|||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothadvertisingdata-txpower
|
||||
fn GetTxPower(&self) -> Option<i8> {
|
||||
self.txPower
|
||||
self.tx_power
|
||||
}
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothadvertisingdata-rssi
|
||||
|
|
|
@ -15,37 +15,37 @@ pub struct BluetoothCharacteristicProperties {
|
|||
reflector_: Reflector,
|
||||
broadcast: bool,
|
||||
read: bool,
|
||||
writeWithoutResponse: bool,
|
||||
write_without_response: bool,
|
||||
write: bool,
|
||||
notify: bool,
|
||||
indicate: bool,
|
||||
authenticatedSignedWrites: bool,
|
||||
reliableWrite: bool,
|
||||
writableAuxiliaries: bool,
|
||||
authenticated_signed_writes: bool,
|
||||
reliable_write: bool,
|
||||
writable_auxiliaries: bool,
|
||||
}
|
||||
|
||||
impl BluetoothCharacteristicProperties {
|
||||
pub fn new_inherited(broadcast: bool,
|
||||
read: bool,
|
||||
writeWithoutResponse: bool,
|
||||
write_without_response: bool,
|
||||
write: bool,
|
||||
notify: bool,
|
||||
indicate: bool,
|
||||
authenticatedSignedWrites: bool,
|
||||
reliableWrite: bool,
|
||||
writableAuxiliaries: bool)
|
||||
authenticated_signed_writes: bool,
|
||||
reliable_write: bool,
|
||||
writable_auxiliaries: bool)
|
||||
-> BluetoothCharacteristicProperties {
|
||||
BluetoothCharacteristicProperties {
|
||||
reflector_: Reflector::new(),
|
||||
broadcast: broadcast,
|
||||
read: read,
|
||||
writeWithoutResponse: writeWithoutResponse,
|
||||
write_without_response: write_without_response,
|
||||
write: write,
|
||||
notify: notify,
|
||||
indicate: indicate,
|
||||
authenticatedSignedWrites: authenticatedSignedWrites,
|
||||
reliableWrite: reliableWrite,
|
||||
writableAuxiliaries: writableAuxiliaries,
|
||||
authenticated_signed_writes: authenticated_signed_writes,
|
||||
reliable_write: reliable_write,
|
||||
writable_auxiliaries: writable_auxiliaries,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ impl BluetoothCharacteristicPropertiesMethods for BluetoothCharacteristicPropert
|
|||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-writewithoutresponse
|
||||
fn WriteWithoutResponse(&self) -> bool {
|
||||
self.writeWithoutResponse
|
||||
self.write_without_response
|
||||
}
|
||||
|
||||
// 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
|
||||
fn AuthenticatedSignedWrites(&self) -> bool {
|
||||
self.authenticatedSignedWrites
|
||||
self.authenticated_signed_writes
|
||||
}
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-reliablewrite
|
||||
fn ReliableWrite(&self) -> bool {
|
||||
self.reliableWrite
|
||||
self.reliable_write
|
||||
}
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-writableauxiliaries
|
||||
fn WritableAuxiliaries(&self) -> bool {
|
||||
self.writableAuxiliaries
|
||||
self.writable_auxiliaries
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,20 +17,20 @@ pub struct BluetoothDevice {
|
|||
reflector_: Reflector,
|
||||
id: DOMString,
|
||||
name: Option<DOMString>,
|
||||
adData: MutHeap<JS<BluetoothAdvertisingData>>,
|
||||
ad_data: MutHeap<JS<BluetoothAdvertisingData>>,
|
||||
gatt: MutNullableHeap<JS<BluetoothRemoteGATTServer>>,
|
||||
}
|
||||
|
||||
impl BluetoothDevice {
|
||||
pub fn new_inherited(id: DOMString,
|
||||
name: Option<DOMString>,
|
||||
adData: &BluetoothAdvertisingData)
|
||||
ad_data: &BluetoothAdvertisingData)
|
||||
-> BluetoothDevice {
|
||||
BluetoothDevice {
|
||||
reflector_: Reflector::new(),
|
||||
id: id,
|
||||
name: name,
|
||||
adData: MutHeap::new(adData),
|
||||
ad_data: MutHeap::new(ad_data),
|
||||
gatt: Default::default(),
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ impl BluetoothDeviceMethods for BluetoothDevice {
|
|||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-addata
|
||||
fn AdData(&self) -> Root<BluetoothAdvertisingData> {
|
||||
self.adData.get()
|
||||
self.ad_data.get()
|
||||
}
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-gatt
|
||||
|
|
|
@ -37,14 +37,14 @@ pub struct BluetoothRemoteGATTCharacteristic {
|
|||
uuid: DOMString,
|
||||
properties: MutHeap<JS<BluetoothCharacteristicProperties>>,
|
||||
value: DOMRefCell<Option<ByteString>>,
|
||||
instanceID: String,
|
||||
instance_id: String,
|
||||
}
|
||||
|
||||
impl BluetoothRemoteGATTCharacteristic {
|
||||
pub fn new_inherited(service: &BluetoothRemoteGATTService,
|
||||
uuid: DOMString,
|
||||
properties: &BluetoothCharacteristicProperties,
|
||||
instanceID: String)
|
||||
instance_id: String)
|
||||
-> BluetoothRemoteGATTCharacteristic {
|
||||
BluetoothRemoteGATTCharacteristic {
|
||||
reflector_: Reflector::new(),
|
||||
|
@ -52,7 +52,7 @@ impl BluetoothRemoteGATTCharacteristic {
|
|||
uuid: uuid,
|
||||
properties: MutHeap::new(properties),
|
||||
value: DOMRefCell::new(None),
|
||||
instanceID: instanceID,
|
||||
instance_id: instance_id,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ impl BluetoothRemoteGATTCharacteristic {
|
|||
}
|
||||
|
||||
fn get_instance_id(&self) -> String {
|
||||
self.instanceID.clone()
|
||||
self.instance_id.clone()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,20 +28,20 @@ pub struct BluetoothRemoteGATTDescriptor {
|
|||
characteristic: MutHeap<JS<BluetoothRemoteGATTCharacteristic>>,
|
||||
uuid: DOMString,
|
||||
value: DOMRefCell<Option<ByteString>>,
|
||||
instanceID: String,
|
||||
instance_id: String,
|
||||
}
|
||||
|
||||
impl BluetoothRemoteGATTDescriptor {
|
||||
pub fn new_inherited(characteristic: &BluetoothRemoteGATTCharacteristic,
|
||||
uuid: DOMString,
|
||||
instanceID: String)
|
||||
instance_id: String)
|
||||
-> BluetoothRemoteGATTDescriptor {
|
||||
BluetoothRemoteGATTDescriptor {
|
||||
reflector_: Reflector::new(),
|
||||
characteristic: MutHeap::new(characteristic),
|
||||
uuid: uuid,
|
||||
value: DOMRefCell::new(None),
|
||||
instanceID: instanceID,
|
||||
instance_id: instance_id,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ impl BluetoothRemoteGATTDescriptor {
|
|||
}
|
||||
|
||||
fn get_instance_id(&self) -> String {
|
||||
self.instanceID.clone()
|
||||
self.instance_id.clone()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,22 +24,22 @@ pub struct BluetoothRemoteGATTService {
|
|||
reflector_: Reflector,
|
||||
device: MutHeap<JS<BluetoothDevice>>,
|
||||
uuid: DOMString,
|
||||
isPrimary: bool,
|
||||
instanceID: String,
|
||||
is_primary: bool,
|
||||
instance_id: String,
|
||||
}
|
||||
|
||||
impl BluetoothRemoteGATTService {
|
||||
pub fn new_inherited(device: &BluetoothDevice,
|
||||
uuid: DOMString,
|
||||
isPrimary: bool,
|
||||
instanceID: String)
|
||||
is_primary: bool,
|
||||
instance_id: String)
|
||||
-> BluetoothRemoteGATTService {
|
||||
BluetoothRemoteGATTService {
|
||||
reflector_: Reflector::new(),
|
||||
device: MutHeap::new(device),
|
||||
uuid: uuid,
|
||||
isPrimary: isPrimary,
|
||||
instanceID: instanceID,
|
||||
is_primary: is_primary,
|
||||
instance_id: instance_id,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ impl BluetoothRemoteGATTService {
|
|||
}
|
||||
|
||||
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
|
||||
fn IsPrimary(&self) -> bool {
|
||||
self.isPrimary
|
||||
self.is_primary
|
||||
}
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-uuid
|
||||
|
|
|
@ -1096,16 +1096,16 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
|
|||
imagedata: &ImageData,
|
||||
dx: Finite<f64>,
|
||||
dy: Finite<f64>,
|
||||
dirtyX: Finite<f64>,
|
||||
dirtyY: Finite<f64>,
|
||||
dirtyWidth: Finite<f64>,
|
||||
dirtyHeight: Finite<f64>) {
|
||||
dirty_x: Finite<f64>,
|
||||
dirty_y: Finite<f64>,
|
||||
dirty_width: Finite<f64>,
|
||||
dirty_height: Finite<f64>) {
|
||||
let data = imagedata.get_data_array();
|
||||
let offset = Point2D::new(*dx, *dy);
|
||||
let image_data_size = Size2D::new(imagedata.Width() as f64, imagedata.Height() as f64);
|
||||
|
||||
let dirty_rect = Rect::new(Point2D::new(*dirtyX, *dirtyY),
|
||||
Size2D::new(*dirtyWidth, *dirtyHeight));
|
||||
let dirty_rect = Rect::new(Point2D::new(*dirty_x, *dirty_y),
|
||||
Size2D::new(*dirty_width, *dirty_height));
|
||||
let msg = CanvasMsg::Canvas2d(Canvas2dMsg::PutImageData(data,
|
||||
offset,
|
||||
image_data_size,
|
||||
|
|
|
@ -17,16 +17,16 @@ use string_cache::Atom;
|
|||
#[dom_struct]
|
||||
pub struct CloseEvent {
|
||||
event: Event,
|
||||
wasClean: bool,
|
||||
was_clean: bool,
|
||||
code: u16,
|
||||
reason: DOMString,
|
||||
}
|
||||
|
||||
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 {
|
||||
event: Event::new_inherited(),
|
||||
wasClean: wasClean,
|
||||
was_clean: was_clean,
|
||||
code: code,
|
||||
reason: reason,
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ impl CloseEvent {
|
|||
impl CloseEventMethods for CloseEvent {
|
||||
// https://html.spec.whatwg.org/multipage/#dom-closeevent-wasclean
|
||||
fn WasClean(&self) -> bool {
|
||||
self.wasClean
|
||||
self.was_clean
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-closeevent-code
|
||||
|
|
|
@ -101,11 +101,11 @@ fn timestamp_in_ms(time: Timespec) -> 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
|
||||
ConsoleMessage {
|
||||
message: String::from(message),
|
||||
logLevel: logLevel,
|
||||
logLevel: log_level,
|
||||
filename: "test".to_owned(),
|
||||
lineNumber: 1,
|
||||
columnNumber: 1,
|
||||
|
|
|
@ -733,13 +733,13 @@ impl Document {
|
|||
// https://w3c.github.io/uievents/#event-type-click
|
||||
let client_x = client_point.x as i32;
|
||||
let client_y = client_point.y as i32;
|
||||
let clickCount = 1;
|
||||
let click_count = 1;
|
||||
let event = MouseEvent::new(&self.window,
|
||||
DOMString::from(mouse_event_type_string),
|
||||
EventBubbles::Bubbles,
|
||||
EventCancelable::Cancelable,
|
||||
Some(&self.window),
|
||||
clickCount,
|
||||
click_count,
|
||||
client_x,
|
||||
client_y,
|
||||
client_x,
|
||||
|
@ -804,7 +804,7 @@ impl Document {
|
|||
if now.duration_since(last_time) < DBL_CLICK_TIMEOUT &&
|
||||
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.
|
||||
let clickCount = 2;
|
||||
let click_count = 2;
|
||||
let client_x = click_pos.x as i32;
|
||||
let client_y = click_pos.y as i32;
|
||||
|
||||
|
@ -813,7 +813,7 @@ impl Document {
|
|||
EventBubbles::Bubbles,
|
||||
EventCancelable::Cancelable,
|
||||
Some(&self.window),
|
||||
clickCount,
|
||||
click_count,
|
||||
client_x,
|
||||
client_y,
|
||||
client_x,
|
||||
|
@ -1617,7 +1617,7 @@ impl Document {
|
|||
}
|
||||
|
||||
// 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 {
|
||||
FocusEventType::Focus => (DOMString::from("focus"), EventBubbles::DoesNotBubble),
|
||||
FocusEventType::Blur => (DOMString::from("blur"), EventBubbles::DoesNotBubble),
|
||||
|
@ -1628,7 +1628,7 @@ impl Document {
|
|||
EventCancelable::NotCancelable,
|
||||
Some(&self.window),
|
||||
0i32,
|
||||
relatedTarget);
|
||||
related_target);
|
||||
let event = event.upcast::<Event>();
|
||||
event.set_trusted(true);
|
||||
let target = node.upcast();
|
||||
|
@ -2380,10 +2380,10 @@ impl DocumentMethods for Document {
|
|||
// https://dom.spec.whatwg.org/#dom-document-createnodeiteratorroot-whattoshow-filter
|
||||
fn CreateNodeIterator(&self,
|
||||
root: &Node,
|
||||
whatToShow: u32,
|
||||
what_to_show: u32,
|
||||
filter: Option<Rc<NodeFilter>>)
|
||||
-> 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
|
||||
|
@ -2391,22 +2391,22 @@ impl DocumentMethods for Document {
|
|||
window: &Window,
|
||||
target: &EventTarget,
|
||||
identifier: i32,
|
||||
pageX: Finite<f64>,
|
||||
pageY: Finite<f64>,
|
||||
screenX: Finite<f64>,
|
||||
screenY: Finite<f64>)
|
||||
page_x: Finite<f64>,
|
||||
page_y: Finite<f64>,
|
||||
screen_x: Finite<f64>,
|
||||
screen_y: Finite<f64>)
|
||||
-> Root<Touch> {
|
||||
let clientX = Finite::wrap(*pageX - window.PageXOffset() as f64);
|
||||
let clientY = Finite::wrap(*pageY - window.PageYOffset() as f64);
|
||||
let client_x = Finite::wrap(*page_x - window.PageXOffset() as f64);
|
||||
let client_y = Finite::wrap(*page_y - window.PageYOffset() as f64);
|
||||
Touch::new(window,
|
||||
identifier,
|
||||
target,
|
||||
screenX,
|
||||
screenY,
|
||||
clientX,
|
||||
clientY,
|
||||
pageX,
|
||||
pageY)
|
||||
screen_x,
|
||||
screen_y,
|
||||
client_x,
|
||||
client_y,
|
||||
page_x,
|
||||
page_y)
|
||||
}
|
||||
|
||||
// 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
|
||||
fn CreateTreeWalker(&self,
|
||||
root: &Node,
|
||||
whatToShow: u32,
|
||||
what_to_show: u32,
|
||||
filter: Option<Rc<NodeFilter>>)
|
||||
-> Root<TreeWalker> {
|
||||
TreeWalker::new(self, root, whatToShow, filter)
|
||||
TreeWalker::new(self, root, what_to_show, filter)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#document.title
|
||||
|
|
|
@ -25,9 +25,9 @@ pub struct File {
|
|||
impl File {
|
||||
#[allow(unrooted_must_root)]
|
||||
fn new_inherited(blob_impl: BlobImpl, name: DOMString,
|
||||
modified: Option<i64>, typeString: &str) -> File {
|
||||
modified: Option<i64>, type_string: &str) -> File {
|
||||
File {
|
||||
blob: Blob::new_inherited(blob_impl, typeString.to_owned()),
|
||||
blob: Blob::new_inherited(blob_impl, type_string.to_owned()),
|
||||
name: name,
|
||||
// https://w3c.github.io/FileAPI/#dfn-lastModified
|
||||
modified: match modified {
|
||||
|
|
|
@ -39,22 +39,22 @@ pub struct HTMLAnchorElement {
|
|||
}
|
||||
|
||||
impl HTMLAnchorElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLAnchorElement {
|
||||
HTMLAnchorElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document),
|
||||
HTMLElement::new_inherited(local_name, prefix, document),
|
||||
rel_list: Default::default(),
|
||||
url: DOMRefCell::new(None),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLAnchorElementBinding::Wrap)
|
||||
}
|
||||
|
@ -540,7 +540,7 @@ impl Activatable for HTMLAnchorElement {
|
|||
}
|
||||
|
||||
//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) {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,20 +20,20 @@ pub struct HTMLAppletElement {
|
|||
}
|
||||
|
||||
impl HTMLAppletElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLAppletElement {
|
||||
HTMLAppletElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLAppletElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -23,18 +23,18 @@ pub struct 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 {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
rel_list: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLAreaElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLAudioElement {
|
|||
}
|
||||
|
||||
impl HTMLAudioElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLAudioElement {
|
||||
HTMLAudioElement {
|
||||
htmlmediaelement:
|
||||
HTMLMediaElement::new_inherited(localName, prefix, document)
|
||||
HTMLMediaElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLAudioElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -23,17 +23,17 @@ pub struct 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 {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLBaseElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -32,17 +32,17 @@ pub struct 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 {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
}
|
||||
}
|
||||
|
||||
#[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> {
|
||||
Node::reflect_node(box HTMLBodyElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLBodyElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLBodyElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,17 +16,17 @@ pub struct 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 {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLBRElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -43,22 +43,22 @@ pub struct HTMLButtonElement {
|
|||
}
|
||||
|
||||
impl HTMLButtonElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLButtonElement {
|
||||
HTMLButtonElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
|
||||
localName, prefix, document),
|
||||
local_name, prefix, document),
|
||||
button_type: Cell::new(ButtonType::Submit)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLButtonElementBinding::Wrap)
|
||||
}
|
||||
|
@ -283,7 +283,7 @@ impl Activatable for HTMLButtonElement {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#implicit-submission
|
||||
#[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 node = doc.upcast::<Node>();
|
||||
let owner = self.form_owner();
|
||||
|
@ -294,10 +294,10 @@ impl Activatable for HTMLButtonElement {
|
|||
.filter_map(Root::downcast::<HTMLButtonElement>)
|
||||
.find(|r| r.form_owner() == owner)
|
||||
.map(|s| synthetic_click_activation(s.r().as_element(),
|
||||
ctrlKey,
|
||||
shiftKey,
|
||||
altKey,
|
||||
metaKey,
|
||||
ctrl_key,
|
||||
shift_key,
|
||||
alt_key,
|
||||
meta_key,
|
||||
ActivationSource::NotFromClick));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,20 +56,20 @@ pub struct HTMLCanvasElement {
|
|||
}
|
||||
|
||||
impl HTMLCanvasElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLCanvasElement {
|
||||
HTMLCanvasElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
context: DOMRefCell::new(None),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLCanvasElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -17,19 +17,19 @@ pub struct HTMLDataElement {
|
|||
}
|
||||
|
||||
impl HTMLDataElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLDataElement {
|
||||
HTMLDataElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLDataElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -21,20 +21,20 @@ pub struct HTMLDataListElement {
|
|||
}
|
||||
|
||||
impl HTMLDataListElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLDataListElement {
|
||||
HTMLDataListElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLDataListElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -28,21 +28,21 @@ pub struct HTMLDetailsElement {
|
|||
}
|
||||
|
||||
impl HTMLDetailsElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLDetailsElement {
|
||||
HTMLDetailsElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document),
|
||||
HTMLElement::new_inherited(local_name, prefix, document),
|
||||
toggle_counter: Cell::new(0)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLDetailsElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -22,21 +22,21 @@ pub struct HTMLDialogElement {
|
|||
}
|
||||
|
||||
impl HTMLDialogElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLDialogElement {
|
||||
HTMLDialogElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document),
|
||||
HTMLElement::new_inherited(local_name, prefix, document),
|
||||
return_value: DOMRefCell::new(DOMString::new()),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLDialogElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLDirectoryElement {
|
|||
}
|
||||
|
||||
impl HTMLDirectoryElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLDirectoryElement {
|
||||
HTMLDirectoryElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLDirectoryElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,19 +16,19 @@ pub struct HTMLDivElement {
|
|||
}
|
||||
|
||||
impl HTMLDivElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLDivElement {
|
||||
HTMLDivElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLDivElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,18 +16,18 @@ pub struct 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 {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLDListElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -62,8 +62,8 @@ impl HTMLElement {
|
|||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document) -> Root<HTMLElement> {
|
||||
Node::reflect_node(box HTMLElement::new_inherited(localName, prefix, document),
|
||||
pub fn new(local_name: Atom, prefix: Option<DOMString>, document: &Document) -> Root<HTMLElement> {
|
||||
Node::reflect_node(box HTMLElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,17 +16,17 @@ pub struct 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 {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLEmbedElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -26,21 +26,21 @@ pub struct HTMLFieldSetElement {
|
|||
}
|
||||
|
||||
impl HTMLFieldSetElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLFieldSetElement {
|
||||
HTMLFieldSetElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
|
||||
localName, prefix, document)
|
||||
local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLFieldSetElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -25,17 +25,17 @@ pub struct 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 {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLFontElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -65,11 +65,11 @@ pub struct HTMLFormElement {
|
|||
}
|
||||
|
||||
impl HTMLFormElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLFormElement {
|
||||
HTMLFormElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
marked_for_reset: Cell::new(false),
|
||||
elements: Default::default(),
|
||||
generation_id: Cell::new(GenerationId(0))
|
||||
|
@ -77,10 +77,10 @@ impl HTMLFormElement {
|
|||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLFormElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,17 +16,17 @@ pub struct 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 {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLFrameElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -19,20 +19,20 @@ pub struct HTMLFrameSetElement {
|
|||
}
|
||||
|
||||
impl HTMLFrameSetElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLFrameSetElement {
|
||||
HTMLFrameSetElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLFrameSetElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -22,19 +22,19 @@ pub struct HTMLHeadElement {
|
|||
}
|
||||
|
||||
impl HTMLHeadElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLHeadElement {
|
||||
HTMLHeadElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLHeadElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -27,23 +27,23 @@ pub struct HTMLHeadingElement {
|
|||
}
|
||||
|
||||
impl HTMLHeadingElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document,
|
||||
level: HeadingLevel) -> HTMLHeadingElement {
|
||||
HTMLHeadingElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document),
|
||||
HTMLElement::new_inherited(local_name, prefix, document),
|
||||
level: level,
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document,
|
||||
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,
|
||||
HTMLHeadingElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -21,17 +21,17 @@ pub struct 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 {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLHRElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -173,11 +173,11 @@ impl HTMLIFrameElement {
|
|||
self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
|
||||
}
|
||||
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLIFrameElement {
|
||||
HTMLIFrameElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
pipeline_id: Cell::new(None),
|
||||
sandbox: Default::default(),
|
||||
sandbox_allowance: Cell::new(None),
|
||||
|
@ -187,10 +187,10 @@ impl HTMLIFrameElement {
|
|||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLIFrameElementBinding::Wrap)
|
||||
}
|
||||
|
@ -488,7 +488,7 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement {
|
|||
}
|
||||
|
||||
// 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.upcast::<Node>().is_in_doc() {
|
||||
self.navigate_or_reload_child_browsing_context(None);
|
||||
|
|
|
@ -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 {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
current_request: DOMRefCell::new(ImageRequest {
|
||||
state: State::Unavailable,
|
||||
parsed_url: None,
|
||||
|
@ -215,10 +215,10 @@ impl HTMLImageElement {
|
|||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLImageElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -125,12 +125,12 @@ static DEFAULT_INPUT_SIZE: u32 = 20;
|
|||
static DEFAULT_MAX_LENGTH: i32 = -1;
|
||||
|
||||
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();
|
||||
HTMLInputElement {
|
||||
htmlelement:
|
||||
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),
|
||||
placeholder: DOMRefCell::new(DOMString::new()),
|
||||
checked_changed: Cell::new(false),
|
||||
|
@ -145,10 +145,10 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLInputElementBinding::Wrap)
|
||||
}
|
||||
|
@ -1275,7 +1275,7 @@ impl Activatable for HTMLInputElement {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#implicit-submission
|
||||
#[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 node = doc.upcast::<Node>();
|
||||
let owner = self.form_owner();
|
||||
|
@ -1295,10 +1295,10 @@ impl Activatable for HTMLInputElement {
|
|||
Some(ref button) => {
|
||||
if button.is_instance_activatable() {
|
||||
synthetic_click_activation(button.as_element(),
|
||||
ctrlKey,
|
||||
shiftKey,
|
||||
altKey,
|
||||
metaKey,
|
||||
ctrl_key,
|
||||
shift_key,
|
||||
alt_key,
|
||||
meta_key,
|
||||
ActivationSource::NotFromClick)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,20 +25,20 @@ pub struct HTMLLabelElement {
|
|||
}
|
||||
|
||||
impl HTMLLabelElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLLabelElement {
|
||||
HTMLLabelElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLLabelElementBinding::Wrap)
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ impl Activatable for HTMLLabelElement {
|
|||
}
|
||||
|
||||
// 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
|
||||
// Issue filed at https://github.com/servo/servo/issues/8263
|
||||
}
|
||||
|
|
|
@ -23,19 +23,19 @@ pub struct HTMLLegendElement {
|
|||
}
|
||||
|
||||
impl HTMLLegendElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document)
|
||||
-> HTMLLegendElement {
|
||||
HTMLLegendElement { htmlelement: HTMLElement::new_inherited(localName, prefix, document) }
|
||||
HTMLLegendElement { htmlelement: HTMLElement::new_inherited(local_name, prefix, document) }
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document)
|
||||
-> Root<HTMLLegendElement> {
|
||||
Node::reflect_node(box HTMLLegendElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLLegendElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLLegendElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -20,17 +20,17 @@ pub struct 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 {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLLIElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -57,10 +57,10 @@ pub struct 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 {
|
||||
HTMLLinkElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
rel_list: Default::default(),
|
||||
parser_inserted: Cell::new(creator == ElementCreator::ParserCreated),
|
||||
stylesheet: DOMRefCell::new(None),
|
||||
|
@ -68,11 +68,11 @@ impl HTMLLinkElement {
|
|||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document,
|
||||
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,
|
||||
HTMLLinkElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,19 +16,19 @@ pub struct HTMLMapElement {
|
|||
}
|
||||
|
||||
impl HTMLMapElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLMapElement {
|
||||
HTMLMapElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLMapElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -31,20 +31,20 @@ pub struct HTMLMetaElement {
|
|||
}
|
||||
|
||||
impl HTMLMetaElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLMetaElement {
|
||||
HTMLMetaElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
stylesheet: DOMRefCell::new(None),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLMetaElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -18,19 +18,19 @@ pub struct HTMLMeterElement {
|
|||
}
|
||||
|
||||
impl HTMLMeterElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLMeterElement {
|
||||
HTMLMeterElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLMeterElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLModElement {
|
|||
}
|
||||
|
||||
impl HTMLModElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLModElement {
|
||||
HTMLModElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLModElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -28,21 +28,21 @@ pub struct HTMLObjectElement {
|
|||
}
|
||||
|
||||
impl HTMLObjectElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLObjectElement {
|
||||
HTMLObjectElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document),
|
||||
HTMLElement::new_inherited(local_name, prefix, document),
|
||||
image: DOMRefCell::new(None),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLObjectElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,19 +16,19 @@ pub struct HTMLOListElement {
|
|||
}
|
||||
|
||||
impl HTMLOListElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLOListElement {
|
||||
HTMLOListElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLOListElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -23,21 +23,21 @@ pub struct HTMLOptGroupElement {
|
|||
}
|
||||
|
||||
impl HTMLOptGroupElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLOptGroupElement {
|
||||
HTMLOptGroupElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
|
||||
localName, prefix, document)
|
||||
local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLOptGroupElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -39,23 +39,23 @@ pub struct HTMLOptionElement {
|
|||
}
|
||||
|
||||
impl HTMLOptionElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLOptionElement {
|
||||
HTMLOptionElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
|
||||
localName, prefix, document),
|
||||
local_name, prefix, document),
|
||||
selectedness: Cell::new(false),
|
||||
dirtiness: Cell::new(false),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLOptionElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -21,20 +21,20 @@ pub struct HTMLOutputElement {
|
|||
}
|
||||
|
||||
impl HTMLOutputElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLOutputElement {
|
||||
HTMLOutputElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLOutputElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLParagraphElement {
|
|||
}
|
||||
|
||||
impl HTMLParagraphElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLParagraphElement {
|
||||
HTMLParagraphElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLParagraphElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLParamElement {
|
|||
}
|
||||
|
||||
impl HTMLParamElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLParamElement {
|
||||
HTMLParamElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLParamElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLPreElement {
|
|||
}
|
||||
|
||||
impl HTMLPreElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLPreElement {
|
||||
HTMLPreElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLPreElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -18,20 +18,20 @@ pub struct HTMLProgressElement {
|
|||
}
|
||||
|
||||
impl HTMLProgressElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLProgressElement {
|
||||
HTMLProgressElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLProgressElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLQuoteElement {
|
|||
}
|
||||
|
||||
impl HTMLQuoteElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLQuoteElement {
|
||||
HTMLQuoteElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLQuoteElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -64,11 +64,11 @@ pub struct 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 {
|
||||
HTMLScriptElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document),
|
||||
HTMLElement::new_inherited(local_name, prefix, document),
|
||||
already_started: Cell::new(false),
|
||||
parser_inserted: Cell::new(creator == ElementCreator::ParserCreated),
|
||||
non_blocking: Cell::new(creator != ElementCreator::ParserCreated),
|
||||
|
@ -79,9 +79,9 @@ impl HTMLScriptElement {
|
|||
}
|
||||
|
||||
#[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> {
|
||||
Node::reflect_node(box HTMLScriptElement::new_inherited(localName, prefix, document, creator),
|
||||
Node::reflect_node(box HTMLScriptElement::new_inherited(local_name, prefix, document, creator),
|
||||
document,
|
||||
HTMLScriptElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -34,21 +34,21 @@ pub struct HTMLSelectElement {
|
|||
static DEFAULT_SELECT_SIZE: u32 = 0;
|
||||
|
||||
impl HTMLSelectElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLSelectElement {
|
||||
HTMLSelectElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
|
||||
localName, prefix, document)
|
||||
local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLSelectElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLSourceElement {
|
|||
}
|
||||
|
||||
impl HTMLSourceElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLSourceElement {
|
||||
HTMLSourceElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLSourceElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,17 +16,17 @@ pub struct 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 {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLSpanElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -28,20 +28,20 @@ pub struct HTMLStyleElement {
|
|||
}
|
||||
|
||||
impl HTMLStyleElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLStyleElement {
|
||||
HTMLStyleElement {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
stylesheet: DOMRefCell::new(None),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLStyleElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLTableCaptionElement {
|
|||
}
|
||||
|
||||
impl HTMLTableCaptionElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLTableCaptionElement {
|
||||
HTMLTableCaptionElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLTableCaptionElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLTableColElement {
|
|||
}
|
||||
|
||||
impl HTMLTableColElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLTableColElement {
|
||||
HTMLTableColElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLTableColElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,19 +16,19 @@ pub struct HTMLTableDataCellElement {
|
|||
}
|
||||
|
||||
impl HTMLTableDataCellElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLTableDataCellElement {
|
||||
HTMLTableDataCellElement {
|
||||
htmltablecellelement:
|
||||
HTMLTableCellElement::new_inherited(localName, prefix, document)
|
||||
HTMLTableCellElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[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> {
|
||||
Node::reflect_node(box HTMLTableDataCellElement::new_inherited(localName,
|
||||
Node::reflect_node(box HTMLTableDataCellElement::new_inherited(local_name,
|
||||
prefix,
|
||||
document),
|
||||
document,
|
||||
|
|
|
@ -49,10 +49,10 @@ impl CollectionFilter for TableRowFilter {
|
|||
}
|
||||
|
||||
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 {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
border: Cell::new(None),
|
||||
cellspacing: Cell::new(None),
|
||||
tbodies: Default::default(),
|
||||
|
@ -60,9 +60,9 @@ impl HTMLTableElement {
|
|||
}
|
||||
|
||||
#[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> {
|
||||
Node::reflect_node(box HTMLTableElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLTableElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLTableElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLTableHeaderCellElement {
|
|||
}
|
||||
|
||||
impl HTMLTableHeaderCellElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLTableHeaderCellElement {
|
||||
HTMLTableHeaderCellElement {
|
||||
htmltablecellelement:
|
||||
HTMLTableCellElement::new_inherited(localName, prefix, document)
|
||||
HTMLTableCellElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLTableHeaderCellElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -40,18 +40,18 @@ pub struct 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 {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
cells: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
#[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> {
|
||||
Node::reflect_node(box HTMLTableRowElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLTableRowElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLTableRowElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -25,17 +25,17 @@ pub struct 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 {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
}
|
||||
}
|
||||
|
||||
#[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> {
|
||||
Node::reflect_node(box HTMLTableSectionElement::new_inherited(localName, prefix, document),
|
||||
Node::reflect_node(box HTMLTableSectionElement::new_inherited(local_name, prefix, document),
|
||||
document,
|
||||
HTMLTableSectionElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -25,21 +25,21 @@ pub struct HTMLTemplateElement {
|
|||
}
|
||||
|
||||
impl HTMLTemplateElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLTemplateElement {
|
||||
HTMLTemplateElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document),
|
||||
HTMLElement::new_inherited(local_name, prefix, document),
|
||||
contents: MutNullableHeap::new(None),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLTemplateElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -96,14 +96,14 @@ static DEFAULT_COLS: u32 = 20;
|
|||
static DEFAULT_ROWS: u32 = 2;
|
||||
|
||||
impl HTMLTextAreaElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLTextAreaElement {
|
||||
let chan = document.window().constellation_chan().clone();
|
||||
HTMLTextAreaElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE | IN_READ_WRITE_STATE,
|
||||
localName, prefix, document),
|
||||
local_name, prefix, document),
|
||||
textinput: DOMRefCell::new(TextInput::new(
|
||||
Lines::Multiple, DOMString::new(), chan, None, SelectionDirection::None)),
|
||||
value_changed: Cell::new(false),
|
||||
|
@ -111,10 +111,10 @@ impl HTMLTextAreaElement {
|
|||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLTextAreaElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,17 +16,17 @@ pub struct 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 {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLTimeElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -22,17 +22,17 @@ pub struct 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 {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLTitleElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,17 +16,17 @@ pub struct 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 {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLTrackElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,17 +16,17 @@ pub struct 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 {
|
||||
htmlelement: HTMLElement::new_inherited(localName, prefix, document)
|
||||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLUListElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,20 +16,20 @@ pub struct HTMLUnknownElement {
|
|||
}
|
||||
|
||||
impl HTMLUnknownElement {
|
||||
fn new_inherited(localName: Atom,
|
||||
fn new_inherited(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
document: &Document) -> HTMLUnknownElement {
|
||||
HTMLUnknownElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(localName, prefix, document)
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLUnknownElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -16,18 +16,18 @@ pub struct 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 {
|
||||
htmlmediaelement:
|
||||
HTMLMediaElement::new_inherited(localName, prefix, document)
|
||||
HTMLMediaElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(localName: Atom,
|
||||
pub fn new(local_name: Atom,
|
||||
prefix: Option<DOMString>,
|
||||
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,
|
||||
HTMLVideoElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ impl KeyboardEvent {
|
|||
|
||||
pub fn new(window: &Window,
|
||||
type_: DOMString,
|
||||
canBubble: bool,
|
||||
can_bubble: bool,
|
||||
cancelable: bool,
|
||||
view: Option<&Window>,
|
||||
_detail: i32,
|
||||
|
@ -78,26 +78,26 @@ impl KeyboardEvent {
|
|||
code: DOMString,
|
||||
location: u32,
|
||||
repeat: bool,
|
||||
isComposing: bool,
|
||||
ctrlKey: bool,
|
||||
altKey: bool,
|
||||
shiftKey: bool,
|
||||
metaKey: bool,
|
||||
is_composing: bool,
|
||||
ctrl_key: bool,
|
||||
alt_key: bool,
|
||||
shift_key: bool,
|
||||
meta_key: bool,
|
||||
char_code: Option<u32>,
|
||||
key_code: u32) -> Root<KeyboardEvent> {
|
||||
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());
|
||||
ev.key.set(key);
|
||||
*ev.code.borrow_mut() = code;
|
||||
ev.ctrl.set(ctrlKey);
|
||||
ev.alt.set(altKey);
|
||||
ev.shift.set(shiftKey);
|
||||
ev.meta.set(metaKey);
|
||||
ev.ctrl.set(ctrl_key);
|
||||
ev.alt.set(alt_key);
|
||||
ev.shift.set(shift_key);
|
||||
ev.meta.set(meta_key);
|
||||
ev.char_code.set(char_code);
|
||||
ev.printable.set(ch);
|
||||
ev.key_code.set(key_code);
|
||||
ev.is_composing.set(isComposing);
|
||||
ev.is_composing.set(is_composing);
|
||||
ev
|
||||
}
|
||||
|
||||
|
@ -759,13 +759,13 @@ impl KeyEventProperties {
|
|||
impl KeyboardEventMethods for KeyboardEvent {
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-initKeyboardEvent
|
||||
fn InitKeyboardEvent(&self,
|
||||
typeArg: DOMString,
|
||||
canBubbleArg: bool,
|
||||
cancelableArg: bool,
|
||||
viewArg: Option<&Window>,
|
||||
keyArg: DOMString,
|
||||
locationArg: u32,
|
||||
_modifiersListArg: DOMString,
|
||||
type_arg: DOMString,
|
||||
can_bubble_arg: bool,
|
||||
cancelable_arg: bool,
|
||||
view_arg: Option<&Window>,
|
||||
key_arg: DOMString,
|
||||
location_arg: u32,
|
||||
_modifiers_list_arg: DOMString,
|
||||
repeat: bool,
|
||||
_locale: DOMString) {
|
||||
if self.upcast::<Event>().dispatching() {
|
||||
|
@ -773,9 +773,9 @@ impl KeyboardEventMethods for KeyboardEvent {
|
|||
}
|
||||
|
||||
self.upcast::<UIEvent>()
|
||||
.InitUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, 0);
|
||||
*self.key_string.borrow_mut() = keyArg;
|
||||
self.location.set(locationArg);
|
||||
.InitUIEvent(type_arg, can_bubble_arg, cancelable_arg, view_arg, 0);
|
||||
*self.key_string.borrow_mut() = key_arg;
|
||||
self.location.set(location_arg);
|
||||
self.repeat.set(repeat);
|
||||
}
|
||||
|
||||
|
@ -825,8 +825,8 @@ impl KeyboardEventMethods for KeyboardEvent {
|
|||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate
|
||||
fn GetModifierState(&self, keyArg: DOMString) -> bool {
|
||||
match &*keyArg {
|
||||
fn GetModifierState(&self, key_arg: DOMString) -> bool {
|
||||
match &*key_arg {
|
||||
"Ctrl" => self.CtrlKey(),
|
||||
"Alt" => self.AltKey(),
|
||||
"Shift" => self.ShiftKey(),
|
||||
|
|
|
@ -59,26 +59,26 @@ impl MouseEvent {
|
|||
|
||||
pub fn new(window: &Window,
|
||||
type_: DOMString,
|
||||
canBubble: EventBubbles,
|
||||
can_bubble: EventBubbles,
|
||||
cancelable: EventCancelable,
|
||||
view: Option<&Window>,
|
||||
detail: i32,
|
||||
screenX: i32,
|
||||
screenY: i32,
|
||||
clientX: i32,
|
||||
clientY: i32,
|
||||
ctrlKey: bool,
|
||||
altKey: bool,
|
||||
shiftKey: bool,
|
||||
metaKey: bool,
|
||||
screen_x: i32,
|
||||
screen_y: i32,
|
||||
client_x: i32,
|
||||
client_y: i32,
|
||||
ctrl_key: bool,
|
||||
alt_key: bool,
|
||||
shift_key: bool,
|
||||
meta_key: bool,
|
||||
button: i16,
|
||||
relatedTarget: Option<&EventTarget>) -> Root<MouseEvent> {
|
||||
related_target: Option<&EventTarget>) -> Root<MouseEvent> {
|
||||
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,
|
||||
screenX, screenY, clientX, clientY,
|
||||
ctrlKey, altKey, shiftKey, metaKey,
|
||||
button, relatedTarget);
|
||||
screen_x, screen_y, client_x, client_y,
|
||||
ctrl_key, alt_key, shift_key, meta_key,
|
||||
button, related_target);
|
||||
ev
|
||||
}
|
||||
|
||||
|
@ -166,37 +166,37 @@ impl MouseEventMethods for MouseEvent {
|
|||
|
||||
// https://w3c.github.io/uievents/#widl-MouseEvent-initMouseEvent
|
||||
fn InitMouseEvent(&self,
|
||||
typeArg: DOMString,
|
||||
canBubbleArg: bool,
|
||||
cancelableArg: bool,
|
||||
viewArg: Option<&Window>,
|
||||
detailArg: i32,
|
||||
screenXArg: i32,
|
||||
screenYArg: i32,
|
||||
clientXArg: i32,
|
||||
clientYArg: i32,
|
||||
ctrlKeyArg: bool,
|
||||
altKeyArg: bool,
|
||||
shiftKeyArg: bool,
|
||||
metaKeyArg: bool,
|
||||
buttonArg: i16,
|
||||
relatedTargetArg: Option<&EventTarget>) {
|
||||
type_arg: DOMString,
|
||||
can_bubble_arg: bool,
|
||||
cancelable_arg: bool,
|
||||
view_arg: Option<&Window>,
|
||||
detail_arg: i32,
|
||||
screen_x_arg: i32,
|
||||
screen_y_arg: i32,
|
||||
client_x_arg: i32,
|
||||
client_y_arg: i32,
|
||||
ctrl_key_arg: bool,
|
||||
alt_key_arg: bool,
|
||||
shift_key_arg: bool,
|
||||
meta_key_arg: bool,
|
||||
button_arg: i16,
|
||||
related_target_arg: Option<&EventTarget>) {
|
||||
if self.upcast::<Event>().dispatching() {
|
||||
return;
|
||||
}
|
||||
|
||||
self.upcast::<UIEvent>()
|
||||
.InitUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
|
||||
self.screen_x.set(screenXArg);
|
||||
self.screen_y.set(screenYArg);
|
||||
self.client_x.set(clientXArg);
|
||||
self.client_y.set(clientYArg);
|
||||
self.ctrl_key.set(ctrlKeyArg);
|
||||
self.alt_key.set(altKeyArg);
|
||||
self.shift_key.set(shiftKeyArg);
|
||||
self.meta_key.set(metaKeyArg);
|
||||
self.button.set(buttonArg);
|
||||
self.related_target.set(relatedTargetArg);
|
||||
.InitUIEvent(type_arg, can_bubble_arg, cancelable_arg, view_arg, detail_arg);
|
||||
self.screen_x.set(screen_x_arg);
|
||||
self.screen_y.set(screen_y_arg);
|
||||
self.client_x.set(client_x_arg);
|
||||
self.client_y.set(client_y_arg);
|
||||
self.ctrl_key.set(ctrl_key_arg);
|
||||
self.alt_key.set(alt_key_arg);
|
||||
self.shift_key.set(shift_key_arg);
|
||||
self.meta_key.set(meta_key_arg);
|
||||
self.button.set(button_arg);
|
||||
self.related_target.set(related_target_arg);
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-event-istrusted
|
||||
|
|
|
@ -21,7 +21,7 @@ pub struct Navigator {
|
|||
bluetooth: MutNullableHeap<JS<Bluetooth>>,
|
||||
plugins: MutNullableHeap<JS<PluginArray>>,
|
||||
mime_types: MutNullableHeap<JS<MimeTypeArray>>,
|
||||
serviceWorker: MutNullableHeap<JS<ServiceWorkerContainer>>,
|
||||
service_worker: MutNullableHeap<JS<ServiceWorkerContainer>>,
|
||||
}
|
||||
|
||||
impl Navigator {
|
||||
|
@ -31,7 +31,7 @@ impl Navigator {
|
|||
bluetooth: Default::default(),
|
||||
plugins: 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
|
||||
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
|
||||
|
|
|
@ -796,10 +796,10 @@ impl Node {
|
|||
}
|
||||
|
||||
pub fn summarize(&self) -> NodeInfo {
|
||||
let USVString(baseURI) = self.BaseURI();
|
||||
let USVString(base_uri) = self.BaseURI();
|
||||
NodeInfo {
|
||||
uniqueId: self.unique_id(),
|
||||
baseURI: baseURI,
|
||||
baseURI: base_uri,
|
||||
parent: self.GetParentNode().map_or("".to_owned(), |node| node.unique_id()),
|
||||
nodeType: self.NodeType(),
|
||||
namespaceURI: String::new(), //FIXME
|
||||
|
@ -2296,8 +2296,8 @@ impl NodeMethods for Node {
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-node-issamenode
|
||||
fn IsSameNode(&self, otherNode: Option<&Node>) -> bool {
|
||||
match otherNode {
|
||||
fn IsSameNode(&self, other_node: Option<&Node>) -> bool {
|
||||
match other_node {
|
||||
Some(node) => self == node,
|
||||
None => false,
|
||||
}
|
||||
|
|
|
@ -51,8 +51,8 @@ impl PerformanceMethods for Performance {
|
|||
|
||||
// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime/Overview.html#dom-performance-now
|
||||
fn Now(&self) -> DOMHighResTimeStamp {
|
||||
let navStart = self.timing.NavigationStartPrecise();
|
||||
let now = (time::precise_time_ns() as f64 - navStart) / 1000000 as f64;
|
||||
let nav_start = self.timing.navigation_start_precise();
|
||||
let now = (time::precise_time_ns() as f64 - nav_start) / 1000000 as f64;
|
||||
Finite::wrap(now)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,20 +14,20 @@ use dom::window::Window;
|
|||
#[dom_struct]
|
||||
pub struct PerformanceTiming {
|
||||
reflector_: Reflector,
|
||||
navigationStart: u64,
|
||||
navigationStartPrecise: f64,
|
||||
navigation_start: u64,
|
||||
navigation_start_precise: f64,
|
||||
document: JS<Document>,
|
||||
}
|
||||
|
||||
impl PerformanceTiming {
|
||||
fn new_inherited(navStart: u64,
|
||||
navStartPrecise: f64,
|
||||
fn new_inherited(nav_start: u64,
|
||||
nav_start_precise: f64,
|
||||
document: &Document)
|
||||
-> PerformanceTiming {
|
||||
PerformanceTiming {
|
||||
reflector_: Reflector::new(),
|
||||
navigationStart: navStart,
|
||||
navigationStartPrecise: navStartPrecise,
|
||||
navigation_start: nav_start,
|
||||
navigation_start_precise: nav_start_precise,
|
||||
document: JS::from_ref(document),
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ impl PerformanceTiming {
|
|||
impl PerformanceTimingMethods for PerformanceTiming {
|
||||
// https://w3c.github.io/navigation-timing/#widl-PerformanceTiming-navigationStart
|
||||
fn NavigationStart(&self) -> u64 {
|
||||
self.navigationStart
|
||||
self.navigation_start
|
||||
}
|
||||
|
||||
// https://w3c.github.io/navigation-timing/#widl-PerformanceTiming-domLoading
|
||||
|
@ -89,7 +89,7 @@ impl PerformanceTimingMethods for PerformanceTiming {
|
|||
|
||||
|
||||
impl PerformanceTiming {
|
||||
pub fn NavigationStartPrecise(&self) -> f64 {
|
||||
self.navigationStartPrecise
|
||||
pub fn navigation_start_precise(&self) -> f64 {
|
||||
self.navigation_start_precise
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,26 +20,26 @@ use string_cache::Atom;
|
|||
pub struct StorageEvent {
|
||||
event: Event,
|
||||
key: Option<DOMString>,
|
||||
oldValue: Option<DOMString>,
|
||||
newValue: Option<DOMString>,
|
||||
old_value: Option<DOMString>,
|
||||
new_value: Option<DOMString>,
|
||||
url: DOMString,
|
||||
storageArea: MutNullableHeap<JS<Storage>>
|
||||
storage_area: MutNullableHeap<JS<Storage>>
|
||||
}
|
||||
|
||||
|
||||
impl StorageEvent {
|
||||
pub fn new_inherited(key: Option<DOMString>,
|
||||
oldValue: Option<DOMString>,
|
||||
newValue: Option<DOMString>,
|
||||
old_value: Option<DOMString>,
|
||||
new_value: Option<DOMString>,
|
||||
url: DOMString,
|
||||
storageArea: Option<&Storage>) -> StorageEvent {
|
||||
storage_area: Option<&Storage>) -> StorageEvent {
|
||||
StorageEvent {
|
||||
event: Event::new_inherited(),
|
||||
key: key,
|
||||
oldValue: oldValue,
|
||||
newValue: newValue,
|
||||
old_value: old_value,
|
||||
new_value: new_value,
|
||||
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
|
||||
fn GetOldValue(&self) -> Option<DOMString> {
|
||||
self.oldValue.clone()
|
||||
self.old_value.clone()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-storageevent-newvalue
|
||||
fn GetNewValue(&self) -> Option<DOMString> {
|
||||
self.newValue.clone()
|
||||
self.new_value.clone()
|
||||
}
|
||||
|
||||
// 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
|
||||
fn GetStorageArea(&self) -> Option<Root<Storage>> {
|
||||
self.storageArea.get()
|
||||
self.storage_area.get()
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-event-istrusted
|
||||
|
|
|
@ -55,26 +55,26 @@ impl TouchEvent {
|
|||
|
||||
pub fn new(window: &Window,
|
||||
type_: DOMString,
|
||||
canBubble: EventBubbles,
|
||||
can_bubble: EventBubbles,
|
||||
cancelable: EventCancelable,
|
||||
view: Option<&Window>,
|
||||
detail: i32,
|
||||
touches: &TouchList,
|
||||
changed_touches: &TouchList,
|
||||
target_touches: &TouchList,
|
||||
ctrlKey: bool,
|
||||
altKey: bool,
|
||||
shiftKey: bool,
|
||||
metaKey: bool) -> Root<TouchEvent> {
|
||||
ctrl_key: bool,
|
||||
alt_key: bool,
|
||||
shift_key: bool,
|
||||
meta_key: bool) -> Root<TouchEvent> {
|
||||
let ev = TouchEvent::new_uninitialized(window, touches, changed_touches, target_touches);
|
||||
ev.upcast::<UIEvent>().InitUIEvent(type_,
|
||||
bool::from(canBubble),
|
||||
bool::from(can_bubble),
|
||||
bool::from(cancelable),
|
||||
view, detail);
|
||||
ev.ctrl_key.set(ctrlKey);
|
||||
ev.alt_key.set(altKey);
|
||||
ev.shift_key.set(shiftKey);
|
||||
ev.meta_key.set(metaKey);
|
||||
ev.ctrl_key.set(ctrl_key);
|
||||
ev.alt_key.set(alt_key);
|
||||
ev.shift_key.set(shift_key);
|
||||
ev.meta_key.set(meta_key);
|
||||
ev
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ use url::{Url, quirks};
|
|||
pub struct 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 Href(url: &Url) -> USVString { USVString(quirks::href(url).to_owned()) }
|
||||
pub fn Hash(url: &Url) -> USVString { USVString(quirks::hash(url).to_owned()) }
|
||||
|
|
|
@ -370,11 +370,11 @@ unsafe extern "C" fn gc_slice_callback(_rt: *mut JSRuntime, progress: GCProgress
|
|||
};
|
||||
if !desc.is_null() {
|
||||
let desc: &GCDescription = &*desc;
|
||||
let invocationKind = match desc.invocationKind_ {
|
||||
let invocation_kind = match desc.invocationKind_ {
|
||||
JSGCInvocationKind::GC_NORMAL => "GC_NORMAL",
|
||||
JSGCInvocationKind::GC_SHRINK => "GC_SHRINK",
|
||||
};
|
||||
println!(" isCompartment={}, invocationKind={}", desc.isCompartment_, invocationKind);
|
||||
println!(" isCompartment={}, invocation_kind={}", desc.isCompartment_, invocation_kind);
|
||||
}
|
||||
let _ = stdout().flush();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue