Modify script to prevent further violations of snake_case

This commit is contained in:
Kunal Mohan 2020-01-18 01:29:26 +05:30
parent 2a594821ba
commit f7db4b7f80
No known key found for this signature in database
GPG key ID: 2B475A4524237BAC
135 changed files with 205 additions and 54 deletions

4
Cargo.lock generated
View file

@ -604,9 +604,9 @@ dependencies = [
[[package]]
name = "cfg-if"
version = "0.1.6"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4"
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]]
name = "cgl"

View file

@ -119,6 +119,7 @@ impl AnalyserNode {
}
/// https://webaudio.github.io/web-audio-api/#dom-analysernode-analysernode
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
context: &BaseAudioContext,

View file

@ -90,6 +90,7 @@ impl AudioBuffer {
}
// https://webaudio.github.io/web-audio-api/#dom-audiobuffer-audiobuffer
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
options: &AudioBufferOptions,

View file

@ -107,6 +107,7 @@ impl AudioBufferSourceNode {
))
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
context: &BaseAudioContext,

View file

@ -85,6 +85,7 @@ impl AudioContext {
}
// https://webaudio.github.io/web-audio-api/#AudioContext-constructors
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
options: &AudioContextOptions,

View file

@ -147,6 +147,7 @@ impl AudioListener {
}
}
#[allow(non_snake_case)]
impl AudioListenerMethods for AudioListener {
// https://webaudio.github.io/web-audio-api/#dom-audiolistener-positionx
fn PositionX(&self) -> DomRoot<AudioParam> {

View file

@ -120,6 +120,7 @@ impl BiquadFilterNode {
))
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
context: &BaseAudioContext,

View file

@ -50,6 +50,7 @@ impl Blob {
}
// https://w3c.github.io/FileAPI/#constructorBlob
#[allow(non_snake_case)]
pub fn Constructor(
global: &GlobalScope,
blobParts: Option<Vec<ArrayBufferOrArrayBufferViewOrBlobOrString>>,

View file

@ -66,6 +66,7 @@ const BT_DESC_CONVERSION_ERROR: &'static str =
"Can't convert to an IDL value of type BluetoothPermissionDescriptor";
#[derive(JSTraceable, MallocSizeOf)]
#[allow(non_snake_case)]
pub struct AllowedBluetoothDevice {
pub deviceId: DOMString,
pub mayUseGATT: bool,

View file

@ -30,6 +30,7 @@ pub struct BluetoothAdvertisingEvent {
rssi: Option<i8>,
}
#[allow(non_snake_case)]
impl BluetoothAdvertisingEvent {
pub fn new_inherited(
device: &BluetoothDevice,

View file

@ -24,6 +24,7 @@ pub struct BluetoothCharacteristicProperties {
writable_auxiliaries: bool,
}
#[allow(non_snake_case)]
impl BluetoothCharacteristicProperties {
pub fn new_inherited(
broadcast: bool,

View file

@ -67,11 +67,14 @@ impl BluetoothRemoteGATTCharacteristic {
service: &BluetoothRemoteGATTService,
uuid: DOMString,
properties: &BluetoothCharacteristicProperties,
instanceID: String,
instance_id: String,
) -> DomRoot<BluetoothRemoteGATTCharacteristic> {
reflect_dom_object(
Box::new(BluetoothRemoteGATTCharacteristic::new_inherited(
service, uuid, properties, instanceID,
service,
uuid,
properties,
instance_id,
)),
global,
BluetoothRemoteGATTCharacteristicBinding::Wrap,

View file

@ -55,13 +55,13 @@ impl BluetoothRemoteGATTDescriptor {
global: &GlobalScope,
characteristic: &BluetoothRemoteGATTCharacteristic,
uuid: DOMString,
instanceID: String,
instance_id: String,
) -> DomRoot<BluetoothRemoteGATTDescriptor> {
reflect_dom_object(
Box::new(BluetoothRemoteGATTDescriptor::new_inherited(
characteristic,
uuid,
instanceID,
instance_id,
)),
global,
BluetoothRemoteGATTDescriptorBinding::Wrap,

View file

@ -45,6 +45,7 @@ impl BluetoothRemoteGATTService {
}
}
#[allow(non_snake_case)]
pub fn new(
global: &GlobalScope,
device: &BluetoothDevice,

View file

@ -583,6 +583,7 @@ const DESCRIPTOR_ERROR_MESSAGE: &'static str =
"https://developer.bluetooth.org/gatt/descriptors/Pages/\
DescriptorsHomePage.aspx\ne.g. 'gatt.characteristic_presentation_format'.";
#[allow(non_snake_case)]
impl BluetoothUUID {
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothuuid-canonicaluuid
pub fn CanonicalUUID(_: &Window, alias: u32) -> UUID {

View file

@ -68,6 +68,7 @@ impl ChannelMergerNode {
))
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
context: &BaseAudioContext,

View file

@ -70,6 +70,7 @@ impl ChannelSplitterNode {
))
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
context: &BaseAudioContext,

View file

@ -23,6 +23,7 @@ pub struct CloseEvent {
reason: DOMString,
}
#[allow(non_snake_case)]
impl CloseEvent {
pub fn new_inherited(was_clean: bool, code: u16, reason: DOMString) -> CloseEvent {
CloseEvent {

View file

@ -34,6 +34,7 @@ impl Comment {
)
}
#[allow(non_snake_case)]
pub fn Constructor(window: &Window, data: DOMString) -> Fallible<DomRoot<Comment>> {
let document = window.Document();
Ok(Comment::new(data, &document))

View file

@ -58,6 +58,7 @@ impl CompositionEvent {
ev
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
type_: DOMString,

View file

@ -43,6 +43,7 @@ where
f()
}
#[allow(non_snake_case)]
impl Console {
// https://developer.mozilla.org/en-US/docs/Web/API/Console/log
pub fn Log(global: &GlobalScope, messages: Vec<DOMString>) {

View file

@ -73,6 +73,7 @@ impl ConstantSourceNode {
))
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
context: &BaseAudioContext,

View file

@ -22,6 +22,7 @@ pub struct CSS {
reflector_: Reflector,
}
#[allow(non_snake_case)]
impl CSS {
/// <http://dev.w3.org/csswg/cssom/#serialize-an-identifier>
pub fn Escape(_: &Window, ident: DOMString) -> Fallible<DOMString> {

View file

@ -55,7 +55,7 @@ impl CustomEvent {
ev
}
#[allow(unsafe_code)]
#[allow(unsafe_code, non_snake_case)]
pub fn Constructor(
global: &GlobalScope,
type_: DOMString,

View file

@ -450,6 +450,7 @@ impl CollectionFilter for AnchorsFilter {
}
}
#[allow(non_snake_case)]
impl Document {
#[inline]
pub fn loader(&self) -> Ref<DocumentLoader> {
@ -2899,6 +2900,7 @@ impl Document {
}
// https://dom.spec.whatwg.org/#dom-document-document
#[allow(non_snake_case)]
pub fn Constructor(window: &Window) -> Fallible<DomRoot<Document>> {
let doc = window.Document();
let docloader = DocumentLoader::new(&*doc.loader());

View file

@ -46,6 +46,7 @@ impl DocumentFragment {
)
}
#[allow(non_snake_case)]
pub fn Constructor(window: &Window) -> Fallible<DomRoot<DocumentFragment>> {
let document = window.Document();

View file

@ -138,6 +138,7 @@ impl DOMException {
)
}
#[allow(non_snake_case)]
pub fn Constructor(
global: &GlobalScope,
message: DOMString,

View file

@ -27,6 +27,7 @@ pub struct DOMMatrix {
parent: DOMMatrixReadOnly,
}
#[allow(non_snake_case)]
impl DOMMatrix {
#[allow(unrooted_must_root)]
pub fn new(global: &GlobalScope, is2D: bool, matrix: Transform3D<f64>) -> DomRoot<Self> {
@ -74,7 +75,7 @@ impl DOMMatrix {
}
pub fn from_readonly(global: &GlobalScope, ro: &DOMMatrixReadOnly) -> DomRoot<Self> {
Self::new(global, ro.is_2d(), ro.matrix().clone())
Self::new(global, ro.is2D(), ro.matrix().clone())
}
// https://drafts.fxtf.org/geometry-1/#dom-dommatrix-fromfloat32array
@ -102,6 +103,7 @@ impl DOMMatrix {
}
}
#[allow(non_snake_case)]
impl DOMMatrixMethods for DOMMatrix {
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m11
fn M11(&self) -> f64 {

View file

@ -33,12 +33,14 @@ use std::ptr::NonNull;
use style::parser::ParserContext;
#[dom_struct]
#[allow(non_snake_case)]
pub struct DOMMatrixReadOnly {
reflector_: Reflector,
matrix: DomRefCell<Transform3D<f64>>,
is2D: Cell<bool>,
}
#[allow(non_snake_case)]
impl DOMMatrixReadOnly {
#[allow(unrooted_must_root)]
pub fn new(global: &GlobalScope, is2D: bool, matrix: Transform3D<f64>) -> DomRoot<Self> {
@ -91,7 +93,7 @@ impl DOMMatrixReadOnly {
self.matrix.borrow()
}
pub fn is_2d(&self) -> bool {
pub fn is2D(&self) -> bool {
self.is2D.get()
}
@ -421,6 +423,7 @@ impl DOMMatrixReadOnly {
}
}
#[allow(non_snake_case)]
impl DOMMatrixReadOnlyMethods for DOMMatrixReadOnly {
// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m11
fn M11(&self) -> f64 {
@ -761,7 +764,7 @@ pub fn dommatrixinit_to_matrix(dict: &DOMMatrixInit) -> Fallible<(bool, Transfor
{
Err(error::Error::Type("Invalid matrix initializer.".to_owned()))
} else {
let mut is2D = dict.is2D;
let mut is_2d = dict.is2D;
// Step 2.
let m11 = dict.m11.unwrap_or(dict.a.unwrap_or(1.0));
// Step 3.
@ -775,7 +778,7 @@ pub fn dommatrixinit_to_matrix(dict: &DOMMatrixInit) -> Fallible<(bool, Transfor
// Step 7.
let m42 = dict.m42.unwrap_or(dict.f.unwrap_or(0.0));
// Step 8.
if is2D.is_none() &&
if is_2d.is_none() &&
(dict.m31 != 0.0 ||
dict.m32 != 0.0 ||
dict.m13 != 0.0 ||
@ -787,17 +790,17 @@ pub fn dommatrixinit_to_matrix(dict: &DOMMatrixInit) -> Fallible<(bool, Transfor
dict.m33 != 1.0 ||
dict.m44 != 1.0)
{
is2D = Some(false);
is_2d = Some(false);
}
// Step 9.
if is2D.is_none() {
is2D = Some(true);
if is_2d.is_none() {
is_2d = Some(true);
}
let matrix = Transform3D::row_major(
m11, m12, dict.m13, dict.m14, m21, m22, dict.m23, dict.m24, dict.m31, dict.m32,
dict.m33, dict.m34, m41, m42, dict.m43, dict.m44,
);
Ok((is2D.unwrap(), matrix))
Ok((is_2d.unwrap(), matrix))
}
}

View file

@ -44,6 +44,7 @@ impl DOMParser {
)
}
#[allow(non_snake_case)]
pub fn Constructor(window: &Window) -> Fallible<DomRoot<DOMParser>> {
Ok(DOMParser::new(window))
}

View file

@ -19,6 +19,7 @@ pub struct DOMPoint {
point: DOMPointReadOnly,
}
#[allow(non_snake_case)]
impl DOMPoint {
fn new_inherited(x: f64, y: f64, z: f64, w: f64) -> DOMPoint {
DOMPoint {

View file

@ -23,6 +23,7 @@ pub struct DOMPointReadOnly {
w: Cell<f64>,
}
#[allow(non_snake_case)]
impl DOMPointReadOnly {
pub fn new_inherited(x: f64, y: f64, z: f64, w: f64) -> DOMPointReadOnly {
DOMPointReadOnly {
@ -58,6 +59,7 @@ impl DOMPointReadOnly {
}
}
#[allow(non_snake_case)]
impl DOMPointReadOnlyMethods for DOMPointReadOnly {
// https://dev.w3.org/fxtf/geometry/Overview.html#dom-dompointreadonly-x
fn X(&self) -> f64 {
@ -80,6 +82,7 @@ impl DOMPointReadOnlyMethods for DOMPointReadOnly {
}
}
#[allow(non_snake_case)]
pub trait DOMPointWriteMethods {
fn SetX(&self, value: f64);
fn SetY(&self, value: f64);

View file

@ -23,6 +23,7 @@ pub struct DOMQuad {
p4: Dom<DOMPoint>,
}
#[allow(non_snake_case)]
impl DOMQuad {
fn new_inherited(p1: &DOMPoint, p2: &DOMPoint, p3: &DOMPoint, p4: &DOMPoint) -> DOMQuad {
DOMQuad {

View file

@ -32,6 +32,7 @@ impl DOMRect {
)
}
#[allow(non_snake_case)]
pub fn Constructor(
global: &GlobalScope,
x: f64,

View file

@ -46,6 +46,7 @@ impl DOMRectReadOnly {
)
}
#[allow(non_snake_case)]
pub fn Constructor(
global: &GlobalScope,
x: f64,

View file

@ -1202,6 +1202,7 @@ impl Element {
}
}
#[allow(non_snake_case)]
pub fn xmlSerialize(&self, traversal_scope: XmlTraversalScope) -> Fallible<DOMString> {
let mut writer = vec![];
match xmlSerialize::serialize(

View file

@ -77,6 +77,7 @@ impl ErrorEvent {
ev
}
#[allow(non_snake_case)]
pub fn Constructor(
global: &GlobalScope,
type_: DOMString,

View file

@ -82,6 +82,7 @@ impl Event {
event
}
#[allow(non_snake_case)]
pub fn Constructor(
global: &GlobalScope,
type_: DOMString,

View file

@ -18,7 +18,7 @@ use crate::dom::eventtarget::EventTarget;
use crate::dom::globalscope::GlobalScope;
use crate::dom::messageevent::MessageEvent;
use crate::dom::performanceresourcetiming::InitiatorType;
use crate::fetch::{create_a_potential_CORS_request, FetchCanceller};
use crate::fetch::{create_a_potential_cors_request, FetchCanceller};
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
use crate::task_source::{TaskSource, TaskSourceName};
use crate::timers::OneshotTimerCallback;
@ -488,6 +488,7 @@ impl EventSource {
}
// https://html.spec.whatwg.org/multipage/#dom-eventsource
#[allow(non_snake_case)]
pub fn Constructor(
global: &GlobalScope,
url: DOMString,
@ -516,7 +517,7 @@ impl EventSource {
};
// Step 8
// TODO: Step 9 set request's client settings
let mut request = create_a_potential_CORS_request(
let mut request = create_a_potential_cors_request(
url_record,
Destination::None,
Some(cors_attribute_state),

View file

@ -339,6 +339,7 @@ impl EventTarget {
reflect_dom_object(Box::new(EventTarget::new_inherited()), global, Wrap)
}
#[allow(non_snake_case)]
pub fn Constructor(global: &GlobalScope) -> Fallible<DomRoot<EventTarget>> {
Ok(EventTarget::new(global))
}

View file

@ -23,6 +23,7 @@ pub struct ExtendableEvent {
extensions_allowed: bool,
}
#[allow(non_snake_case)]
impl ExtendableEvent {
pub fn new_inherited() -> ExtendableEvent {
ExtendableEvent {

View file

@ -26,6 +26,7 @@ use js::rust::HandleValue;
use servo_atoms::Atom;
#[dom_struct]
#[allow(non_snake_case)]
pub struct ExtendableMessageEvent {
event: ExtendableEvent,
#[ignore_malloc_size_of = "mozjs"]
@ -37,6 +38,7 @@ pub struct ExtendableMessageEvent {
frozen_ports: DomRefCell<Option<Heap<JSVal>>>,
}
#[allow(non_snake_case)]
impl ExtendableMessageEvent {
pub fn new_inherited(
origin: DOMString,
@ -101,6 +103,7 @@ impl ExtendableMessageEvent {
}
}
#[allow(non_snake_case)]
impl ExtendableMessageEvent {
pub fn dispatch_jsval(
target: &EventTarget,

View file

@ -80,6 +80,7 @@ impl File {
}
// https://w3c.github.io/FileAPI/#file-constructor
#[allow(non_snake_case)]
pub fn Constructor(
global: &GlobalScope,
fileBits: Vec<ArrayBufferOrArrayBufferViewOrBlobOrString>,

View file

@ -159,6 +159,7 @@ impl FileReader {
)
}
#[allow(non_snake_case)]
pub fn Constructor(global: &GlobalScope) -> Fallible<DomRoot<FileReader>> {
Ok(FileReader::new(global))
}

View file

@ -40,6 +40,7 @@ impl FileReaderSync {
)
}
#[allow(non_snake_case)]
pub fn Constructor(global: &GlobalScope) -> Fallible<DomRoot<FileReaderSync>> {
Ok(FileReaderSync::new(global))
}

View file

@ -60,6 +60,7 @@ impl FocusEvent {
ev
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
type_: DOMString,

View file

@ -51,6 +51,7 @@ impl FormData {
}
// https://xhr.spec.whatwg.org/#dom-formdata
#[allow(non_snake_case)]
pub fn Constructor(
global: &GlobalScope,
form: Option<&HTMLFormElement>,

View file

@ -48,6 +48,7 @@ impl FormDataEvent {
ev
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
type_: DOMString,

View file

@ -76,6 +76,7 @@ impl GainNode {
))
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
context: &BaseAudioContext,

View file

@ -69,6 +69,7 @@ impl GamepadEvent {
}
// https://w3c.github.io/gamepad/#gamepadevent-interface
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
type_: DOMString,

View file

@ -238,6 +238,7 @@ impl GPUDeviceMethods for GPUDevice {
}
/// https://gpuweb.github.io/gpuweb/#GPUDevice-createBindGroupLayout
#[allow(non_snake_case)]
fn CreateBindGroupLayout(
&self,
descriptor: &GPUBindGroupLayoutDescriptor,

View file

@ -60,6 +60,7 @@ impl HashChangeEvent {
ev
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
type_: DOMString,

View file

@ -50,6 +50,7 @@ impl Headers {
}
// https://fetch.spec.whatwg.org/#dom-headers
#[allow(non_snake_case)]
pub fn Constructor(
global: &GlobalScope,
init: Option<HeadersInit>,
@ -393,13 +394,13 @@ pub fn normalize_value(value: ByteString) -> ByteString {
}
}
fn is_HTTP_whitespace(byte: u8) -> bool {
fn is_http_whitespace(byte: u8) -> bool {
byte == b'\t' || byte == b'\n' || byte == b'\r' || byte == b' '
}
fn index_of_first_non_whitespace(value: &ByteString) -> Option<usize> {
for (index, &byte) in value.iter().enumerate() {
if !is_HTTP_whitespace(byte) {
if !is_http_whitespace(byte) {
return Some(index);
}
}
@ -408,7 +409,7 @@ fn index_of_first_non_whitespace(value: &ByteString) -> Option<usize> {
fn index_of_last_non_whitespace(value: &ByteString) -> Option<usize> {
for (index, &byte) in value.iter().enumerate().rev() {
if !is_HTTP_whitespace(byte) {
if !is_http_whitespace(byte) {
return Some(index);
}
}

View file

@ -49,6 +49,7 @@ impl HTMLAudioElement {
}
// https://html.spec.whatwg.org/multipage/#dom-audio
#[allow(non_snake_case)]
pub fn Audio(window: &Window, src: Option<DOMString>) -> Fallible<DomRoot<HTMLAudioElement>> {
let document = window.Document();
let audio = HTMLAudioElement::new(local_name!("audio"), None, &document);

View file

@ -47,6 +47,7 @@ impl HTMLFormControlsCollection {
// FIXME: This shouldn't need to be implemented here since HTMLCollection (the parent of
// HTMLFormControlsCollection) implements Length
#[allow(non_snake_case)]
pub fn Length(&self) -> u32 {
self.collection.Length()
}

View file

@ -378,6 +378,7 @@ impl HTMLFormElementMethods for HTMLFormElement {
}
// https://html.spec.whatwg.org/multipage/#the-form-element:supported-property-names
#[allow(non_snake_case)]
fn SupportedPropertyNames(&self) -> Vec<DOMString> {
// Step 1
#[derive(Debug, Eq, Ord, PartialEq, PartialOrd)]

View file

@ -15,6 +15,7 @@ pub struct HTMLHtmlElement {
htmlelement: HTMLElement,
}
#[allow(non_snake_case)]
impl HTMLHtmlElement {
fn new_inherited(
localName: LocalName,

View file

@ -41,7 +41,7 @@ use crate::dom::performanceresourcetiming::InitiatorType;
use crate::dom::values::UNSIGNED_LONG_MAX;
use crate::dom::virtualmethods::VirtualMethods;
use crate::dom::window::Window;
use crate::fetch::create_a_potential_CORS_request;
use crate::fetch::create_a_potential_cors_request;
use crate::image_listener::{add_cache_listener_for_element, ImageCacheListener};
use crate::microtask::{Microtask, MicrotaskRunnable};
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
@ -283,7 +283,7 @@ pub(crate) fn image_fetch_request(
from_picture_or_srcset: FromPictureOrSrcSet,
) -> RequestBuilder {
let mut request =
create_a_potential_CORS_request(img_url, Destination::Image, cors_setting, None)
create_a_potential_cors_request(img_url, Destination::Image, cors_setting, None)
.origin(origin)
.pipeline_id(Some(pipeline_id))
.referrer_policy(referrer_policy);
@ -293,6 +293,7 @@ pub(crate) fn image_fetch_request(
request
}
#[allow(non_snake_case)]
impl HTMLImageElement {
/// Update the current image with a valid URL.
fn fetch_image(&self, img_url: &ServoUrl) {

View file

@ -290,6 +290,7 @@ static DEFAULT_INPUT_SIZE: u32 = 20;
static DEFAULT_MAX_LENGTH: i32 = -1;
static DEFAULT_MIN_LENGTH: i32 = -1;
#[allow(non_snake_case)]
impl HTMLInputElement {
fn new_inherited(
local_name: LocalName,
@ -1038,7 +1039,7 @@ impl HTMLInputElementMethods for HTMLInputElement {
}
// https://html.spec.whatwg.org/multipage/#dom-input-valueasdate
#[allow(unsafe_code)]
#[allow(unsafe_code, non_snake_case)]
fn SetValueAsDate(&self, cx: SafeJSContext, value: *mut JSObject) -> ErrorResult {
rooted!(in(*cx) let value = value);
if !self.does_value_as_date_apply() {

View file

@ -60,7 +60,7 @@ use crate::dom::url::URL;
use crate::dom::videotrack::VideoTrack;
use crate::dom::videotracklist::VideoTrackList;
use crate::dom::virtualmethods::VirtualMethods;
use crate::fetch::{create_a_potential_CORS_request, FetchCanceller};
use crate::fetch::{create_a_potential_cors_request, FetchCanceller};
use crate::microtask::{Microtask, MicrotaskRunnable};
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
use crate::script_thread::ScriptThread;
@ -292,6 +292,7 @@ impl From<MediaStreamOrBlob> for SrcObject {
}
#[dom_struct]
#[allow(non_snake_case)]
pub struct HTMLMediaElement {
htmlelement: HTMLElement,
/// <https://html.spec.whatwg.org/multipage/#dom-media-networkstate>
@ -837,7 +838,7 @@ impl HTMLMediaElement {
};
let cors_setting = cors_setting_for_element(self.upcast());
let request = create_a_potential_CORS_request(url.clone(), destination, cors_setting, None)
let request = create_a_potential_cors_request(url.clone(), destination, cors_setting, None)
.headers(headers)
.origin(document.origin().immutable().clone())
.pipeline_id(Some(self.global().pipeline_id()))

View file

@ -77,6 +77,7 @@ impl HTMLOptionElement {
}
// https://html.spec.whatwg.org/multipage/#dom-option
#[allow(non_snake_case)]
pub fn Option(
window: &Window,
text: DOMString,

View file

@ -26,7 +26,7 @@ use crate::dom::node::{document_from_node, window_from_node};
use crate::dom::node::{BindContext, ChildrenMutation, CloneChildrenFlag, Node};
use crate::dom::performanceresourcetiming::InitiatorType;
use crate::dom::virtualmethods::VirtualMethods;
use crate::fetch::create_a_potential_CORS_request;
use crate::fetch::create_a_potential_cors_request;
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
use crate::script_module::fetch_inline_module_script;
use crate::script_module::{fetch_external_module_script, ModuleOwner};
@ -326,7 +326,7 @@ pub(crate) fn script_fetch_request(
referrer_policy: Option<ReferrerPolicy>,
integrity_metadata: String,
) -> RequestBuilder {
create_a_potential_CORS_request(url, Destination::Script, cors_setting, None)
create_a_potential_cors_request(url, Destination::Script, cors_setting, None)
.origin(origin)
.pipeline_id(Some(pipeline_id))
.referrer(Some(referrer))

View file

@ -128,14 +128,13 @@ impl ImageData {
))
}
// https://html.spec.whatwg.org/multipage/#pixel-manipulation:dom-imagedata-3
#[allow(unsafe_code)]
#[allow(unsafe_code, non_snake_case)]
pub fn Constructor(global: &GlobalScope, width: u32, height: u32) -> Fallible<DomRoot<Self>> {
unsafe { Self::new_without_jsobject(global, width, height) }
}
// https://html.spec.whatwg.org/multipage/#pixel-manipulation:dom-imagedata-4
#[allow(unsafe_code)]
#[allow(unused_variables)]
#[allow(unsafe_code, unused_variables, non_snake_case)]
pub unsafe fn Constructor_(
cx: JSContext,
global: &GlobalScope,

View file

@ -44,6 +44,7 @@ impl InputEvent {
ev
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
type_: DOMString,

View file

@ -96,6 +96,7 @@ impl KeyboardEvent {
ev
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
type_: DOMString,

View file

@ -63,6 +63,7 @@ impl MediaElementAudioSourceNode {
))
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
context: &AudioContext,

View file

@ -43,6 +43,7 @@ impl MediaMetadata {
}
/// https://w3c.github.io/mediasession/#dom-mediametadata-mediametadata
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
init: &MediaMetadataInit,

View file

@ -56,6 +56,7 @@ impl MediaQueryListEvent {
ev
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
type_: DOMString,

View file

@ -21,6 +21,7 @@ pub struct MediaStream {
tracks: DomRefCell<Vec<Dom<MediaStreamTrack>>>,
}
#[allow(non_snake_case)]
impl MediaStream {
pub fn new_inherited() -> MediaStream {
MediaStream {

View file

@ -19,6 +19,7 @@ pub struct MessageChannel {
impl MessageChannel {
/// <https://html.spec.whatwg.org/multipage/#dom-messagechannel>
#[allow(non_snake_case)]
pub fn Constructor(global: &GlobalScope) -> Fallible<DomRoot<MessageChannel>> {
let incumbent = GlobalScope::incumbent().ok_or(Error::InvalidState)?;

View file

@ -53,6 +53,7 @@ impl From<&WindowProxyOrMessagePortOrServiceWorker> for SrcObject {
}
#[dom_struct]
#[allow(non_snake_case)]
pub struct MessageEvent {
event: Event,
#[ignore_malloc_size_of = "mozjs"]
@ -65,6 +66,7 @@ pub struct MessageEvent {
frozen_ports: DomRefCell<Option<Heap<JSVal>>>,
}
#[allow(non_snake_case)]
impl MessageEvent {
pub fn new_inherited(
origin: DOMString,
@ -262,6 +264,7 @@ impl MessageEventMethods for MessageEvent {
}
/// <https://html.spec.whatwg.org/multipage/#dom-messageevent-initmessageevent>
#[allow(non_snake_case)]
fn InitMessageEvent(
&self,
_cx: JSContext,

View file

@ -124,6 +124,7 @@ impl MouseEvent {
ev
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
type_: DOMString,

View file

@ -79,6 +79,7 @@ impl MutationObserver {
}
}
#[allow(non_snake_case)]
pub fn Constructor(
global: &Window,
callback: Rc<MutationCallback>,

View file

@ -5,62 +5,76 @@
use crate::dom::bindings::str::DOMString;
use std::borrow::Cow;
#[allow(non_snake_case)]
pub fn Product() -> DOMString {
DOMString::from("Gecko")
}
#[allow(non_snake_case)]
pub fn ProductSub() -> DOMString {
DOMString::from("20100101")
}
#[allow(non_snake_case)]
pub fn Vendor() -> DOMString {
DOMString::from("")
}
#[allow(non_snake_case)]
pub fn VendorSub() -> DOMString {
DOMString::from("")
}
#[allow(non_snake_case)]
pub fn TaintEnabled() -> bool {
false
}
#[allow(non_snake_case)]
pub fn AppName() -> DOMString {
DOMString::from("Netscape") // Like Gecko/Webkit
}
#[allow(non_snake_case)]
pub fn AppCodeName() -> DOMString {
DOMString::from("Mozilla")
}
#[allow(non_snake_case)]
#[cfg(target_os = "windows")]
pub fn Platform() -> DOMString {
DOMString::from("Win32")
}
#[allow(non_snake_case)]
#[cfg(any(target_os = "android", target_os = "linux"))]
pub fn Platform() -> DOMString {
DOMString::from("Linux")
}
#[allow(non_snake_case)]
#[cfg(target_os = "macos")]
pub fn Platform() -> DOMString {
DOMString::from("Mac")
}
#[allow(non_snake_case)]
#[cfg(target_os = "ios")]
pub fn Platform() -> DOMString {
DOMString::from("iOS")
}
#[allow(non_snake_case)]
pub fn UserAgent(user_agent: Cow<'static, str>) -> DOMString {
DOMString::from(&*user_agent)
}
#[allow(non_snake_case)]
pub fn AppVersion() -> DOMString {
DOMString::from("4.0")
}
#[allow(non_snake_case)]
pub fn Language() -> DOMString {
DOMString::from("en-US")
}

View file

@ -47,6 +47,7 @@ impl OfflineAudioCompletionEvent {
ev
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
type_: DOMString,

View file

@ -41,6 +41,7 @@ pub struct OfflineAudioContext {
pending_rendering_promise: DomRefCell<Option<Rc<Promise>>>,
}
#[allow(non_snake_case)]
impl OfflineAudioContext {
#[allow(unrooted_must_root)]
fn new_inherited(

View file

@ -69,6 +69,7 @@ impl OffscreenCanvas {
)
}
#[allow(non_snake_case)]
pub fn Constructor(
global: &GlobalScope,
width: u64,

View file

@ -95,6 +95,7 @@ impl OscillatorNode {
))
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
context: &BaseAudioContext,

View file

@ -55,6 +55,7 @@ impl PageTransitionEvent {
ev
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
type_: DOMString,

View file

@ -184,6 +184,7 @@ impl PannerNode {
))
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
context: &BaseAudioContext,

View file

@ -61,6 +61,7 @@ impl PerformanceObserver {
reflect_dom_object(Box::new(observer), global, PerformanceObserverBinding::Wrap)
}
#[allow(non_snake_case)]
pub fn Constructor(
global: &GlobalScope,
callback: Rc<PerformanceObserverCallback>,

View file

@ -85,6 +85,7 @@ impl Permissions {
// https://w3c.github.io/permissions/#dom-permissions-query
// https://w3c.github.io/permissions/#dom-permissions-request
// https://w3c.github.io/permissions/#dom-permissions-revoke
#[allow(non_snake_case)]
fn manipulate(
&self,
op: Operation,
@ -199,6 +200,7 @@ impl Permissions {
}
}
#[allow(non_snake_case)]
impl PermissionsMethods for Permissions {
// https://w3c.github.io/permissions/#dom-permissions-query
fn Query(&self, cx: JSContext, permissionDesc: *mut JSObject) -> Rc<Promise> {

View file

@ -61,6 +61,7 @@ impl PopStateEvent {
ev
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
type_: DOMString,

View file

@ -56,6 +56,8 @@ impl ProgressEvent {
}
ev
}
#[allow(non_snake_case)]
pub fn Constructor(
global: &GlobalScope,
type_: DOMString,

View file

@ -65,7 +65,7 @@ impl PromiseRejectionEvent {
ev
}
#[allow(unrooted_must_root)]
#[allow(unrooted_must_root, non_snake_case)]
pub fn Constructor(
global: &GlobalScope,
type_: DOMString,

View file

@ -67,6 +67,7 @@ impl RadioNodeList {
// https://dom.spec.whatwg.org/#dom-nodelist-length
// https://github.com/servo/servo/issues/5875
#[allow(non_snake_case)]
pub fn Length(&self) -> u32 {
self.node_list.Length()
}

View file

@ -83,6 +83,7 @@ impl Range {
}
// https://dom.spec.whatwg.org/#dom-range
#[allow(non_snake_case)]
pub fn Constructor(window: &Window) -> Fallible<DomRoot<Range>> {
let document = window.Document();
Ok(Range::new_with_doc(&document))

View file

@ -74,6 +74,7 @@ impl Request {
}
// https://fetch.spec.whatwg.org/#dom-request
#[allow(non_snake_case)]
pub fn Constructor(
global: &GlobalScope,
input: RequestInfo,

View file

@ -53,6 +53,7 @@ pub struct Response {
stream_consumer: DomRefCell<Option<StreamConsumer>>,
}
#[allow(non_snake_case)]
impl Response {
pub fn new_inherited() -> Response {
Response {

View file

@ -59,6 +59,7 @@ impl RTCIceCandidate {
)
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
config: &RTCIceCandidateInit,

View file

@ -196,6 +196,7 @@ impl RTCPeerConnection {
this
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
config: &RTCConfiguration,

View file

@ -56,6 +56,7 @@ impl RTCPeerConnectionIceEvent {
e
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
ty: DOMString,

View file

@ -44,6 +44,7 @@ impl RTCSessionDescription {
)
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
config: &RTCSessionDescriptionInit,

View file

@ -50,6 +50,7 @@ impl RTCTrackEvent {
trackevent
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
type_: DOMString,

View file

@ -83,6 +83,7 @@ impl StereoPannerNode {
))
}
#[allow(non_snake_case)]
pub fn Constructor(
window: &Window,
context: &BaseAudioContext,

View file

@ -27,6 +27,7 @@ pub struct StorageEvent {
storage_area: MutNullableDom<Storage>,
}
#[allow(non_snake_case)]
impl StorageEvent {
pub fn new_inherited(
key: Option<DOMString>,
@ -109,6 +110,7 @@ impl StorageEvent {
}
}
#[allow(non_snake_case)]
impl StorageEventMethods for StorageEvent {
// https://html.spec.whatwg.org/multipage/#dom-storageevent-key
fn GetKey(&self) -> Option<DOMString> {

View file

@ -55,7 +55,7 @@ pub trait LayoutSVGSVGElementHelpers {
}
impl LayoutSVGSVGElementHelpers for LayoutDom<SVGSVGElement> {
#[allow(unsafe_code)]
#[allow(unsafe_code, non_snake_case)]
fn data(&self) -> SVGSVGData {
unsafe {
let SVG = &*self.unsafe_get();

View file

@ -72,6 +72,7 @@ pub struct TestBinding {
url: MutableWeakRef<URL>,
}
#[allow(non_snake_case)]
impl TestBinding {
fn new_inherited() -> TestBinding {
TestBinding {
@ -1076,6 +1077,7 @@ impl TestBindingMethods for TestBinding {
}
}
#[allow(non_snake_case)]
impl TestBinding {
pub fn BooleanAttributeStatic(_: &GlobalScope) -> bool {
false

View file

@ -33,6 +33,7 @@ impl TestBindingIterable {
)
}
#[allow(non_snake_case)]
pub fn Constructor(global: &GlobalScope) -> Fallible<DomRoot<TestBindingIterable>> {
Ok(TestBindingIterable::new(global))
}

View file

@ -59,6 +59,7 @@ impl TestBindingPairIterable {
)
}
#[allow(non_snake_case)]
pub fn Constructor(global: &GlobalScope) -> Fallible<DomRoot<TestBindingPairIterable>> {
Ok(TestBindingPairIterable::new(global))
}

Some files were not shown because too many files have changed in this diff Show more