Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: syntax errors in JS example sections (v3) #18307

Merged
merged 11 commits into from
Jul 16, 2022

Conversation

lionralfs
Copy link
Contributor

@lionralfs lionralfs commented Jul 13, 2022

Summary

Followup to PR #18186 and #18191


Skipped issues (POTENTIALLY OUTDATED, SEE #18186 (comment)):

At this point I might as well open an issue to track all the syntax issues I skipped

This PR…
-->

  • Adds a new document
  • Rewrites (or significantly expands) a document
  • Fixes a typo, bug, or other error

@github-actions github-actions bot added the Content:WebAPI Web API docs label Jul 13, 2022
@@ -77,7 +77,7 @@ The [x](https://svgwg.org/svg2-draft/geometry.html#XProperty) property describes

A \<coordinate> is a length in the user coordinate system that is the given distance from the origin of the user coordinate system along the relevant axis (the x-axis for X coordinates, the y-axis for Y coordinates). Its syntax is the same as that for [\<length>](https://www.w3.org/TR/SVG11/types.html#DataTypeLength)

```js
```go
Copy link
Contributor Author

@lionralfs lionralfs Jul 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 13, 2022

Preview URLs

Flaws

Note! 82 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/API/Presentation/receiver
Title: Presentation.receiver
on GitHub
Flaw count: 2

  • macros:
    • /en-US/docs/Web/API/Navigator/receiver does not exist
    • /en-US/docs/Web/API/PresentationReceiver/connectionList does not exist

URL: /en-US/docs/Web/API/Pointer_events/Pinch_zoom_gestures
Title: Pinch zoom gestures
on GitHub
Flaw count: 13

  • macros:
    • /en-US/docs/Web/API/HTMLElement/pointerdown_event redirects to /en-US/docs/Web/API/Element/pointerdown_event
    • /en-US/docs/Web/API/HTMLElement/pointermove_event redirects to /en-US/docs/Web/API/Element/pointermove_event
    • /en-US/docs/Web/API/HTMLElement/pointerup_event redirects to /en-US/docs/Web/API/Element/pointerup_event
    • /en-US/docs/Web/API/HTMLElement/pointerup_event redirects to /en-US/docs/Web/API/Element/pointerup_event
    • /en-US/docs/Web/API/HTMLElement/pointercancel_event redirects to /en-US/docs/Web/API/Element/pointercancel_event
    • and 8 more flaws omitted

URL: /en-US/docs/Web/API/Pointer_events/Multi-touch_interaction
Title: Multi-touch interaction
on GitHub
Flaw count: 17

  • macros:
    • /en-US/docs/Web/API/HTMLElement/pointerdown_event redirects to /en-US/docs/Web/API/Element/pointerdown_event
    • /en-US/docs/Web/API/HTMLElement/pointermove_event redirects to /en-US/docs/Web/API/Element/pointermove_event
    • /en-US/docs/Web/API/HTMLElement/pointerup_event redirects to /en-US/docs/Web/API/Element/pointerup_event
    • /en-US/docs/Web/API/HTMLElement/pointercancel_event redirects to /en-US/docs/Web/API/Element/pointercancel_event
    • /en-US/docs/Web/API/HTMLElement/pointerdown_event redirects to /en-US/docs/Web/API/Element/pointerdown_event
    • and 12 more flaws omitted

URL: /en-US/docs/Web/API/ServiceWorkerGlobalScope/message_event
Title: ServiceWorkerGlobalScope: message event
on GitHub
Flaw count: 1

  • macros:
    • /en-US/docs/Web/API/ServiceWorker/postMessage does not exist

URL: /en-US/docs/Web/API/SerialPort
Title: SerialPort
on GitHub
Flaw count: 1

  • bad_bcd_links:
    • no explanation!

URL: /en-US/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView
Title: ReadableStreamBYOBRequest.respondWithNewView()
on GitHub
Flaw count: 2

  • macros:
    • wrong xref macro used (consider changing which macro you use)
    • wrong xref macro used (consider changing which macro you use)

URL: /en-US/docs/Web/API/VRDisplay/submitFrame
Title: VRDisplay.submitFrame()
on GitHub
Flaw count: 1

  • macros:
    • /en-US/docs/Web/API/GetFrameData does not exist

URL: /en-US/docs/Web/API/TreeWalker
Title: TreeWalker
on GitHub
Flaw count: 2

  • macros:
    • /en-US/docs/Web/API/NodeFilter redirects to /en-US/docs/Web/API/Document/createNodeIterator
    • /en-US/docs/Web/API/NodeFilter redirects to /en-US/docs/Web/API/Document/createNodeIterator

URL: /en-US/docs/Web/API/Web_Audio_API/Migrating_from_webkitAudioContext
Title: Migrating from webkitAudioContext
on GitHub
Flaw count: 8

  • macros:
    • /en-US/docs/Web/API/CreateGain does not exist
    • /en-US/docs/Web/API/CreateDelay does not exist
    • /en-US/docs/Web/API/CreateScriptProcessor does not exist
    • /en-US/docs/Web/API/AudioBufferSourceNode_ does not exist
    • /en-US/docs/Web/API/HTMLInputElement/type does not exist
    • and 3 more flaws omitted

External URLs

URL: /en-US/docs/Web/API/Performance/resourcetimingbufferfull_event
Title: Performance: resourcetimingbufferfull event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/ReadableStreamDefaultReader/releaseLock
Title: ReadableStreamDefaultReader.releaseLock()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/Scheduler/postTask
Title: Scheduler.postTask()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RTCIceCandidate/protocol
Title: RTCIceCandidate.protocol
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/PushSubscription/getKey
Title: PushSubscription.getKey()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/Streams_API/Using_readable_streams
Title: Using readable streams
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/Streams_API/Using_writable_streams
Title: Using writable streams
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/Serial
Title: Serial
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/Serial/requestPort
Title: Serial.requestPort()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/TouchList/item
Title: TouchList.item()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/Touch_events/Multi-touch_interaction
Title: Multi-touch interaction
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/Presentation/receiver
Title: Presentation.receiver
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RTCIceServer/urls
Title: RTCIceServers.urls
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RTCIceServer/credentialType
Title: RTCIceServer.credentialType
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RTCIceServer/credential
Title: RTCIceServer.credential
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RTCIceServer/url
Title: RTCIceServer.url
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RTCIceServer/username
Title: RTCIceServer.username
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/Permissions_API/Using_the_Permissions_API
Title: Using the Permissions API
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/PresentationRequest/start
Title: PresentationRequest.start()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/ReportingObserver/disconnect
Title: ReportingObserver.disconnect()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/TrackEvent
Title: TrackEvent
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers
Title: Using Service Workers
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/Pointer_events/Pinch_zoom_gestures
Title: Pinch zoom gestures
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/Pointer_events/Multi-touch_interaction
Title: Multi-touch interaction
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SecurityPolicyViolationEvent/SecurityPolicyViolationEvent
Title: SecurityPolicyViolationEvent()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/ServiceWorkerGlobalScope/install_event
Title: ServiceWorkerGlobalScope: install event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/ServiceWorkerGlobalScope/pushsubscriptionchange_event
Title: ServiceWorkerGlobalScope: pushsubscriptionchange event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/ServiceWorkerGlobalScope/activate_event
Title: ServiceWorkerGlobalScope: activate event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/ServiceWorkerGlobalScope/sync_event
Title: ServiceWorkerGlobalScope: sync event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/ServiceWorkerGlobalScope/message_event
Title: ServiceWorkerGlobalScope: message event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/ServiceWorkerGlobalScope/periodicsync_event
Title: ServiceWorkerGlobalScope: periodicsync event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/ServiceWorkerGlobalScope/contentdelete_event
Title: ServiceWorkerGlobalScope: contentdelete event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RelativeOrientationSensor
Title: RelativeOrientationSensor
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SerialPort
Title: SerialPort
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SerialPort/open
Title: SerialPort.open()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/TrustedScriptURL
Title: TrustedScriptURL
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/queueMicrotask
Title: queueMicrotask()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/Request/Request
Title: Request()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RTCPeerConnection/currentLocalDescription
Title: RTCPeerConnection.currentLocalDescription
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RTCPeerConnection/pendingRemoteDescription
Title: RTCPeerConnection.pendingRemoteDescription
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RTCPeerConnection/removeStream
Title: RTCPeerConnection.removeStream()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RTCPeerConnection/getSenders
Title: RTCPeerConnection.getSenders()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RTCPeerConnection/negotiationneeded_event
Title: RTCPeerConnection: negotiationneeded event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RTCPeerConnection/addTrack
Title: RTCPeerConnection.addTrack()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RTCPeerConnection/pendingLocalDescription
Title: RTCPeerConnection.pendingLocalDescription
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RTCPeerConnection/currentRemoteDescription
Title: RTCPeerConnection.currentRemoteDescription
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RTCPeerConnection/localDescription
Title: RTCPeerConnection.localDescription
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RTCPeerConnection/remoteDescription
Title: RTCPeerConnection.remoteDescription
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/PublicKeyCredential
Title: PublicKeyCredential
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SpeechSynthesisErrorEvent
Title: SpeechSynthesisErrorEvent
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SpeechSynthesisErrorEvent/error
Title: SpeechSynthesisErrorEvent.error
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/ShadowRoot/host
Title: ShadowRoot.host
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/ShadowRoot/mode
Title: ShadowRoot.mode
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/ShadowRoot/delegatesFocus
Title: ShadowRoot.delegatesFocus
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/Web_Serial_API
Title: Web Serial API
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/WorkerGlobalScope/self
Title: WorkerGlobalScope.self
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/ScriptProcessorNode/audioprocess_event
Title: ScriptProcessorNode: audioprocess event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView
Title: ReadableStreamBYOBRequest.respondWithNewView()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/VRDisplay/submitFrame
Title: VRDisplay.submitFrame()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/ServiceWorker/statechange_event
Title: ServiceWorker: statechange event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/TreeWalker
Title: TreeWalker
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/Web_Audio_API/Migrating_from_webkitAudioContext
Title: Migrating from webkitAudioContext
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/Performance_API/Using_the_Performance_API
Title: Using the Performance API
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SpeechRecognition/grammars
Title: SpeechRecognition.grammars
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SpeechRecognition/maxAlternatives
Title: SpeechRecognition.maxAlternatives
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SpeechRecognition/interimResults
Title: SpeechRecognition.interimResults
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SpeechRecognition/continuous
Title: SpeechRecognition.continuous
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SpeechRecognition/SpeechRecognition
Title: SpeechRecognition()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SpeechRecognition/lang
Title: SpeechRecognition.lang
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SpeechSynthesisUtterance/error_event
Title: SpeechSynthesisUtterance: error event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SpeechSynthesisUtterance/volume
Title: SpeechSynthesisUtterance.volume
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SpeechSynthesisUtterance/voice
Title: SpeechSynthesisUtterance.voice
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SpeechSynthesisUtterance/text
Title: SpeechSynthesisUtterance.text
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SpeechSynthesisUtterance/pitch
Title: SpeechSynthesisUtterance.pitch
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SpeechSynthesisUtterance/SpeechSynthesisUtterance
Title: SpeechSynthesisUtterance()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SpeechSynthesisUtterance/lang
Title: SpeechSynthesisUtterance.lang
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/StylePropertyMapReadOnly/has
Title: StylePropertyMapReadOnly.has()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SpeechSynthesis/speak
Title: SpeechSynthesis.speak()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SVGRect/The__X__property
Title: The 'X' property
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RTCSessionDescription/RTCSessionDescription
Title: RTCSessionDescription()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SVGAnimatedString/animVal
Title: SVGAnimatedString.animVal
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/ReadableStream/locked
Title: ReadableStream.locked
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RTCIceTransport/gatheringstatechange_event
Title: RTCIceTransport: gatheringstatechange event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RTCIceTransport/getRemoteCandidates
Title: RTCIceTransport.getRemoteCandidates()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/RTCIceTransport/getLocalCandidates
Title: RTCIceTransport.getLocalCandidates()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SVGAElement/target
Title: SVGAElement.target
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/TextTrackCue/exit_event
Title: TextTrackCue: exit event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/Pointer_Lock_API
Title: Pointer Lock API
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SourceBuffer/removeAsync
Title: SourceBuffer.removeAsync()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/SourceBuffer/abort
Title: SourceBuffer.abort()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/ResizeObserver/ResizeObserver
Title: ResizeObserver()
on GitHub

No new external URLs

(this comment was updated 2022-07-16 12:56:46.708568)

Comment on lines -52 to +53
highWaterMark,
size()
highWaterMark: 3,
size: () => 1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -28,7 +28,7 @@ The constant `sanitized` is an object created via a Trusted Types policy.

```js
const sanitized = scriptPolicy.createScriptURL("https://example.com/my-script.js");
console.log(sanitized;) /* a TrustedScriptURL object */
console.log(sanitize); /* a TrustedScriptURL object */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be sanitized?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, you're absolutely right. One backspace too much 😅

@lionralfs lionralfs marked this pull request as ready for review July 16, 2022 12:16
@lionralfs lionralfs requested a review from a team as a code owner July 16, 2022 12:16
@lionralfs lionralfs requested review from sideshowbarker and removed request for a team July 16, 2022 12:16
Copy link
Member

@teoli2003 teoli2003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nits that I will commit soon.

I find this really amazing: so many small errors fixed really quickly.

@teoli2003 teoli2003 merged commit 74f46a4 into mdn:main Jul 16, 2022
@lionralfs lionralfs deleted the fix-js-example-syntax-errors-3 branch July 17, 2022 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants