source: webkit/trunk/Source/WebCore/css/DOMMatrix.idl

Last change on this file was 289117, checked in by Alexey Shvayka, 3 years ago

[WebIDL] Rename Document / ScriptExecutionContext / GlobalObject values of [*CallWith] to include "Current"
https://bugs.webkit.org/show_bug.cgi?id=236137

Reviewed by Chris Dumez.

Before this change, _current_ realm was kinda an implicit default, which didn't
match all newer standards that use _relevant_ per recommendation for spec authors [1].

Making _relevant_ a default isn't feasible either: there are plenty usages of
[CallWith=GlobalObject] for converting JS values to WebIDL, which are correct,
and some older specs like IndexedDB require it.

Since there is no way for static operations / attributes to acquire a _relevant_
realm, this patch asserts that Relevant* values aren't used with them.

That could probably be expanded for constructors, given their "prototype"s are
unforgeable, yet before doing that we should investigate how other vendors are
handling cross-realm NewTarget.

[1] https://html.spec.whatwg.org/multipage/webappapis.html#realms-settings-objects-global-objects:concept-relevant-everything-2

No new tests, no behavior change.

  • Modules/WebGPU/GPUAdapter.idl:
  • Modules/applepay/ApplePaySession.idl:
  • Modules/applepay/ApplePaySetup.idl:
  • Modules/beacon/Navigator+Beacon.idl:
  • Modules/cache/WindowOrWorkerGlobalScope+Caches.idl:
  • Modules/encryptedmedia/MediaKeyStatusMap.idl:
  • Modules/encryptedmedia/MediaKeySystemAccess.idl:
  • Modules/encryptedmedia/MediaKeys.idl:
  • Modules/encryptedmedia/Navigator+EME.idl:
  • Modules/encryptedmedia/legacy/WebKitMediaKeys.idl:
  • Modules/entriesapi/DOMFileSystem.idl:
  • Modules/entriesapi/FileSystemDirectoryEntry.idl:
  • Modules/entriesapi/FileSystemDirectoryReader.idl:
  • Modules/entriesapi/FileSystemEntry.idl:
  • Modules/entriesapi/FileSystemFileEntry.idl:
  • Modules/entriesapi/HTMLInputElement+EntriesAPI.idl:
  • Modules/fetch/FetchBody.idl:
  • Modules/fetch/FetchRequest.idl:
  • Modules/fetch/FetchResponse.idl:
  • Modules/indexeddb/IDBCursor.idl:
  • Modules/indexeddb/IDBFactory.idl:
  • Modules/indexeddb/IDBIndex.idl:
  • Modules/indexeddb/IDBKeyRange.idl:
  • Modules/indexeddb/IDBObjectStore.idl:
  • Modules/mediacapabilities/MediaCapabilities.idl:
  • Modules/mediarecorder/MediaRecorder.idl:
  • Modules/mediasession/MediaMetadata.idl:
  • Modules/mediasession/MediaSessionPlaylistMixin.idl:
  • Modules/mediasource/DOMURL+MediaSource.idl:
  • Modules/mediasource/MediaSource.idl:
  • Modules/mediastream/MediaStream.idl:
  • Modules/mediastream/RTCPeerConnection.idl:
  • Modules/mediastream/RTCRtpReceiver.idl:
  • Modules/mediastream/RTCRtpSFrameTransform.idl:
  • Modules/mediastream/RTCRtpScriptTransform.idl:
  • Modules/mediastream/RTCRtpScriptTransformer.idl:
  • Modules/mediastream/RTCRtpSender.idl:
  • Modules/notifications/Notification.idl:
  • Modules/paymentrequest/MerchantValidationEvent.idl:
  • Modules/paymentrequest/PaymentRequest.idl:
  • Modules/paymentrequest/PaymentResponse.idl:
  • Modules/push-api/PushManager.idl:
  • Modules/push-api/PushMessageData.idl:
  • Modules/push-api/PushSubscription.idl:
  • Modules/speech/SpeechRecognition.idl:
  • Modules/speech/SpeechSynthesisUtterance.idl:
  • Modules/streams/WritableStream.idl:
  • Modules/streams/WritableStreamSink.idl:
  • Modules/webaudio/AudioBuffer.idl:
  • Modules/webaudio/AudioContext.idl:
  • Modules/webaudio/AudioWorkletNode.idl:
  • Modules/webaudio/AudioWorkletProcessor.idl:
  • Modules/webaudio/BaseAudioContext.idl:
  • Modules/webaudio/IIRFilterNode.idl:
  • Modules/webaudio/OfflineAudioContext.idl:
  • Modules/webauthn/PublicKeyCredential.idl:
  • Modules/websockets/WebSocket.idl:
  • Modules/webxr/WebXRFrame.idl:
  • Modules/webxr/WebXRSystem.idl:
  • animation/Animatable.idl:
  • animation/DocumentTimeline.idl:
  • animation/KeyframeEffect.idl:
  • bindings/scripts/CodeGenerator.pm:

(ExtendedAttributeContains):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateAttributeGetterBodyDefinition):
(GenerateCallWith):
(GenerateParametersCheck):

  • bindings/scripts/IDLAttributes.json:
  • bindings/scripts/test/JS/*: Updated.
  • bindings/scripts/test/TestInterface.idl:
  • bindings/scripts/test/TestLegacyFactoryFunction.idl:
  • bindings/scripts/test/TestMixinInterface.idl:
  • bindings/scripts/test/TestObj.idl:
  • bindings/scripts/test/TestPromiseRejectionEvent.idl:
  • bindings/scripts/test/TestSupplemental.idl:
  • crypto/SubtleCrypto.idl:
  • css/DOMCSSNamespace+CSSPainting.idl:
  • css/DOMCSSNamespace+CSSPropertiesandValues.idl:
  • css/DOMCSSNamespace.idl:
  • css/DOMMatrix.idl:
  • css/DOMMatrixReadOnly.idl:
  • css/FontFace.idl:
  • css/FontFaceSet.idl:
  • dom/AbortController.idl:
  • dom/AbortSignal.idl:
  • dom/BroadcastChannel.idl:
  • dom/Comment.idl:
  • dom/DataTransfer.idl:
  • dom/DataTransferItem.idl:
  • dom/DeviceMotionEvent.idl:
  • dom/DeviceOrientationEvent.idl:
  • dom/Document.idl:
  • dom/DocumentFragment.idl:
  • dom/Element.idl:
  • dom/ErrorEvent.idl:
  • dom/EventTarget.idl:
  • dom/MessageChannel.idl:
  • dom/MessagePort.idl:
  • dom/MouseEvent.idl:
  • dom/Range.idl:
  • dom/Text.idl:
  • fileapi/Blob.idl:
  • fileapi/File.idl:
  • fileapi/FileReader.idl:
  • fileapi/FileReaderSync.idl:
  • html/DOMURL.idl:
  • html/HTMLAudioElement.idl:
  • html/HTMLCanvasElement.idl:
  • html/HTMLFrameElement.idl:
  • html/HTMLImageElement.idl:
  • html/HTMLOptionElement.idl:
  • html/HTMLOutputElement.idl:
  • html/MediaController.idl:
  • html/OffscreenCanvas.idl:
  • html/track/DataCue.idl:
  • html/track/TextTrackCue.idl:
  • html/track/VTTCue.idl:
  • html/track/VTTRegion.idl:
  • inspector/CommandLineAPIHost.idl:
  • inspector/InspectorAuditAccessibilityObject.idl:
  • inspector/InspectorAuditResourcesObject.idl:
  • page/DOMWindow.idl:
  • page/EventSource.idl:
  • page/IntersectionObserver.idl:
  • page/NavigatorServiceWorker.idl:
  • page/NavigatorShare.idl:
  • page/Performance+UserTiming.idl:
  • page/PerformanceMark.idl:
  • page/PerformanceMeasure.idl:
  • page/PerformanceObserver.idl:
  • page/RemoteDOMWindow.idl:
  • page/ResizeObserver.idl:
  • page/WindowOrWorkerGlobalScope.idl:
  • testing/Internals.idl:
  • testing/ServiceWorkerInternals.idl:
  • testing/WebXRTest.idl:
  • workers/DedicatedWorkerGlobalScope.idl:
  • workers/Worker.idl:
  • workers/service/FetchEvent.idl:
  • workers/service/ServiceWorker.idl:
  • workers/service/ServiceWorkerClient.idl:
  • workers/service/ServiceWorkerClients.idl:
  • workers/service/ServiceWorkerRegistration.idl:
  • workers/shared/SharedWorker.idl:
  • worklets/PaintWorkletGlobalScope.idl:
  • xml/DOMParser.idl:
  • xml/XMLHttpRequest.idl:
File size: 5.0 KB
Line 
1/*
2 * Copyright (C) 2017 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26// FIXME: Should be [LegacyWindowAlias=(SVGMatrix, WebKitCSSMatrix)].
27[
28 ExportMacro=WEBCORE_EXPORT,
29 Exposed=(Window,Worker),
30 LegacyWindowAlias=WebKitCSSMatrix,
31 JSGenerateToNativeObject,
32] interface DOMMatrix : DOMMatrixReadOnly {
33 [CallWith=CurrentScriptExecutionContext] constructor(optional (DOMString or sequence<unrestricted double>) init);
34
35 [NewObject] static DOMMatrix fromMatrix(optional DOMMatrixInit other);
36 [NewObject] static DOMMatrix fromFloat32Array(Float32Array array32);
37 [NewObject] static DOMMatrix fromFloat64Array(Float64Array array64);
38
39 // These attributes are simple aliases for certain elements of the 4x4 matrix
40 inherit attribute unrestricted double a; // Alias for m11.
41 inherit attribute unrestricted double b; // Alias for m12.
42 inherit attribute unrestricted double c; // Alias for m21.
43 inherit attribute unrestricted double d; // Alias for m22.
44 inherit attribute unrestricted double e; // Alias for m41.
45 inherit attribute unrestricted double f; // Alias for m42.
46
47 inherit attribute unrestricted double m11;
48 inherit attribute unrestricted double m12;
49 inherit attribute unrestricted double m13;
50 inherit attribute unrestricted double m14;
51 inherit attribute unrestricted double m21;
52 inherit attribute unrestricted double m22;
53 inherit attribute unrestricted double m23;
54 inherit attribute unrestricted double m24;
55 inherit attribute unrestricted double m31;
56 inherit attribute unrestricted double m32;
57 inherit attribute unrestricted double m33;
58 inherit attribute unrestricted double m34;
59 inherit attribute unrestricted double m41;
60 inherit attribute unrestricted double m42;
61 inherit attribute unrestricted double m43;
62 inherit attribute unrestricted double m44;
63
64 // Mutable transform methods
65 DOMMatrix multiplySelf(optional DOMMatrixInit other);
66 DOMMatrix preMultiplySelf(optional DOMMatrixInit other);
67 DOMMatrix translateSelf(optional unrestricted double tx = 0,
68 optional unrestricted double ty = 0,
69 optional unrestricted double tz = 0);
70 DOMMatrix scaleSelf(optional unrestricted double scaleX = 1,
71 optional unrestricted double scaleY,
72 optional unrestricted double scaleZ = 1,
73 optional unrestricted double originX = 0,
74 optional unrestricted double originY = 0,
75 optional unrestricted double originZ = 0);
76 DOMMatrix scale3dSelf(optional unrestricted double scale = 1,
77 optional unrestricted double originX = 0,
78 optional unrestricted double originY = 0,
79 optional unrestricted double originZ = 0);
80 DOMMatrix rotateSelf(optional unrestricted double rotX = 0,
81 optional unrestricted double rotY,
82 optional unrestricted double rotZ); // Angles are in degrees.
83 DOMMatrix rotateFromVectorSelf(optional unrestricted double x = 0,
84 optional unrestricted double y = 0);
85 DOMMatrix rotateAxisAngleSelf(optional unrestricted double x = 0,
86 optional unrestricted double y = 0,
87 optional unrestricted double z = 0,
88 optional unrestricted double angle = 0); // Angle is in degrees.
89 DOMMatrix skewXSelf(optional unrestricted double sx = 0); // Angle is in degrees.
90 DOMMatrix skewYSelf(optional unrestricted double sy = 0); // Angle is in degrees.
91 DOMMatrix invertSelf();
92
93 [Exposed=Window, ImplementedAs=setMatrixValueForBindings] DOMMatrix setMatrixValue(DOMString transformList);
94};
Note: See TracBrowser for help on using the repository browser.