aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
Diffstat (limited to 'components/script')
-rw-r--r--components/script/canvas_state.rs62
-rw-r--r--components/script/dom/audioparam.rs3
-rw-r--r--components/script/dom/bluetoothadvertisingevent.rs1
-rw-r--r--components/script/dom/bluetoothcharacteristicproperties.rs2
-rw-r--r--components/script/dom/closeevent.rs1
-rw-r--r--components/script/dom/compositionevent.rs1
-rw-r--r--components/script/dom/dedicatedworkerglobalscope.rs7
-rw-r--r--components/script/dom/document.rs3
-rw-r--r--components/script/dom/errorevent.rs2
-rw-r--r--components/script/dom/extendablemessageevent.rs2
-rw-r--r--components/script/dom/focusevent.rs1
-rw-r--r--components/script/dom/gamepad.rs1
-rw-r--r--components/script/dom/globalscope.rs1
-rw-r--r--components/script/dom/gpuadapter.rs1
-rw-r--r--components/script/dom/gpubuffer.rs1
-rw-r--r--components/script/dom/gpudevice.rs2
-rw-r--r--components/script/dom/gputexture.rs2
-rw-r--r--components/script/dom/inputevent.rs1
-rw-r--r--components/script/dom/keyboardevent.rs2
-rw-r--r--components/script/dom/messageevent.rs2
-rw-r--r--components/script/dom/mouseevent.rs2
-rw-r--r--components/script/dom/mutationrecord.rs1
-rw-r--r--components/script/dom/serviceworkerglobalscope.rs8
-rw-r--r--components/script/dom/webgl2renderingcontext.rs3
-rw-r--r--components/script/dom/webgl_validations/tex_image_2d.rs2
25 files changed, 70 insertions, 44 deletions
diff --git a/components/script/canvas_state.rs b/components/script/canvas_state.rs
index d5ff17ec78c..2008a9b9fad 100644
--- a/components/script/canvas_state.rs
+++ b/components/script/canvas_state.rs
@@ -330,27 +330,28 @@ impl CanvasState {
pixels
}
- //
- // drawImage coordinates explained
- //
- // Source Image Destination Canvas
- // +-------------+ +-------------+
- // | | | |
- // |(sx,sy) | |(dx,dy) |
- // | +----+ | | +----+ |
- // | | | | | | | |
- // | | |sh |---->| | |dh |
- // | | | | | | | |
- // | +----+ | | +----+ |
- // | sw | | dw |
- // | | | |
- // +-------------+ +-------------+
- //
- //
- // The rectangle (sx, sy, sw, sh) from the source image
- // is copied on the rectangle (dx, dy, dh, dw) of the destination canvas
- //
- // https://html.spec.whatwg.org/multipage/#dom-context-2d-drawimage
+ ///
+ /// drawImage coordinates explained
+ ///
+ /// ```
+ /// Source Image Destination Canvas
+ /// +-------------+ +-------------+
+ /// | | | |
+ /// |(sx,sy) | |(dx,dy) |
+ /// | +----+ | | +----+ |
+ /// | | | | | | | |
+ /// | | |sh |---->| | |dh |
+ /// | | | | | | | |
+ /// | +----+ | | +----+ |
+ /// | sw | | dw |
+ /// | | | |
+ /// +-------------+ +-------------+
+ /// ```
+ ///
+ /// The rectangle (sx, sy, sw, sh) from the source image
+ /// is copied on the rectangle (dx, dy, dh, dw) of the destination canvas
+ ///
+ /// <https://html.spec.whatwg.org/multipage/#dom-context-2d-drawimage>
#[allow(clippy::too_many_arguments)]
fn draw_image_internal(
&self,
@@ -594,10 +595,10 @@ impl CanvasState {
}
}
- // It is used by DrawImage to calculate the size of the source and destination rectangles based
- // on the drawImage call arguments
- // source rectangle = area of the original image to be copied
- // destination rectangle = area of the destination canvas where the source image is going to be drawn
+ /// It is used by DrawImage to calculate the size of the source and destination rectangles based
+ /// on the drawImage call arguments
+ /// source rectangle = area of the original image to be copied
+ /// destination rectangle = area of the destination canvas where the source image is going to be drawn
#[allow(clippy::too_many_arguments)]
fn adjust_source_dest_rects(
&self,
@@ -844,7 +845,7 @@ impl CanvasState {
)
}
- // https://html.spec.whatwg.org/multipage/#dom-context-2d-createradialgradient
+ /// <https://html.spec.whatwg.org/multipage/#dom-context-2d-createradialgradient>
#[allow(clippy::too_many_arguments)]
pub fn create_radial_gradient(
&self,
@@ -1283,9 +1284,8 @@ impl CanvasState {
)
}
- // https://html.spec.whatwg.org/multipage/#dom-context-2d-putimagedata
- #[allow(unsafe_code)]
- #[allow(clippy::too_many_arguments)]
+ /// <https://html.spec.whatwg.org/multipage/#dom-context-2d-putimagedata>
+ #[allow(unsafe_code, clippy::too_many_arguments)]
pub fn put_image_data_(
&self,
canvas_size: Size2D<u64>,
@@ -1381,7 +1381,7 @@ impl CanvasState {
)
}
- // https://html.spec.whatwg.org/multipage/#dom-context-2d-drawimage
+ /// <https://html.spec.whatwg.org/multipage/#dom-context-2d-drawimage>
#[allow(clippy::too_many_arguments)]
pub fn draw_image__(
&self,
@@ -1653,7 +1653,7 @@ impl CanvasState {
Ok(())
}
- // https://html.spec.whatwg.org/multipage/#dom-context-2d-ellipse
+ /// <https://html.spec.whatwg.org/multipage/#dom-context-2d-ellipse>
#[allow(clippy::too_many_arguments)]
pub fn ellipse(
&self,
diff --git a/components/script/dom/audioparam.rs b/components/script/dom/audioparam.rs
index 9687e5a9e03..f54a4785073 100644
--- a/components/script/dom/audioparam.rs
+++ b/components/script/dom/audioparam.rs
@@ -64,8 +64,7 @@ impl AudioParam {
}
}
- #[allow(crown::unrooted_must_root)]
- #[allow(clippy::too_many_arguments)]
+ #[allow(crown::unrooted_must_root, clippy::too_many_arguments)]
pub fn new(
window: &Window,
context: &BaseAudioContext,
diff --git a/components/script/dom/bluetoothadvertisingevent.rs b/components/script/dom/bluetoothadvertisingevent.rs
index d24ad715036..e10a95a829b 100644
--- a/components/script/dom/bluetoothadvertisingevent.rs
+++ b/components/script/dom/bluetoothadvertisingevent.rs
@@ -50,6 +50,7 @@ impl BluetoothAdvertisingEvent {
}
}
+ #[allow(clippy::too_many_arguments)]
fn new(
global: &GlobalScope,
proto: Option<HandleObject>,
diff --git a/components/script/dom/bluetoothcharacteristicproperties.rs b/components/script/dom/bluetoothcharacteristicproperties.rs
index 3401d445a89..be322eec17a 100644
--- a/components/script/dom/bluetoothcharacteristicproperties.rs
+++ b/components/script/dom/bluetoothcharacteristicproperties.rs
@@ -26,6 +26,7 @@ pub struct BluetoothCharacteristicProperties {
#[allow(non_snake_case)]
impl BluetoothCharacteristicProperties {
+ #[allow(clippy::too_many_arguments)]
pub fn new_inherited(
broadcast: bool,
read: bool,
@@ -51,6 +52,7 @@ impl BluetoothCharacteristicProperties {
}
}
+ #[allow(clippy::too_many_arguments)]
pub fn new(
global: &GlobalScope,
broadcast: bool,
diff --git a/components/script/dom/closeevent.rs b/components/script/dom/closeevent.rs
index 4dee3eb84cf..17347e2d4fe 100644
--- a/components/script/dom/closeevent.rs
+++ b/components/script/dom/closeevent.rs
@@ -50,6 +50,7 @@ impl CloseEvent {
)
}
+ #[allow(clippy::too_many_arguments)]
fn new_with_proto(
global: &GlobalScope,
proto: Option<HandleObject>,
diff --git a/components/script/dom/compositionevent.rs b/components/script/dom/compositionevent.rs
index 2f4cc05943b..5061f187141 100644
--- a/components/script/dom/compositionevent.rs
+++ b/components/script/dom/compositionevent.rs
@@ -48,6 +48,7 @@ impl CompositionEvent {
)
}
+ #[allow(clippy::too_many_arguments)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/dedicatedworkerglobalscope.rs b/components/script/dom/dedicatedworkerglobalscope.rs
index 3f90990dba1..6baa4673572 100644
--- a/components/script/dom/dedicatedworkerglobalscope.rs
+++ b/components/script/dom/dedicatedworkerglobalscope.rs
@@ -237,6 +237,7 @@ impl WorkerEventLoopMethods for DedicatedWorkerGlobalScope {
}
impl DedicatedWorkerGlobalScope {
+ #[allow(clippy::too_many_arguments)]
fn new_inherited(
init: WorkerGlobalScopeInit,
worker_name: DOMString,
@@ -274,7 +275,7 @@ impl DedicatedWorkerGlobalScope {
}
}
- #[allow(unsafe_code)]
+ #[allow(unsafe_code, clippy::too_many_arguments)]
pub fn new(
init: WorkerGlobalScopeInit,
worker_name: DOMString,
@@ -311,8 +312,8 @@ impl DedicatedWorkerGlobalScope {
unsafe { DedicatedWorkerGlobalScopeBinding::Wrap(SafeJSContext::from_ptr(cx), scope) }
}
- #[allow(unsafe_code)]
- // https://html.spec.whatwg.org/multipage/#run-a-worker
+ /// <https://html.spec.whatwg.org/multipage/#run-a-worker>
+ #[allow(unsafe_code, clippy::too_many_arguments)]
pub fn run_worker_scope(
mut init: WorkerGlobalScopeInit,
worker_url: ServoUrl,
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index c29b61460f8..d427fbcf631 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -3060,6 +3060,7 @@ pub enum HasBrowsingContext {
}
impl Document {
+ #[allow(clippy::too_many_arguments)]
pub fn new_inherited(
window: &Window,
has_browsing_context: HasBrowsingContext,
@@ -3315,6 +3316,7 @@ impl Document {
))
}
+ #[allow(clippy::too_many_arguments)]
pub fn new(
window: &Window,
has_browsing_context: HasBrowsingContext,
@@ -3348,6 +3350,7 @@ impl Document {
)
}
+ #[allow(clippy::too_many_arguments)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/errorevent.rs b/components/script/dom/errorevent.rs
index c144ca258a7..aa3a209d77d 100644
--- a/components/script/dom/errorevent.rs
+++ b/components/script/dom/errorevent.rs
@@ -51,6 +51,7 @@ impl ErrorEvent {
reflect_dom_object_with_proto(Box::new(ErrorEvent::new_inherited()), global, proto)
}
+ #[allow(clippy::too_many_arguments)]
pub fn new(
global: &GlobalScope,
type_: Atom,
@@ -67,6 +68,7 @@ impl ErrorEvent {
)
}
+ #[allow(clippy::too_many_arguments)]
fn new_with_proto(
global: &GlobalScope,
proto: Option<HandleObject>,
diff --git a/components/script/dom/extendablemessageevent.rs b/components/script/dom/extendablemessageevent.rs
index eb27c30400d..122bd07f342 100644
--- a/components/script/dom/extendablemessageevent.rs
+++ b/components/script/dom/extendablemessageevent.rs
@@ -64,6 +64,7 @@ impl ExtendableMessageEvent {
}
}
+ #[allow(clippy::too_many_arguments)]
pub fn new(
global: &GlobalScope,
type_: Atom,
@@ -87,6 +88,7 @@ impl ExtendableMessageEvent {
)
}
+ #[allow(clippy::too_many_arguments)]
fn new_with_proto(
global: &GlobalScope,
proto: Option<HandleObject>,
diff --git a/components/script/dom/focusevent.rs b/components/script/dom/focusevent.rs
index cb064b3fb1e..69a90434ac4 100644
--- a/components/script/dom/focusevent.rs
+++ b/components/script/dom/focusevent.rs
@@ -66,6 +66,7 @@ impl FocusEvent {
)
}
+ #[allow(clippy::too_many_arguments)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/gamepad.rs b/components/script/dom/gamepad.rs
index e057f83d76c..75f2dc2f42f 100644
--- a/components/script/dom/gamepad.rs
+++ b/components/script/dom/gamepad.rs
@@ -52,6 +52,7 @@ pub struct Gamepad {
}
impl Gamepad {
+ #[allow(clippy::too_many_arguments)]
fn new_inherited(
gamepad_id: u32,
id: String,
diff --git a/components/script/dom/globalscope.rs b/components/script/dom/globalscope.rs
index 7072a7114f9..c60aa0f09be 100644
--- a/components/script/dom/globalscope.rs
+++ b/components/script/dom/globalscope.rs
@@ -742,6 +742,7 @@ impl FileListener {
}
impl GlobalScope {
+ #[allow(clippy::too_many_arguments)]
pub fn new_inherited(
pipeline_id: PipelineId,
devtools_chan: Option<IpcSender<ScriptToDevtoolsControlMsg>>,
diff --git a/components/script/dom/gpuadapter.rs b/components/script/dom/gpuadapter.rs
index 33708ac396c..81749917e50 100644
--- a/components/script/dom/gpuadapter.rs
+++ b/components/script/dom/gpuadapter.rs
@@ -63,6 +63,7 @@ impl GPUAdapter {
}
}
+ #[allow(clippy::too_many_arguments)]
pub fn new(
global: &GlobalScope,
channel: WebGPU,
diff --git a/components/script/dom/gpubuffer.rs b/components/script/dom/gpubuffer.rs
index 430cf031cbb..efdc2e87a77 100644
--- a/components/script/dom/gpubuffer.rs
+++ b/components/script/dom/gpubuffer.rs
@@ -98,6 +98,7 @@ impl GPUBuffer {
}
}
+ #[allow(clippy::too_many_arguments)]
pub fn new(
global: &GlobalScope,
channel: WebGPU,
diff --git a/components/script/dom/gpudevice.rs b/components/script/dom/gpudevice.rs
index bc47b1bdfda..d0d44e040c6 100644
--- a/components/script/dom/gpudevice.rs
+++ b/components/script/dom/gpudevice.rs
@@ -114,6 +114,7 @@ pub struct GPUDevice {
}
impl GPUDevice {
+ #[allow(clippy::too_many_arguments)]
fn new_inherited(
channel: WebGPU,
adapter: &GPUAdapter,
@@ -144,6 +145,7 @@ impl GPUDevice {
}
}
+ #[allow(clippy::too_many_arguments)]
pub fn new(
global: &GlobalScope,
channel: WebGPU,
diff --git a/components/script/dom/gputexture.rs b/components/script/dom/gputexture.rs
index 582e0883902..a08944a9244 100644
--- a/components/script/dom/gputexture.rs
+++ b/components/script/dom/gputexture.rs
@@ -46,6 +46,7 @@ pub struct GPUTexture {
}
impl GPUTexture {
+ #[allow(clippy::too_many_arguments)]
fn new_inherited(
texture: WebGPUTexture,
device: &GPUDevice,
@@ -74,6 +75,7 @@ impl GPUTexture {
}
}
+ #[allow(clippy::too_many_arguments)]
pub fn new(
global: &GlobalScope,
texture: WebGPUTexture,
diff --git a/components/script/dom/inputevent.rs b/components/script/dom/inputevent.rs
index aab34c990e7..3049ad75fd8 100644
--- a/components/script/dom/inputevent.rs
+++ b/components/script/dom/inputevent.rs
@@ -22,6 +22,7 @@ pub struct InputEvent {
}
impl InputEvent {
+ #[allow(clippy::too_many_arguments)]
fn new(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/keyboardevent.rs b/components/script/dom/keyboardevent.rs
index d973f78315c..7da3ca695a8 100644
--- a/components/script/dom/keyboardevent.rs
+++ b/components/script/dom/keyboardevent.rs
@@ -64,6 +64,7 @@ impl KeyboardEvent {
reflect_dom_object_with_proto(Box::new(KeyboardEvent::new_inherited()), window, proto)
}
+ #[allow(clippy::too_many_arguments)]
pub fn new(
window: &Window,
type_: DOMString,
@@ -99,6 +100,7 @@ impl KeyboardEvent {
)
}
+ #[allow(clippy::too_many_arguments)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/messageevent.rs b/components/script/dom/messageevent.rs
index 5fb0352d266..e71e9fb4bf4 100644
--- a/components/script/dom/messageevent.rs
+++ b/components/script/dom/messageevent.rs
@@ -131,6 +131,7 @@ impl MessageEvent {
ev
}
+ #[allow(clippy::too_many_arguments)]
pub fn new(
global: &GlobalScope,
type_: Atom,
@@ -156,6 +157,7 @@ impl MessageEvent {
)
}
+ #[allow(clippy::too_many_arguments)]
fn new_with_proto(
global: &GlobalScope,
proto: Option<HandleObject>,
diff --git a/components/script/dom/mouseevent.rs b/components/script/dom/mouseevent.rs
index eb9ecf8770e..327723f48f8 100644
--- a/components/script/dom/mouseevent.rs
+++ b/components/script/dom/mouseevent.rs
@@ -85,6 +85,7 @@ impl MouseEvent {
reflect_dom_object_with_proto(Box::new(MouseEvent::new_inherited()), window, proto)
}
+ #[allow(clippy::too_many_arguments)]
pub fn new(
window: &Window,
type_: DOMString,
@@ -128,6 +129,7 @@ impl MouseEvent {
)
}
+ #[allow(clippy::too_many_arguments)]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,
diff --git a/components/script/dom/mutationrecord.rs b/components/script/dom/mutationrecord.rs
index 505928367b4..15680f338bf 100644
--- a/components/script/dom/mutationrecord.rs
+++ b/components/script/dom/mutationrecord.rs
@@ -96,6 +96,7 @@ impl MutationRecord {
)
}
+ #[allow(clippy::too_many_arguments)]
fn new_inherited(
record_type: &str,
target: &Node,
diff --git a/components/script/dom/serviceworkerglobalscope.rs b/components/script/dom/serviceworkerglobalscope.rs
index 5c9e1210ba6..e0f0ef21d1b 100644
--- a/components/script/dom/serviceworkerglobalscope.rs
+++ b/components/script/dom/serviceworkerglobalscope.rs
@@ -253,8 +253,7 @@ impl ServiceWorkerGlobalScope {
}
}
- #[allow(unsafe_code)]
- #[allow(clippy::too_many_arguments)]
+ #[allow(unsafe_code, clippy::too_many_arguments)]
pub fn new(
init: WorkerGlobalScopeInit,
worker_url: ServoUrl,
@@ -285,9 +284,8 @@ impl ServiceWorkerGlobalScope {
unsafe { ServiceWorkerGlobalScopeBinding::Wrap(SafeJSContext::from_ptr(cx), scope) }
}
- #[allow(unsafe_code)]
- // https://w3c.github.io/ServiceWorker/#run-service-worker-algorithm
- #[allow(clippy::too_many_arguments)]
+ /// <https://w3c.github.io/ServiceWorker/#run-service-worker-algorithm>
+ #[allow(unsafe_code, clippy::too_many_arguments)]
pub fn run_serviceworker_scope(
scope_things: ScopeThings,
own_sender: Sender<ServiceWorkerScriptMsg>,
diff --git a/components/script/dom/webgl2renderingcontext.rs b/components/script/dom/webgl2renderingcontext.rs
index bfd972b8c20..351acca1bca 100644
--- a/components/script/dom/webgl2renderingcontext.rs
+++ b/components/script/dom/webgl2renderingcontext.rs
@@ -453,8 +453,7 @@ impl WebGL2RenderingContext {
})
}
- #[allow(unsafe_code)]
- #[allow(clippy::too_many_arguments)]
+ #[allow(unsafe_code, clippy::too_many_arguments)]
fn read_pixels_into(
&self,
x: i32,
diff --git a/components/script/dom/webgl_validations/tex_image_2d.rs b/components/script/dom/webgl_validations/tex_image_2d.rs
index 9c6d56e31f1..96afb62820e 100644
--- a/components/script/dom/webgl_validations/tex_image_2d.rs
+++ b/components/script/dom/webgl_validations/tex_image_2d.rs
@@ -254,7 +254,7 @@ pub struct TexImage2DValidator<'a> {
}
impl<'a> TexImage2DValidator<'a> {
- // TODO: Move data validation logic here.
+ /// TODO: Move data validation logic here.
#[allow(clippy::too_many_arguments)]
pub fn new(
context: &'a WebGLRenderingContext,