From 5c1723c9833c133e1af641533293e63d8723f8d3 Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Mon, 22 Jan 2024 14:13:48 +0100 Subject: rustdoc: Fix many rustdoc errors (#31147) This fixes many rustdoc errors that occur due to raw URLs in rustdoc comments as well as unescaped Rust code that should be in backticks. --- components/script/body.rs | 6 +- components/script/canvas_state.rs | 2 +- components/script/dom/analysernode.rs | 28 +- components/script/dom/audiobuffer.rs | 10 +- components/script/dom/audiocontext.rs | 12 +- components/script/dom/baseaudiocontext.rs | 40 +- components/script/dom/bindings/root.rs | 9 +- components/script/dom/bindings/serializable.rs | 2 +- components/script/dom/bindings/str.rs | 36 +- components/script/dom/bindings/structuredclone.rs | 5 +- components/script/dom/bindings/trace.rs | 2 +- components/script/dom/bindings/transferable.rs | 2 +- components/script/dom/bindings/xmlname.rs | 6 +- components/script/dom/blob.rs | 4 +- components/script/dom/customelementregistry.rs | 4 +- .../script/dom/dedicatedworkerglobalscope.rs | 4 +- components/script/dom/dissimilaroriginwindow.rs | 8 +- components/script/dom/document.rs | 38 +- components/script/dom/element.rs | 2 +- components/script/dom/extendablemessageevent.rs | 10 +- components/script/dom/fakexrdevice.rs | 20 +- components/script/dom/fakexrinputcontroller.rs | 22 +- components/script/dom/globalscope.rs | 16 +- components/script/dom/gpuadapter.rs | 10 +- components/script/dom/gpuadapterinfo.rs | 8 +- components/script/dom/gpubindgroup.rs | 4 +- components/script/dom/gpubindgrouplayout.rs | 4 +- components/script/dom/gpubuffer.rs | 12 +- components/script/dom/gpucanvascontext.rs | 12 +- components/script/dom/gpucommandbuffer.rs | 4 +- components/script/dom/gpucommandencoder.rs | 18 +- components/script/dom/gpucompilationinfo.rs | 2 +- components/script/dom/gpucompilationmessage.rs | 12 +- components/script/dom/gpucomputepassencoder.rs | 14 +- components/script/dom/gpucomputepipeline.rs | 6 +- components/script/dom/gpudevice.rs | 46 +-- components/script/dom/gpudevicelostinfo.rs | 4 +- components/script/dom/gpuoutofmemoryerror.rs | 2 +- components/script/dom/gpupipelinelayout.rs | 4 +- components/script/dom/gpuqueryset.rs | 6 +- components/script/dom/gpuqueue.rs | 10 +- components/script/dom/gpurenderbundle.rs | 4 +- components/script/dom/gpurenderbundleencoder.rs | 22 +- components/script/dom/gpurenderpassencoder.rs | 32 +- components/script/dom/gpurenderpipeline.rs | 6 +- components/script/dom/gpusampler.rs | 4 +- components/script/dom/gpushadermodule.rs | 6 +- components/script/dom/gpusupportedlimits.rs | 56 +-- components/script/dom/gputexture.rs | 8 +- components/script/dom/gputextureview.rs | 4 +- components/script/dom/gpuuncapturederrorevent.rs | 6 +- components/script/dom/gpuvalidationerror.rs | 4 +- components/script/dom/htmlanchorelement.rs | 2 +- components/script/dom/htmlcanvaselement.rs | 2 +- components/script/dom/htmlformelement.rs | 6 +- components/script/dom/htmliframeelement.rs | 2 +- components/script/dom/htmlimageelement.rs | 9 +- components/script/dom/htmlmediaelement.rs | 30 +- components/script/dom/htmlscriptelement.rs | 2 +- components/script/dom/htmlvideoelement.rs | 8 +- components/script/dom/mediadeviceinfo.rs | 8 +- components/script/dom/mediadevices.rs | 4 +- .../script/dom/mediaelementaudiosourcenode.rs | 2 +- components/script/dom/mediametadata.rs | 14 +- components/script/dom/mediasession.rs | 18 +- components/script/dom/mediastream.rs | 14 +- .../script/dom/mediastreamaudiodestinationnode.rs | 2 +- .../script/dom/mediastreamaudiosourcenode.rs | 2 +- components/script/dom/mediastreamtrack.rs | 6 +- components/script/dom/messageport.rs | 2 +- components/script/dom/mutationobserver.rs | 4 +- components/script/dom/navigator.rs | 6 +- components/script/dom/node.rs | 4 +- components/script/dom/performance.rs | 6 +- components/script/dom/raredata.rs | 2 +- components/script/dom/response.rs | 2 +- components/script/dom/rtcicecandidate.rs | 10 +- components/script/dom/rtcpeerconnection.rs | 30 +- components/script/dom/rtcpeerconnectioniceevent.rs | 6 +- components/script/dom/rtcrtptransceiver.rs | 6 +- components/script/dom/rtcsessiondescription.rs | 4 +- components/script/dom/serviceworker.rs | 6 +- components/script/dom/serviceworkercontainer.rs | 4 +- components/script/dom/servoparser/async_html.rs | 2 +- components/script/dom/servoparser/mod.rs | 4 +- components/script/dom/shadowroot.rs | 4 +- components/script/dom/submitevent.rs | 2 +- components/script/dom/textcontrol.rs | 2 +- components/script/dom/textmetrics.rs | 24 +- components/script/dom/webgl2renderingcontext.rs | 444 ++++++++++----------- components/script/dom/webgl_extensions/wrapper.rs | 2 +- components/script/dom/webglbuffer.rs | 2 +- components/script/dom/webglrenderingcontext.rs | 4 +- components/script/dom/webgltexture.rs | 3 +- components/script/dom/window.rs | 8 +- components/script/dom/windowproxy.rs | 22 +- components/script/dom/worker.rs | 6 +- components/script/dom/xrframe.rs | 14 +- components/script/dom/xrhand.rs | 4 +- components/script/dom/xrinputsource.rs | 8 +- components/script/dom/xrinputsourcearray.rs | 4 +- components/script/dom/xrjointpose.rs | 2 +- components/script/dom/xrmediabinding.rs | 6 +- components/script/dom/xrpose.rs | 2 +- components/script/dom/xrray.rs | 10 +- components/script/dom/xrreferencespace.rs | 2 +- components/script/dom/xrrenderstate.rs | 10 +- components/script/dom/xrrigidtransform.rs | 2 +- components/script/dom/xrsession.rs | 24 +- components/script/dom/xrsubimage.rs | 2 +- components/script/dom/xrsystem.rs | 6 +- components/script/dom/xrtest.rs | 6 +- components/script/dom/xrview.rs | 6 +- components/script/dom/xrviewerpose.rs | 2 +- components/script/dom/xrviewport.rs | 8 +- components/script/dom/xrwebglbinding.rs | 14 +- components/script/dom/xrwebgllayer.rs | 14 +- components/script/dom/xrwebglsubimage.rs | 10 +- components/script/fetch.rs | 2 +- components/script/script_module.rs | 26 +- components/script/script_runtime.rs | 4 +- components/script/script_thread.rs | 6 +- components/script/serviceworker_manager.rs | 10 +- components/script/task_queue.rs | 4 +- components/script/task_source/timer.rs | 2 +- components/script/timers.rs | 2 +- 126 files changed, 791 insertions(+), 791 deletions(-) (limited to 'components/script') diff --git a/components/script/body.rs b/components/script/body.rs index 5dbfb706f7d..f922db3b046 100644 --- a/components/script/body.rs +++ b/components/script/body.rs @@ -342,7 +342,7 @@ impl Callback for TransmitBodyPromiseRejectionHandler { } } -/// The result of https://fetch.spec.whatwg.org/#concept-bodyinit-extract +/// The result of pub struct ExtractedBody { pub stream: DomRoot, pub source: BodySource, @@ -353,12 +353,12 @@ pub struct ExtractedBody { impl ExtractedBody { /// Build a request body from the extracted body, /// to be sent over IPC to net to use with `concept-request-transmit-body`, - /// see https://fetch.spec.whatwg.org/#concept-request-transmit-body. + /// see . /// /// Also returning the corresponding readable stream, /// to be stored on the request in script, /// and potentially used as part of `consume_body`, - /// see https://fetch.spec.whatwg.org/#concept-body-consume-body + /// see /// /// Transmitting a body over fetch, and consuming it in script, /// are mutually exclusive operations, since each will lock the stream to a reader. diff --git a/components/script/canvas_state.rs b/components/script/canvas_state.rs index d08f142ca10..196a5f21559 100644 --- a/components/script/canvas_state.rs +++ b/components/script/canvas_state.rs @@ -150,7 +150,7 @@ pub(crate) struct CanvasState { #[no_trace] image_cache: Arc, /// The base URL for resolving CSS image URL values. - /// Needed because of https://github.com/servo/servo/issues/17625 + /// Needed because of #[no_trace] base_url: ServoUrl, #[no_trace] diff --git a/components/script/dom/analysernode.rs b/components/script/dom/analysernode.rs index 71bf078202c..2d727f28e86 100644 --- a/components/script/dom/analysernode.rs +++ b/components/script/dom/analysernode.rs @@ -129,7 +129,7 @@ impl AnalyserNode { Ok(object) } - /// https://webaudio.github.io/web-audio-api/#dom-analysernode-analysernode + /// #[allow(non_snake_case)] pub fn Constructor( window: &Window, @@ -147,7 +147,7 @@ impl AnalyserNode { impl AnalyserNodeMethods for AnalyserNode { #[allow(unsafe_code)] - /// https://webaudio.github.io/web-audio-api/#dom-analysernode-getfloatfrequencydata + /// fn GetFloatFrequencyData(&self, mut array: CustomAutoRooterGuard) { // Invariant to maintain: No JS code that may touch the array should // run whilst we're writing to it @@ -156,7 +156,7 @@ impl AnalyserNodeMethods for AnalyserNode { } #[allow(unsafe_code)] - /// https://webaudio.github.io/web-audio-api/#dom-analysernode-getbytefrequencydata + /// fn GetByteFrequencyData(&self, mut array: CustomAutoRooterGuard) { // Invariant to maintain: No JS code that may touch the array should // run whilst we're writing to it @@ -165,7 +165,7 @@ impl AnalyserNodeMethods for AnalyserNode { } #[allow(unsafe_code)] - /// https://webaudio.github.io/web-audio-api/#dom-analysernode-getfloattimedomaindata + /// fn GetFloatTimeDomainData(&self, mut array: CustomAutoRooterGuard) { // Invariant to maintain: No JS code that may touch the array should // run whilst we're writing to it @@ -174,7 +174,7 @@ impl AnalyserNodeMethods for AnalyserNode { } #[allow(unsafe_code)] - /// https://webaudio.github.io/web-audio-api/#dom-analysernode-getbytetimedomaindata + /// fn GetByteTimeDomainData(&self, mut array: CustomAutoRooterGuard) { // Invariant to maintain: No JS code that may touch the array should // run whilst we're writing to it @@ -182,7 +182,7 @@ impl AnalyserNodeMethods for AnalyserNode { self.engine.borrow().fill_byte_time_domain_data(dest); } - /// https://webaudio.github.io/web-audio-api/#dom-analysernode-fftsize + /// fn SetFftSize(&self, value: u32) -> Fallible<()> { if value > 32768 || value < 32 || (value & (value - 1) != 0) { return Err(Error::IndexSize); @@ -191,22 +191,22 @@ impl AnalyserNodeMethods for AnalyserNode { Ok(()) } - /// https://webaudio.github.io/web-audio-api/#dom-analysernode-fftsize + /// fn FftSize(&self) -> u32 { self.engine.borrow().get_fft_size() as u32 } - /// https://webaudio.github.io/web-audio-api/#dom-analysernode-frequencybincount + /// fn FrequencyBinCount(&self) -> u32 { self.FftSize() / 2 } - /// https://webaudio.github.io/web-audio-api/#dom-analysernode-mindecibels + /// fn MinDecibels(&self) -> Finite { Finite::wrap(self.engine.borrow().get_min_decibels()) } - /// https://webaudio.github.io/web-audio-api/#dom-analysernode-mindecibels + /// fn SetMinDecibels(&self, value: Finite) -> Fallible<()> { if *value >= self.engine.borrow().get_max_decibels() { return Err(Error::IndexSize); @@ -215,12 +215,12 @@ impl AnalyserNodeMethods for AnalyserNode { Ok(()) } - /// https://webaudio.github.io/web-audio-api/#dom-analysernode-maxdecibels + /// fn MaxDecibels(&self) -> Finite { Finite::wrap(self.engine.borrow().get_max_decibels()) } - /// https://webaudio.github.io/web-audio-api/#dom-analysernode-maxdecibels + /// fn SetMaxDecibels(&self, value: Finite) -> Fallible<()> { if *value <= self.engine.borrow().get_min_decibels() { return Err(Error::IndexSize); @@ -229,12 +229,12 @@ impl AnalyserNodeMethods for AnalyserNode { Ok(()) } - /// https://webaudio.github.io/web-audio-api/#dom-analysernode-smoothingtimeconstant + /// fn SmoothingTimeConstant(&self) -> Finite { Finite::wrap(self.engine.borrow().get_smoothing_constant()) } - /// https://webaudio.github.io/web-audio-api/#dom-analysernode-smoothingtimeconstant + /// fn SetSmoothingTimeConstant(&self, value: Finite) -> Fallible<()> { if *value < 0. || *value > 1. { return Err(Error::IndexSize); diff --git a/components/script/dom/audiobuffer.rs b/components/script/dom/audiobuffer.rs index 1cbba52aed7..3dfa2d0a25a 100644 --- a/components/script/dom/audiobuffer.rs +++ b/components/script/dom/audiobuffer.rs @@ -34,7 +34,7 @@ pub const MAX_SAMPLE_RATE: f32 = 192000.; /// /// js_channels buffers are (re)attached right before calling GetChannelData /// and remain attached until its contents are needed by some other API -/// implementation. Follow https://webaudio.github.io/web-audio-api/#acquire-the-content +/// implementation. Follow /// to know in which situations js_channels buffers must be detached. /// #[dom_struct] @@ -48,13 +48,13 @@ pub struct AudioBuffer { #[ignore_malloc_size_of = "servo_media"] #[no_trace] shared_channels: DomRefCell>, - /// https://webaudio.github.io/web-audio-api/#dom-audiobuffer-samplerate + /// sample_rate: f32, - /// https://webaudio.github.io/web-audio-api/#dom-audiobuffer-length + /// length: u32, - /// https://webaudio.github.io/web-audio-api/#dom-audiobuffer-duration + /// duration: f64, - /// https://webaudio.github.io/web-audio-api/#dom-audiobuffer-numberofchannels + /// number_of_channels: u32, } diff --git a/components/script/dom/audiocontext.rs b/components/script/dom/audiocontext.rs index 524aae9d647..a82ff1e93a3 100644 --- a/components/script/dom/audiocontext.rs +++ b/components/script/dom/audiocontext.rs @@ -39,9 +39,9 @@ use crate::task_source::TaskSource; pub struct AudioContext { context: BaseAudioContext, latency_hint: AudioContextLatencyCategory, - /// https://webaudio.github.io/web-audio-api/#dom-audiocontext-baselatency + /// base_latency: f64, - /// https://webaudio.github.io/web-audio-api/#dom-audiocontext-outputlatency + /// output_latency: f64, } @@ -256,7 +256,7 @@ impl AudioContextMethods for AudioContext { promise } - /// https://webaudio.github.io/web-audio-api/#dom-audiocontext-createmediaelementsource + /// fn CreateMediaElementSource( &self, media_element: &HTMLMediaElement, @@ -266,7 +266,7 @@ impl AudioContextMethods for AudioContext { MediaElementAudioSourceNode::new(window, self, media_element) } - /// https://webaudio.github.io/web-audio-api/#dom-audiocontext-createmediastreamsource + /// fn CreateMediaStreamSource( &self, stream: &MediaStream, @@ -276,7 +276,7 @@ impl AudioContextMethods for AudioContext { MediaStreamAudioSourceNode::new(window, self, stream) } - /// https://webaudio.github.io/web-audio-api/#dom-audiocontext-createmediastreamtracksource + /// fn CreateMediaStreamTrackSource( &self, track: &MediaStreamTrack, @@ -286,7 +286,7 @@ impl AudioContextMethods for AudioContext { MediaStreamTrackAudioSourceNode::new(window, self, track) } - /// https://webaudio.github.io/web-audio-api/#dom-audiocontext-createmediastreamdestination + /// fn CreateMediaStreamDestination(&self) -> Fallible> { let global = self.global(); let window = global.as_window(); diff --git a/components/script/dom/baseaudiocontext.rs b/components/script/dom/baseaudiocontext.rs index 9673e964352..e661cf30955 100644 --- a/components/script/dom/baseaudiocontext.rs +++ b/components/script/dom/baseaudiocontext.rs @@ -86,20 +86,20 @@ pub struct BaseAudioContext { #[ignore_malloc_size_of = "servo_media"] #[no_trace] audio_context_impl: Arc>, - /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-destination + /// destination: MutNullableDom, listener: MutNullableDom, /// Resume promises which are soon to be fulfilled by a queued task. #[ignore_malloc_size_of = "promises are hard"] in_flight_resume_promises_queue: DomRefCell]>, ErrorResult)>>, - /// https://webaudio.github.io/web-audio-api/#pendingresumepromises + /// #[ignore_malloc_size_of = "promises are hard"] pending_resume_promises: DomRefCell>>, #[ignore_malloc_size_of = "promises are hard"] decode_resolvers: DomRefCell>, - /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-samplerate + /// sample_rate: f32, - /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-state + /// /// Although servo-media already keeps track of the control thread state, /// we keep a state flag here as well. This is so that we can synchronously /// throw when trying to do things on the context when the context has just @@ -268,23 +268,23 @@ impl BaseAudioContext { } impl BaseAudioContextMethods for BaseAudioContext { - /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-samplerate + /// fn SampleRate(&self) -> Finite { Finite::wrap(self.sample_rate) } - /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-currenttime + /// fn CurrentTime(&self) -> Finite { let current_time = self.audio_context_impl.lock().unwrap().current_time(); Finite::wrap(current_time) } - /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-state + /// fn State(&self) -> AudioContextState { self.state.get() } - /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-resume + /// fn Resume(&self, comp: InRealm) -> Rc { // Step 1. let promise = Promise::new_in_current_realm(comp); @@ -315,7 +315,7 @@ impl BaseAudioContextMethods for BaseAudioContext { promise } - /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-destination + /// fn Destination(&self) -> DomRoot { let global = self.global(); self.destination.or_init(|| { @@ -327,7 +327,7 @@ impl BaseAudioContextMethods for BaseAudioContext { }) } - /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-listener + /// fn Listener(&self) -> DomRoot { let global = self.global(); let window = global.as_window(); @@ -337,7 +337,7 @@ impl BaseAudioContextMethods for BaseAudioContext { // https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-onstatechange event_handler!(statechange, GetOnstatechange, SetOnstatechange); - /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createoscillator + /// fn CreateOscillator(&self) -> Fallible> { OscillatorNode::new( &self.global().as_window(), @@ -346,22 +346,22 @@ impl BaseAudioContextMethods for BaseAudioContext { ) } - /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-creategain + /// fn CreateGain(&self) -> Fallible> { GainNode::new(&self.global().as_window(), &self, &GainOptions::empty()) } - /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createpanner + /// fn CreatePanner(&self) -> Fallible> { PannerNode::new(&self.global().as_window(), &self, &PannerOptions::empty()) } - /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createanalyser + /// fn CreateAnalyser(&self) -> Fallible> { AnalyserNode::new(&self.global().as_window(), &self, &AnalyserOptions::empty()) } - /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createbiquadfilter + /// fn CreateBiquadFilter(&self) -> Fallible> { BiquadFilterNode::new( &self.global().as_window(), @@ -370,7 +370,7 @@ impl BaseAudioContextMethods for BaseAudioContext { ) } - /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createstereopanner + /// fn CreateStereoPanner(&self) -> Fallible> { StereoPannerNode::new( &self.global().as_window(), @@ -379,7 +379,7 @@ impl BaseAudioContextMethods for BaseAudioContext { ) } - /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createconstantsource + /// fn CreateConstantSource(&self) -> Fallible> { ConstantSourceNode::new( &self.global().as_window(), @@ -388,21 +388,21 @@ impl BaseAudioContextMethods for BaseAudioContext { ) } - /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createchannelmerger + /// fn CreateChannelMerger(&self, count: u32) -> Fallible> { let mut opts = ChannelMergerOptions::empty(); opts.numberOfInputs = count; ChannelMergerNode::new(&self.global().as_window(), &self, &opts) } - /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createchannelsplitter + /// fn CreateChannelSplitter(&self, count: u32) -> Fallible> { let mut opts = ChannelSplitterOptions::empty(); opts.numberOfOutputs = count; ChannelSplitterNode::new(&self.global().as_window(), &self, &opts) } - /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createbuffer + /// fn CreateBuffer( &self, number_of_channels: u32, diff --git a/components/script/dom/bindings/root.rs b/components/script/dom/bindings/root.rs index 68f754628bc..e6d49ed892f 100644 --- a/components/script/dom/bindings/root.rs +++ b/components/script/dom/bindings/root.rs @@ -224,8 +224,9 @@ where /// A rooting mechanism for reflectors on the stack. /// LIFO is not required. /// -/// See also [*Exact Stack Rooting - Storing a GCPointer on the CStack*] -/// (https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Internals/GC/Exact_Stack_Rooting). +/// See also [*Exact Stack Rooting - Storing a GCPointer on the CStack*][cstack]. +/// +/// [cstack]: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Internals/GC/Exact_Stack_Rooting pub struct RootCollection { roots: UnsafeCell>, } @@ -340,7 +341,7 @@ impl Dom { } impl Dom { - /// Create a Dom from a &T + /// Create a `Dom` from a `&T` #[allow(crown::unrooted_must_root)] pub fn from_ref(obj: &T) -> Dom { assert_in_script(); @@ -758,7 +759,7 @@ where self.value } - /// Transforms a slice of Dom into a slice of LayoutDom. + /// Transforms a slice of `Dom` into a slice of `LayoutDom`. // FIXME(nox): This should probably be done through a ToLayout trait. pub unsafe fn to_layout_slice(slice: &'dom [Dom]) -> &'dom [LayoutDom<'dom, T>] { // This doesn't compile if Dom and LayoutDom don't have the same diff --git a/components/script/dom/bindings/serializable.rs b/components/script/dom/bindings/serializable.rs index a2ca8f5a040..7b18e35bc36 100644 --- a/components/script/dom/bindings/serializable.rs +++ b/components/script/dom/bindings/serializable.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ //! Trait representing the concept of [serializable objects] -//! (https://html.spec.whatwg.org/multipage/#serializable-objects). +//! (). use crate::dom::bindings::reflector::DomObject; use crate::dom::bindings::structuredclone::StructuredDataHolder; diff --git a/components/script/dom/bindings/str.rs b/components/script/dom/bindings/str.rs index 6db9d0773ad..f97306784ed 100644 --- a/components/script/dom/bindings/str.rs +++ b/components/script/dom/bindings/str.rs @@ -316,12 +316,12 @@ impl DOMString { /// A valid date string should be "YYYY-MM-DD" /// YYYY must be four or more digits, MM and DD both must be two digits - /// https://html.spec.whatwg.org/multipage/#valid-date-string + /// pub fn is_valid_date_string(&self) -> bool { self.parse_date_string().is_ok() } - /// https://html.spec.whatwg.org/multipage/#parse-a-date-string + /// pub fn parse_date_string(&self) -> Result<(i32, u32, u32), ()> { let value = &self.0; // Step 1, 2, 3 @@ -336,7 +336,7 @@ impl DOMString { Ok((year_int, month_int, day_int)) } - /// https://html.spec.whatwg.org/multipage/#parse-a-time-string + /// pub fn parse_time_string(&self) -> Result<(u32, u32, f64), ()> { let value = &self.0; // Step 1, 2, 3 @@ -353,12 +353,12 @@ impl DOMString { /// A valid month string should be "YYYY-MM" /// YYYY must be four or more digits, MM both must be two digits - /// https://html.spec.whatwg.org/multipage/#valid-month-string + /// pub fn is_valid_month_string(&self) -> bool { self.parse_month_string().is_ok() } - /// https://html.spec.whatwg.org/multipage/#parse-a-month-string + /// pub fn parse_month_string(&self) -> Result<(i32, u32), ()> { let value = &self; // Step 1, 2, 3 @@ -374,12 +374,12 @@ impl DOMString { /// A valid week string should be like {YYYY}-W{WW}, such as "2017-W52" /// YYYY must be four or more digits, WW both must be two digits - /// https://html.spec.whatwg.org/multipage/#valid-week-string + /// pub fn is_valid_week_string(&self) -> bool { self.parse_week_string().is_ok() } - /// https://html.spec.whatwg.org/multipage/#parse-a-week-string + /// pub fn parse_week_string(&self) -> Result<(i32, u32), ()> { let value = &self.0; // Step 1, 2, 3 @@ -422,7 +422,7 @@ impl DOMString { Ok((year_int, week_int)) } - /// https://html.spec.whatwg.org/multipage/#valid-floating-point-number + /// pub fn is_valid_floating_point_number_string(&self) -> bool { lazy_static! { static ref RE: Regex = @@ -431,7 +431,7 @@ impl DOMString { RE.is_match(&self.0) && self.parse_floating_point_number().is_ok() } - /// https://html.spec.whatwg.org/multipage/#rules-for-parsing-floating-point-number-values + /// pub fn parse_floating_point_number(&self) -> Result { // Steps 15-16 are telling us things about IEEE rounding modes // for floating-point significands; this code assumes the Rust @@ -456,7 +456,7 @@ impl DOMString { } } - /// https://html.spec.whatwg.org/multipage/#best-representation-of-the-number-as-a-floating-point-number + /// pub fn set_best_representation_of_the_floating_point_number(&mut self) { if let Ok(val) = self.parse_floating_point_number() { self.0 = val.to_string(); @@ -465,7 +465,7 @@ impl DOMString { /// A valid normalized local date and time string should be "{date}T{time}" /// where date and time are both valid, and the time string must be as short as possible - /// https://html.spec.whatwg.org/multipage/#valid-normalised-local-date-and-time-string + /// pub fn convert_valid_normalized_local_date_and_time_string(&mut self) -> Result<(), ()> { let ((year, month, day), (hour, minute, second)) = self.parse_local_date_and_time_string()?; @@ -491,7 +491,7 @@ impl DOMString { Ok(()) } - /// https://html.spec.whatwg.org/multipage/#parse-a-local-date-and-time-string + /// pub fn parse_local_date_and_time_string( &self, ) -> Result<((i32, u32, u32), (u32, u32, f64)), ()> { @@ -520,7 +520,7 @@ impl DOMString { Ok((date_tuple, time_tuple)) } - /// https://html.spec.whatwg.org/multipage/#valid-e-mail-address + /// pub fn is_valid_email_address_string(&self) -> bool { lazy_static! { static ref RE: Regex = Regex::new(concat!( @@ -532,7 +532,7 @@ impl DOMString { RE.is_match(&self.0) } - /// https://html.spec.whatwg.org/multipage/#valid-simple-colour + /// pub fn is_valid_simple_color_string(&self) -> bool { let mut chars = self.0.chars(); if self.0.len() == 7 && chars.next() == Some('#') { @@ -669,7 +669,7 @@ impl Extend for DOMString { } } -/// https://html.spec.whatwg.org/multipage/#parse-a-month-component +/// fn parse_month_component(value: &str) -> Result<(i32, u32), ()> { // Step 3 let mut iterator = value.split('-'); @@ -692,7 +692,7 @@ fn parse_month_component(value: &str) -> Result<(i32, u32), ()> { Ok((year_int, month_int)) } -/// https://html.spec.whatwg.org/multipage/#parse-a-date-component +/// fn parse_date_component(value: &str) -> Result<(i32, u32, u32), ()> { // Step 1 let (year_int, month_int) = parse_month_component(value)?; @@ -714,7 +714,7 @@ fn parse_date_component(value: &str) -> Result<(i32, u32, u32), ()> { Ok((year_int, month_int, day_int)) } -/// https://html.spec.whatwg.org/multipage/#parse-a-time-component +/// fn parse_time_component(value: &str) -> Result<(u32, u32, f64), ()> { // Step 1 let mut iterator = value.split(':'); @@ -781,7 +781,7 @@ fn max_day_in_month(year_num: i32, month_num: u32) -> Result { } } -/// https://html.spec.whatwg.org/multipage/#week-number-of-the-last-day +/// fn max_week_in_year(year: i32) -> u32 { Utc.with_ymd_and_hms(year as i32, 1, 1, 0, 0, 0) .earliest() diff --git a/components/script/dom/bindings/structuredclone.rs b/components/script/dom/bindings/structuredclone.rs index 3ed7c60e500..cbee01363bf 100644 --- a/components/script/dom/bindings/structuredclone.rs +++ b/components/script/dom/bindings/structuredclone.rs @@ -2,8 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -//! This module implements structured cloning, as defined by [HTML] -//! (https://html.spec.whatwg.org/multipage/#safe-passing-of-structured-data). +//! This module implements structured cloning, as defined by [HTML](https://html.spec.whatwg.org/multipage/#safe-passing-of-structured-data). use std::collections::HashMap; use std::os::raw; @@ -253,7 +252,7 @@ static STRUCTURED_CLONE_CALLBACKS: JSStructuredCloneCallbacks = JSStructuredClon }; /// A data holder for results from, and inputs to, structured-data read/write operations. -/// https://html.spec.whatwg.org/multipage/#safe-passing-of-structured-data +/// pub enum StructuredDataHolder { Read { /// A map of deserialized blobs, stored temporarily here to keep them rooted. diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index 3d730dff605..4860e17fea0 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -579,7 +579,7 @@ impl<'a, T: 'static + JSTraceable> RootedVec<'a, T> { } impl<'a, T: 'static + JSTraceable + DomObject> RootedVec<'a, Dom> { - /// Create a vector of items of type Dom that is rooted for + /// Create a vector of items of type `Dom` that is rooted for /// the lifetime of this struct pub fn from_iter(root: &'a mut RootableVec>, iter: I) -> Self where diff --git a/components/script/dom/bindings/transferable.rs b/components/script/dom/bindings/transferable.rs index 5e15ec785fa..6c75bfe2828 100644 --- a/components/script/dom/bindings/transferable.rs +++ b/components/script/dom/bindings/transferable.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ //! Trait representing the concept of [transferable objects] -//! (https://html.spec.whatwg.org/multipage/#transferable-objects). +//! (). use js::jsapi::MutableHandleObject; diff --git a/components/script/dom/bindings/xmlname.rs b/components/script/dom/bindings/xmlname.rs index 30082c2d6e8..7fd7a7ec4de 100644 --- a/components/script/dom/bindings/xmlname.rs +++ b/components/script/dom/bindings/xmlname.rs @@ -9,7 +9,7 @@ use html5ever::{namespace_url, ns, LocalName, Namespace, Prefix}; use crate::dom::bindings::error::{Error, ErrorResult, Fallible}; use crate::dom::bindings::str::DOMString; -/// Validate a qualified name. See https://dom.spec.whatwg.org/#validate for details. +/// Validate a qualified name. See for details. pub fn validate_qualified_name(qualified_name: &str) -> ErrorResult { // Step 2. match xml_name_type(qualified_name) { @@ -20,7 +20,7 @@ pub fn validate_qualified_name(qualified_name: &str) -> ErrorResult { } /// Validate a namespace and qualified name and extract their parts. -/// See https://dom.spec.whatwg.org/#validate-and-extract for details. +/// See for details. pub fn validate_and_extract( namespace: Option, qualified_name: &str, @@ -86,7 +86,7 @@ pub enum XMLName { InvalidXMLName, } -/// Check if an element name is valid. See http://www.w3.org/TR/xml/#NT-Name +/// Check if an element name is valid. See /// for details. pub fn xml_name_type(name: &str) -> XMLName { fn is_valid_start(c: char) -> bool { diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs index f2ae708d91d..61903d5753e 100644 --- a/components/script/dom/blob.rs +++ b/components/script/dom/blob.rs @@ -307,7 +307,7 @@ impl BlobMethods for Blob { /// /// XXX: We will relax the restriction here, /// since the spec has some problem over this part. -/// see https://github.com/w3c/FileAPI/issues/43 +/// see pub fn normalize_type_string(s: &str) -> String { if is_ascii_printable(s) { let s_lower = s.to_ascii_lowercase(); @@ -322,6 +322,6 @@ pub fn normalize_type_string(s: &str) -> String { fn is_ascii_printable(string: &str) -> bool { // Step 5.1 in Sec 5.1 of File API spec - // https://w3c.github.io/FileAPI/#constructorBlob + // string.chars().all(|c| c >= '\x20' && c <= '\x7E') } diff --git a/components/script/dom/customelementregistry.rs b/components/script/dom/customelementregistry.rs index 2f8e90e6808..c1c60adc94c 100644 --- a/components/script/dom/customelementregistry.rs +++ b/components/script/dom/customelementregistry.rs @@ -464,7 +464,7 @@ impl CustomElementRegistryMethods for CustomElementRegistry { // Step 6 promise } - /// https://html.spec.whatwg.org/multipage/#dom-customelementregistry-upgrade + /// fn Upgrade(&self, node: &Node) { // Spec says to make a list first and then iterate the list, but // try-to-upgrade only queues upgrade reactions and doesn't itself @@ -540,7 +540,7 @@ impl CustomElementDefinition { self.name == self.local_name } - /// https://dom.spec.whatwg.org/#concept-create-element Step 6.1 + /// Step 6.1 #[allow(unsafe_code)] pub fn create_element( &self, diff --git a/components/script/dom/dedicatedworkerglobalscope.rs b/components/script/dom/dedicatedworkerglobalscope.rs index 4960fed32b5..b7b3b1faceb 100644 --- a/components/script/dom/dedicatedworkerglobalscope.rs +++ b/components/script/dom/dedicatedworkerglobalscope.rs @@ -649,7 +649,7 @@ unsafe extern "C" fn interrupt_callback(cx: *mut JSContext) -> bool { } impl DedicatedWorkerGlobalScopeMethods for DedicatedWorkerGlobalScope { - /// https://html.spec.whatwg.org/multipage/#dom-dedicatedworkerglobalscope-postmessage + /// fn PostMessage( &self, cx: SafeJSContext, @@ -659,7 +659,7 @@ impl DedicatedWorkerGlobalScopeMethods for DedicatedWorkerGlobalScope { self.post_message_impl(cx, message, transfer) } - /// https://html.spec.whatwg.org/multipage/#dom-dedicatedworkerglobalscope-postmessage + /// fn PostMessage_( &self, cx: SafeJSContext, diff --git a/components/script/dom/dissimilaroriginwindow.rs b/components/script/dom/dissimilaroriginwindow.rs index cd38216d0ca..90c695cb6a1 100644 --- a/components/script/dom/dissimilaroriginwindow.rs +++ b/components/script/dom/dissimilaroriginwindow.rs @@ -135,7 +135,7 @@ impl DissimilarOriginWindowMethods for DissimilarOriginWindow { false } - /// https://html.spec.whatwg.org/multipage/#dom-window-postmessage + /// fn PostMessage( &self, cx: JSContext, @@ -146,7 +146,7 @@ impl DissimilarOriginWindowMethods for DissimilarOriginWindow { self.post_message_impl(&target_origin, cx, message, transfer) } - /// https://html.spec.whatwg.org/multipage/#dom-window-postmessage-options + /// fn PostMessage_( &self, cx: JSContext, @@ -195,7 +195,7 @@ impl DissimilarOriginWindowMethods for DissimilarOriginWindow { } impl DissimilarOriginWindow { - /// https://html.spec.whatwg.org/multipage/#window-post-message-steps + /// fn post_message_impl( &self, target_origin: &USVString, @@ -209,7 +209,7 @@ impl DissimilarOriginWindow { self.post_message(target_origin, data) } - /// https://html.spec.whatwg.org/multipage/#window-post-message-steps + /// pub fn post_message( &self, target_origin: &USVString, diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 3ce1299a59b..7de5d650bdd 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -289,7 +289,7 @@ pub struct Document { pending_parsing_blocking_script: DomRefCell>, /// Number of stylesheets that block executing the next parser-inserted script script_blocking_stylesheets_count: Cell, - /// https://html.spec.whatwg.org/multipage/#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing + /// deferred_scripts: PendingInOrderScriptVec, /// asap_in_order_scripts_list: PendingInOrderScriptVec, @@ -346,7 +346,7 @@ pub struct Document { /// The document's origin. #[no_trace] origin: MutableOrigin, - /// https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-states + /// #[no_trace] referrer_policy: Cell>, /// @@ -370,7 +370,7 @@ pub struct Document { /// This is sent to the layout thread every time a reflow is done; /// layout uses this to determine if the gains from parallel layout will be worth the overhead. /// - /// See also: https://github.com/servo/servo/issues/10110 + /// See also: dom_count: Cell, /// Entry node for fullscreen. fullscreen_element: MutNullableDom, @@ -378,7 +378,7 @@ pub struct Document { /// their 'form' content attribute. Used to reset form controls /// whenever any element with the same ID as the form attribute /// is inserted or removed from the document. - /// See https://html.spec.whatwg.org/multipage/#form-owner + /// See form_id_listener_map: DomRefCell>>>, #[no_trace] interactive_time: DomRefCell, @@ -386,9 +386,9 @@ pub struct Document { tti_window: DomRefCell, /// RAII canceller for Fetch canceller: FetchCanceller, - /// https://html.spec.whatwg.org/multipage/#throw-on-dynamic-markup-insertion-counter + /// throw_on_dynamic_markup_insertion_counter: Cell, - /// https://html.spec.whatwg.org/multipage/#page-showing + /// page_showing: Cell, /// Whether the document is salvageable. salvageable: Cell, @@ -405,7 +405,7 @@ pub struct Document { /// List of tasks to execute as soon as last script/layout blocker is removed. #[ignore_malloc_size_of = "Measuring trait objects is hard"] delayed_tasks: DomRefCell>>, - /// https://html.spec.whatwg.org/multipage/#completely-loaded + /// completely_loaded: Cell, /// Set of shadow roots connected to the document tree. shadow_roots: DomRefCell>>, @@ -422,14 +422,14 @@ pub struct Document { DomRefCell>>, /// List of all WebGPU context IDs that need flushing. dirty_webgpu_contexts: DomRefCell>>, - /// https://html.spec.whatwg.org/multipage/#concept-document-csp-list + /// #[ignore_malloc_size_of = "Defined in rust-content-security-policy"] #[no_trace] csp_list: DomRefCell>, - /// https://w3c.github.io/slection-api/#dfn-selection + /// selection: MutNullableDom, /// A timeline for animations which is used for synchronizing animations. - /// https://drafts.csswg.org/web-animations/#timeline + /// animation_timeline: DomRefCell, /// Animations for this Document animations: DomRefCell, @@ -2426,7 +2426,7 @@ impl Document { self.pending_parsing_blocking_script.borrow().is_some() } - /// https://html.spec.whatwg.org/multipage/#prepare-a-script step 22.d. + /// step 22.d. pub fn pending_parsing_blocking_script_loaded( &self, element: &HTMLScriptElement, @@ -2465,8 +2465,8 @@ impl Document { .push(Dom::from_ref(script)); } - /// https://html.spec.whatwg.org/multipage/#the-end step 5. - /// https://html.spec.whatwg.org/multipage/#prepare-a-script step 22.d. + /// step 5. + /// step 22.d. pub fn asap_script_loaded(&self, element: &HTMLScriptElement, result: ScriptResult) { { let mut scripts = self.asap_scripts_set.borrow_mut(); @@ -2484,8 +2484,8 @@ impl Document { self.asap_in_order_scripts_list.push(script); } - /// https://html.spec.whatwg.org/multipage/#the-end step 5. - /// https://html.spec.whatwg.org/multipage/#prepare-a-script step 22.c. + /// step 5. + /// step> 22.c. pub fn asap_in_order_script_loaded(&self, element: &HTMLScriptElement, result: ScriptResult) { self.asap_in_order_scripts_list.loaded(element, result); while let Some((element, result)) = self @@ -2501,14 +2501,14 @@ impl Document { self.deferred_scripts.push(script); } - /// https://html.spec.whatwg.org/multipage/#the-end step 3. - /// https://html.spec.whatwg.org/multipage/#prepare-a-script step 22.d. + /// step 3. + /// step 22.d. pub fn deferred_script_loaded(&self, element: &HTMLScriptElement, result: ScriptResult) { self.deferred_scripts.loaded(element, result); self.process_deferred_scripts(); } - /// https://html.spec.whatwg.org/multipage/#the-end step 3. + /// step 3. fn process_deferred_scripts(&self) { if self.ready_state.get() != DocumentReadyState::Interactive { return; @@ -3207,7 +3207,7 @@ impl Document { ref_filter_map(self.csp_list.borrow(), Option::as_ref) } - /// https://www.w3.org/TR/CSP/#should-block-inline + /// pub fn should_elements_inline_type_behavior_be_blocked( &self, el: &Element, diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index e0b9e93fdc7..b54d35c408b 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -491,7 +491,7 @@ impl Element { self.shadow_root().is_some() } - /// https://dom.spec.whatwg.org/#dom-element-attachshadow + /// /// XXX This is not exposed to web content yet. It is meant to be used /// for UA widgets only. pub fn attach_shadow(&self, is_ua_widget: IsUserAgentWidget) -> Fallible> { diff --git a/components/script/dom/extendablemessageevent.rs b/components/script/dom/extendablemessageevent.rs index 892769bf14b..87684450f1f 100644 --- a/components/script/dom/extendablemessageevent.rs +++ b/components/script/dom/extendablemessageevent.rs @@ -29,16 +29,16 @@ use crate::script_runtime::JSContext; #[dom_struct] #[allow(non_snake_case)] pub struct ExtendableMessageEvent { - /// https://w3c.github.io/ServiceWorker/#extendableevent + /// event: ExtendableEvent, - /// https://w3c.github.io/ServiceWorker/#dom-extendablemessageevent-data + /// #[ignore_malloc_size_of = "mozjs"] data: Heap, /// origin: DOMString, - /// https://w3c.github.io/ServiceWorker/#dom-extendablemessageevent-lasteventid + /// lastEventId: DOMString, - /// https://w3c.github.io/ServiceWorker/#dom-extendablemessageevent-ports + /// ports: Vec>, #[ignore_malloc_size_of = "mozjs"] frozen_ports: DomRefCell>>, @@ -193,7 +193,7 @@ impl ExtendableMessageEventMethods for ExtendableMessageEvent { self.event.IsTrusted() } - /// https://w3c.github.io/ServiceWorker/#extendablemessage-event-ports + /// fn Ports(&self, cx: JSContext) -> JSVal { if let Some(ports) = &*self.frozen_ports.borrow() { return ports.get(); diff --git a/components/script/dom/fakexrdevice.rs b/components/script/dom/fakexrdevice.rs index 17d3a192fc3..305531f6048 100644 --- a/components/script/dom/fakexrdevice.rs +++ b/components/script/dom/fakexrdevice.rs @@ -184,7 +184,7 @@ impl From for EntityType { } impl FakeXRDeviceMethods for FakeXRDevice { - /// https://github.com/immersive-web/webxr-test-api/blob/master/explainer.md + /// fn SetViews(&self, views: Vec) -> Fallible<()> { let _ = self .sender @@ -192,7 +192,7 @@ impl FakeXRDeviceMethods for FakeXRDevice { Ok(()) } - /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrdevice-setviewerorigin + /// fn SetViewerOrigin( &self, origin: &FakeXRRigidTransformInit, @@ -204,17 +204,17 @@ impl FakeXRDeviceMethods for FakeXRDevice { Ok(()) } - /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrdevice-clearviewerorigin + /// fn ClearViewerOrigin(&self) { let _ = self.sender.send(MockDeviceMsg::SetViewerOrigin(None)); } - /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrdevice-clearfloororigin + /// fn ClearFloorOrigin(&self) { let _ = self.sender.send(MockDeviceMsg::SetFloorOrigin(None)); } - /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrdevice-setfloororigin + /// fn SetFloorOrigin(&self, origin: &FakeXRRigidTransformInit) -> Fallible<()> { let _ = self .sender @@ -222,18 +222,18 @@ impl FakeXRDeviceMethods for FakeXRDevice { Ok(()) } - /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrdevice-clearworld + /// fn ClearWorld(&self) { let _ = self.sender.send(MockDeviceMsg::ClearWorld); } - /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrdevice-setworld + /// fn SetWorld(&self, world: &FakeXRWorldInit) -> Fallible<()> { let _ = self.sender.send(MockDeviceMsg::SetWorld(get_world(world)?)); Ok(()) } - /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrdevice-simulatevisibilitychange + /// fn SimulateVisibilityChange(&self, v: XRVisibilityState) { let v = match v { XRVisibilityState::Visible => Visibility::Visible, @@ -243,7 +243,7 @@ impl FakeXRDeviceMethods for FakeXRDevice { let _ = self.sender.send(MockDeviceMsg::VisibilityChange(v)); } - /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrdevice-simulateinputsourceconnection + /// fn SimulateInputSourceConnection( &self, init: &FakeXRInputSourceInit, @@ -289,7 +289,7 @@ impl FakeXRDeviceMethods for FakeXRDevice { Ok(controller) } - /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrdevice-disconnect + /// fn Disconnect(&self) -> Rc { let global = self.global(); let p = Promise::new(&global); diff --git a/components/script/dom/fakexrinputcontroller.rs b/components/script/dom/fakexrinputcontroller.rs index bdeaefb450f..0de0493d1f9 100644 --- a/components/script/dom/fakexrinputcontroller.rs +++ b/components/script/dom/fakexrinputcontroller.rs @@ -59,34 +59,34 @@ impl FakeXRInputController { } impl FakeXRInputControllerMethods for FakeXRInputController { - /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrinputcontroller-setpointerorigin + /// fn SetPointerOrigin(&self, origin: &FakeXRRigidTransformInit, _emulated: bool) -> Fallible<()> { self.send_message(MockInputMsg::SetPointerOrigin(Some(get_origin(origin)?))); Ok(()) } - /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrinputcontroller-setgriporigin + /// fn SetGripOrigin(&self, origin: &FakeXRRigidTransformInit, _emulated: bool) -> Fallible<()> { self.send_message(MockInputMsg::SetGripOrigin(Some(get_origin(origin)?))); Ok(()) } - /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrinputcontroller-cleargriporigin + /// fn ClearGripOrigin(&self) { self.send_message(MockInputMsg::SetGripOrigin(None)) } - /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrinputcontroller-disconnect + /// fn Disconnect(&self) { self.send_message(MockInputMsg::Disconnect) } - /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrinputcontroller-reconnect + /// fn Reconnect(&self) { self.send_message(MockInputMsg::Reconnect) } - /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrinputcontroller-startselection + /// fn StartSelection(&self) { self.send_message(MockInputMsg::TriggerSelect( SelectKind::Select, @@ -94,7 +94,7 @@ impl FakeXRInputControllerMethods for FakeXRInputController { )) } - /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrinputcontroller-endselection + /// fn EndSelection(&self) { self.send_message(MockInputMsg::TriggerSelect( SelectKind::Select, @@ -102,7 +102,7 @@ impl FakeXRInputControllerMethods for FakeXRInputController { )) } - /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrinputcontroller-simulateselect + /// fn SimulateSelect(&self) { self.send_message(MockInputMsg::TriggerSelect( SelectKind::Select, @@ -110,7 +110,7 @@ impl FakeXRInputControllerMethods for FakeXRInputController { )) } - /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrinputcontroller-sethandedness + /// fn SetHandedness(&self, handedness: XRHandedness) { let h = match handedness { XRHandedness::None => Handedness::None, @@ -120,7 +120,7 @@ impl FakeXRInputControllerMethods for FakeXRInputController { let _ = self.send_message(MockInputMsg::SetHandedness(h)); } - /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrinputcontroller-settargetraymode + /// fn SetTargetRayMode(&self, target_ray_mode: XRTargetRayMode) { let t = match target_ray_mode { XRTargetRayMode::Gaze => TargetRayMode::Gaze, @@ -130,7 +130,7 @@ impl FakeXRInputControllerMethods for FakeXRInputController { let _ = self.send_message(MockInputMsg::SetTargetRayMode(t)); } - /// https://immersive-web.github.io/webxr-test-api/#dom-fakexrinputcontroller-setprofiles + /// fn SetProfiles(&self, profiles: Vec) { let t = profiles.into_iter().map(String::from).collect(); let _ = self.send_message(MockInputMsg::SetProfiles(t)); diff --git a/components/script/dom/globalscope.rs b/components/script/dom/globalscope.rs index c78d24c7e8f..00c19614014 100644 --- a/components/script/dom/globalscope.rs +++ b/components/script/dom/globalscope.rs @@ -131,7 +131,7 @@ use crate::timers::{ #[derive(JSTraceable)] pub struct AutoCloseWorker { - /// https://html.spec.whatwg.org/multipage/#dom-workerglobalscope-closing + /// closing: Arc, /// A handle to join on the worker thread. join_handle: Option>, @@ -207,7 +207,7 @@ pub struct GlobalScope { console_timers: DomRefCell>, /// module map is used when importing JavaScript modules - /// https://html.spec.whatwg.org/multipage/#concept-settings-object-module-map + /// #[ignore_malloc_size_of = "mozjs"] module_map: DomRefCell>>, @@ -257,7 +257,7 @@ pub struct GlobalScope { #[no_trace] origin: MutableOrigin, - /// https://html.spec.whatwg.org/multipage/#concept-environment-creation-url + /// #[no_trace] creation_url: Option, @@ -442,7 +442,7 @@ pub struct ManagedMessagePort { pub enum BroadcastChannelState { /// The broadcast-channel router id for this global, and a queue of managed channels. /// Step 9, "sort destinations" - /// of https://html.spec.whatwg.org/multipage/#dom-broadcastchannel-postmessage + /// of /// requires keeping track of creation order, hence the queue. Managed( #[no_trace] BroadcastChannelRouterId, @@ -1339,7 +1339,7 @@ impl GlobalScope { } } - /// https://html.spec.whatwg.org/multipage/#ports-and-garbage-collection + /// pub fn perform_a_message_port_garbage_collection_checkpoint(&self) { let is_empty = if let MessagePortState::Managed(_id, message_ports) = &mut *self.message_port_state.borrow_mut() @@ -1373,7 +1373,7 @@ impl GlobalScope { /// Remove broadcast-channels that are closed. /// TODO: Also remove them if they do not have an event-listener. - /// see https://github.com/servo/servo/issues/25772 + /// see pub fn perform_a_broadcast_channel_garbage_collection_checkpoint(&self) { let is_empty = if let BroadcastChannelState::Managed(router_id, ref mut channels) = &mut *self.broadcast_channel_state.borrow_mut() @@ -1791,7 +1791,7 @@ impl GlobalScope { } } - /// https://w3c.github.io/FileAPI/#dfn-size + /// pub fn get_blob_size(&self, blob_id: &BlobId) -> u64 { let blob_state = self.blob_state.borrow(); if let BlobState::Managed(blobs_map) = &*blob_state { @@ -3055,7 +3055,7 @@ impl GlobalScope { false } - /// https://www.w3.org/TR/CSP/#get-csp-of-object + /// pub fn get_csp_list(&self) -> Option { if let Some(window) = self.downcast::() { return window.Document().get_csp_list().map(|c| c.clone()); diff --git a/components/script/dom/gpuadapter.rs b/components/script/dom/gpuadapter.rs index 03170efb8e2..39aa2cbb9c4 100644 --- a/components/script/dom/gpuadapter.rs +++ b/components/script/dom/gpuadapter.rs @@ -86,7 +86,7 @@ impl GPUAdapter { } impl GPUAdapterMethods for GPUAdapter { - /// https://gpuweb.github.io/gpuweb/#dom-gpuadapter-requestdevice + /// fn RequestDevice(&self, descriptor: &GPUDeviceDescriptor, comp: InRealm) -> Rc { // Step 2 let promise = Promise::new_in_current_realm(comp); @@ -205,13 +205,13 @@ impl GPUAdapterMethods for GPUAdapter { promise } - /// https://gpuweb.github.io/gpuweb/#dom-gpuadapter-isfallbackadapter + /// fn IsFallbackAdapter(&self) -> bool { //TODO false } - /// https://gpuweb.github.io/gpuweb/#dom-gpuadapter-requestadapterinfo + /// fn RequestAdapterInfo(&self, unmask_hints: Vec, comp: InRealm) -> Rc { // XXX: Adapter info should be generated here ... // Step 1 @@ -225,12 +225,12 @@ impl GPUAdapterMethods for GPUAdapter { promise } - /// https://gpuweb.github.io/gpuweb/#dom-gpuadapter-features + /// fn Features(&self) -> DomRoot { DomRoot::from_ref(&self.features) } - /// https://gpuweb.github.io/gpuweb/#dom-gpuadapter-limits + /// fn Limits(&self) -> DomRoot { DomRoot::from_ref(&self.limits) } diff --git a/components/script/dom/gpuadapterinfo.rs b/components/script/dom/gpuadapterinfo.rs index e475fd7b859..a31454185c6 100644 --- a/components/script/dom/gpuadapterinfo.rs +++ b/components/script/dom/gpuadapterinfo.rs @@ -35,22 +35,22 @@ impl GPUAdapterInfo { // TODO: wgpu does not expose right fields right now impl GPUAdapterInfoMethods for GPUAdapterInfo { - /// https://gpuweb.github.io/gpuweb/#dom-gpuadapterinfo-vendor + /// fn Vendor(&self) -> DOMString { DOMString::new() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuadapterinfo-architecture + /// fn Architecture(&self) -> DOMString { DOMString::new() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuadapterinfo-device + /// fn Device(&self) -> DOMString { DOMString::new() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuadapterinfo-description + /// fn Description(&self) -> DOMString { DOMString::from_string(self.info.driver_info.clone()) } diff --git a/components/script/dom/gpubindgroup.rs b/components/script/dom/gpubindgroup.rs index 5aa7b14473e..de0e18569fb 100644 --- a/components/script/dom/gpubindgroup.rs +++ b/components/script/dom/gpubindgroup.rs @@ -63,12 +63,12 @@ impl GPUBindGroup { } impl GPUBindGroupMethods for GPUBindGroup { - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn Label(&self) -> USVString { self.label.borrow().clone() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn SetLabel(&self, value: USVString) { *self.label.borrow_mut() = value; } diff --git a/components/script/dom/gpubindgrouplayout.rs b/components/script/dom/gpubindgrouplayout.rs index b08181b40b6..8624afee2f7 100644 --- a/components/script/dom/gpubindgrouplayout.rs +++ b/components/script/dom/gpubindgrouplayout.rs @@ -48,12 +48,12 @@ impl GPUBindGroupLayout { } impl GPUBindGroupLayoutMethods for GPUBindGroupLayout { - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn Label(&self) -> USVString { self.label.borrow().clone() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn SetLabel(&self, value: USVString) { *self.label.borrow_mut() = value; } diff --git a/components/script/dom/gpubuffer.rs b/components/script/dom/gpubuffer.rs index 8a97bf3cace..8c7a268fa30 100644 --- a/components/script/dom/gpubuffer.rs +++ b/components/script/dom/gpubuffer.rs @@ -135,7 +135,7 @@ impl Drop for GPUBuffer { impl GPUBufferMethods for GPUBuffer { #[allow(unsafe_code)] - /// https://gpuweb.github.io/gpuweb/#dom-gpubuffer-unmap + /// fn Unmap(&self) -> Fallible<()> { let cx = GlobalScope::get_cx(); // Step 1 @@ -181,7 +181,7 @@ impl GPUBufferMethods for GPUBuffer { Ok(()) } - /// https://gpuweb.github.io/gpuweb/#dom-gpubuffer-destroy + /// fn Destroy(&self) -> Fallible<()> { let state = self.state.get(); match state { @@ -206,7 +206,7 @@ impl GPUBufferMethods for GPUBuffer { } #[allow(unsafe_code)] - /// https://gpuweb.github.io/gpuweb/#dom-gpubuffer-mapasync-offset-size + /// fn MapAsync( &self, mode: u32, @@ -278,7 +278,7 @@ impl GPUBufferMethods for GPUBuffer { promise } - /// https://gpuweb.github.io/gpuweb/#dom-gpubuffer-getmappedrange + /// #[allow(unsafe_code)] fn GetMappedRange( &self, @@ -333,12 +333,12 @@ impl GPUBufferMethods for GPUBuffer { Ok(NonNull::new(array_buffer).unwrap()) } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn Label(&self) -> USVString { self.label.borrow().clone() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn SetLabel(&self, value: USVString) { *self.label.borrow_mut() = value; } diff --git a/components/script/dom/gpucanvascontext.rs b/components/script/dom/gpucanvascontext.rs index 6e0a06f0232..abe4f686004 100644 --- a/components/script/dom/gpucanvascontext.rs +++ b/components/script/dom/gpucanvascontext.rs @@ -100,14 +100,14 @@ pub struct GPUCanvasContext { #[ignore_malloc_size_of = "channels are hard"] #[no_trace] channel: WebGPU, - /// https://gpuweb.github.io/gpuweb/#dom-gpucanvascontext-canvas + /// canvas: HTMLCanvasElementOrOffscreenCanvas, // TODO: can we have wgpu surface that is hw accelerated inside wr ... #[ignore_malloc_size_of = "Defined in webrender"] #[no_trace] webrender_image: Cell>, context_id: WebGPUContextId, - /// https://gpuweb.github.io/gpuweb/#dom-gpucanvascontext-currenttexture-slot + /// texture: MutNullableDom, } @@ -206,12 +206,12 @@ impl LayoutCanvasRenderingContextHelpers for LayoutDom<'_, GPUCanvasContext> { } impl GPUCanvasContextMethods for GPUCanvasContext { - /// https://gpuweb.github.io/gpuweb/#dom-gpucanvascontext-canvas + /// fn Canvas(&self) -> HTMLCanvasElementOrOffscreenCanvas { self.canvas.clone() } - /// https://gpuweb.github.io/gpuweb/#dom-gpucanvascontext-configure + /// fn Configure(&self, descriptor: &GPUCanvasConfiguration) { // Step 1 is let // Step 2 @@ -293,7 +293,7 @@ impl GPUCanvasContextMethods for GPUCanvasContext { self.webrender_image.set(Some(receiver.recv().unwrap())); } - /// https://gpuweb.github.io/gpuweb/#dom-gpucanvascontext-unconfigure + /// fn Unconfigure(&self) { if let Some(image_key) = self.webrender_image.take() { if let Err(e) = self.channel.0.send(( @@ -312,7 +312,7 @@ impl GPUCanvasContextMethods for GPUCanvasContext { self.texture.take(); } - /// https://gpuweb.github.io/gpuweb/#dom-gpucanvascontext-getcurrenttexture + /// fn GetCurrentTexture(&self) -> Fallible> { // Step 5. self.mark_as_dirty(); diff --git a/components/script/dom/gpucommandbuffer.rs b/components/script/dom/gpucommandbuffer.rs index b0269fa4d40..c054c5abcf8 100644 --- a/components/script/dom/gpucommandbuffer.rs +++ b/components/script/dom/gpucommandbuffer.rs @@ -95,12 +95,12 @@ impl GPUCommandBuffer { } impl GPUCommandBufferMethods for GPUCommandBuffer { - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn Label(&self) -> USVString { self.label.borrow().clone() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn SetLabel(&self, value: USVString) { *self.label.borrow_mut() = value; } diff --git a/components/script/dom/gpucommandencoder.rs b/components/script/dom/gpucommandencoder.rs index ec9aa70046d..869a4e17346 100644 --- a/components/script/dom/gpucommandencoder.rs +++ b/components/script/dom/gpucommandencoder.rs @@ -107,17 +107,17 @@ impl GPUCommandEncoder { } impl GPUCommandEncoderMethods for GPUCommandEncoder { - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn Label(&self) -> USVString { self.label.borrow().clone() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn SetLabel(&self, value: USVString) { *self.label.borrow_mut() = value; } - /// https://gpuweb.github.io/gpuweb/#dom-gpucommandencoder-begincomputepass + /// fn BeginComputePass( &self, descriptor: &GPUComputePassDescriptor, @@ -152,7 +152,7 @@ impl GPUCommandEncoderMethods for GPUCommandEncoder { ) } - /// https://gpuweb.github.io/gpuweb/#dom-gpucommandencoder-beginrenderpass + /// fn BeginRenderPass( &self, descriptor: &GPURenderPassDescriptor, @@ -250,7 +250,7 @@ impl GPUCommandEncoderMethods for GPUCommandEncoder { ) } - /// https://gpuweb.github.io/gpuweb/#dom-gpucommandencoder-copybuffertobuffer + /// fn CopyBufferToBuffer( &self, source: &GPUBuffer, @@ -284,7 +284,7 @@ impl GPUCommandEncoderMethods for GPUCommandEncoder { .expect("Failed to send CopyBufferToBuffer"); } - /// https://gpuweb.github.io/gpuweb/#dom-gpucommandencoder-copybuffertotexture + /// fn CopyBufferToTexture( &self, source: &GPUImageCopyBuffer, @@ -316,7 +316,7 @@ impl GPUCommandEncoderMethods for GPUCommandEncoder { .expect("Failed to send CopyBufferToTexture"); } - /// https://gpuweb.github.io/gpuweb/#dom-gpucommandencoder-copybuffertotexture + /// fn CopyTextureToBuffer( &self, source: &GPUImageCopyTexture, @@ -348,7 +348,7 @@ impl GPUCommandEncoderMethods for GPUCommandEncoder { .expect("Failed to send CopyTextureToBuffer"); } - /// https://gpuweb.github.io/gpuweb/#GPUCommandEncoder-copyTextureToTexture + /// fn CopyTextureToTexture( &self, source: &GPUImageCopyTexture, @@ -376,7 +376,7 @@ impl GPUCommandEncoderMethods for GPUCommandEncoder { .expect("Failed to send CopyTextureToTexture"); } - /// https://gpuweb.github.io/gpuweb/#dom-gpucommandencoder-finish + /// fn Finish(&self, descriptor: &GPUCommandBufferDescriptor) -> DomRoot { self.channel .0 diff --git a/components/script/dom/gpucompilationinfo.rs b/components/script/dom/gpucompilationinfo.rs index d964f4ea325..ad9fe04707d 100644 --- a/components/script/dom/gpucompilationinfo.rs +++ b/components/script/dom/gpucompilationinfo.rs @@ -19,7 +19,7 @@ pub struct GPUCompilationInfo { // TODO: wgpu does not expose right fields right now impl GPUCompilationInfoMethods for GPUCompilationInfo { - /// https://gpuweb.github.io/gpuweb/#dom-gpucompilationinfo-messages + /// fn Messages(&self, _cx: JSContext) -> JSVal { todo!() } diff --git a/components/script/dom/gpucompilationmessage.rs b/components/script/dom/gpucompilationmessage.rs index 26b8dafe0dd..c7037dd9bd8 100644 --- a/components/script/dom/gpucompilationmessage.rs +++ b/components/script/dom/gpucompilationmessage.rs @@ -65,32 +65,32 @@ impl GPUCompilationMessage { } impl GPUCompilationMessageMethods for GPUCompilationMessage { - /// https://gpuweb.github.io/gpuweb/#dom-gpucompilationmessage-message + /// fn Message(&self) -> DOMString { self.message.to_owned() } - /// https://gpuweb.github.io/gpuweb/#dom-gpucompilationmessage-type + /// fn Type(&self) -> GPUCompilationMessageType { self.mtype } - /// https://gpuweb.github.io/gpuweb/#dom-gpucompilationmessage-linenum + /// fn LineNum(&self) -> u64 { self.line_num } - /// https://gpuweb.github.io/gpuweb/#dom-gpucompilationmessage-linepos + /// fn LinePos(&self) -> u64 { self.line_pos } - /// https://gpuweb.github.io/gpuweb/#dom-gpucompilationmessage-offset + /// fn Offset(&self) -> u64 { self.offset } - /// https://gpuweb.github.io/gpuweb/#dom-gpucompilationmessage-length + /// fn Length(&self) -> u64 { self.length } diff --git a/components/script/dom/gpucomputepassencoder.rs b/components/script/dom/gpucomputepassencoder.rs index 0d43e152403..2b9e85540d9 100644 --- a/components/script/dom/gpucomputepassencoder.rs +++ b/components/script/dom/gpucomputepassencoder.rs @@ -67,24 +67,24 @@ impl GPUComputePassEncoder { } impl GPUComputePassEncoderMethods for GPUComputePassEncoder { - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn Label(&self) -> USVString { self.label.borrow().clone() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn SetLabel(&self, value: USVString) { *self.label.borrow_mut() = value; } - /// https://gpuweb.github.io/gpuweb/#dom-gpucomputepassencoder-dispatchworkgroups + /// fn DispatchWorkgroups(&self, x: u32, y: u32, z: u32) { if let Some(compute_pass) = self.compute_pass.borrow_mut().as_mut() { wgpu_comp::wgpu_compute_pass_dispatch_workgroups(compute_pass, x, y, z); } } - /// https://gpuweb.github.io/gpuweb/#dom-gpucomputepassencoder-dispatchworkgroupsindirect + /// fn DispatchWorkgroupsIndirect(&self, indirect_buffer: &GPUBuffer, indirect_offset: u64) { if let Some(compute_pass) = self.compute_pass.borrow_mut().as_mut() { wgpu_comp::wgpu_compute_pass_dispatch_workgroups_indirect( @@ -95,7 +95,7 @@ impl GPUComputePassEncoderMethods for GPUComputePassEncoder { } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderpassencoder-endpass + /// fn End(&self) -> Fallible<()> { let compute_pass = self.compute_pass.borrow_mut().take(); self.channel @@ -116,7 +116,7 @@ impl GPUComputePassEncoderMethods for GPUComputePassEncoder { Ok(()) } - /// https://gpuweb.github.io/gpuweb/#dom-gpuprogrammablepassencoder-setbindgroup + /// #[allow(unsafe_code)] fn SetBindGroup(&self, index: u32, bind_group: &GPUBindGroup, dynamic_offsets: Vec) { if let Some(compute_pass) = self.compute_pass.borrow_mut().as_mut() { @@ -132,7 +132,7 @@ impl GPUComputePassEncoderMethods for GPUComputePassEncoder { } } - /// https://gpuweb.github.io/gpuweb/#dom-gpucomputepassencoder-setpipeline + /// fn SetPipeline(&self, pipeline: &GPUComputePipeline) { if let Some(compute_pass) = self.compute_pass.borrow_mut().as_mut() { wgpu_comp::wgpu_compute_pass_set_pipeline(compute_pass, pipeline.id().0); diff --git a/components/script/dom/gpucomputepipeline.rs b/components/script/dom/gpucomputepipeline.rs index ef568e04df6..008ab4a0c3f 100644 --- a/components/script/dom/gpucomputepipeline.rs +++ b/components/script/dom/gpucomputepipeline.rs @@ -70,17 +70,17 @@ impl GPUComputePipeline { } impl GPUComputePipelineMethods for GPUComputePipeline { - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn Label(&self) -> USVString { self.label.borrow().clone() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn SetLabel(&self, value: USVString) { *self.label.borrow_mut() = value; } - /// https://gpuweb.github.io/gpuweb/#dom-gpupipelinebase-getbindgrouplayout + /// fn GetBindGroupLayout(&self, index: u32) -> Fallible> { if index > self.bind_group_layouts.len() as u32 { return Err(Error::Range(String::from("Index out of bounds"))); diff --git a/components/script/dom/gpudevice.rs b/components/script/dom/gpudevice.rs index 515afa3a55d..58775a34f44 100644 --- a/components/script/dom/gpudevice.rs +++ b/components/script/dom/gpudevice.rs @@ -311,7 +311,7 @@ impl GPUDevice { } } - /// https://gpuweb.github.io/gpuweb/#lose-the-device + /// pub fn lose(&self, reason: GPUDeviceLostReason) { if let Some(ref lost_promise) = *self.lost_promise.borrow() { let global = &self.global(); @@ -328,39 +328,39 @@ impl GPUDevice { } impl GPUDeviceMethods for GPUDevice { - /// https://gpuweb.github.io/gpuweb/#dom-gpudevice-features + /// fn Features(&self) -> DomRoot { DomRoot::from_ref(&self.features) } - /// https://gpuweb.github.io/gpuweb/#dom-gpudevice-limits + /// fn Limits(&self) -> DomRoot { DomRoot::from_ref(&self.limits) } - /// https://gpuweb.github.io/gpuweb/#dom-gpudevice-queue + /// fn GetQueue(&self) -> DomRoot { DomRoot::from_ref(&self.default_queue) } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn Label(&self) -> USVString { self.label.borrow().clone() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn SetLabel(&self, value: USVString) { *self.label.borrow_mut() = value; } - /// https://gpuweb.github.io/gpuweb/#dom-gpudevice-lost + /// fn GetLost(&self, comp: InRealm) -> Fallible> { let promise = Promise::new_in_current_realm(comp); *self.lost_promise.borrow_mut() = Some(promise.clone()); Ok(promise) } - /// https://gpuweb.github.io/gpuweb/#dom-gpudevice-createbuffer + /// fn CreateBuffer(&self, descriptor: &GPUBufferDescriptor) -> Fallible> { let desc = wgt::BufferUsages::from_bits(descriptor.usage).map(|usg| wgpu_res::BufferDescriptor { @@ -425,7 +425,7 @@ impl GPUDeviceMethods for GPUDevice { )) } - /// https://gpuweb.github.io/gpuweb/#GPUDevice-createBindGroupLayout + /// #[allow(non_snake_case)] fn CreateBindGroupLayout( &self, @@ -546,7 +546,7 @@ impl GPUDeviceMethods for GPUDevice { ) } - /// https://gpuweb.github.io/gpuweb/#dom-gpudevice-createpipelinelayout + /// fn CreatePipelineLayout( &self, descriptor: &GPUPipelineLayoutDescriptor, @@ -596,7 +596,7 @@ impl GPUDeviceMethods for GPUDevice { ) } - /// https://gpuweb.github.io/gpuweb/#dom-gpudevice-createbindgroup + /// fn CreateBindGroup(&self, descriptor: &GPUBindGroupDescriptor) -> DomRoot { let entries = descriptor .entries @@ -657,7 +657,7 @@ impl GPUDeviceMethods for GPUDevice { ) } - /// https://gpuweb.github.io/gpuweb/#dom-gpudevice-createshadermodule + /// fn CreateShaderModule( &self, descriptor: RootedTraceableBox, @@ -690,7 +690,7 @@ impl GPUDeviceMethods for GPUDevice { ) } - /// https://gpuweb.github.io/gpuweb/#dom-gpudevice-createcomputepipeline + /// fn CreateComputePipeline( &self, descriptor: &GPUComputePipelineDescriptor, @@ -736,7 +736,7 @@ impl GPUDeviceMethods for GPUDevice { ) } - /// https://gpuweb.github.io/gpuweb/#dom-gpudevice-createcommandencoder + /// fn CreateCommandEncoder( &self, descriptor: &GPUCommandEncoderDescriptor, @@ -770,7 +770,7 @@ impl GPUDeviceMethods for GPUDevice { ) } - /// https://gpuweb.github.io/gpuweb/#dom-gpudevice-createtexture + /// fn CreateTexture(&self, descriptor: &GPUTextureDescriptor) -> DomRoot { let size = convert_texture_size_to_dict(&descriptor.size); let desc = wgt::TextureUsages::from_bits(descriptor.usage).map(|usg| { @@ -836,7 +836,7 @@ impl GPUDeviceMethods for GPUDevice { ) } - /// https://gpuweb.github.io/gpuweb/#dom-gpudevice-createsampler + /// fn CreateSampler(&self, descriptor: &GPUSamplerDescriptor) -> DomRoot { let sampler_id = self .global() @@ -885,7 +885,7 @@ impl GPUDeviceMethods for GPUDevice { ) } - /// https://gpuweb.github.io/gpuweb/#dom-gpudevice-createrenderpipeline + /// fn CreateRenderPipeline( &self, descriptor: &GPURenderPipelineDescriptor, @@ -1039,7 +1039,7 @@ impl GPUDeviceMethods for GPUDevice { ) } - /// https://gpuweb.github.io/gpuweb/#dom-gpudevice-createrenderbundleencoder + /// fn CreateRenderBundleEncoder( &self, descriptor: &GPURenderBundleEncoderDescriptor, @@ -1078,7 +1078,7 @@ impl GPUDeviceMethods for GPUDevice { ) } - /// https://gpuweb.github.io/gpuweb/#dom-gpudevice-pusherrorscope + /// fn PushErrorScope(&self, filter: GPUErrorFilter) { let mut context = self.scope_context.borrow_mut(); let scope_id = context.next_scope_id; @@ -1097,7 +1097,7 @@ impl GPUDeviceMethods for GPUDevice { assert!(res.is_none()); } - /// https://gpuweb.github.io/gpuweb/#dom-gpudevice-poperrorscope + /// fn PopErrorScope(&self, comp: InRealm) -> Rc { let mut context = self.scope_context.borrow_mut(); let promise = Promise::new_in_current_realm(comp); @@ -1131,7 +1131,7 @@ impl GPUDeviceMethods for GPUDevice { // https://gpuweb.github.io/gpuweb/#dom-gpudevice-onuncapturederror event_handler!(uncapturederror, GetOnuncapturederror, SetOnuncapturederror); - /// https://gpuweb.github.io/gpuweb/#dom-gpudevice-destroy + /// fn Destroy(&self) { if self.valid.get() { self.valid.set(false); @@ -1148,7 +1148,7 @@ impl GPUDeviceMethods for GPUDevice { } } - /// https://gpuweb.github.io/gpuweb/#dom-gpudevice-createcomputepipelineasync + /// fn CreateComputePipelineAsync( &self, _descriptor: &GPUComputePipelineDescriptor, @@ -1156,7 +1156,7 @@ impl GPUDeviceMethods for GPUDevice { todo!() } - /// https://gpuweb.github.io/gpuweb/#dom-gpudevice-createrenderpipelineasync + /// fn CreateRenderPipelineAsync(&self, _descriptor: &GPURenderPipelineDescriptor) -> Rc { todo!() } diff --git a/components/script/dom/gpudevicelostinfo.rs b/components/script/dom/gpudevicelostinfo.rs index 420f4d28c1a..1616e9d7169 100644 --- a/components/script/dom/gpudevicelostinfo.rs +++ b/components/script/dom/gpudevicelostinfo.rs @@ -42,12 +42,12 @@ impl GPUDeviceLostInfo { } impl GPUDeviceLostInfoMethods for GPUDeviceLostInfo { - /// https://gpuweb.github.io/gpuweb/#dom-gpudevicelostinfo-message + /// fn Message(&self) -> DOMString { self.message.clone() } - /// https://gpuweb.github.io/gpuweb/#dom-gpudevicelostinfo-reason + /// fn Reason(&self) -> GPUDeviceLostReason { self.reason } diff --git a/components/script/dom/gpuoutofmemoryerror.rs b/components/script/dom/gpuoutofmemoryerror.rs index 539cbe59f57..65252a28530 100644 --- a/components/script/dom/gpuoutofmemoryerror.rs +++ b/components/script/dom/gpuoutofmemoryerror.rs @@ -33,7 +33,7 @@ impl GPUOutOfMemoryError { ) } - /// https://gpuweb.github.io/gpuweb/#dom-gpuoutofmemoryerror-gpuoutofmemoryerror + /// #[allow(non_snake_case)] pub fn Constructor(global: &GlobalScope, proto: Option) -> DomRoot { GPUOutOfMemoryError::new_with_proto(global, proto) diff --git a/components/script/dom/gpupipelinelayout.rs b/components/script/dom/gpupipelinelayout.rs index e01ef489743..e54a1c68fc3 100644 --- a/components/script/dom/gpupipelinelayout.rs +++ b/components/script/dom/gpupipelinelayout.rs @@ -64,12 +64,12 @@ impl GPUPipelineLayout { } impl GPUPipelineLayoutMethods for GPUPipelineLayout { - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn Label(&self) -> USVString { self.label.borrow().clone() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn SetLabel(&self, value: USVString) { *self.label.borrow_mut() = value; } diff --git a/components/script/dom/gpuqueryset.rs b/components/script/dom/gpuqueryset.rs index 69599b4490a..51f859b6e13 100644 --- a/components/script/dom/gpuqueryset.rs +++ b/components/script/dom/gpuqueryset.rs @@ -18,17 +18,17 @@ pub struct GPUQuerySet { // TODO: wgpu does not expose right fields right now impl GPUQuerySetMethods for GPUQuerySet { - /// https://gpuweb.github.io/gpuweb/#dom-gpuqueryset-destroy + /// fn Destroy(&self) { todo!() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn Label(&self) -> USVString { todo!() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn SetLabel(&self, _value: USVString) { todo!() } diff --git a/components/script/dom/gpuqueue.rs b/components/script/dom/gpuqueue.rs index a9a850e825f..41dc1085529 100644 --- a/components/script/dom/gpuqueue.rs +++ b/components/script/dom/gpuqueue.rs @@ -58,17 +58,17 @@ impl GPUQueue { } impl GPUQueueMethods for GPUQueue { - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn Label(&self) -> USVString { self.label.borrow().clone() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn SetLabel(&self, value: USVString) { *self.label.borrow_mut() = value; } - /// https://gpuweb.github.io/gpuweb/#dom-gpuqueue-submit + /// fn Submit(&self, command_buffers: Vec>) { let valid = command_buffers.iter().all(|cb| { cb.buffers().iter().all(|b| match b.state() { @@ -99,7 +99,7 @@ impl GPUQueueMethods for GPUQueue { .unwrap(); } - /// https://gpuweb.github.io/gpuweb/#dom-gpuqueue-writebuffer + /// #[allow(unsafe_code)] fn WriteBuffer( &self, @@ -146,7 +146,7 @@ impl GPUQueueMethods for GPUQueue { Ok(()) } - /// https://gpuweb.github.io/gpuweb/#dom-gpuqueue-writetexture + /// fn WriteTexture( &self, destination: &GPUImageCopyTexture, diff --git a/components/script/dom/gpurenderbundle.rs b/components/script/dom/gpurenderbundle.rs index 5a746a4f0dd..c90aadf78e4 100644 --- a/components/script/dom/gpurenderbundle.rs +++ b/components/script/dom/gpurenderbundle.rs @@ -67,12 +67,12 @@ impl GPURenderBundle { } impl GPURenderBundleMethods for GPURenderBundle { - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn Label(&self) -> USVString { self.label.borrow().clone() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn SetLabel(&self, value: USVString) { *self.label.borrow_mut() = value; } diff --git a/components/script/dom/gpurenderbundleencoder.rs b/components/script/dom/gpurenderbundleencoder.rs index df78a4055ba..a81d7ad6891 100644 --- a/components/script/dom/gpurenderbundleencoder.rs +++ b/components/script/dom/gpurenderbundleencoder.rs @@ -70,17 +70,17 @@ impl GPURenderBundleEncoder { } impl GPURenderBundleEncoderMethods for GPURenderBundleEncoder { - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn Label(&self) -> USVString { self.label.borrow().clone() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn SetLabel(&self, value: USVString) { *self.label.borrow_mut() = value; } - /// https://gpuweb.github.io/gpuweb/#dom-gpuprogrammablepassencoder-setbindgroup + /// #[allow(unsafe_code)] fn SetBindGroup(&self, index: u32, bind_group: &GPUBindGroup, dynamic_offsets: Vec) { if let Some(encoder) = self.render_bundle_encoder.borrow_mut().as_mut() { @@ -96,14 +96,14 @@ impl GPURenderBundleEncoderMethods for GPURenderBundleEncoder { } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderencoderbase-setpipeline + /// fn SetPipeline(&self, pipeline: &GPURenderPipeline) { if let Some(encoder) = self.render_bundle_encoder.borrow_mut().as_mut() { wgpu_bundle::wgpu_render_bundle_set_pipeline(encoder, pipeline.id().0); } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderencoderbase-setindexbuffer + /// fn SetIndexBuffer( &self, buffer: &GPUBuffer, @@ -125,7 +125,7 @@ impl GPURenderBundleEncoderMethods for GPURenderBundleEncoder { } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderencoderbase-setvertexbuffer + /// fn SetVertexBuffer(&self, slot: u32, buffer: &GPUBuffer, offset: u64, size: u64) { if let Some(encoder) = self.render_bundle_encoder.borrow_mut().as_mut() { wgpu_bundle::wgpu_render_bundle_set_vertex_buffer( @@ -138,7 +138,7 @@ impl GPURenderBundleEncoderMethods for GPURenderBundleEncoder { } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderencoderbase-draw + /// fn Draw(&self, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32) { if let Some(encoder) = self.render_bundle_encoder.borrow_mut().as_mut() { wgpu_bundle::wgpu_render_bundle_draw( @@ -151,7 +151,7 @@ impl GPURenderBundleEncoderMethods for GPURenderBundleEncoder { } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderencoderbase-drawindexed + /// fn DrawIndexed( &self, index_count: u32, @@ -172,7 +172,7 @@ impl GPURenderBundleEncoderMethods for GPURenderBundleEncoder { } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderencoderbase-drawindirect + /// fn DrawIndirect(&self, indirect_buffer: &GPUBuffer, indirect_offset: u64) { if let Some(encoder) = self.render_bundle_encoder.borrow_mut().as_mut() { wgpu_bundle::wgpu_render_bundle_draw_indirect( @@ -183,7 +183,7 @@ impl GPURenderBundleEncoderMethods for GPURenderBundleEncoder { } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderencoderbase-drawindexedindirect + /// fn DrawIndexedIndirect(&self, indirect_buffer: &GPUBuffer, indirect_offset: u64) { if let Some(encoder) = self.render_bundle_encoder.borrow_mut().as_mut() { wgpu_bundle::wgpu_render_bundle_draw_indexed_indirect( @@ -194,7 +194,7 @@ impl GPURenderBundleEncoderMethods for GPURenderBundleEncoder { } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderbundleencoder-finish + /// fn Finish(&self, descriptor: &GPURenderBundleDescriptor) -> DomRoot { let desc = wgt::RenderBundleDescriptor { label: convert_label(&descriptor.parent), diff --git a/components/script/dom/gpurenderpassencoder.rs b/components/script/dom/gpurenderpassencoder.rs index a970eff4e2b..13c80035f04 100644 --- a/components/script/dom/gpurenderpassencoder.rs +++ b/components/script/dom/gpurenderpassencoder.rs @@ -72,17 +72,17 @@ impl GPURenderPassEncoder { } impl GPURenderPassEncoderMethods for GPURenderPassEncoder { - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn Label(&self) -> USVString { self.label.borrow().clone() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn SetLabel(&self, value: USVString) { *self.label.borrow_mut() = value; } - /// https://gpuweb.github.io/gpuweb/#dom-gpuprogrammablepassencoder-setbindgroup + /// #[allow(unsafe_code)] fn SetBindGroup(&self, index: u32, bind_group: &GPUBindGroup, dynamic_offsets: Vec) { if let Some(render_pass) = self.render_pass.borrow_mut().as_mut() { @@ -98,7 +98,7 @@ impl GPURenderPassEncoderMethods for GPURenderPassEncoder { } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderpassencoder-setviewport + /// fn SetViewport( &self, x: Finite, @@ -121,14 +121,14 @@ impl GPURenderPassEncoderMethods for GPURenderPassEncoder { } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderpassencoder-setscissorrect + /// fn SetScissorRect(&self, x: u32, y: u32, width: u32, height: u32) { if let Some(render_pass) = self.render_pass.borrow_mut().as_mut() { wgpu_render::wgpu_render_pass_set_scissor_rect(render_pass, x, y, width, height); } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderpassencoder-setblendcolor + /// fn SetBlendConstant(&self, color: GPUColor) { if let Some(render_pass) = self.render_pass.borrow_mut().as_mut() { let colors = match color { @@ -155,14 +155,14 @@ impl GPURenderPassEncoderMethods for GPURenderPassEncoder { } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderpassencoder-setstencilreference + /// fn SetStencilReference(&self, reference: u32) { if let Some(render_pass) = self.render_pass.borrow_mut().as_mut() { wgpu_render::wgpu_render_pass_set_stencil_reference(render_pass, reference); } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderpassencoder-end + /// fn End(&self) -> Fallible<()> { let render_pass = self.render_pass.borrow_mut().take(); self.channel @@ -183,14 +183,14 @@ impl GPURenderPassEncoderMethods for GPURenderPassEncoder { Ok(()) } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderencoderbase-setpipeline + /// fn SetPipeline(&self, pipeline: &GPURenderPipeline) { if let Some(render_pass) = self.render_pass.borrow_mut().as_mut() { wgpu_render::wgpu_render_pass_set_pipeline(render_pass, pipeline.id().0); } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurendercommandsmixin-setindexbuffer + /// fn SetIndexBuffer( &self, buffer: &GPUBuffer, @@ -212,7 +212,7 @@ impl GPURenderPassEncoderMethods for GPURenderPassEncoder { } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderencoderbase-setvertexbuffer + /// fn SetVertexBuffer(&self, slot: u32, buffer: &GPUBuffer, offset: u64, size: u64) { if let Some(render_pass) = self.render_pass.borrow_mut().as_mut() { wgpu_render::wgpu_render_pass_set_vertex_buffer( @@ -225,7 +225,7 @@ impl GPURenderPassEncoderMethods for GPURenderPassEncoder { } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderencoderbase-draw + /// fn Draw(&self, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32) { if let Some(render_pass) = self.render_pass.borrow_mut().as_mut() { wgpu_render::wgpu_render_pass_draw( @@ -238,7 +238,7 @@ impl GPURenderPassEncoderMethods for GPURenderPassEncoder { } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderencoderbase-drawindexed + /// fn DrawIndexed( &self, index_count: u32, @@ -259,7 +259,7 @@ impl GPURenderPassEncoderMethods for GPURenderPassEncoder { } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderencoderbase-drawindirect + /// fn DrawIndirect(&self, indirect_buffer: &GPUBuffer, indirect_offset: u64) { if let Some(render_pass) = self.render_pass.borrow_mut().as_mut() { wgpu_render::wgpu_render_pass_draw_indirect( @@ -270,7 +270,7 @@ impl GPURenderPassEncoderMethods for GPURenderPassEncoder { } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderencoderbase-drawindexedindirect + /// fn DrawIndexedIndirect(&self, indirect_buffer: &GPUBuffer, indirect_offset: u64) { if let Some(render_pass) = self.render_pass.borrow_mut().as_mut() { wgpu_render::wgpu_render_pass_draw_indexed_indirect( @@ -281,7 +281,7 @@ impl GPURenderPassEncoderMethods for GPURenderPassEncoder { } } - /// https://gpuweb.github.io/gpuweb/#dom-gpurenderpassencoder-executebundles + /// #[allow(unsafe_code)] fn ExecuteBundles(&self, bundles: Vec>) { let bundle_ids = bundles.iter().map(|b| b.id().0).collect::>(); diff --git a/components/script/dom/gpurenderpipeline.rs b/components/script/dom/gpurenderpipeline.rs index a1cef99c7e8..765737fa8b9 100644 --- a/components/script/dom/gpurenderpipeline.rs +++ b/components/script/dom/gpurenderpipeline.rs @@ -70,17 +70,17 @@ impl GPURenderPipeline { } impl GPURenderPipelineMethods for GPURenderPipeline { - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn Label(&self) -> USVString { self.label.borrow().clone() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn SetLabel(&self, value: USVString) { *self.label.borrow_mut() = value; } - /// https://gpuweb.github.io/gpuweb/#dom-gpupipelinebase-getbindgrouplayout + /// fn GetBindGroupLayout(&self, index: u32) -> Fallible> { if index > self.bind_group_layouts.len() as u32 { return Err(Error::Range(String::from("Index out of bounds"))); diff --git a/components/script/dom/gpusampler.rs b/components/script/dom/gpusampler.rs index 6a3b5462ff1..48663c722e6 100644 --- a/components/script/dom/gpusampler.rs +++ b/components/script/dom/gpusampler.rs @@ -65,12 +65,12 @@ impl GPUSampler { } impl GPUSamplerMethods for GPUSampler { - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn Label(&self) -> USVString { self.label.borrow().clone() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn SetLabel(&self, value: USVString) { *self.label.borrow_mut() = value; } diff --git a/components/script/dom/gpushadermodule.rs b/components/script/dom/gpushadermodule.rs index 261f551a27f..745daefaac3 100644 --- a/components/script/dom/gpushadermodule.rs +++ b/components/script/dom/gpushadermodule.rs @@ -52,17 +52,17 @@ impl GPUShaderModule { } impl GPUShaderModuleMethods for GPUShaderModule { - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn Label(&self) -> USVString { self.label.borrow().clone() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn SetLabel(&self, value: USVString) { *self.label.borrow_mut() = value; } - /// https://gpuweb.github.io/gpuweb/#dom-gpushadermodule-getcompilationinfo + /// fn GetCompilationInfo(&self) -> Fallible> { todo!("Missing in wgpu: https://github.com/gfx-rs/wgpu/issues/2170") } diff --git a/components/script/dom/gpusupportedlimits.rs b/components/script/dom/gpusupportedlimits.rs index d4fc0f1a0d0..2c30f9cbdfc 100644 --- a/components/script/dom/gpusupportedlimits.rs +++ b/components/script/dom/gpusupportedlimits.rs @@ -34,142 +34,142 @@ impl GPUSupportedLimits { } impl GPUSupportedLimitsMethods for GPUSupportedLimits { - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxtexturedimension1d + /// fn MaxTextureDimension1D(&self) -> u32 { self.limits.max_texture_dimension_1d } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxtexturedimension2d + /// fn MaxTextureDimension2D(&self) -> u32 { self.limits.max_texture_dimension_2d } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxtexturedimension3d + /// fn MaxTextureDimension3D(&self) -> u32 { self.limits.max_texture_dimension_3d } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxtexturearraylayers + /// fn MaxTextureArrayLayers(&self) -> u32 { self.limits.max_texture_array_layers } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxbindgroups + /// fn MaxBindGroups(&self) -> u32 { self.limits.max_bind_groups } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxbindingsperbindgroup + /// fn MaxBindingsPerBindGroup(&self) -> u32 { self.limits.max_bindings_per_bind_group } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxdynamicuniformbuffersperpipelinelayout + /// fn MaxDynamicUniformBuffersPerPipelineLayout(&self) -> u32 { self.limits.max_dynamic_uniform_buffers_per_pipeline_layout } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxdynamicstoragebuffersperpipelinelayout + /// fn MaxDynamicStorageBuffersPerPipelineLayout(&self) -> u32 { self.limits.max_dynamic_storage_buffers_per_pipeline_layout } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxsampledtexturespershaderstage + /// fn MaxSampledTexturesPerShaderStage(&self) -> u32 { self.limits.max_sampled_textures_per_shader_stage } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxsamplerspershaderstage + /// fn MaxSamplersPerShaderStage(&self) -> u32 { self.limits.max_samplers_per_shader_stage } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxstoragebufferspershaderstage + /// fn MaxStorageBuffersPerShaderStage(&self) -> u32 { self.limits.max_storage_buffers_per_shader_stage } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxstoragetexturespershaderstage + /// fn MaxStorageTexturesPerShaderStage(&self) -> u32 { self.limits.max_storage_textures_per_shader_stage } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxuniformbufferspershaderstage + /// fn MaxUniformBuffersPerShaderStage(&self) -> u32 { self.limits.max_uniform_buffers_per_shader_stage } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxuniformbufferbindingsize + /// fn MaxUniformBufferBindingSize(&self) -> u64 { self.limits.max_uniform_buffer_binding_size as u64 } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxstoragebufferbindingsize + /// fn MaxStorageBufferBindingSize(&self) -> u64 { self.limits.max_storage_buffer_binding_size as u64 } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-minuniformbufferoffsetalignment + /// fn MinUniformBufferOffsetAlignment(&self) -> u32 { self.limits.min_uniform_buffer_offset_alignment } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-minstoragebufferoffsetalignment + /// fn MinStorageBufferOffsetAlignment(&self) -> u32 { self.limits.min_storage_buffer_offset_alignment } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxvertexbuffers + /// fn MaxVertexBuffers(&self) -> u32 { self.limits.max_vertex_buffers } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxbuffersize + /// fn MaxBufferSize(&self) -> u64 { self.limits.max_buffer_size } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxvertexattributes + /// fn MaxVertexAttributes(&self) -> u32 { self.limits.max_vertex_attributes } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxvertexbufferarraystride + /// fn MaxVertexBufferArrayStride(&self) -> u32 { self.limits.max_vertex_buffer_array_stride } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxinterstageshadercomponents + /// fn MaxInterStageShaderComponents(&self) -> u32 { self.limits.max_inter_stage_shader_components } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxcomputeworkgroupstoragesize + /// fn MaxComputeWorkgroupStorageSize(&self) -> u32 { self.limits.max_compute_workgroup_storage_size } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxcomputeinvocationsperworkgroup + /// fn MaxComputeInvocationsPerWorkgroup(&self) -> u32 { self.limits.max_compute_invocations_per_workgroup } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxcomputeworkgroupsizex + /// fn MaxComputeWorkgroupSizeX(&self) -> u32 { self.limits.max_compute_workgroup_size_x } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxcomputeworkgroupsizey + /// fn MaxComputeWorkgroupSizeY(&self) -> u32 { self.limits.max_compute_workgroup_size_y } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxcomputeworkgroupsizez + /// fn MaxComputeWorkgroupSizeZ(&self) -> u32 { self.limits.max_compute_workgroup_size_z } - /// https://gpuweb.github.io/gpuweb/#dom-gpusupportedlimits-maxcomputeworkgroupsperdimension + /// fn MaxComputeWorkgroupsPerDimension(&self) -> u32 { self.limits.max_compute_workgroups_per_dimension } diff --git a/components/script/dom/gputexture.rs b/components/script/dom/gputexture.rs index b10f79915d3..d3058f1e5dd 100644 --- a/components/script/dom/gputexture.rs +++ b/components/script/dom/gputexture.rs @@ -117,17 +117,17 @@ impl GPUTexture { } impl GPUTextureMethods for GPUTexture { - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn Label(&self) -> USVString { self.label.borrow().clone() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn SetLabel(&self, value: USVString) { *self.label.borrow_mut() = value; } - /// https://gpuweb.github.io/gpuweb/#dom-gputexture-createview + /// fn CreateView(&self, descriptor: &GPUTextureViewDescriptor) -> DomRoot { let scope_id = self.device.use_current_scope(); @@ -189,7 +189,7 @@ impl GPUTextureMethods for GPUTexture { ) } - /// https://gpuweb.github.io/gpuweb/#dom-gputexture-destroy + /// fn Destroy(&self) { if self.destroyed.get() { return; diff --git a/components/script/dom/gputextureview.rs b/components/script/dom/gputextureview.rs index af207c076f9..ce887542684 100644 --- a/components/script/dom/gputextureview.rs +++ b/components/script/dom/gputextureview.rs @@ -56,12 +56,12 @@ impl GPUTextureView { } impl GPUTextureViewMethods for GPUTextureView { - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn Label(&self) -> USVString { self.label.borrow().clone() } - /// https://gpuweb.github.io/gpuweb/#dom-gpuobjectbase-label + /// fn SetLabel(&self, value: USVString) { *self.label.borrow_mut() = value; } diff --git a/components/script/dom/gpuuncapturederrorevent.rs b/components/script/dom/gpuuncapturederrorevent.rs index d6d9bdbd45a..fbc210516f7 100644 --- a/components/script/dom/gpuuncapturederrorevent.rs +++ b/components/script/dom/gpuuncapturederrorevent.rs @@ -58,7 +58,7 @@ impl GPUUncapturedErrorEvent { ev } - /// https://gpuweb.github.io/gpuweb/#dom-gpuuncapturederrorevent-gpuuncapturederrorevent + /// #[allow(non_snake_case)] pub fn Constructor( global: &GlobalScope, @@ -77,12 +77,12 @@ impl GPUUncapturedErrorEvent { } impl GPUUncapturedErrorEventMethods for GPUUncapturedErrorEvent { - /// https://gpuweb.github.io/gpuweb/#dom-gpuuncapturederrorevent-error + /// fn Error(&self) -> GPUError { clone_gpu_error(&self.gpu_error) } - /// https://dom.spec.whatwg.org/#dom-event-istrusted + /// fn IsTrusted(&self) -> bool { self.event.IsTrusted() } diff --git a/components/script/dom/gpuvalidationerror.rs b/components/script/dom/gpuvalidationerror.rs index 044502bfa32..176429ef490 100644 --- a/components/script/dom/gpuvalidationerror.rs +++ b/components/script/dom/gpuvalidationerror.rs @@ -42,7 +42,7 @@ impl GPUValidationError { ) } - /// https://gpuweb.github.io/gpuweb/#dom-gpuvalidationerror-gpuvalidationerror + /// #[allow(non_snake_case)] pub fn Constructor( global: &GlobalScope, @@ -54,7 +54,7 @@ impl GPUValidationError { } impl GPUValidationErrorMethods for GPUValidationError { - /// https://gpuweb.github.io/gpuweb/#dom-gpuvalidationerror-message + /// fn Message(&self) -> DOMString { self.message.clone() } diff --git a/components/script/dom/htmlanchorelement.rs b/components/script/dom/htmlanchorelement.rs index a347e3d6e9a..1d720e7b955 100644 --- a/components/script/dom/htmlanchorelement.rs +++ b/components/script/dom/htmlanchorelement.rs @@ -610,7 +610,7 @@ pub fn get_element_target(subject: &Element) -> Option { }; } -/// < https://html.spec.whatwg.org/multipage/#get-an-element's-noopener> +/// pub fn get_element_noopener(subject: &Element, target_attribute_value: Option) -> bool { if !(subject.is::() || subject.is::() || diff --git a/components/script/dom/htmlcanvaselement.rs b/components/script/dom/htmlcanvaselement.rs index e412457753a..60dfeb3bb47 100644 --- a/components/script/dom/htmlcanvaselement.rs +++ b/components/script/dom/htmlcanvaselement.rs @@ -442,7 +442,7 @@ impl HTMLCanvasElementMethods for HTMLCanvasElement { Ok(USVString(url)) } - /// https://w3c.github.io/mediacapture-fromelement/#dom-htmlcanvaselement-capturestream + /// fn CaptureStream(&self, _frame_request_rate: Option>) -> DomRoot { let global = self.global(); let stream = MediaStream::new(&*global); diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs index 06a97771a38..50a21ae45df 100644 --- a/components/script/dom/htmlformelement.rs +++ b/components/script/dom/htmlformelement.rs @@ -89,7 +89,7 @@ pub struct GenerationId(u32); pub struct HTMLFormElement { htmlelement: HTMLElement, marked_for_reset: Cell, - /// https://html.spec.whatwg.org/multipage/#constructing-entry-list + /// constructing_entry_list: Cell, elements: DomOnceCell, generation_id: Cell, @@ -615,12 +615,12 @@ impl HTMLFormElementMethods for HTMLFormElement { return names_vec; } - /// https://html.spec.whatwg.org/multipage/#dom-form-checkvalidity + /// fn CheckValidity(&self) -> bool { self.static_validation().is_ok() } - /// https://html.spec.whatwg.org/multipage/#dom-form-reportvalidity + /// fn ReportValidity(&self) -> bool { self.interactive_validation().is_ok() } diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index 4119bb9c86c..f973ddc73f8 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -483,7 +483,7 @@ impl HTMLIFrameElement { } } - /// https://html.spec.whatwg.org/multipage/#iframe-load-event-steps steps 1-4 + /// steps 1-4 pub fn iframe_load_event_steps(&self, loaded_pipeline: PipelineId) { // TODO(#9592): assert that the load blocker is present at all times when we // can guarantee that it's created for the case of iframe.reload(). diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs index 91ba8dc2499..baef87bff4c 100644 --- a/components/script/dom/htmlimageelement.rs +++ b/components/script/dom/htmlimageelement.rs @@ -425,7 +425,7 @@ impl HTMLImageElement { self.upcast::().dirty(NodeDamage::OtherNodeDamage); } - /// Step 24 of https://html.spec.whatwg.org/multipage/#update-the-image-data + /// Step 24 of fn process_image_response(&self, image: ImageResponse) { // TODO: Handle multipart/x-mixed-replace let (trigger_image_load, trigger_image_error) = match (image, self.image_request.get()) { @@ -674,7 +674,7 @@ impl HTMLImageElement { source_size_list.evaluate(&device, quirks_mode) } - /// https://html.spec.whatwg.org/multipage/#matches-the-environment + /// fn matches_environment(&self, media_query: String) -> bool { let document = document_from_node(self); let quirks_mode = document.quirks_mode(); @@ -1019,7 +1019,7 @@ impl HTMLImageElement { ScriptThread::await_stable_state(Microtask::ImageElement(task)); } - /// Step 2-12 of https://html.spec.whatwg.org/multipage/#img-environment-changes + /// Step 2-12 of fn react_to_environment_changes_sync_steps(&self, generation: u32) { // TODO reduce duplicacy of this code @@ -1814,7 +1814,8 @@ where return (s, ""); } -/// Parse an `srcset` attribute - https://html.spec.whatwg.org/multipage/#parsing-a-srcset-attribute. +/// Parse an `srcset` attribute: +/// . pub fn parse_a_srcset_attribute(input: &str) -> Vec { let mut url_len = 0; let mut candidates: Vec = vec![]; diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs index 2d89abaa7b7..0b2ed564c19 100644 --- a/components/script/dom/htmlmediaelement.rs +++ b/components/script/dom/htmlmediaelement.rs @@ -346,19 +346,19 @@ pub struct HTMLMediaElement { #[ignore_malloc_size_of = "Arc"] #[no_trace] audio_renderer: DomRefCell>>>, - /// https://html.spec.whatwg.org/multipage/#show-poster-flag + /// show_poster: Cell, - /// https://html.spec.whatwg.org/multipage/#dom-media-duration + /// duration: Cell, - /// https://html.spec.whatwg.org/multipage/#official-playback-position + /// playback_position: Cell, - /// https://html.spec.whatwg.org/multipage/#default-playback-start-position + /// default_playback_start_position: Cell, - /// https://html.spec.whatwg.org/multipage/#dom-media-volume + /// volume: Cell, - /// https://html.spec.whatwg.org/multipage/#dom-media-seeking + /// seeking: Cell, - /// https://html.spec.whatwg.org/multipage/#dom-media-muted + /// muted: Cell, /// URL of the media resource, if any. #[no_trace] @@ -367,14 +367,14 @@ pub struct HTMLMediaElement { /// is a blob. #[no_trace] blob_url: DomRefCell>, - /// https://html.spec.whatwg.org/multipage/#dom-media-played + /// #[ignore_malloc_size_of = "Rc"] played: DomRefCell, // https://html.spec.whatwg.org/multipage/#dom-media-audiotracks audio_tracks_list: MutNullableDom, // https://html.spec.whatwg.org/multipage/#dom-media-videotracks video_tracks_list: MutNullableDom, - /// https://html.spec.whatwg.org/multipage/#dom-media-texttracks + /// text_tracks_list: MutNullableDom, /// Time of last timeupdate notification. #[ignore_malloc_size_of = "Defined in std::time"] @@ -498,7 +498,7 @@ impl HTMLMediaElement { } } - /// https://html.spec.whatwg.org/multipage/#time-marches-on + /// fn time_marches_on(&self) { // Step 6. if Instant::now() > self.next_timeupdate_event.get() { @@ -1316,7 +1316,7 @@ impl HTMLMediaElement { task_source.queue_simple_event(self.upcast(), atom!("seeked"), &window); } - /// https://html.spec.whatwg.org/multipage/#poster-frame + /// pub fn process_poster_image_loaded(&self, image: Arc) { if !self.show_poster.get() { return; @@ -2230,12 +2230,12 @@ impl HTMLMediaElementMethods for HTMLMediaElement { self.paused.get() } - /// https://html.spec.whatwg.org/multipage/#dom-media-defaultplaybackrate + /// fn GetDefaultPlaybackRate(&self) -> Fallible> { Ok(Finite::wrap(self.defaultPlaybackRate.get())) } - /// https://html.spec.whatwg.org/multipage/#dom-media-defaultplaybackrate + /// fn SetDefaultPlaybackRate(&self, value: Finite) -> ErrorResult { let min_allowed = -64.0; let max_allowed = 64.0; @@ -2251,12 +2251,12 @@ impl HTMLMediaElementMethods for HTMLMediaElement { Ok(()) } - /// https://html.spec.whatwg.org/multipage/#dom-media-playbackrate + /// fn GetPlaybackRate(&self) -> Fallible> { Ok(Finite::wrap(self.playbackRate.get())) } - /// https://html.spec.whatwg.org/multipage/#dom-media-playbackrate + /// fn SetPlaybackRate(&self, value: Finite) -> ErrorResult { let min_allowed = -64.0; let max_allowed = 64.0; diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index e7b71e853e1..398214de1a4 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -1073,7 +1073,7 @@ impl HTMLScriptElement { } #[allow(unsafe_code)] - /// https://html.spec.whatwg.org/multipage/#run-a-module-script + /// pub fn run_a_module_script(&self, script: &ScriptOrigin, _rethrow_errors: bool) { // TODO use a settings object rather than this element's document/window // Step 2 diff --git a/components/script/dom/htmlvideoelement.rs b/components/script/dom/htmlvideoelement.rs index 9149acedede..a9fcd3d87ef 100644 --- a/components/script/dom/htmlvideoelement.rs +++ b/components/script/dom/htmlvideoelement.rs @@ -49,9 +49,9 @@ const DEFAULT_HEIGHT: u32 = 150; #[dom_struct] pub struct HTMLVideoElement { htmlmediaelement: HTMLMediaElement, - /// https://html.spec.whatwg.org/multipage/#dom-video-videowidth + /// video_width: Cell, - /// https://html.spec.whatwg.org/multipage/#dom-video-videoheight + /// video_height: Cell, /// Incremented whenever tasks associated with this element are cancelled. generation_id: Cell, @@ -136,7 +136,7 @@ impl HTMLVideoElement { } } - /// https://html.spec.whatwg.org/multipage/#poster-frame + /// fn fetch_poster_frame(&self, poster_url: &str) { // Step 1. let cancel_receiver = self.poster_frame_canceller.borrow_mut().initialize(); @@ -182,7 +182,7 @@ impl HTMLVideoElement { } } - /// https://html.spec.whatwg.org/multipage/#poster-frame + /// fn do_fetch_poster_frame( &self, poster_url: ServoUrl, diff --git a/components/script/dom/mediadeviceinfo.rs b/components/script/dom/mediadeviceinfo.rs index c07be051076..cfacd7c6271 100644 --- a/components/script/dom/mediadeviceinfo.rs +++ b/components/script/dom/mediadeviceinfo.rs @@ -55,22 +55,22 @@ impl MediaDeviceInfo { } impl MediaDeviceInfoMethods for MediaDeviceInfo { - /// https://w3c.github.io/mediacapture-main/#dom-mediadeviceinfo-deviceid + /// fn DeviceId(&self) -> DOMString { self.device_id.clone() } - /// https://w3c.github.io/mediacapture-main/#dom-mediadeviceinfo-kind + /// fn Kind(&self) -> MediaDeviceKind { self.kind } - /// https://w3c.github.io/mediacapture-main/#dom-mediadeviceinfo-label + /// fn Label(&self) -> DOMString { self.label.clone() } - /// https://w3c.github.io/mediacapture-main/#dom-mediadeviceinfo-groupid + /// fn GroupId(&self) -> DOMString { self.group_id.clone() } diff --git a/components/script/dom/mediadevices.rs b/components/script/dom/mediadevices.rs index dc7b6820448..8739510a82b 100644 --- a/components/script/dom/mediadevices.rs +++ b/components/script/dom/mediadevices.rs @@ -44,7 +44,7 @@ impl MediaDevices { } impl MediaDevicesMethods for MediaDevices { - /// https://w3c.github.io/mediacapture-main/#dom-mediadevices-getusermedia + /// #[allow(unsafe_code)] fn GetUserMedia(&self, constraints: &MediaStreamConstraints, comp: InRealm) -> Rc { let p = Promise::new_in_current_realm(comp); @@ -67,7 +67,7 @@ impl MediaDevicesMethods for MediaDevices { p } - /// https://w3c.github.io/mediacapture-main/#dom-mediadevices-enumeratedevices + /// fn EnumerateDevices(&self) -> Rc { // Step 1. let in_realm_proof = AlreadyInRealm::assert(); diff --git a/components/script/dom/mediaelementaudiosourcenode.rs b/components/script/dom/mediaelementaudiosourcenode.rs index bb874f0f482..fed3d87b58f 100644 --- a/components/script/dom/mediaelementaudiosourcenode.rs +++ b/components/script/dom/mediaelementaudiosourcenode.rs @@ -83,7 +83,7 @@ impl MediaElementAudioSourceNode { } impl MediaElementAudioSourceNodeMethods for MediaElementAudioSourceNode { - /// https://webaudio.github.io/web-audio-api/#dom-mediaelementaudiosourcenode-mediaelement + /// fn MediaElement(&self) -> DomRoot { DomRoot::from_ref(&*self.media_element) } diff --git a/components/script/dom/mediametadata.rs b/components/script/dom/mediametadata.rs index d5452680157..e9b6b605c7a 100644 --- a/components/script/dom/mediametadata.rs +++ b/components/script/dom/mediametadata.rs @@ -48,7 +48,7 @@ impl MediaMetadata { reflect_dom_object_with_proto(Box::new(MediaMetadata::new_inherited(init)), global, proto) } - /// https://w3c.github.io/mediasession/#dom-mediametadata-mediametadata + /// #[allow(non_snake_case)] pub fn Constructor( window: &Window, @@ -70,34 +70,34 @@ impl MediaMetadata { } impl MediaMetadataMethods for MediaMetadata { - /// https://w3c.github.io/mediasession/#dom-mediametadata-title + /// fn Title(&self) -> DOMString { self.title.borrow().clone() } - /// https://w3c.github.io/mediasession/#dom-mediametadata-title + /// fn SetTitle(&self, value: DOMString) { *self.title.borrow_mut() = value; self.queue_update_metadata_algorithm(); } - /// https://w3c.github.io/mediasession/#dom-mediametadata-artist + /// fn Artist(&self) -> DOMString { self.artist.borrow().clone() } - /// https://w3c.github.io/mediasession/#dom-mediametadata-artist + /// fn SetArtist(&self, value: DOMString) { *self.artist.borrow_mut() = value; self.queue_update_metadata_algorithm(); } - /// https://w3c.github.io/mediasession/#dom-mediametadata-album + /// fn Album(&self) -> DOMString { self.album.borrow().clone() } - /// https://w3c.github.io/mediasession/#dom-mediametadata-album + /// fn SetAlbum(&self, value: DOMString) { *self.album.borrow_mut() = value; self.queue_update_metadata_algorithm(); diff --git a/components/script/dom/mediasession.rs b/components/script/dom/mediasession.rs index b1907c4678c..77a5d4494bd 100644 --- a/components/script/dom/mediasession.rs +++ b/components/script/dom/mediasession.rs @@ -32,13 +32,13 @@ use crate::realms::{enter_realm, InRealm}; #[dom_struct] pub struct MediaSession { reflector_: Reflector, - /// https://w3c.github.io/mediasession/#dom-mediasession-metadata + /// #[ignore_malloc_size_of = "defined in embedder_traits"] #[no_trace] metadata: DomRefCell>, - /// https://w3c.github.io/mediasession/#dom-mediasession-playbackstate + /// playback_state: DomRefCell, - /// https://w3c.github.io/mediasession/#supported-media-session-actions + /// #[ignore_malloc_size_of = "Rc"] action_handlers: DomRefCell>>, @@ -125,7 +125,7 @@ impl MediaSession { } impl MediaSessionMethods for MediaSession { - /// https://w3c.github.io/mediasession/#dom-mediasession-metadata + /// fn GetMetadata(&self) -> Option> { if let Some(ref metadata) = *self.metadata.borrow() { let mut init = MediaMetadataInit::empty(); @@ -139,7 +139,7 @@ impl MediaSessionMethods for MediaSession { } } - /// https://w3c.github.io/mediasession/#dom-mediasession-metadata + /// fn SetMetadata(&self, metadata: Option<&MediaMetadata>) { if let Some(ref metadata) = metadata { metadata.set_session(self); @@ -168,17 +168,17 @@ impl MediaSessionMethods for MediaSession { self.send_event(MediaSessionEvent::SetMetadata(_metadata)); } - /// https://w3c.github.io/mediasession/#dom-mediasession-playbackstate + /// fn PlaybackState(&self) -> MediaSessionPlaybackState { *self.playback_state.borrow() } - /// https://w3c.github.io/mediasession/#dom-mediasession-playbackstate + /// fn SetPlaybackState(&self, state: MediaSessionPlaybackState) { *self.playback_state.borrow_mut() = state; } - /// https://w3c.github.io/mediasession/#update-action-handler-algorithm + /// fn SetActionHandler( &self, action: MediaSessionAction, @@ -193,7 +193,7 @@ impl MediaSessionMethods for MediaSession { }; } - /// https://w3c.github.io/mediasession/#dom-mediasession-setpositionstate + /// fn SetPositionState(&self, state: &MediaPositionState) -> Fallible<()> { // If the state is an empty dictionary then clear the position state. if state.duration.is_none() && state.position.is_none() && state.playbackRate.is_none() { diff --git a/components/script/dom/mediastream.rs b/components/script/dom/mediastream.rs index 55da06cc74a..4f790a1ced7 100644 --- a/components/script/dom/mediastream.rs +++ b/components/script/dom/mediastream.rs @@ -91,7 +91,7 @@ impl MediaStream { } impl MediaStreamMethods for MediaStream { - /// https://w3c.github.io/mediacapture-main/#dom-mediastream-gettracks + /// fn GetTracks(&self) -> Vec> { self.tracks .borrow() @@ -100,7 +100,7 @@ impl MediaStreamMethods for MediaStream { .collect() } - /// https://w3c.github.io/mediacapture-main/#dom-mediastream-getaudiotracks + /// fn GetAudioTracks(&self) -> Vec> { self.tracks .borrow() @@ -110,7 +110,7 @@ impl MediaStreamMethods for MediaStream { .collect() } - /// https://w3c.github.io/mediacapture-main/#dom-mediastream-getvideotracks + /// fn GetVideoTracks(&self) -> Vec> { self.tracks .borrow() @@ -120,7 +120,7 @@ impl MediaStreamMethods for MediaStream { .collect() } - /// https://w3c.github.io/mediacapture-main/#dom-mediastream-gettrackbyid + /// fn GetTrackById(&self, id: DOMString) -> Option> { self.tracks .borrow() @@ -129,7 +129,7 @@ impl MediaStreamMethods for MediaStream { .map(|x| DomRoot::from_ref(&**x)) } - /// https://w3c.github.io/mediacapture-main/#dom-mediastream-addtrack + /// fn AddTrack(&self, track: &MediaStreamTrack) { let existing = self.tracks.borrow().iter().find(|x| *x == &track).is_some(); @@ -139,12 +139,12 @@ impl MediaStreamMethods for MediaStream { self.add_track(track) } - /// https://w3c.github.io/mediacapture-main/#dom-mediastream-removetrack + /// fn RemoveTrack(&self, track: &MediaStreamTrack) { self.tracks.borrow_mut().retain(|x| *x != track); } - /// https://w3c.github.io/mediacapture-main/#dom-mediastream-clone + /// fn Clone(&self) -> DomRoot { self.clone_with_proto(None) } diff --git a/components/script/dom/mediastreamaudiodestinationnode.rs b/components/script/dom/mediastreamaudiodestinationnode.rs index 1950ce34a26..b2ce9e3aaab 100644 --- a/components/script/dom/mediastreamaudiodestinationnode.rs +++ b/components/script/dom/mediastreamaudiodestinationnode.rs @@ -85,7 +85,7 @@ impl MediaStreamAudioDestinationNode { } impl MediaStreamAudioDestinationNodeMethods for MediaStreamAudioDestinationNode { - /// https://webaudio.github.io/web-audio-api/#dom-mediastreamaudiodestinationnode-stream + /// fn Stream(&self) -> DomRoot { DomRoot::from_ref(&self.stream) } diff --git a/components/script/dom/mediastreamaudiosourcenode.rs b/components/script/dom/mediastreamaudiosourcenode.rs index 4f273f960b2..141bc0fd5d1 100644 --- a/components/script/dom/mediastreamaudiosourcenode.rs +++ b/components/script/dom/mediastreamaudiosourcenode.rs @@ -81,7 +81,7 @@ impl MediaStreamAudioSourceNode { } impl MediaStreamAudioSourceNodeMethods for MediaStreamAudioSourceNode { - /// https://webaudio.github.io/web-audio-api/#dom-MediaStreamAudioSourceNode-stream + /// fn MediaStream(&self) -> DomRoot { DomRoot::from_ref(&self.stream) } diff --git a/components/script/dom/mediastreamtrack.rs b/components/script/dom/mediastreamtrack.rs index 06950d5350e..4f1d7db6838 100644 --- a/components/script/dom/mediastreamtrack.rs +++ b/components/script/dom/mediastreamtrack.rs @@ -51,7 +51,7 @@ impl MediaStreamTrack { } impl MediaStreamTrackMethods for MediaStreamTrack { - /// https://w3c.github.io/mediacapture-main/#dom-mediastreamtrack-kind + /// fn Kind(&self) -> DOMString { match self.ty { MediaStreamType::Video => "video".into(), @@ -59,12 +59,12 @@ impl MediaStreamTrackMethods for MediaStreamTrack { } } - /// https://w3c.github.io/mediacapture-main/#dom-mediastreamtrack-id + /// fn Id(&self) -> DOMString { self.id.id().to_string().into() } - /// https://w3c.github.io/mediacapture-main/#dom-mediastreamtrack-clone + /// fn Clone(&self) -> DomRoot { MediaStreamTrack::new(&self.global(), self.id, self.ty) } diff --git a/components/script/dom/messageport.rs b/components/script/dom/messageport.rs index f0de3a48e94..112188015d3 100644 --- a/components/script/dom/messageport.rs +++ b/components/script/dom/messageport.rs @@ -199,7 +199,7 @@ impl Transferable for MessagePort { Ok(u64::from_ne_bytes(big)) } - /// https://html.spec.whatwg.org/multipage/#message-ports:transfer-receiving-steps + /// fn transfer_receive( owner: &GlobalScope, sc_holder: &mut StructuredDataHolder, diff --git a/components/script/dom/mutationobserver.rs b/components/script/dom/mutationobserver.rs index cc0c470164c..d923311e09c 100644 --- a/components/script/dom/mutationobserver.rs +++ b/components/script/dom/mutationobserver.rs @@ -351,14 +351,14 @@ impl MutationObserverMethods for MutationObserver { Ok(()) } - /// https://dom.spec.whatwg.org/#dom-mutationobserver-takerecords + /// fn TakeRecords(&self) -> Vec> { let records: Vec> = self.record_queue.borrow().clone(); self.record_queue.borrow_mut().clear(); records } - /// https://dom.spec.whatwg.org/#dom-mutationobserver-disconnect + /// fn Disconnect(&self) { // Step 1 let mut nodes = self.node_list.borrow_mut(); diff --git a/components/script/dom/navigator.rs b/components/script/dom/navigator.rs index 1271dd7bed3..cf3928b8fed 100644 --- a/components/script/dom/navigator.rs +++ b/components/script/dom/navigator.rs @@ -174,19 +174,19 @@ impl NavigatorMethods for Navigator { .or_init(|| Permissions::new(&self.global())) } - /// https://immersive-web.github.io/webxr/#dom-navigator-xr + /// fn Xr(&self) -> DomRoot { self.xr .or_init(|| XRSystem::new(&self.global().as_window())) } - /// https://w3c.github.io/mediacapture-main/#dom-navigator-mediadevices + /// fn MediaDevices(&self) -> DomRoot { self.mediadevices .or_init(|| MediaDevices::new(&self.global())) } - /// https://w3c.github.io/mediasession/#dom-navigator-mediasession + /// fn MediaSession(&self) -> DomRoot { self.mediasession.or_init(|| { // There is a single MediaSession instance per Pipeline diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index b2c95c5f92a..c50ee80164f 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -1017,7 +1017,7 @@ impl Node { } } - /// https://dom.spec.whatwg.org/#concept-shadow-including-inclusive-ancestor + /// pub fn inclusive_ancestors( &self, shadow_including: ShadowIncluding, @@ -1231,7 +1231,7 @@ impl Node { } } - /// https://dom.spec.whatwg.org/#retarget + /// pub fn retarget(&self, b: &Node) -> DomRoot { let mut a = DomRoot::from_ref(&*self); loop { diff --git a/components/script/dom/performance.rs b/components/script/dom/performance.rs index 178f30a2a89..85b3f9800f3 100644 --- a/components/script/dom/performance.rs +++ b/components/script/dom/performance.rs @@ -57,7 +57,7 @@ const INVALID_ENTRY_NAMES: &'static [&'static str] = &[ /// Performance and PerformanceObserverEntryList interfaces implementations. #[derive(JSTraceable, MallocSizeOf)] pub struct PerformanceEntryList { - /// https://w3c.github.io/performance-timeline/#dfn-performance-entry-buffer + /// entries: DOMPerformanceEntryList, } @@ -142,7 +142,7 @@ pub struct Performance { observers: DomRefCell>, pending_notification_observers_task: Cell, navigation_start_precise: u64, - /// https://w3c.github.io/performance-timeline/#dfn-maxbuffersize + /// /// The max-size of the buffer, set to 0 once the pipeline exits. /// TODO: have one max-size per entry type. resource_timing_buffer_size_limit: Cell, @@ -372,7 +372,7 @@ impl Performance { self.resource_timing_buffer_pending_full_event.set(false); } /// `add a PerformanceResourceTiming entry` paragraph of - /// https://w3c.github.io/resource-timing/#sec-extensions-performance-interface + /// fn should_queue_resource_entry(&self, entry: &PerformanceEntry) -> bool { // Step 1 is done in the args list. if !self.resource_timing_buffer_pending_full_event.get() { diff --git a/components/script/dom/raredata.rs b/components/script/dom/raredata.rs index 1354637d7ae..836e15d2a48 100644 --- a/components/script/dom/raredata.rs +++ b/components/script/dom/raredata.rs @@ -35,7 +35,7 @@ pub struct NodeRareData { #[derive(Default, JSTraceable, MallocSizeOf)] #[crown::unrooted_must_root_lint::must_root] pub struct ElementRareData { - /// https://dom.spec.whatwg.org/#dom-element-shadowroot + /// /// The ShadowRoot this element is host of. /// XXX This is currently not exposed to web content. Only for /// internal use. diff --git a/components/script/dom/response.rs b/components/script/dom/response.rs index 0d43077495a..b419f3aa1d6 100644 --- a/components/script/dom/response.rs +++ b/components/script/dom/response.rs @@ -47,7 +47,7 @@ pub struct Response { url: DomRefCell>, #[no_trace] url_list: DomRefCell>, - /// The stream of https://fetch.spec.whatwg.org/#body. + /// The stream of . body_stream: MutNullableDom, #[ignore_malloc_size_of = "StreamConsumer"] stream_consumer: DomRefCell>, diff --git a/components/script/dom/rtcicecandidate.rs b/components/script/dom/rtcicecandidate.rs index 8d190662723..d39b853f36c 100644 --- a/components/script/dom/rtcicecandidate.rs +++ b/components/script/dom/rtcicecandidate.rs @@ -100,27 +100,27 @@ impl RTCIceCandidate { } impl RTCIceCandidateMethods for RTCIceCandidate { - /// https://w3c.github.io/webrtc-pc/#dom-rtcicecandidate-candidate + /// fn Candidate(&self) -> DOMString { self.candidate.clone() } - /// https://w3c.github.io/webrtc-pc/#dom-rtcicecandidate-sdpmid + /// fn GetSdpMid(&self) -> Option { self.sdp_m_id.clone() } - /// https://w3c.github.io/webrtc-pc/#dom-rtcicecandidate-sdpmlineindex + /// fn GetSdpMLineIndex(&self) -> Option { self.sdp_m_line_index.clone() } - /// https://w3c.github.io/webrtc-pc/#dom-rtcicecandidate-usernamefragment + /// fn GetUsernameFragment(&self) -> Option { self.username_fragment.clone() } - /// https://w3c.github.io/webrtc-pc/#dom-rtcicecandidate-tojson + /// fn ToJSON(&self) -> RTCIceCandidateInit { RTCIceCandidateInit { candidate: self.candidate.clone(), diff --git a/components/script/dom/rtcpeerconnection.rs b/components/script/dom/rtcpeerconnection.rs index 8e61a421b97..9f8060b27ba 100644 --- a/components/script/dom/rtcpeerconnection.rs +++ b/components/script/dom/rtcpeerconnection.rs @@ -360,7 +360,7 @@ impl RTCPeerConnection { self.data_channels.borrow_mut().remove(&id); } - /// https://www.w3.org/TR/webrtc/#update-ice-gathering-state + /// fn update_gathering_state(&self, state: GatheringState) { // step 1 if self.closed.get() { @@ -400,7 +400,7 @@ impl RTCPeerConnection { } } - /// https://www.w3.org/TR/webrtc/#update-ice-connection-state + /// fn update_ice_connection_state(&self, state: IceConnectionState) { // step 1 if self.closed.get() { @@ -553,7 +553,7 @@ impl RTCPeerConnectionMethods for RTCPeerConnection { // https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-ondatachannel event_handler!(datachannel, GetOndatachannel, SetOndatachannel); - /// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-addicecandidate + /// fn AddIceCandidate(&self, candidate: &RTCIceCandidateInit, comp: InRealm) -> Rc { let p = Promise::new_in_current_realm(comp); if candidate.sdpMid.is_none() && candidate.sdpMLineIndex.is_none() { @@ -588,7 +588,7 @@ impl RTCPeerConnectionMethods for RTCPeerConnection { p } - /// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-createoffer + /// fn CreateOffer(&self, _options: &RTCOfferOptions, comp: InRealm) -> Rc { let p = Promise::new_in_current_realm(comp); if self.closed.get() { @@ -600,7 +600,7 @@ impl RTCPeerConnectionMethods for RTCPeerConnection { p } - /// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-createoffer + /// fn CreateAnswer(&self, _options: &RTCAnswerOptions, comp: InRealm) -> Rc { let p = Promise::new_in_current_realm(comp); if self.closed.get() { @@ -612,17 +612,17 @@ impl RTCPeerConnectionMethods for RTCPeerConnection { p } - /// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-localdescription + /// fn GetLocalDescription(&self) -> Option> { self.local_description.get() } - /// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-remotedescription + /// fn GetRemoteDescription(&self) -> Option> { self.remote_description.get() } - /// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-setlocaldescription + /// fn SetLocalDescription(&self, desc: &RTCSessionDescriptionInit, comp: InRealm) -> Rc { // XXXManishearth validate the current state let p = Promise::new_in_current_realm(comp); @@ -662,7 +662,7 @@ impl RTCPeerConnectionMethods for RTCPeerConnection { p } - /// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-setremotedescription + /// fn SetRemoteDescription(&self, desc: &RTCSessionDescriptionInit, comp: InRealm) -> Rc { // XXXManishearth validate the current state let p = Promise::new_in_current_realm(comp); @@ -713,22 +713,22 @@ impl RTCPeerConnectionMethods for RTCPeerConnection { } } - /// https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-icegatheringstate + /// fn IceGatheringState(&self) -> RTCIceGatheringState { self.gathering_state.get() } - /// https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-iceconnectionstate + /// fn IceConnectionState(&self) -> RTCIceConnectionState { self.ice_connection_state.get() } - /// https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-signalingstate + /// fn SignalingState(&self) -> RTCSignalingState { self.signaling_state.get() } - /// https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close + /// fn Close(&self) { // Step 1 if self.closed.get() { @@ -758,7 +758,7 @@ impl RTCPeerConnectionMethods for RTCPeerConnection { // (no current support for connection state) } - /// https://www.w3.org/TR/webrtc/#dom-peerconnection-createdatachannel + /// fn CreateDataChannel( &self, label: USVString, @@ -767,7 +767,7 @@ impl RTCPeerConnectionMethods for RTCPeerConnection { RTCDataChannel::new(&self.global(), &self, label, init, None) } - /// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-addtransceiver + /// fn AddTransceiver( &self, _track_or_kind: MediaStreamTrackOrString, diff --git a/components/script/dom/rtcpeerconnectioniceevent.rs b/components/script/dom/rtcpeerconnectioniceevent.rs index 2a77fd70d84..47dc3742da1 100644 --- a/components/script/dom/rtcpeerconnectioniceevent.rs +++ b/components/script/dom/rtcpeerconnectioniceevent.rs @@ -90,17 +90,17 @@ impl RTCPeerConnectionIceEvent { } impl RTCPeerConnectionIceEventMethods for RTCPeerConnectionIceEvent { - /// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceevent-candidate + /// fn GetCandidate(&self) -> Option> { self.candidate.as_ref().map(|x| DomRoot::from_ref(&**x)) } - /// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceevent-url + /// fn GetUrl(&self) -> Option { self.url.clone() } - /// https://dom.spec.whatwg.org/#dom-event-istrusted + /// fn IsTrusted(&self) -> bool { self.event.IsTrusted() } diff --git a/components/script/dom/rtcrtptransceiver.rs b/components/script/dom/rtcrtptransceiver.rs index ebf7cac6375..6ac881fe56a 100644 --- a/components/script/dom/rtcrtptransceiver.rs +++ b/components/script/dom/rtcrtptransceiver.rs @@ -40,17 +40,17 @@ impl RTCRtpTransceiver { } impl RTCRtpTransceiverMethods for RTCRtpTransceiver { - /// https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-direction + /// fn Direction(&self) -> RTCRtpTransceiverDirection { self.direction.get() } - /// https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-direction + /// fn SetDirection(&self, direction: RTCRtpTransceiverDirection) { self.direction.set(direction); } - /// https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-sender + /// fn Sender(&self) -> DomRoot { DomRoot::from_ref(&*self.sender) } diff --git a/components/script/dom/rtcsessiondescription.rs b/components/script/dom/rtcsessiondescription.rs index 46de2c33873..01f6251006f 100644 --- a/components/script/dom/rtcsessiondescription.rs +++ b/components/script/dom/rtcsessiondescription.rs @@ -60,12 +60,12 @@ impl RTCSessionDescription { } impl RTCSessionDescriptionMethods for RTCSessionDescription { - /// https://w3c.github.io/webrtc-pc/#dom-rtcsessiondescription-type + /// fn Type(&self) -> RTCSdpType { self.ty } - /// https://w3c.github.io/webrtc-pc/#dom-rtcsessiondescription-sdp + /// fn Sdp(&self) -> DOMString { self.sdp.clone() } diff --git a/components/script/dom/serviceworker.rs b/components/script/dom/serviceworker.rs index 7e456265e95..a5db3c87356 100644 --- a/components/script/dom/serviceworker.rs +++ b/components/script/dom/serviceworker.rs @@ -89,7 +89,7 @@ impl ServiceWorker { ServoUrl::parse(&self.script_url.borrow().clone()).unwrap() } - /// https://w3c.github.io/ServiceWorker/#service-worker-postmessage + /// fn post_message_impl( &self, cx: JSContext, @@ -129,7 +129,7 @@ impl ServiceWorkerMethods for ServiceWorker { USVString(self.script_url.borrow().clone()) } - /// https://w3c.github.io/ServiceWorker/#service-worker-postmessage + /// fn PostMessage( &self, cx: JSContext, @@ -139,7 +139,7 @@ impl ServiceWorkerMethods for ServiceWorker { self.post_message_impl(cx, message, transfer) } - /// https://w3c.github.io/ServiceWorker/#service-worker-postmessage + /// fn PostMessage_( &self, cx: JSContext, diff --git a/components/script/dom/serviceworkercontainer.rs b/components/script/dom/serviceworkercontainer.rs index 7812e91cd8e..2d4c1039ba8 100644 --- a/components/script/dom/serviceworkercontainer.rs +++ b/components/script/dom/serviceworkercontainer.rs @@ -59,8 +59,8 @@ impl ServiceWorkerContainerMethods for ServiceWorkerContainer { self.client.get_controller() } - /// https://w3c.github.io/ServiceWorker/#dom-serviceworkercontainer-register - A - /// and https://w3c.github.io/ServiceWorker/#start-register - B + /// - A + /// and - B fn Register( &self, script_url: USVString, diff --git a/components/script/dom/servoparser/async_html.rs b/components/script/dom/servoparser/async_html.rs index 2e24623e264..3c717f57b71 100644 --- a/components/script/dom/servoparser/async_html.rs +++ b/components/script/dom/servoparser/async_html.rs @@ -880,7 +880,7 @@ impl TreeSink for Sink { } /// - /// Specifically, the cases. + /// Specifically, the `` cases. fn is_mathml_annotation_xml_integration_point(&self, handle: &Self::Handle) -> bool { let node_data = self.get_parse_node_data(&handle.id); node_data.is_integration_point diff --git a/components/script/dom/servoparser/mod.rs b/components/script/dom/servoparser/mod.rs index 632a0442548..bb450a32296 100644 --- a/components/script/dom/servoparser/mod.rs +++ b/components/script/dom/servoparser/mod.rs @@ -339,7 +339,7 @@ impl ServoParser { self.script_created_parser || self.script_nesting_level.get() > 0 } - /// Steps 6-8 of https://html.spec.whatwg.org/multipage/#document.write() + /// Steps 6-8 of pub fn write(&self, text: Vec) { assert!(self.can_write()); @@ -1301,7 +1301,7 @@ impl TreeSink for Sink { } } -/// https://html.spec.whatwg.org/multipage/#create-an-element-for-the-token +/// fn create_element_for_token( name: QualName, attrs: Vec, diff --git a/components/script/dom/shadowroot.rs b/components/script/dom/shadowroot.rs index 2c9e56d8352..6326e9fd9a7 100644 --- a/components/script/dom/shadowroot.rs +++ b/components/script/dom/shadowroot.rs @@ -217,12 +217,12 @@ impl ShadowRootMethods for ShadowRoot { elements } - /// https://dom.spec.whatwg.org/#dom-shadowroot-mode + /// fn Mode(&self) -> ShadowRootMode { ShadowRootMode::Closed } - /// https://dom.spec.whatwg.org/#dom-shadowroot-host + /// fn Host(&self) -> DomRoot { let host = self.host.get(); host.expect("Trying to get host from a detached shadow root") diff --git a/components/script/dom/submitevent.rs b/components/script/dom/submitevent.rs index 524b8a883ba..7a522de2991 100644 --- a/components/script/dom/submitevent.rs +++ b/components/script/dom/submitevent.rs @@ -87,7 +87,7 @@ impl SubmitEventMethods for SubmitEvent { self.event.IsTrusted() } - /// https://html.spec.whatwg.org/multipage/#dom-submitevent-submitter + /// fn GetSubmitter(&self) -> Option> { self.submitter.as_ref().map(|s| DomRoot::from_ref(&**s)) } diff --git a/components/script/dom/textcontrol.rs b/components/script/dom/textcontrol.rs index 38ffb5eccf6..aae103ce728 100644 --- a/components/script/dom/textcontrol.rs +++ b/components/script/dom/textcontrol.rs @@ -5,7 +5,7 @@ //! This is an abstraction used by `HTMLInputElement` and `HTMLTextAreaElement` to implement the //! text control selection DOM API. //! -//! https://html.spec.whatwg.org/multipage/#textFieldSelection +//! use script_traits::ScriptToConstellationChan; diff --git a/components/script/dom/textmetrics.rs b/components/script/dom/textmetrics.rs index 665588b86f1..afcf06ea501 100644 --- a/components/script/dom/textmetrics.rs +++ b/components/script/dom/textmetrics.rs @@ -97,62 +97,62 @@ impl TextMetrics { } impl TextMetricsMethods for TextMetrics { - /// https://html.spec.whatwg.org/multipage/#dom-textmetrics-width + /// fn Width(&self) -> Finite { self.width } - /// https://html.spec.whatwg.org/multipage/#dom-textmetrics-actualboundingboxleft + /// fn ActualBoundingBoxLeft(&self) -> Finite { self.actualBoundingBoxLeft } - /// https://html.spec.whatwg.org/multipage/#dom-textmetrics-actualboundingboxright + /// fn ActualBoundingBoxRight(&self) -> Finite { self.actualBoundingBoxRight } - /// https://html.spec.whatwg.org/multipage/#dom-textmetrics-fontboundingboxascent + /// fn FontBoundingBoxAscent(&self) -> Finite { self.fontBoundingBoxAscent } - /// https://html.spec.whatwg.org/multipage/#dom-textmetrics-fontboundingboxascent + /// fn FontBoundingBoxDescent(&self) -> Finite { self.fontBoundingBoxDescent } - /// https://html.spec.whatwg.org/multipage/#dom-textmetrics-actualboundingboxascent + /// fn ActualBoundingBoxAscent(&self) -> Finite { self.actualBoundingBoxAscent } - /// https://html.spec.whatwg.org/multipage/#dom-textmetrics-actualboundingboxdescent + /// fn ActualBoundingBoxDescent(&self) -> Finite { self.actualBoundingBoxDescent } - /// https://html.spec.whatwg.org/multipage/#dom-textmetrics-emheightascent + /// fn EmHeightAscent(&self) -> Finite { self.emHeightAscent } - /// https://html.spec.whatwg.org/multipage/#dom-textmetrics-emheightdescent + /// fn EmHeightDescent(&self) -> Finite { self.emHeightDescent } - /// https://html.spec.whatwg.org/multipage/#dom-textmetrics-hangingbaseline + /// fn HangingBaseline(&self) -> Finite { self.hangingBaseline } - /// https://html.spec.whatwg.org/multipage/#dom-textmetrics-alphabeticbaseline + /// fn AlphabeticBaseline(&self) -> Finite { self.alphabeticBaseline } - /// https://html.spec.whatwg.org/multipage/#dom-textmetrics-ideographicbaseline + /// fn IdeographicBaseline(&self) -> Finite { self.ideographicBaseline } diff --git a/components/script/dom/webgl2renderingcontext.rs b/components/script/dom/webgl2renderingcontext.rs index 7882d018c1a..14917edb8ef 100644 --- a/components/script/dom/webgl2renderingcontext.rs +++ b/components/script/dom/webgl2renderingcontext.rs @@ -899,32 +899,32 @@ impl WebGL2RenderingContext { } impl WebGL2RenderingContextMethods for WebGL2RenderingContext { - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.1 + /// fn Canvas(&self) -> DomRoot { self.base.Canvas() } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.11 + /// fn Flush(&self) { self.base.Flush() } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.11 + /// fn Finish(&self) { self.base.Finish() } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.1 + /// fn DrawingBufferWidth(&self) -> i32 { self.base.DrawingBufferWidth() } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.1 + /// fn DrawingBufferHeight(&self) -> i32 { self.base.DrawingBufferHeight() } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5 + /// fn GetBufferParameter(&self, _cx: JSContext, target: u32, parameter: u32) -> JSVal { let buffer = handle_potential_webgl_error!(self.base, self.bound_buffer(target), return NullValue()); @@ -932,7 +932,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } #[allow(unsafe_code)] - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn GetParameter(&self, cx: JSContext, parameter: u32) -> JSVal { match parameter { constants::VERSION => unsafe { @@ -1109,17 +1109,17 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { self.base.GetParameter(cx, parameter) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8 + /// fn GetTexParameter(&self, cx: JSContext, target: u32, pname: u32) -> JSVal { self.base.GetTexParameter(cx, target, pname) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn GetError(&self) -> u32 { self.base.GetError() } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.2 + /// fn GetContextAttributes(&self) -> Option { self.base.GetContextAttributes() } @@ -1129,17 +1129,17 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { self.base.IsContextLost() } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.14 + /// fn GetSupportedExtensions(&self) -> Option> { self.base.GetSupportedExtensions() } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.14 + /// fn GetExtension(&self, cx: JSContext, name: DOMString) -> Option> { self.base.GetExtension(cx, name) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.4 + /// fn GetFramebufferAttachmentParameter( &self, cx: JSContext, @@ -1176,58 +1176,58 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.7 + /// fn GetRenderbufferParameter(&self, cx: JSContext, target: u32, pname: u32) -> JSVal { self.base.GetRenderbufferParameter(cx, target, pname) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn ActiveTexture(&self, texture: u32) { self.base.ActiveTexture(texture) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn BlendColor(&self, r: f32, g: f32, b: f32, a: f32) { self.base.BlendColor(r, g, b, a) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn BlendEquation(&self, mode: u32) { self.base.BlendEquation(mode) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn BlendEquationSeparate(&self, mode_rgb: u32, mode_alpha: u32) { self.base.BlendEquationSeparate(mode_rgb, mode_alpha) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn BlendFunc(&self, src_factor: u32, dest_factor: u32) { self.base.BlendFunc(src_factor, dest_factor) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn BlendFuncSeparate(&self, src_rgb: u32, dest_rgb: u32, src_alpha: u32, dest_alpha: u32) { self.base .BlendFuncSeparate(src_rgb, dest_rgb, src_alpha, dest_alpha) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn AttachShader(&self, program: &WebGLProgram, shader: &WebGLShader) { self.base.AttachShader(program, shader) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn DetachShader(&self, program: &WebGLProgram, shader: &WebGLShader) { self.base.DetachShader(program, shader) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn BindAttribLocation(&self, program: &WebGLProgram, index: u32, name: DOMString) { self.base.BindAttribLocation(program, index, name) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2 + /// fn BindBuffer(&self, target: u32, buffer: Option<&WebGLBuffer>) { let current_vao; let slot = match target { @@ -1246,7 +1246,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { self.base.bind_buffer_maybe(&slot, target, buffer); } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.6 + /// fn BindFramebuffer(&self, target: u32, framebuffer: Option<&WebGLFramebuffer>) { handle_potential_webgl_error!( self.base, @@ -1276,22 +1276,22 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.7 + /// fn BindRenderbuffer(&self, target: u32, renderbuffer: Option<&WebGLRenderbuffer>) { self.base.BindRenderbuffer(target, renderbuffer) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8 + /// fn BindTexture(&self, target: u32, texture: Option<&WebGLTexture>) { self.base.BindTexture(target, texture) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8 + /// fn GenerateMipmap(&self, target: u32) { self.base.GenerateMipmap(target) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5 + /// fn BufferData_(&self, target: u32, data: Option, usage: u32) { let usage = handle_potential_webgl_error!(self.base, self.buffer_usage(usage), return); let bound_buffer = @@ -1299,7 +1299,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { self.base.buffer_data(target, data, usage, bound_buffer) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5 + /// fn BufferData(&self, target: u32, size: i64, usage: u32) { let usage = handle_potential_webgl_error!(self.base, self.buffer_usage(usage), return); let bound_buffer = @@ -1307,7 +1307,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { self.base.buffer_data_(target, size, usage, bound_buffer) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.3 + /// #[allow(unsafe_code)] fn BufferData__( &self, @@ -1351,7 +1351,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { handle_potential_webgl_error!(self.base, bound_buffer.buffer_data(target, &data, usage)); } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5 + /// fn BufferSubData(&self, target: u32, offset: i64, data: ArrayBufferViewOrArrayBuffer) { let bound_buffer = handle_potential_webgl_error!(self.base, self.bound_buffer(target), return); @@ -1359,7 +1359,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { .buffer_sub_data(target, offset, data, bound_buffer) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.3 + /// #[allow(unsafe_code)] fn BufferSubData_( &self, @@ -1411,7 +1411,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { sender.send(data).unwrap(); } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.3 + /// fn CopyBufferSubData( &self, read_target: u32, @@ -1467,7 +1467,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { )); } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.3 + /// #[allow(unsafe_code)] fn GetBufferSubData( &self, @@ -1524,7 +1524,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.6 + /// #[allow(unsafe_code)] fn CompressedTexImage2D( &self, @@ -1559,7 +1559,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { ) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8 + /// #[allow(unsafe_code)] fn CompressedTexSubImage2D( &self, @@ -1589,7 +1589,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { ) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8 + /// fn CopyTexImage2D( &self, target: u32, @@ -1605,7 +1605,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { .CopyTexImage2D(target, level, internal_format, x, y, width, height, border) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8 + /// fn CopyTexSubImage2D( &self, target: u32, @@ -1621,56 +1621,56 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { .CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.11 + /// fn Clear(&self, mask: u32) { self.base.Clear(mask) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn ClearColor(&self, red: f32, green: f32, blue: f32, alpha: f32) { self.base.ClearColor(red, green, blue, alpha) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn ClearDepth(&self, depth: f32) { self.base.ClearDepth(depth) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn ClearStencil(&self, stencil: i32) { self.base.ClearStencil(stencil) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn ColorMask(&self, r: bool, g: bool, b: bool, a: bool) { self.base.ColorMask(r, g, b, a) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn CullFace(&self, mode: u32) { self.base.CullFace(mode) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn FrontFace(&self, mode: u32) { self.base.FrontFace(mode) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn DepthFunc(&self, func: u32) { self.base.DepthFunc(func) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn DepthMask(&self, flag: bool) { self.base.DepthMask(flag) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn DepthRange(&self, near: f32, far: f32) { self.base.DepthRange(near, far) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn Enable(&self, cap: u32) { match cap { constants::RASTERIZER_DISCARD => { @@ -1681,7 +1681,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn Disable(&self, cap: u32) { match cap { constants::RASTERIZER_DISCARD => { @@ -1692,47 +1692,47 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn CompileShader(&self, shader: &WebGLShader) { self.base.CompileShader(shader) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5 + /// fn CreateBuffer(&self) -> Option> { self.base.CreateBuffer() } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.6 + /// fn CreateFramebuffer(&self) -> Option> { self.base.CreateFramebuffer() } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.7 + /// fn CreateRenderbuffer(&self) -> Option> { self.base.CreateRenderbuffer() } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8 + /// fn CreateTexture(&self) -> Option> { self.base.CreateTexture() } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn CreateProgram(&self) -> Option> { self.base.CreateProgram() } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn CreateShader(&self, shader_type: u32) -> Option> { self.base.CreateShader(shader_type) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.17 + /// fn CreateVertexArray(&self) -> Option> { self.base.create_vertex_array_webgl2() } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5 + /// fn DeleteBuffer(&self, buffer: Option<&WebGLBuffer>) { let buffer = match buffer { Some(buffer) => buffer, @@ -1761,61 +1761,61 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { buffer.mark_for_deletion(Operation::Infallible); } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.6 + /// fn DeleteFramebuffer(&self, framebuffer: Option<&WebGLFramebuffer>) { self.base.DeleteFramebuffer(framebuffer) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.7 + /// fn DeleteRenderbuffer(&self, renderbuffer: Option<&WebGLRenderbuffer>) { self.base.DeleteRenderbuffer(renderbuffer) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8 + /// fn DeleteTexture(&self, texture: Option<&WebGLTexture>) { self.base.DeleteTexture(texture) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn DeleteProgram(&self, program: Option<&WebGLProgram>) { self.base.DeleteProgram(program) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn DeleteShader(&self, shader: Option<&WebGLShader>) { self.base.DeleteShader(shader) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.17 + /// fn DeleteVertexArray(&self, vertex_array: Option<&WebGLVertexArrayObject>) { self.base.delete_vertex_array_webgl2(vertex_array); } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.11 + /// fn DrawArrays(&self, mode: u32, first: i32, count: i32) { self.validate_uniform_block_for_draw(); self.validate_vertex_attribs_for_draw(); self.base.DrawArrays(mode, first, count) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.11 + /// fn DrawElements(&self, mode: u32, count: i32, type_: u32, offset: i64) { self.validate_uniform_block_for_draw(); self.validate_vertex_attribs_for_draw(); self.base.DrawElements(mode, count, type_, offset) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn EnableVertexAttribArray(&self, attrib_id: u32) { self.base.EnableVertexAttribArray(attrib_id) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn DisableVertexAttribArray(&self, attrib_id: u32) { self.base.DisableVertexAttribArray(attrib_id) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn GetActiveUniform( &self, program: &WebGLProgram, @@ -1824,7 +1824,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { self.base.GetActiveUniform(program, index) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn GetActiveAttrib( &self, program: &WebGLProgram, @@ -1833,23 +1833,23 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { self.base.GetActiveAttrib(program, index) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn GetAttribLocation(&self, program: &WebGLProgram, name: DOMString) -> i32 { self.base.GetAttribLocation(program, name) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.7 + /// fn GetFragDataLocation(&self, program: &WebGLProgram, name: DOMString) -> i32 { handle_potential_webgl_error!(self.base, self.base.validate_ownership(program), return -1); handle_potential_webgl_error!(self.base, program.get_frag_data_location(name), -1) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn GetProgramInfoLog(&self, program: &WebGLProgram) -> Option { self.base.GetProgramInfoLog(program) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn GetProgramParameter(&self, cx: JSContext, program: &WebGLProgram, param_id: u32) -> JSVal { handle_potential_webgl_error!( self.base, @@ -1871,17 +1871,17 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn GetShaderInfoLog(&self, shader: &WebGLShader) -> Option { self.base.GetShaderInfoLog(shader) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn GetShaderParameter(&self, cx: JSContext, shader: &WebGLShader, param_id: u32) -> JSVal { self.base.GetShaderParameter(cx, shader, param_id) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn GetShaderPrecisionFormat( &self, shader_type: u32, @@ -1891,7 +1891,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { .GetShaderPrecisionFormat(shader_type, precision_type) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2 + /// #[allow(unsafe_code)] fn GetIndexedParameter(&self, cx: JSContext, target: u32, index: u32) -> JSVal { let bindings = match target { @@ -1931,7 +1931,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn GetUniformLocation( &self, program: &WebGLProgram, @@ -1940,28 +1940,28 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { self.base.GetUniformLocation(program, name) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn GetVertexAttrib(&self, cx: JSContext, index: u32, pname: u32) -> JSVal { self.base.GetVertexAttrib(cx, index, pname) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn GetVertexAttribOffset(&self, index: u32, pname: u32) -> i64 { self.base.GetVertexAttribOffset(index, pname) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn Hint(&self, target: u32, mode: u32) { self.base.Hint(target, mode) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5 + /// fn IsBuffer(&self, buffer: Option<&WebGLBuffer>) -> bool { self.base.IsBuffer(buffer) } // TODO: We could write this without IPC, recording the calls to `enable` and `disable`. - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2 + /// fn IsEnabled(&self, cap: u32) -> bool { match cap { constants::RASTERIZER_DISCARD => self.enable_rasterizer_discard.get(), @@ -1969,42 +1969,42 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.6 + /// fn IsFramebuffer(&self, frame_buffer: Option<&WebGLFramebuffer>) -> bool { self.base.IsFramebuffer(frame_buffer) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn IsProgram(&self, program: Option<&WebGLProgram>) -> bool { self.base.IsProgram(program) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.7 + /// fn IsRenderbuffer(&self, render_buffer: Option<&WebGLRenderbuffer>) -> bool { self.base.IsRenderbuffer(render_buffer) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn IsShader(&self, shader: Option<&WebGLShader>) -> bool { self.base.IsShader(shader) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8 + /// fn IsTexture(&self, texture: Option<&WebGLTexture>) -> bool { self.base.IsTexture(texture) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.17 + /// fn IsVertexArray(&self, vertex_array: Option<&WebGLVertexArrayObject>) -> bool { self.base.is_vertex_array_webgl2(vertex_array) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn LineWidth(&self, width: f32) { self.base.LineWidth(width) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2 + /// fn PixelStorei(&self, param_name: u32, param_value: i32) { if param_value < 0 { return self.base.webgl_error(InvalidValue); @@ -2018,12 +2018,12 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn PolygonOffset(&self, factor: f32, units: f32) { self.base.PolygonOffset(factor, units) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.12 + /// fn ReadPixels( &self, x: i32, @@ -2040,7 +2040,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { self.read_pixels_into(x, y, width, height, format, pixel_type, pixels, 0) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.10 + /// fn ReadPixels_( &self, x: i32, @@ -2131,7 +2131,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { )); } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.10 + /// #[allow(unsafe_code)] fn ReadPixels__( &self, @@ -2156,72 +2156,72 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { ) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn SampleCoverage(&self, value: f32, invert: bool) { self.base.SampleCoverage(value, invert) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.4 + /// fn Scissor(&self, x: i32, y: i32, width: i32, height: i32) { self.base.Scissor(x, y, width, height) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn StencilFunc(&self, func: u32, ref_: i32, mask: u32) { self.base.StencilFunc(func, ref_, mask) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn StencilFuncSeparate(&self, face: u32, func: u32, ref_: i32, mask: u32) { self.base.StencilFuncSeparate(face, func, ref_, mask) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn StencilMask(&self, mask: u32) { self.base.StencilMask(mask) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn StencilMaskSeparate(&self, face: u32, mask: u32) { self.base.StencilMaskSeparate(face, mask) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn StencilOp(&self, fail: u32, zfail: u32, zpass: u32) { self.base.StencilOp(fail, zfail, zpass) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 + /// fn StencilOpSeparate(&self, face: u32, fail: u32, zfail: u32, zpass: u32) { self.base.StencilOpSeparate(face, fail, zfail, zpass) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn LinkProgram(&self, program: &WebGLProgram) { self.base.LinkProgram(program) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn ShaderSource(&self, shader: &WebGLShader, source: DOMString) { self.base.ShaderSource(shader, source) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn GetShaderSource(&self, shader: &WebGLShader) -> Option { self.base.GetShaderSource(shader) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn Uniform1f(&self, location: Option<&WebGLUniformLocation>, val: f32) { self.base.Uniform1f(location, val) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn Uniform1i(&self, location: Option<&WebGLUniformLocation>, val: i32) { self.base.Uniform1i(location, val) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn Uniform1iv( &self, location: Option<&WebGLUniformLocation>, @@ -2283,7 +2283,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { }); } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn Uniform1fv( &self, location: Option<&WebGLUniformLocation>, @@ -2294,12 +2294,12 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { self.base.uniform1fv(location, v, src_offset, src_length); } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn Uniform2f(&self, location: Option<&WebGLUniformLocation>, x: f32, y: f32) { self.base.Uniform2f(location, x, y) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn Uniform2fv( &self, location: Option<&WebGLUniformLocation>, @@ -2310,12 +2310,12 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { self.base.uniform2fv(location, v, src_offset, src_length); } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn Uniform2i(&self, location: Option<&WebGLUniformLocation>, x: i32, y: i32) { self.base.Uniform2i(location, x, y) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn Uniform2iv( &self, location: Option<&WebGLUniformLocation>, @@ -2359,12 +2359,12 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { }); } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn Uniform3f(&self, location: Option<&WebGLUniformLocation>, x: f32, y: f32, z: f32) { self.base.Uniform3f(location, x, y, z) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn Uniform3fv( &self, location: Option<&WebGLUniformLocation>, @@ -2375,12 +2375,12 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { self.base.uniform3fv(location, v, src_offset, src_length); } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn Uniform3i(&self, location: Option<&WebGLUniformLocation>, x: i32, y: i32, z: i32) { self.base.Uniform3i(location, x, y, z) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn Uniform3iv( &self, location: Option<&WebGLUniformLocation>, @@ -2424,12 +2424,12 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { }); } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn Uniform4i(&self, location: Option<&WebGLUniformLocation>, x: i32, y: i32, z: i32, w: i32) { self.base.Uniform4i(location, x, y, z, w) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn Uniform4iv( &self, location: Option<&WebGLUniformLocation>, @@ -2473,12 +2473,12 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { }); } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn Uniform4f(&self, location: Option<&WebGLUniformLocation>, x: f32, y: f32, z: f32, w: f32) { self.base.Uniform4f(location, x, y, z, w) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn Uniform4fv( &self, location: Option<&WebGLUniformLocation>, @@ -2489,7 +2489,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { self.base.uniform4fv(location, v, src_offset, src_length); } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn UniformMatrix2fv( &self, location: Option<&WebGLUniformLocation>, @@ -2502,7 +2502,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { .uniform_matrix_2fv(location, transpose, v, src_offset, src_length) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn UniformMatrix3fv( &self, location: Option<&WebGLUniformLocation>, @@ -2515,7 +2515,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { .uniform_matrix_3fv(location, transpose, v, src_offset, src_length) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn UniformMatrix4fv( &self, location: Option<&WebGLUniformLocation>, @@ -2528,7 +2528,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { .uniform_matrix_4fv(location, transpose, v, src_offset, src_length) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8 + /// fn UniformMatrix3x2fv( &self, location: Option<&WebGLUniformLocation>, @@ -2556,7 +2556,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { }); } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8 + /// fn UniformMatrix4x2fv( &self, location: Option<&WebGLUniformLocation>, @@ -2584,7 +2584,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { }); } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8 + /// fn UniformMatrix2x3fv( &self, location: Option<&WebGLUniformLocation>, @@ -2612,7 +2612,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { }); } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8 + /// fn UniformMatrix4x3fv( &self, location: Option<&WebGLUniformLocation>, @@ -2640,7 +2640,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { }); } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8 + /// fn UniformMatrix2x4fv( &self, location: Option<&WebGLUniformLocation>, @@ -2668,7 +2668,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { }); } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8 + /// fn UniformMatrix3x4fv( &self, location: Option<&WebGLUniformLocation>, @@ -2696,7 +2696,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { }); } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8 + /// #[allow(unsafe_code)] fn GetUniform( &self, @@ -2768,62 +2768,62 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn UseProgram(&self, program: Option<&WebGLProgram>) { self.base.UseProgram(program) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn ValidateProgram(&self, program: &WebGLProgram) { self.base.ValidateProgram(program) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn VertexAttrib1f(&self, indx: u32, x: f32) { self.base.VertexAttrib1f(indx, x) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn VertexAttrib1fv(&self, indx: u32, v: Float32ArrayOrUnrestrictedFloatSequence) { self.base.VertexAttrib1fv(indx, v) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn VertexAttrib2f(&self, indx: u32, x: f32, y: f32) { self.base.VertexAttrib2f(indx, x, y) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn VertexAttrib2fv(&self, indx: u32, v: Float32ArrayOrUnrestrictedFloatSequence) { self.base.VertexAttrib2fv(indx, v) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn VertexAttrib3f(&self, indx: u32, x: f32, y: f32, z: f32) { self.base.VertexAttrib3f(indx, x, y, z) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn VertexAttrib3fv(&self, indx: u32, v: Float32ArrayOrUnrestrictedFloatSequence) { self.base.VertexAttrib3fv(indx, v) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn VertexAttrib4f(&self, indx: u32, x: f32, y: f32, z: f32, w: f32) { self.base.VertexAttrib4f(indx, x, y, z, w) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn VertexAttrib4fv(&self, indx: u32, v: Float32ArrayOrUnrestrictedFloatSequence) { self.base.VertexAttrib4fv(indx, v) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8 + /// fn VertexAttribI4i(&self, index: u32, x: i32, y: i32, z: i32, w: i32) { self.vertex_attrib_i(index, x, y, z, w) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8 + /// fn VertexAttribI4iv(&self, index: u32, v: Int32ArrayOrLongSequence) { let values = match v { Int32ArrayOrLongSequence::Int32Array(v) => v.to_vec(), @@ -2835,12 +2835,12 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { self.vertex_attrib_i(index, values[0], values[1], values[2], values[3]); } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8 + /// fn VertexAttribI4ui(&self, index: u32, x: u32, y: u32, z: u32, w: u32) { self.vertex_attrib_u(index, x, y, z, w) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8 + /// fn VertexAttribI4uiv(&self, index: u32, v: Uint32ArrayOrUnsignedLongSequence) { let values = match v { Uint32ArrayOrUnsignedLongSequence::Uint32Array(v) => v.to_vec(), @@ -2852,7 +2852,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { self.vertex_attrib_u(index, values[0], values[1], values[2], values[3]); } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 + /// fn VertexAttribPointer( &self, attrib_id: u32, @@ -2866,7 +2866,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { .VertexAttribPointer(attrib_id, size, data_type, normalized, stride, offset) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8 + /// fn VertexAttribIPointer(&self, index: u32, size: i32, type_: u32, stride: i32, offset: i64) { match type_ { constants::BYTE | @@ -2881,12 +2881,12 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { .VertexAttribPointer(index, size, type_, false, stride, offset) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.4 + /// fn Viewport(&self, x: i32, y: i32, width: i32, height: i32) { self.base.Viewport(x, y, width, height) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8 + /// fn TexImage2D( &self, target: u32, @@ -2912,7 +2912,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { ) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8 + /// fn TexImage2D_( &self, target: u32, @@ -2926,7 +2926,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { .TexImage2D_(target, level, internal_format, format, data_type, source) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.6 + /// fn TexImage2D__( &self, target: u32, @@ -2999,7 +2999,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { Ok(()) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.6 + /// fn TexImage2D___( &self, target: u32, @@ -3066,7 +3066,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { Ok(()) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.6 + /// #[allow(unsafe_code)] fn TexImage2D____( &self, @@ -3163,7 +3163,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { Ok(()) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8 + /// fn TexSubImage2D( &self, target: u32, @@ -3181,7 +3181,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { ) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8 + /// fn TexSubImage2D_( &self, target: u32, @@ -3196,17 +3196,17 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { .TexSubImage2D_(target, level, xoffset, yoffset, format, data_type, source) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8 + /// fn TexParameterf(&self, target: u32, name: u32, value: f32) { self.base.TexParameterf(target, name, value) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8 + /// fn TexParameteri(&self, target: u32, name: u32, value: i32) { self.base.TexParameteri(target, name, value) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.6 + /// fn CheckFramebufferStatus(&self, target: u32) -> u32 { let fb_slot = match target { constants::FRAMEBUFFER | constants::DRAW_FRAMEBUFFER => { @@ -3224,13 +3224,13 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.7 + /// fn RenderbufferStorage(&self, target: u32, internal_format: u32, width: i32, height: i32) { self.base .RenderbufferStorage(target, internal_format, width, height) } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.6 + /// fn FramebufferRenderbuffer( &self, target: u32, @@ -3272,7 +3272,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { }; } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.6 + /// fn FramebufferTexture2D( &self, target: u32, @@ -3301,12 +3301,12 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn GetAttachedShaders(&self, program: &WebGLProgram) -> Option>> { self.base.GetAttachedShaders(program) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.9 + /// fn DrawArraysInstanced(&self, mode: u32, first: i32, count: i32, primcount: i32) { self.validate_uniform_block_for_draw(); self.validate_vertex_attribs_for_draw(); @@ -3317,7 +3317,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { ) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.9 + /// fn DrawElementsInstanced( &self, mode: u32, @@ -3335,7 +3335,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { ) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.9 + /// fn DrawRangeElements( &self, mode: u32, @@ -3358,17 +3358,17 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { ) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.9 + /// fn VertexAttribDivisor(&self, index: u32, divisor: u32) { self.base.vertex_attrib_divisor(index, divisor); } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.12 + /// fn CreateQuery(&self) -> Option> { Some(WebGLQuery::new(&self.base)) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.12 + /// #[cfg_attr(rustfmt, rustfmt_skip)] fn DeleteQuery(&self, query: Option<&WebGLQuery>) { if let Some(query) = query { @@ -3396,7 +3396,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.12 + /// fn IsQuery(&self, query: Option<&WebGLQuery>) -> bool { match query { Some(query) => self.base.validate_ownership(query).is_ok() && query.is_valid(), @@ -3404,12 +3404,12 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.13 + /// fn CreateSampler(&self) -> Option> { Some(WebGLSampler::new(&self.base)) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.13 + /// fn DeleteSampler(&self, sampler: Option<&WebGLSampler>) { if let Some(sampler) = sampler { handle_potential_webgl_error!(self.base, self.base.validate_ownership(sampler), return); @@ -3422,7 +3422,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.13 + /// fn IsSampler(&self, sampler: Option<&WebGLSampler>) -> bool { match sampler { Some(sampler) => self.base.validate_ownership(sampler).is_ok() && sampler.is_valid(), @@ -3430,7 +3430,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.12 + /// #[cfg_attr(rustfmt, rustfmt_skip)] fn BeginQuery(&self, target: u32, query: &WebGLQuery) { handle_potential_webgl_error!(self.base, self.base.validate_ownership(query), return); @@ -3459,7 +3459,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.12 + /// #[cfg_attr(rustfmt, rustfmt_skip)] fn EndQuery(&self, target: u32) { let active_query = match target { @@ -3486,7 +3486,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.12 + /// #[cfg_attr(rustfmt, rustfmt_skip)] fn GetQuery(&self, target: u32, pname: u32) -> Option> { if pname != constants::CURRENT_QUERY { @@ -3514,7 +3514,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { active_query } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.12 + /// #[cfg_attr(rustfmt, rustfmt_skip)] fn GetQueryParameter(&self, _cx: JSContext, query: &WebGLQuery, pname: u32) -> JSVal { handle_potential_webgl_error!( @@ -3535,7 +3535,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.14 + /// fn FenceSync(&self, condition: u32, flags: u32) -> Option> { if flags != 0 { self.base.webgl_error(InvalidValue); @@ -3549,7 +3549,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { Some(WebGLSync::new(&self.base)) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.14 + /// fn IsSync(&self, sync: Option<&WebGLSync>) -> bool { match sync { Some(sync) => { @@ -3570,7 +3570,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.14 + /// fn ClientWaitSync(&self, sync: &WebGLSync, flags: u32, timeout: u64) -> u32 { if !sync.is_valid() { self.base.webgl_error(InvalidOperation); @@ -3596,7 +3596,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.14 + /// fn WaitSync(&self, sync: &WebGLSync, flags: u32, timeout: i64) { if !sync.is_valid() { self.base.webgl_error(InvalidOperation); @@ -3616,7 +3616,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { .send_command(WebGLCommand::WaitSync(sync.id(), flags, timeout)); } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.14 + /// fn GetSyncParameter(&self, _cx: JSContext, sync: &WebGLSync, pname: u32) -> JSVal { if !sync.is_valid() { self.base.webgl_error(InvalidOperation); @@ -3645,7 +3645,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.14 + /// fn DeleteSync(&self, sync: Option<&WebGLSync>) { if let Some(sync) = sync { handle_potential_webgl_error!(self.base, self.base.validate_ownership(sync), return); @@ -3653,7 +3653,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.13 + /// fn BindSampler(&self, unit: u32, sampler: Option<&WebGLSampler>) { if let Some(sampler) = sampler { handle_potential_webgl_error!(self.base, self.base.validate_ownership(sampler), return); @@ -3671,12 +3671,12 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.17 + /// fn BindVertexArray(&self, array: Option<&WebGLVertexArrayObject>) { self.base.bind_vertex_array_webgl2(array); } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.13 + /// fn SamplerParameteri(&self, sampler: &WebGLSampler, pname: u32, param: i32) { handle_potential_webgl_error!(self.base, self.base.validate_ownership(sampler), return); let param = WebGLSamplerValue::GLenum(param as u32); @@ -3686,7 +3686,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.13 + /// fn SamplerParameterf(&self, sampler: &WebGLSampler, pname: u32, param: f32) { handle_potential_webgl_error!(self.base, self.base.validate_ownership(sampler), return); let param = WebGLSamplerValue::Float(param); @@ -3696,7 +3696,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.13 + /// fn GetSamplerParameter(&self, _cx: JSContext, sampler: &WebGLSampler, pname: u32) -> JSVal { handle_potential_webgl_error!( self.base, @@ -3715,12 +3715,12 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.15 + /// fn CreateTransformFeedback(&self) -> Option> { Some(WebGLTransformFeedback::new(&self.base)) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.15 + /// fn DeleteTransformFeedback(&self, tf: Option<&WebGLTransformFeedback>) { if let Some(tf) = tf { handle_potential_webgl_error!(self.base, self.base.validate_ownership(tf), return); @@ -3733,7 +3733,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.15 + /// fn IsTransformFeedback(&self, tf: Option<&WebGLTransformFeedback>) -> bool { match tf { Some(tf) => { @@ -3754,7 +3754,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.15 + /// fn BindTransformFeedback(&self, target: u32, tf: Option<&WebGLTransformFeedback>) { if target != constants::TRANSFORM_FEEDBACK { self.base.webgl_error(InvalidEnum); @@ -3787,7 +3787,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.15 + /// #[allow(non_snake_case)] fn BeginTransformFeedback(&self, primitiveMode: u32) { match primitiveMode { @@ -3822,7 +3822,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { current_tf.begin(&self.base, primitiveMode); } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.15 + /// fn EndTransformFeedback(&self) { if let Some(current_tf) = self.current_transform_feedback.get() { if !current_tf.is_active() { @@ -3833,7 +3833,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.15 + /// fn ResumeTransformFeedback(&self) { if let Some(current_tf) = self.current_transform_feedback.get() { if !current_tf.is_active() || !current_tf.is_paused() { @@ -3844,7 +3844,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.15 + /// fn PauseTransformFeedback(&self) { if let Some(current_tf) = self.current_transform_feedback.get() { if !current_tf.is_active() || current_tf.is_paused() { @@ -3855,7 +3855,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.15 + /// #[allow(non_snake_case)] fn TransformFeedbackVaryings( &self, @@ -3895,7 +3895,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.15 + /// fn GetTransformFeedbackVarying( &self, program: &WebGLProgram, @@ -3923,7 +3923,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { )) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.16 + /// fn BindBufferBase(&self, target: u32, index: u32, buffer: Option<&WebGLBuffer>) { let (generic_slot, indexed_bindings) = match target { constants::TRANSFORM_FEEDBACK_BUFFER => ( @@ -3970,7 +3970,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { indexed_binding.size.set(0); } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.16 + /// fn BindBufferRange( &self, target: u32, @@ -4048,7 +4048,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { indexed_binding.size.set(size); } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.16 + /// fn GetUniformIndices(&self, program: &WebGLProgram, names: Vec) -> Option> { handle_potential_webgl_error!( self.base, @@ -4063,7 +4063,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { Some(indices) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.16 + /// #[allow(unsafe_code)] fn GetActiveUniforms( &self, @@ -4102,7 +4102,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { rval.get() } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.16 + /// fn GetUniformBlockIndex(&self, program: &WebGLProgram, block_name: DOMString) -> u32 { handle_potential_webgl_error!( self.base, @@ -4117,7 +4117,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { index } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.16 + /// #[allow(unsafe_code)] fn GetActiveUniformBlockParameter( &self, @@ -4159,7 +4159,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.16 + /// fn GetActiveUniformBlockName( &self, program: &WebGLProgram, @@ -4178,7 +4178,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { Some(DOMString::from(name)) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.16 + /// fn UniformBlockBinding(&self, program: &WebGLProgram, block_index: u32, block_binding: u32) { handle_potential_webgl_error!(self.base, self.base.validate_ownership(program), return); @@ -4193,7 +4193,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { ) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.11 + /// fn ClearBufferfv( &self, buffer: u32, @@ -4215,7 +4215,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { ) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.11 + /// fn ClearBufferiv( &self, buffer: u32, @@ -4237,7 +4237,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { ) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.11 + /// fn ClearBufferuiv( &self, buffer: u32, @@ -4259,7 +4259,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { ) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.11 + /// fn ClearBufferfi(&self, buffer: u32, draw_buffer: i32, depth: f32, stencil: i32) { if buffer != constants::DEPTH_STENCIL { return self.base.webgl_error(InvalidEnum); @@ -4279,7 +4279,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { )); } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.4 + /// fn InvalidateFramebuffer(&self, target: u32, attachments: Vec) { if !self.valid_fb_attachment_values(target, &attachments) { return; @@ -4289,7 +4289,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { .send_command(WebGLCommand::InvalidateFramebuffer(target, attachments)) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.4 + /// fn InvalidateSubFramebuffer( &self, target: u32, @@ -4318,7 +4318,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { )) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.4 + /// fn FramebufferTextureLayer( &self, target: u32, @@ -4348,7 +4348,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.5 + /// #[allow(unsafe_code)] fn GetInternalformatParameter( &self, @@ -4389,7 +4389,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.5 + /// fn RenderbufferStorageMultisample( &self, target: u32, @@ -4402,7 +4402,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { .renderbuffer_storage(target, samples, internal_format, width, height) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.4 + /// fn ReadBuffer(&self, src: u32) { match src { constants::BACK | constants::NONE => {}, @@ -4423,7 +4423,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.11 + /// fn DrawBuffers(&self, buffers: Vec) { if let Some(fb) = self.base.get_draw_framebuffer_slot().get() { handle_potential_webgl_error!(self.base, fb.set_draw_buffers(buffers), return) @@ -4442,7 +4442,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { } } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.6 + /// fn TexStorage2D( &self, target: u32, @@ -4454,7 +4454,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext { self.tex_storage(2, target, levels, internal_format, width, height, 1) } - /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.6 + /// fn TexStorage3D( &self, target: u32, diff --git a/components/script/dom/webgl_extensions/wrapper.rs b/components/script/dom/webgl_extensions/wrapper.rs index d5fed25c9f3..3351dbef2a0 100644 --- a/components/script/dom/webgl_extensions/wrapper.rs +++ b/components/script/dom/webgl_extensions/wrapper.rs @@ -37,7 +37,7 @@ pub struct TypedWebGLExtensionWrapper { } /// Typed WebGL Extension implementation. -/// Exposes the exact MutNullableDom type defined by the extension. +/// Exposes the exact `MutNullableDom` type defined by the extension. impl TypedWebGLExtensionWrapper { pub fn new() -> TypedWebGLExtensionWrapper { TypedWebGLExtensionWrapper { diff --git a/components/script/dom/webglbuffer.rs b/components/script/dom/webglbuffer.rs index 8817a06c505..7e6b9533566 100644 --- a/components/script/dom/webglbuffer.rs +++ b/components/script/dom/webglbuffer.rs @@ -32,7 +32,7 @@ pub struct WebGLBuffer { capacity: Cell, marked_for_deletion: Cell, attached_counter: Cell, - /// https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glGetBufferParameteriv.xml + /// usage: Cell, } diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index aa782eb6788..471baeede50 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -4656,13 +4656,13 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { }; } - /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 + /// fn GetAttachedShaders(&self, program: &WebGLProgram) -> Option>> { handle_potential_webgl_error!(self, self.validate_ownership(program), return None); handle_potential_webgl_error!(self, program.attached_shaders().map(Some), None) } - /// https://immersive-web.github.io/webxr/#dom-webglrenderingcontextbase-makexrcompatible + /// fn MakeXRCompatible(&self) -> Rc { // XXXManishearth Fill in with compatibility checks when rust-webxr supports this let p = Promise::new(&self.global()); diff --git a/components/script/dom/webgltexture.rs b/components/script/dom/webgltexture.rs index efce995d9b2..6acb699054e 100644 --- a/components/script/dom/webgltexture.rs +++ b/components/script/dom/webgltexture.rs @@ -280,8 +280,7 @@ impl WebGLTexture { } /// We have to follow the conversion rules for GLES 2.0. See: - /// https://www.khronos.org/webgl/public-mailing-list/archives/1008/msg00014.html - /// + /// pub fn tex_parameter(&self, param: u32, value: TexParameterValue) -> WebGLResult<()> { let target = self.target().unwrap(); diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index c822c9cded4..10d6097b374 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -374,7 +374,7 @@ pub struct Window { #[ignore_malloc_size_of = "Rc is hard"] layout_marker: DomRefCell>>, - /// https://dom.spec.whatwg.org/#window-current-event + /// current_event: DomRefCell>>, } @@ -404,7 +404,7 @@ impl Window { } /// A convenience method for - /// https://html.spec.whatwg.org/multipage/#a-browsing-context-is-discarded + /// pub fn discard_browsing_context(&self) { let proxy = match self.window_proxy.get() { Some(proxy) => proxy, @@ -1593,7 +1593,7 @@ impl Window { current } - /// https://html.spec.whatwg.org/multipage/#window-post-message-steps + /// fn post_message_impl( &self, target_origin: &USVString, @@ -2212,7 +2212,7 @@ impl Window { /// Commence a new URL load which will either replace this window or scroll to a fragment. /// - /// https://html.spec.whatwg.org/multipage/#navigating-across-documents + /// pub fn load_url( &self, replace: HistoryEntryReplacement, diff --git a/components/script/dom/windowproxy.rs b/components/script/dom/windowproxy.rs index 2d023e02f8a..612476b76e2 100644 --- a/components/script/dom/windowproxy.rs +++ b/components/script/dom/windowproxy.rs @@ -100,7 +100,7 @@ pub struct WindowProxy { /// Has the browsing context been disowned? disowned: Cell, - /// https://html.spec.whatwg.org/multipage/#is-closing + /// is_closing: Cell, /// The containing iframe element, if this is a same-origin iframe @@ -109,7 +109,7 @@ pub struct WindowProxy { /// The parent browsing context's window proxy, if this is a nested browsing context parent: Option>, - /// https://html.spec.whatwg.org/multipage/#delaying-load-events-mode + /// delaying_load_events_mode: Cell, /// The creator browsing context's base url. @@ -356,17 +356,17 @@ impl WindowProxy { None } - /// https://html.spec.whatwg.org/multipage/#delaying-load-events-mode + /// pub fn is_delaying_load_events_mode(&self) -> bool { self.delaying_load_events_mode.get() } - /// https://html.spec.whatwg.org/multipage/#delaying-load-events-mode + /// pub fn start_delaying_load_events_mode(&self) { self.delaying_load_events_mode.set(true); } - /// https://html.spec.whatwg.org/multipage/#delaying-load-events-mode + /// pub fn stop_delaying_load_events_mode(&self) { self.delaying_load_events_mode.set(false); if let Some(document) = self.document() { @@ -381,18 +381,18 @@ impl WindowProxy { self.disowned.set(true); } - /// https://html.spec.whatwg.org/multipage/#dom-window-close + /// /// Step 3.1, set BCs `is_closing` to true. pub fn close(&self) { self.is_closing.set(true); } - /// https://html.spec.whatwg.org/multipage/#is-closing + /// pub fn is_closing(&self) -> bool { self.is_closing.get() } - /// https://html.spec.whatwg.org/multipage/#creator-base-url + /// pub fn creator_base_url(&self) -> Option { self.creator_base_url.clone() } @@ -401,7 +401,7 @@ impl WindowProxy { self.creator_base_url.is_some() } - /// https://html.spec.whatwg.org/multipage/#creator-url + /// pub fn creator_url(&self) -> Option { self.creator_url.clone() } @@ -410,7 +410,7 @@ impl WindowProxy { self.creator_base_url.is_some() } - /// https://html.spec.whatwg.org/multipage/#creator-origin + /// pub fn creator_origin(&self) -> Option { self.creator_origin.clone() } @@ -720,7 +720,7 @@ impl WindowProxy { /// active document of that creator browsing context at the time A was created is the creator /// Document. /// -/// See: https://html.spec.whatwg.org/multipage/#creating-browsing-contexts +/// See: #[derive(Debug, Deserialize, Serialize)] pub struct CreatorBrowsingContextInfo { /// Creator document URL. diff --git a/components/script/dom/worker.rs b/components/script/dom/worker.rs index 94b248cef84..ef5f0ba6c2e 100644 --- a/components/script/dom/worker.rs +++ b/components/script/dom/worker.rs @@ -204,7 +204,7 @@ impl Worker { worker.upcast().fire_event(atom!("error")); } - /// https://html.spec.whatwg.org/multipage/#dom-dedicatedworkerglobalscope-postmessage + /// fn post_message_impl( &self, cx: JSContext, @@ -228,7 +228,7 @@ impl Worker { } impl WorkerMethods for Worker { - /// https://html.spec.whatwg.org/multipage/#dom-worker-postmessage + /// fn PostMessage( &self, cx: JSContext, @@ -238,7 +238,7 @@ impl WorkerMethods for Worker { self.post_message_impl(cx, message, transfer) } - /// https://html.spec.whatwg.org/multipage/#dom-worker-postmessage + /// fn PostMessage_( &self, cx: JSContext, diff --git a/components/script/dom/xrframe.rs b/components/script/dom/xrframe.rs index 7afb14d6453..05788baa5d2 100644 --- a/components/script/dom/xrframe.rs +++ b/components/script/dom/xrframe.rs @@ -49,12 +49,12 @@ impl XRFrame { reflect_dom_object(Box::new(XRFrame::new_inherited(session, data)), global) } - /// https://immersive-web.github.io/webxr/#xrframe-active + /// pub fn set_active(&self, active: bool) { self.active.set(active); } - /// https://immersive-web.github.io/webxr/#xrframe-animationframe + /// pub fn set_animation_frame(&self, animation_frame: bool) { self.animation_frame.set(animation_frame); } @@ -73,12 +73,12 @@ impl XRFrame { } impl XRFrameMethods for XRFrame { - /// https://immersive-web.github.io/webxr/#dom-xrframe-session + /// fn Session(&self) -> DomRoot { DomRoot::from_ref(&self.session) } - /// https://immersive-web.github.io/webxr/#dom-xrframe-getviewerpose + /// fn GetViewerPose( &self, reference: &XRReferenceSpace, @@ -109,7 +109,7 @@ impl XRFrameMethods for XRFrame { ))) } - /// https://immersive-web.github.io/webxr/#dom-xrframe-getpose + /// fn GetPose( &self, space: &XRSpace, @@ -135,7 +135,7 @@ impl XRFrameMethods for XRFrame { Ok(Some(XRPose::new(&self.global(), pose))) } - /// https://immersive-web.github.io/webxr/#dom-xrframe-getpose + /// fn GetJointPose( &self, space: &XRJointSpace, @@ -167,7 +167,7 @@ impl XRFrameMethods for XRFrame { ))) } - /// https://immersive-web.github.io/hit-test/#dom-xrframe-gethittestresults + /// fn GetHitTestResults(&self, source: &XRHitTestSource) -> Vec> { self.data .hit_test_results diff --git a/components/script/dom/xrhand.rs b/components/script/dom/xrhand.rs index 6d232587f2e..23204f8ca57 100644 --- a/components/script/dom/xrhand.rs +++ b/components/script/dom/xrhand.rs @@ -41,12 +41,12 @@ impl XRHand { } impl XRHandMethods for XRHand { - /// https://github.com/immersive-web/webxr-hands-input/blob/master/explainer.md + /// fn Length(&self) -> i32 { XRHandConstants::LITTLE_PHALANX_TIP as i32 + 1 } - /// https://github.com/immersive-web/webxr-hands-input/blob/master/explainer.md + /// fn IndexedGetter(&self, joint_index: u32) -> Option> { let joint = match joint_index { XRHandConstants::WRIST => Joint::Wrist, diff --git a/components/script/dom/xrinputsource.rs b/components/script/dom/xrinputsource.rs index 3317c2a014d..443905c14c4 100644 --- a/components/script/dom/xrinputsource.rs +++ b/components/script/dom/xrinputsource.rs @@ -78,7 +78,7 @@ impl XRInputSource { } impl XRInputSourceMethods for XRInputSource { - /// https://immersive-web.github.io/webxr/#dom-xrinputsource-handedness + /// fn Handedness(&self) -> XRHandedness { match self.info.handedness { Handedness::None => XRHandedness::None, @@ -87,7 +87,7 @@ impl XRInputSourceMethods for XRInputSource { } } - /// https://immersive-web.github.io/webxr/#dom-xrinputsource-targetraymode + /// fn TargetRayMode(&self) -> XRTargetRayMode { match self.info.target_ray_mode { TargetRayMode::Gaze => XRTargetRayMode::Gaze, @@ -96,7 +96,7 @@ impl XRInputSourceMethods for XRInputSource { } } - /// https://immersive-web.github.io/webxr/#dom-xrinputsource-targetrayspace + /// fn TargetRaySpace(&self) -> DomRoot { self.target_ray_space.or_init(|| { let global = self.global(); @@ -104,7 +104,7 @@ impl XRInputSourceMethods for XRInputSource { }) } - /// https://immersive-web.github.io/webxr/#dom-xrinputsource-gripspace + /// fn GetGripSpace(&self) -> Option> { if self.info.supports_grip { Some(self.grip_space.or_init(|| { diff --git a/components/script/dom/xrinputsourcearray.rs b/components/script/dom/xrinputsourcearray.rs index c293aad549a..d90382a0f42 100644 --- a/components/script/dom/xrinputsourcearray.rs +++ b/components/script/dom/xrinputsourcearray.rs @@ -130,12 +130,12 @@ impl XRInputSourceArray { } impl XRInputSourceArrayMethods for XRInputSourceArray { - /// https://immersive-web.github.io/webxr/#dom-xrinputsourcearray-length + /// fn Length(&self) -> u32 { self.input_sources.borrow().len() as u32 } - /// https://immersive-web.github.io/webxr/#xrinputsourcearray + /// fn IndexedGetter(&self, n: u32) -> Option> { self.input_sources .borrow() diff --git a/components/script/dom/xrjointpose.rs b/components/script/dom/xrjointpose.rs index d889cb7bb14..df5e5a689e7 100644 --- a/components/script/dom/xrjointpose.rs +++ b/components/script/dom/xrjointpose.rs @@ -42,7 +42,7 @@ impl XRJointPose { } impl XRJointPoseMethods for XRJointPose { - /// https://immersive-web.github.io/webxr/#dom-XRJointPose-views + /// fn GetRadius(&self) -> Option> { self.radius.map(Finite::wrap) } diff --git a/components/script/dom/xrmediabinding.rs b/components/script/dom/xrmediabinding.rs index 648b4997f91..1fe04ccfa93 100644 --- a/components/script/dom/xrmediabinding.rs +++ b/components/script/dom/xrmediabinding.rs @@ -65,7 +65,7 @@ impl XRMediaBinding { } impl XRMediaBindingMethods for XRMediaBinding { - /// https://immersive-web.github.io/layers/#dom-xrmediabinding-createquadlayer + /// fn CreateQuadLayer( &self, _: &HTMLVideoElement, @@ -75,7 +75,7 @@ impl XRMediaBindingMethods for XRMediaBinding { Err(Error::NotSupported) } - /// https://immersive-web.github.io/layers/#dom-xrmediabinding-createcylinderlayer + /// fn CreateCylinderLayer( &self, _: &HTMLVideoElement, @@ -85,7 +85,7 @@ impl XRMediaBindingMethods for XRMediaBinding { Err(Error::NotSupported) } - /// https://immersive-web.github.io/layers/#dom-xrmediabinding-createequirectlayer + /// fn CreateEquirectLayer( &self, _: &HTMLVideoElement, diff --git a/components/script/dom/xrpose.rs b/components/script/dom/xrpose.rs index 90b9629757e..86e558904bb 100644 --- a/components/script/dom/xrpose.rs +++ b/components/script/dom/xrpose.rs @@ -33,7 +33,7 @@ impl XRPose { } impl XRPoseMethods for XRPose { - /// https://immersive-web.github.io/webxr/#dom-xrpose-transform + /// fn Transform(&self) -> DomRoot { DomRoot::from_ref(&self.transform) } diff --git a/components/script/dom/xrray.rs b/components/script/dom/xrray.rs index 6c6cfb0074f..62d1d1aa6eb 100644 --- a/components/script/dom/xrray.rs +++ b/components/script/dom/xrray.rs @@ -48,7 +48,7 @@ impl XRRay { } #[allow(non_snake_case)] - /// https://immersive-web.github.io/hit-test/#dom-xrray-xrray + /// pub fn Constructor( window: &Window, proto: Option, @@ -83,7 +83,7 @@ impl XRRay { } #[allow(non_snake_case)] - /// https://immersive-web.github.io/hit-test/#dom-xrray-xrray-transform + /// pub fn Constructor_( window: &Window, proto: Option, @@ -108,7 +108,7 @@ impl XRRay { } impl XRRayMethods for XRRay { - /// https://immersive-web.github.io/hit-test/#dom-xrray-origin + /// fn Origin(&self) -> DomRoot { DOMPointReadOnly::new( &self.global(), @@ -119,7 +119,7 @@ impl XRRayMethods for XRRay { ) } - /// https://immersive-web.github.io/hit-test/#dom-xrray-direction + /// fn Direction(&self) -> DomRoot { DOMPointReadOnly::new( &self.global(), @@ -130,7 +130,7 @@ impl XRRayMethods for XRRay { ) } - /// https://immersive-web.github.io/hit-test/#dom-xrray-matrix + /// fn Matrix(&self, _cx: JSContext) -> Float32Array { // https://immersive-web.github.io/hit-test/#xrray-obtain-the-matrix if !self.matrix.is_initialized() { diff --git a/components/script/dom/xrreferencespace.rs b/components/script/dom/xrreferencespace.rs index 52dab15f7bb..eb3c9706b16 100644 --- a/components/script/dom/xrreferencespace.rs +++ b/components/script/dom/xrreferencespace.rs @@ -73,7 +73,7 @@ impl XRReferenceSpace { } impl XRReferenceSpaceMethods for XRReferenceSpace { - /// https://immersive-web.github.io/webxr/#dom-xrreferencespace-getoffsetreferencespace + /// fn GetOffsetReferenceSpace(&self, new: &XRRigidTransform) -> DomRoot { let offset = new.transform().then(&self.offset.transform()); let offset = XRRigidTransform::new(&self.global(), offset); diff --git a/components/script/dom/xrrenderstate.rs b/components/script/dom/xrrenderstate.rs index efbb5c43b34..d070e144374 100644 --- a/components/script/dom/xrrenderstate.rs +++ b/components/script/dom/xrrenderstate.rs @@ -133,27 +133,27 @@ impl XRRenderState { } impl XRRenderStateMethods for XRRenderState { - /// https://immersive-web.github.io/webxr/#dom-xrrenderstate-depthnear + /// fn DepthNear(&self) -> Finite { Finite::wrap(self.depth_near.get()) } - /// https://immersive-web.github.io/webxr/#dom-xrrenderstate-depthfar + /// fn DepthFar(&self) -> Finite { Finite::wrap(self.depth_far.get()) } - /// https://immersive-web.github.io/webxr/#dom-xrrenderstate-inlineverticalfieldofview + /// fn GetInlineVerticalFieldOfView(&self) -> Option> { self.inline_vertical_fov.get().map(Finite::wrap) } - /// https://immersive-web.github.io/webxr/#dom-xrrenderstate-baselayer + /// fn GetBaseLayer(&self) -> Option> { self.base_layer.get() } - /// https://immersive-web.github.io/layers/#dom-xrrenderstate-layers + /// fn Layers(&self, cx: JSContext) -> JSVal { // TODO: cache this array? let layers = self.layers.borrow(); diff --git a/components/script/dom/xrrigidtransform.rs b/components/script/dom/xrrigidtransform.rs index 42ad6f9fd70..c30b2f20a2e 100644 --- a/components/script/dom/xrrigidtransform.rs +++ b/components/script/dom/xrrigidtransform.rs @@ -146,7 +146,7 @@ impl XRRigidTransformMethods for XRRigidTransform { } impl XRRigidTransform { - /// https://immersive-web.github.io/webxr/#dom-xrpose-transform + /// pub fn transform(&self) -> ApiRigidTransform { self.transform } diff --git a/components/script/dom/xrsession.rs b/components/script/dom/xrsession.rs index 26db5edb78e..2a79321b390 100644 --- a/components/script/dom/xrsession.rs +++ b/components/script/dom/xrsession.rs @@ -82,7 +82,7 @@ pub struct XRSession { // Any promises from calling end() #[ignore_malloc_size_of = "promises are hard"] end_promises: DomRefCell>>, - /// https://immersive-web.github.io/webxr/#ended + /// ended: Cell, #[ignore_malloc_size_of = "defined in webxr"] #[no_trace] @@ -90,7 +90,7 @@ pub struct XRSession { #[ignore_malloc_size_of = "defined in webxr"] pending_hit_test_promises: DomRefCell>>, /// Opaque framebuffers need to know the session is "outside of a requestAnimationFrame" - /// https://immersive-web.github.io/webxr/#opaque-framebuffer + /// outside_raf: Cell, } @@ -362,7 +362,7 @@ impl XRSession { } } - /// https://immersive-web.github.io/webxr/#xr-animation-frame + /// fn raf_callback(&self, mut frame: Frame) { debug!("WebXR RAF callback {:?}", frame); #[cfg(feature = "xr-profile")] @@ -533,7 +533,7 @@ impl XRSession { }); } - /// https://immersive-web.github.io/webxr/#xrframe-apply-frame-updates + /// fn apply_frame_updates(&self, _frame: &XRFrame) { // TODO: add a comment about why this is empty right now! } @@ -596,7 +596,7 @@ impl XRSessionMethods for XRSession { self.active_render_state.get() } - /// https://immersive-web.github.io/webxr/#dom-xrsession-updaterenderstate + /// fn UpdateRenderState(&self, init: &XRRenderStateInit, _: InRealm) -> ErrorResult { // Step 2 if self.ended.get() { @@ -725,7 +725,7 @@ impl XRSessionMethods for XRSession { Ok(()) } - /// https://immersive-web.github.io/webxr/#dom-xrsession-requestanimationframe + /// fn RequestAnimationFrame(&self, callback: Rc) -> i32 { // queue up RAF callback, obtain ID let raf_id = self.next_raf_id.get(); @@ -737,7 +737,7 @@ impl XRSessionMethods for XRSession { raf_id } - /// https://immersive-web.github.io/webxr/#dom-xrsession-cancelanimationframe + /// fn CancelAnimationFrame(&self, frame: i32) { let mut list = self.raf_callback_list.borrow_mut(); if let Some(pair) = list.iter_mut().find(|pair| pair.0 == frame) { @@ -750,17 +750,17 @@ impl XRSessionMethods for XRSession { } } - /// https://immersive-web.github.io/webxr/#dom-xrsession-environmentblendmode + /// fn EnvironmentBlendMode(&self) -> XREnvironmentBlendMode { self.blend_mode } - /// https://immersive-web.github.io/webxr/#dom-xrsession-visibilitystate + /// fn VisibilityState(&self) -> XRVisibilityState { self.visibility_state.get() } - /// https://immersive-web.github.io/webxr/#dom-xrsession-requestreferencespace + /// fn RequestReferenceSpace(&self, ty: XRReferenceSpaceType, comp: InRealm) -> Rc { let p = Promise::new_in_current_realm(comp); @@ -797,12 +797,12 @@ impl XRSessionMethods for XRSession { p } - /// https://immersive-web.github.io/webxr/#dom-xrsession-inputsources + /// fn InputSources(&self) -> DomRoot { DomRoot::from_ref(&*self.input_sources) } - /// https://immersive-web.github.io/webxr/#dom-xrsession-end + /// fn End(&self) -> Rc { let global = self.global(); let p = Promise::new(&global); diff --git a/components/script/dom/xrsubimage.rs b/components/script/dom/xrsubimage.rs index eb084db630a..e16e18bbaf2 100644 --- a/components/script/dom/xrsubimage.rs +++ b/components/script/dom/xrsubimage.rs @@ -16,7 +16,7 @@ pub struct XRSubImage { } impl XRSubImageMethods for XRSubImage { - /// https://immersive-web.github.io/layers/#dom-xrsubimage-viewport + /// fn Viewport(&self) -> DomRoot { DomRoot::from_ref(&self.viewport) } diff --git a/components/script/dom/xrsystem.rs b/components/script/dom/xrsystem.rs index e4e158605e0..0f49ea47fb5 100644 --- a/components/script/dom/xrsystem.rs +++ b/components/script/dom/xrsystem.rs @@ -82,7 +82,7 @@ impl XRSystem { self.active_immersive_session.set(Some(session)) } - /// https://immersive-web.github.io/webxr/#ref-for-eventdef-xrsession-end + /// pub fn end_session(&self, session: &XRSession) { // Step 3 if let Some(active) = self.active_immersive_session.get() { @@ -110,7 +110,7 @@ impl Into for XRSessionMode { } impl XRSystemMethods for XRSystem { - /// https://immersive-web.github.io/webxr/#dom-xr-issessionsupported + /// fn IsSessionSupported(&self, mode: XRSessionMode) -> Rc { // XXXManishearth this should select an XR device first let promise = Promise::new(&self.global()); @@ -153,7 +153,7 @@ impl XRSystemMethods for XRSystem { promise } - /// https://immersive-web.github.io/webxr/#dom-xr-requestsession + /// #[allow(unsafe_code)] fn RequestSession( &self, diff --git a/components/script/dom/xrtest.rs b/components/script/dom/xrtest.rs index 7327154e79d..204784e7934 100644 --- a/components/script/dom/xrtest.rs +++ b/components/script/dom/xrtest.rs @@ -65,7 +65,7 @@ impl XRTest { } impl XRTestMethods for XRTest { - /// https://github.com/immersive-web/webxr-test-api/blob/master/explainer.md + /// #[allow(unsafe_code)] fn SimulateDeviceConnection(&self, init: &FakeXRDeviceInit) -> Rc { let global = self.global(); @@ -180,14 +180,14 @@ impl XRTestMethods for XRTest { p } - /// https://github.com/immersive-web/webxr-test-api/blob/master/explainer.md + /// fn SimulateUserActivation(&self, f: Rc) { ScriptThread::set_user_interacting(true); let _ = f.Call__(vec![], ExceptionHandling::Rethrow); ScriptThread::set_user_interacting(false); } - /// https://github.com/immersive-web/webxr-test-api/blob/master/explainer.md + /// fn DisconnectAllDevices(&self) -> Rc { // XXXManishearth implement device disconnection and session ending let global = self.global(); diff --git a/components/script/dom/xrview.rs b/components/script/dom/xrview.rs index 663906e92f5..15a273319a2 100644 --- a/components/script/dom/xrview.rs +++ b/components/script/dom/xrview.rs @@ -82,12 +82,12 @@ impl XRView { } impl XRViewMethods for XRView { - /// https://immersive-web.github.io/webxr/#dom-xrview-eye + /// fn Eye(&self) -> XREye { self.eye } - /// https://immersive-web.github.io/webxr/#dom-xrview-projectionmatrix + /// fn ProjectionMatrix(&self, _cx: JSContext) -> Float32Array { if !self.proj.is_initialized() { let cx = GlobalScope::get_cx(); @@ -102,7 +102,7 @@ impl XRViewMethods for XRView { .expect("Failed to get projection matrix.") } - /// https://immersive-web.github.io/webxr/#dom-xrview-transform + /// fn Transform(&self) -> DomRoot { DomRoot::from_ref(&self.transform) } diff --git a/components/script/dom/xrviewerpose.rs b/components/script/dom/xrviewerpose.rs index 7105d593737..0f2fda1e21a 100644 --- a/components/script/dom/xrviewerpose.rs +++ b/components/script/dom/xrviewerpose.rs @@ -167,7 +167,7 @@ impl XRViewerPose { } impl XRViewerPoseMethods for XRViewerPose { - /// https://immersive-web.github.io/webxr/#dom-xrviewerpose-views + /// fn Views(&self, _cx: JSContext) -> JSVal { self.views.get() } diff --git a/components/script/dom/xrviewport.rs b/components/script/dom/xrviewport.rs index d9c90505034..5a98c7839c0 100644 --- a/components/script/dom/xrviewport.rs +++ b/components/script/dom/xrviewport.rs @@ -32,22 +32,22 @@ impl XRViewport { } impl XRViewportMethods for XRViewport { - /// https://immersive-web.github.io/webxr/#dom-xrviewport-x + /// fn X(&self) -> i32 { self.viewport.origin.x } - /// https://immersive-web.github.io/webxr/#dom-xrviewport-y + /// fn Y(&self) -> i32 { self.viewport.origin.y } - /// https://immersive-web.github.io/webxr/#dom-xrviewport-width + /// fn Width(&self) -> i32 { self.viewport.size.width } - /// https://immersive-web.github.io/webxr/#dom-xrviewport-height + /// fn Height(&self) -> i32 { self.viewport.size.height } diff --git a/components/script/dom/xrwebglbinding.rs b/components/script/dom/xrwebglbinding.rs index 82a2c8afdea..073798db0af 100644 --- a/components/script/dom/xrwebglbinding.rs +++ b/components/script/dom/xrwebglbinding.rs @@ -75,7 +75,7 @@ impl XRWebGLBinding { } impl XRWebGLBindingMethods for XRWebGLBinding { - /// https://immersive-web.github.io/layers/#dom-xrwebglbinding-createprojectionlayer + /// fn CreateProjectionLayer( &self, _: XRTextureType, @@ -85,7 +85,7 @@ impl XRWebGLBindingMethods for XRWebGLBinding { Err(Error::NotSupported) } - /// https://immersive-web.github.io/layers/#dom-xrwebglbinding-createquadlayer + /// fn CreateQuadLayer( &self, _: XRTextureType, @@ -95,7 +95,7 @@ impl XRWebGLBindingMethods for XRWebGLBinding { Err(Error::NotSupported) } - /// https://immersive-web.github.io/layers/#dom-xrwebglbinding-createcylinderlayer + /// fn CreateCylinderLayer( &self, _: XRTextureType, @@ -105,7 +105,7 @@ impl XRWebGLBindingMethods for XRWebGLBinding { Err(Error::NotSupported) } - /// https://immersive-web.github.io/layers/#dom-xrwebglbinding-createequirectlayer + /// fn CreateEquirectLayer( &self, _: XRTextureType, @@ -115,13 +115,13 @@ impl XRWebGLBindingMethods for XRWebGLBinding { Err(Error::NotSupported) } - /// https://immersive-web.github.io/layers/#dom-xrwebglbinding-createcubelayer + /// fn CreateCubeLayer(&self, _: &Option) -> Fallible> { // https://github.com/servo/servo/issues/27493 Err(Error::NotSupported) } - /// https://immersive-web.github.io/layers/#dom-xrwebglbinding-getsubimage + /// fn GetSubImage( &self, _: &XRCompositionLayer, @@ -132,7 +132,7 @@ impl XRWebGLBindingMethods for XRWebGLBinding { Err(Error::NotSupported) } - /// https://immersive-web.github.io/layers/#dom-xrwebglbinding-getviewsubimage + /// fn GetViewSubImage( &self, _: &XRProjectionLayer, diff --git a/components/script/dom/xrwebgllayer.rs b/components/script/dom/xrwebgllayer.rs index b876fa0b7ce..e96cdf7f015 100644 --- a/components/script/dom/xrwebgllayer.rs +++ b/components/script/dom/xrwebgllayer.rs @@ -97,7 +97,7 @@ impl XRWebGLLayer { ) } - /// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-xrwebgllayer + /// #[allow(non_snake_case)] pub fn Constructor( global: &Window, @@ -282,32 +282,32 @@ impl XRWebGLLayer { } impl XRWebGLLayerMethods for XRWebGLLayer { - /// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-antialias + /// fn Antialias(&self) -> bool { self.antialias } - /// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-ignoredepthvalues + /// fn IgnoreDepthValues(&self) -> bool { self.ignore_depth_values } - /// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-framebuffer + /// fn GetFramebuffer(&self) -> Option> { self.framebuffer.as_ref().map(|x| DomRoot::from_ref(&**x)) } - /// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-framebufferwidth + /// fn FramebufferWidth(&self) -> u32 { self.size().width } - /// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-framebufferheight + /// fn FramebufferHeight(&self) -> u32 { self.size().height } - /// https://immersive-web.github.io/webxr/#dom-xrwebgllayer-getviewport + /// fn GetViewport(&self, view: &XRView) -> Option> { if self.session() != view.session() { return None; diff --git a/components/script/dom/xrwebglsubimage.rs b/components/script/dom/xrwebglsubimage.rs index 19726128087..6a224e25839 100644 --- a/components/script/dom/xrwebglsubimage.rs +++ b/components/script/dom/xrwebglsubimage.rs @@ -22,27 +22,27 @@ pub struct XRWebGLSubImage { } impl XRWebGLSubImageMethods for XRWebGLSubImage { - /// https://immersive-web.github.io/layers/#dom-xrwebglsubimage-colortexture + /// fn ColorTexture(&self) -> DomRoot { DomRoot::from_ref(&self.color_texture) } - /// https://immersive-web.github.io/layers/#dom-xrwebglsubimage-depthstenciltexture + /// fn GetDepthStencilTexture(&self) -> Option> { self.depth_stencil_texture.as_deref().map(DomRoot::from_ref) } - /// https://immersive-web.github.io/layers/#dom-xrwebglsubimage-imageindex + /// fn GetImageIndex(&self) -> Option { self.image_index } - /// https://immersive-web.github.io/layers/#dom-xrwebglsubimage-texturewidth + /// fn TextureWidth(&self) -> u32 { self.size.width } - /// https://immersive-web.github.io/layers/#dom-xrwebglsubimage-textureheight + /// fn TextureHeight(&self) -> u32 { self.size.height } diff --git a/components/script/fetch.rs b/components/script/fetch.rs index 73872fbdf0d..355104e1d3e 100644 --- a/components/script/fetch.rs +++ b/components/script/fetch.rs @@ -356,7 +356,7 @@ pub fn load_whole_resource( } } -/// https://html.spec.whatwg.org/multipage/#create-a-potential-cors-request +/// pub(crate) fn create_a_potential_cors_request( url: ServoUrl, destination: Destination, diff --git a/components/script/script_module.rs b/components/script/script_module.rs index 4a3da79454a..13171db65ce 100644 --- a/components/script/script_module.rs +++ b/components/script/script_module.rs @@ -414,7 +414,7 @@ pub enum ModuleStatus { impl ModuleTree { #[allow(unsafe_code)] - /// https://html.spec.whatwg.org/multipage/#creating-a-module-script + /// /// Step 7-11. fn compile_module_script( &self, @@ -467,7 +467,7 @@ impl ModuleTree { } #[allow(unsafe_code)] - /// https://html.spec.whatwg.org/multipage/#fetch-the-descendants-of-and-link-a-module-script + /// /// Step 5-2. pub fn instantiate_module_tree( &self, @@ -600,7 +600,7 @@ impl ModuleTree { /// /// Bareword module specifiers are currently disallowed as these may be given /// special meanings in the future. - /// https://html.spec.whatwg.org/multipage/#resolve-a-module-specifier + /// #[allow(unsafe_code)] fn resolve_module_specifier( cx: *mut JSContext, @@ -626,7 +626,7 @@ impl ModuleTree { return ServoUrl::parse_with_base(Some(url), &specifier_str.clone()); } - /// https://html.spec.whatwg.org/multipage/#finding-the-first-parse-error + /// fn find_first_parse_error( &self, global: &GlobalScope, @@ -684,7 +684,7 @@ impl ModuleTree { } #[allow(unsafe_code)] - /// https://html.spec.whatwg.org/multipage/#fetch-the-descendants-of-a-module-script + /// fn fetch_module_descendants( &self, owner: &ModuleOwner, @@ -784,7 +784,7 @@ impl ModuleTree { } } - /// https://html.spec.whatwg.org/multipage/#fetch-the-descendants-of-and-link-a-module-script + /// /// step 4-7. fn advance_finished_and_link(&self, global: &GlobalScope) { { @@ -1388,8 +1388,8 @@ fn fetch_an_import_module_script_graph( } #[allow(unsafe_code, non_snake_case)] -/// https://tc39.github.io/ecma262/#sec-hostresolveimportedmodule -/// https://html.spec.whatwg.org/multipage/#hostresolveimportedmodule(referencingscriptormodule%2C-specifier) +/// +/// unsafe extern "C" fn HostResolveImportedModule( cx: *mut JSContext, reference_private: RawHandleValue, @@ -1442,8 +1442,8 @@ unsafe extern "C" fn HostResolveImportedModule( } #[allow(unsafe_code, non_snake_case)] -/// https://tc39.es/ecma262/#sec-hostgetimportmetaproperties -/// https://html.spec.whatwg.org/multipage/#hostgetimportmetaproperties +/// +/// unsafe extern "C" fn HostPopulateImportMeta( cx: *mut JSContext, reference_private: RawHandleValue, @@ -1474,7 +1474,7 @@ unsafe extern "C" fn HostPopulateImportMeta( ) } -/// https://html.spec.whatwg.org/multipage/#fetch-a-module-script-tree +/// pub(crate) fn fetch_external_module_script( owner: ModuleOwner, url: ServoUrl, @@ -1545,7 +1545,7 @@ struct DynamicModule { id: DynamicModuleId, } -/// https://html.spec.whatwg.org/multipage/#fetch-a-single-module-script +/// fn fetch_single_module_script( owner: ModuleOwner, url: ServoUrl, @@ -1698,7 +1698,7 @@ fn fetch_single_module_script( } #[allow(unsafe_code)] -/// https://html.spec.whatwg.org/multipage/#fetch-an-inline-module-script-graph +/// pub(crate) fn fetch_inline_module_script( owner: ModuleOwner, module_script_text: Rc, diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs index 6d0894fa3fb..f797a61e212 100644 --- a/components/script/script_runtime.rs +++ b/components/script/script_runtime.rs @@ -233,7 +233,7 @@ unsafe extern "C" fn enqueue_promise_job( } #[allow(unsafe_code, crown::unrooted_must_root)] -/// https://html.spec.whatwg.org/multipage/#the-hostpromiserejectiontracker-implementation +/// unsafe extern "C" fn promise_rejection_tracker( cx: *mut RawJSContext, _muted_errors: bool, @@ -311,7 +311,7 @@ unsafe extern "C" fn promise_rejection_tracker( } #[allow(unsafe_code, crown::unrooted_must_root)] -/// https://html.spec.whatwg.org/multipage/#notify-about-rejected-promises +/// pub fn notify_about_rejected_promises(global: &GlobalScope) { let cx = GlobalScope::get_cx(); unsafe { diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 5f87aaac47b..0bb89c0956b 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -975,7 +975,7 @@ impl ScriptThread { /// Check that two origins are "similar enough", /// for now only used to prevent cross-origin JS url evaluation. /// - /// https://github.com/whatwg/html/issues/2591 + /// pub fn check_load_origin(source: &LoadOrigin, target: &ImmutableOrigin) -> bool { match (source, target) { (LoadOrigin::Constellation, _) | (LoadOrigin::WebDriver, _) => { @@ -992,7 +992,7 @@ impl ScriptThread { } } - /// Step 13 of https://html.spec.whatwg.org/multipage/#navigate + /// Step 13 of pub fn navigate( browsing_context: BrowsingContextId, pipeline_id: PipelineId, @@ -3750,7 +3750,7 @@ impl ScriptThread { } /// Turn javascript: URL into JS code to eval, according to the steps in - /// https://html.spec.whatwg.org/multipage/#javascript-protocol + /// pub fn eval_js_url(global_scope: &GlobalScope, load_data: &mut LoadData) { // This slice of the URL’s serialization is equivalent to (5.) to (7.): // Start with the scheme data of the parsed URL; diff --git a/components/script/serviceworker_manager.rs b/components/script/serviceworker_manager.rs index 4bb28c65d56..f51398bbd29 100644 --- a/components/script/serviceworker_manager.rs +++ b/components/script/serviceworker_manager.rs @@ -118,15 +118,15 @@ impl Drop for ServiceWorkerRegistration { } } -/// https://w3c.github.io/ServiceWorker/#service-worker-registration-concept +/// struct ServiceWorkerRegistration { /// A unique identifer. id: ServiceWorkerRegistrationId, - /// https://w3c.github.io/ServiceWorker/#dfn-active-worker + /// active_worker: Option, - /// https://w3c.github.io/ServiceWorker/#dfn-waiting-worker + /// waiting_worker: Option, - /// https://w3c.github.io/ServiceWorker/#dfn-installing-worker + /// installing_worker: Option, /// A channel to send control message to the worker, /// currently only used to signal shutdown. @@ -209,7 +209,7 @@ impl ServiceWorkerRegistration { /// A structure managing all registrations and workers for a given origin. pub struct ServiceWorkerManager { - /// https://w3c.github.io/ServiceWorker/#dfn-scope-to-registration-map + /// registrations: HashMap, // Will be useful to implement posting a message to a client. // See https://github.com/servo/servo/issues/24660 diff --git a/components/script/task_queue.rs b/components/script/task_queue.rs index bb58dea8ab1..9e4ea9c4906 100644 --- a/components/script/task_queue.rs +++ b/components/script/task_queue.rs @@ -65,7 +65,7 @@ impl TaskQueue { } /// Release previously held-back tasks for documents that are now fully-active. - /// https://html.spec.whatwg.org/multipage/#event-loop-processing-model:fully-active + /// fn release_tasks_for_fully_active_documents( &self, fully_active: &HashSet, @@ -83,7 +83,7 @@ impl TaskQueue { } /// Hold back tasks for currently not fully-active documents. - /// https://html.spec.whatwg.org/multipage/#event-loop-processing-model:fully-active + /// fn store_task_for_inactive_pipeline(&self, msg: T, pipeline_id: &PipelineId) { let mut inactive = self.inactive.borrow_mut(); let inactive_queue = inactive.entry(pipeline_id.clone()).or_default(); diff --git a/components/script/task_source/timer.rs b/components/script/task_source/timer.rs index f5bfdbb8f52..856e05921f4 100644 --- a/components/script/task_source/timer.rs +++ b/components/script/task_source/timer.rs @@ -11,7 +11,7 @@ use crate::task::{TaskCanceller, TaskOnce}; use crate::task_source::{TaskSource, TaskSourceName}; #[derive(JSTraceable)] -/// https://html.spec.whatwg.org/multipage/#timer-task-source +/// pub struct TimerTaskSource( pub Box, #[no_trace] pub PipelineId, diff --git a/components/script/timers.rs b/components/script/timers.rs index 2289c9aac8c..895475f1b4d 100644 --- a/components/script/timers.rs +++ b/components/script/timers.rs @@ -361,7 +361,7 @@ pub struct JsTimerHandle(i32); #[derive(DenyPublicFields, JSTraceable, MallocSizeOf)] pub struct JsTimers { next_timer_handle: Cell, - /// https://html.spec.whatwg.org/multipage/#list-of-active-timers + /// active_timers: DomRefCell>, /// The nesting level of the currently executing timer task or 0. nesting_level: Cell, -- cgit v1.2.3