haikuwebkit/Source/WebCore/page/RemoteDOMWindow.idl

58 lines
2.7 KiB
Plaintext
Raw Permalink Normal View History

Add bindings code for RemoteDOMWindow https://bugs.webkit.org/show_bug.cgi?id=184653 Reviewed by Ryosuke Niwa. Add bindings code for RemoteDOMWindow. A RemoteDOMWindow behaves exactly like a cross-origin DOMWindow, which is backed by a RemoteDOMWindow object instead of a DOMWindow one. Since a RemoteDOMWindow is always cross origin, we do not need cross-origin checks and the bindings code is identical to the DOMWindow code paths from cross-origin handling. No new tests, this code will be used and tested via Bug 184515. * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/JSDOMWindowCustom.cpp: (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): (WebCore::JSDOMWindow::getOwnPropertySlot): (WebCore::JSDOMWindow::getOwnPropertySlotByIndex): (WebCore::addCrossOriginWindowOwnPropertyNames): * bindings/js/JSDOMWindowCustom.h: * bindings/js/JSRemoteDOMWindowBase.cpp: Added. (WebCore::JSRemoteDOMWindowBase::JSRemoteDOMWindowBase): (WebCore::JSRemoteDOMWindowBase::destroy): (WebCore::JSRemoteDOMWindowBase::javaScriptRuntimeFlags): (WebCore::toJS): (WebCore::toJSRemoteDOMWindow): * bindings/js/JSRemoteDOMWindowBase.h: Added. JSRemoteDOMWindow unfortunately currently needs to be a global object because of: 1. a JSProxy's target needs to be a JSGlobalObject currently 2. The 'structure()->setGlobalObject(vm, &window);' call in JSDOMWindowProxy::setWindow(VM&, JSDOMGlobalObject&) which requires a JSGlobalObject. Ideally, this wouldn't be the case in the future but this would require some code refactoring. Our DOM global objects normally subclass JSDOMGlobalObject so I decided to subclass JSDOMGlobalObject, which brings some things our bindings code expect. However, subclassing JSDOMGlobalObject directly is problematic because it does not hold the m_wrapped implementation pointer. To address this issue, all our our DOM global objects have a JS*Base base class which subclasses JSDOMGlobalObject and stores the m_wrapped implementation pointer. I followed the same pattern here. (WebCore::toJS): * bindings/js/JSRemoteDOMWindowCustom.cpp: Added. (WebCore::JSRemoteDOMWindow::getOwnPropertySlot): (WebCore::JSRemoteDOMWindow::getOwnPropertySlotByIndex): (WebCore::JSRemoteDOMWindow::put): (WebCore::JSRemoteDOMWindow::putByIndex): (WebCore::JSRemoteDOMWindow::deleteProperty): (WebCore::JSRemoteDOMWindow::deletePropertyByIndex): (WebCore::JSRemoteDOMWindow::getOwnPropertyNames): (WebCore::JSRemoteDOMWindow::defineOwnProperty): (WebCore::JSRemoteDOMWindow::getPrototype): (WebCore::JSRemoteDOMWindow::preventExtensions): (WebCore::JSRemoteDOMWindow::toStringName): * bindings/scripts/CodeGeneratorJS.pm: (IsDOMGlobalObject): (GenerateHeader): (GenerateOverloadDispatcher): (GenerateImplementation): * page/RemoteDOMWindow.idl: Added. Canonical link: https://commits.webkit.org/200204@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-17 16:59:34 +00:00
/*
* Copyright (C) 2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
[
CustomDefineOwnProperty,
CustomDeleteProperty,
CustomGetOwnPropertyNames,
CustomGetOwnPropertySlot,
CustomGetPrototype,
CustomPreventExtensions,
CustomPut,
InterfaceName=Window,
IsImmutablePrototypeExoticObject,
IsImmutablePrototypeExoticObjectOnPrototype,
JSCustomToNativeObject,
JSLegacyParent=JSRemoteDOMWindowBase,
LegacyUnenumerableNamedProperties,
[WebIDL] Realign our IDL extended attribute names with those specified in WebIDL https://bugs.webkit.org/show_bug.cgi?id=216194 Reviewed by Darin Adler. Source/WebCore: Over time, the WebIDL and HTML specifications have added / renamed extended attributes and we have not stayed up to date. This updates the names everywhere and URLs in IDLAttributes.json. [AllowShared] -> new, marked as unsupported [HTMLConstructor] - > new, marked as unsupported [LegacyLenientSetter] -> renamed from [LenientSetter], still unsupported [LegacyLenientThis] -> renamed from [LenientThis] [LegacyNamespace] -> new, marked as unsupported [LegacyNoInterfaceObject] -> renamed from [NoInterfaceObject] [LegacyNullToEmptyString] -> renamed from [TreatNullAs=EmptyString] [LegacyOverrideBuiltIns] -> renamed from OverrideBuiltins [LegacyTreatNonObjectAsNull] -> renamed from [TreatNonObjectAsNull], still unsupported [LegacyUnforgeable] -> renamed from [Unforgeable] [Serializable] -> new, marked as unsupported [Transferable] -> new, marked as unsupported * Modules/applepay/ApplePayCancelEvent.idl: * Modules/applepay/ApplePayPaymentAuthorizedEvent.idl: * Modules/applepay/ApplePayPaymentMethodSelectedEvent.idl: * Modules/applepay/ApplePayShippingContactSelectedEvent.idl: * Modules/applepay/ApplePayShippingMethodSelectedEvent.idl: * Modules/applepay/ApplePayValidateMerchantEvent.idl: * Modules/fetch/FetchBody.idl: * Modules/mediacontrols/MediaControlsHost.idl: * Modules/mediasource/VideoPlaybackQuality.idl: * Modules/mediastream/RTCPeerConnection.idl: * Modules/plugins/QuickTimePluginReplacement.idl: * Modules/quota/StorageInfo.idl: * Modules/quota/StorageQuota.idl: * Modules/speech/SpeechSynthesis.idl: * Modules/speech/SpeechSynthesisVoice.idl: * Modules/streams/ReadableStreamSink.idl: * Modules/streams/ReadableStreamSource.idl: * Modules/webaudio/WebKitAudioBufferSourceNode.idl: * Modules/webaudio/WebKitAudioListener.idl: * Modules/webaudio/WebKitDynamicsCompressorNode.idl: * Modules/webaudio/WebKitOscillatorNode.idl: * Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb: * accessibility/AccessibilityRole.idl: * accessibility/AriaAttributes.idl: * animation/Animatable.idl: * bindings/IDLTypes.h: * bindings/js/DOMWrapperWorld.h: (WebCore::DOMWrapperWorld::disableLegacyOverrideBuiltInsBehavior): (WebCore::DOMWrapperWorld::shouldDisableLegacyOverrideBuiltInsBehavior const): (WebCore::DOMWrapperWorld::disableOverrideBuiltinsBehavior): Deleted. (WebCore::DOMWrapperWorld::shouldDisableOverrideBuiltinsBehavior const): Deleted. * bindings/js/JSDOMAbstractOperations.h: (WebCore::isVisibleNamedProperty): (WebCore::accessVisibleNamedProperty): * bindings/js/JSDOMConvertNullable.h: * bindings/js/JSDOMConvertStrings.h: (WebCore::Converter<IDLTreatNullAsEmptyAdaptor<T>>::convert): Deleted. (WebCore::JSConverter<IDLTreatNullAsEmptyAdaptor<T>>::convert): Deleted. * bindings/scripts/CodeGeneratorJS.pm: (GenerateGetOwnPropertySlot): (GenerateGetOwnPropertySlotByIndex): (GeneratePut): (GeneratePutByIndex): (GenerateIsLegacyUnforgeablePropertyName): (GenerateDefineOwnProperty): (GenerateDeletePropertyCommon): (AttributeShouldBeOnInstance): (OperationShouldBeOnInstance): (IsAcceleratedDOMAttribute): (GetJSCAttributesForAttribute): (GenerateHeader): (GenerateImplementation): (GenerateAttributeGetterTrampolineDefinition): (GenerateAttributeSetterTrampolineDefinition): (IsAnnotatedType): (GetAnnotatedIDLType): (GenerateConstructorHelperMethods): (NeedsConstructorProperty): (IsLegacyUnforgeable): (ComputeFunctionSpecial): (GenerateIsUnforgeablePropertyName): Deleted. (IsUnforgeable): Deleted. * bindings/scripts/IDLAttributes.json: * bindings/scripts/preprocess-idls.pl: * bindings/scripts/test/BindingTestGlobalConstructors.idl: * bindings/scripts/test/JS/JSTestEventTarget.cpp: * bindings/scripts/test/JS/JSTestGlobalObject.cpp: * bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.cpp: Added. * bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.h: Added. * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.cpp: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.h: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.cpp: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.h: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h: Removed. * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: Removed. * bindings/scripts/test/JS/JSTestOverrideBuiltins.h: Removed. * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestIncludes.idl: * bindings/scripts/test/TestLegacyOverrideBuiltIns.idl: Added. * bindings/scripts/test/TestNamedSetterWithLegacyOverrideBuiltIns.idl: Added. * bindings/scripts/test/TestNamedSetterWithLegacyUnforgeableProperties.idl: Added. * bindings/scripts/test/TestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.idl: Added. * bindings/scripts/test/TestNamedSetterWithOverrideBuiltins.idl: Removed. * bindings/scripts/test/TestNamedSetterWithUnforgableProperties.idl: Removed. * bindings/scripts/test/TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.idl: Removed. * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestOperationBase.idl: * bindings/scripts/test/TestOverrideBuiltins.idl: Removed. * css/CSSStyleDeclaration.idl: * css/CSSUnknownRule.idl: * css/ElementCSSInlineStyle.idl: * css/MediaList.idl: * css/StyleMedia.idl: * dom/CharacterData.idl: * dom/ChildNode.idl: * dom/DOMImplementation.idl: * dom/DOMStringMap.idl: * dom/DeviceOrientationOrMotionEvent.idl: * dom/Document.idl: * dom/DocumentAndElementEventHandlers.idl: * dom/DocumentOrShadowRoot.idl: * dom/Element.idl: * dom/Event.idl: * dom/EventListener.idl: * dom/GlobalEventHandlers.idl: * dom/NavigatorMaxTouchPoints.idl: * dom/NonDocumentTypeChildNode.idl: * dom/NonElementParentNode.idl: * dom/ParentNode.idl: * dom/ShadowRoot.idl: * dom/Slotable.idl: * html/HTMLBodyElement.idl: * html/HTMLDocument.idl: * html/HTMLElement.idl: * html/HTMLFontElement.idl: * html/HTMLFormElement.idl: * html/HTMLFrameElement.idl: * html/HTMLHyperlinkElementUtils.idl: * html/HTMLIFrameElement.idl: * html/HTMLImageElement.idl: * html/HTMLInputElement.idl: * html/HTMLObjectElement.idl: * html/HTMLOrForeignElement.idl: * html/HTMLOutputElement.idl: * html/HTMLTableCellElement.idl: * html/HTMLTableElement.idl: * html/HTMLTableRowElement.idl: * html/HTMLTextAreaElement.idl: * html/canvas/ANGLEInstancedArrays.idl: * html/canvas/CanvasCompositing.idl: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasDrawPath.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasFilters.idl: * html/canvas/CanvasImageData.idl: * html/canvas/CanvasImageSmoothing.idl: * html/canvas/CanvasPath.idl: * html/canvas/CanvasPathDrawingStyles.idl: * html/canvas/CanvasRect.idl: * html/canvas/CanvasShadowStyles.idl: * html/canvas/CanvasState.idl: * html/canvas/CanvasText.idl: * html/canvas/CanvasTextDrawingStyles.idl: * html/canvas/CanvasTransform.idl: * html/canvas/CanvasUserInterface.idl: * html/canvas/EXTBlendMinMax.idl: * html/canvas/EXTColorBufferFloat.idl: * html/canvas/EXTColorBufferHalfFloat.idl: * html/canvas/EXTFragDepth.idl: * html/canvas/EXTShaderTextureLOD.idl: * html/canvas/EXTTextureFilterAnisotropic.idl: * html/canvas/EXTsRGB.idl: * html/canvas/OESElementIndexUint.idl: * html/canvas/OESStandardDerivatives.idl: * html/canvas/OESTextureFloat.idl: * html/canvas/OESTextureFloatLinear.idl: * html/canvas/OESTextureHalfFloat.idl: * html/canvas/OESTextureHalfFloatLinear.idl: * html/canvas/OESVertexArrayObject.idl: * html/canvas/WebGLColorBufferFloat.idl: * html/canvas/WebGLCompressedTextureASTC.idl: * html/canvas/WebGLCompressedTextureATC.idl: * html/canvas/WebGLCompressedTextureETC.idl: * html/canvas/WebGLCompressedTextureETC1.idl: * html/canvas/WebGLCompressedTexturePVRTC.idl: * html/canvas/WebGLCompressedTextureS3TC.idl: * html/canvas/WebGLCompressedTextureS3TCsRGB.idl: * html/canvas/WebGLDebugRendererInfo.idl: * html/canvas/WebGLDebugShaders.idl: * html/canvas/WebGLDepthTexture.idl: * html/canvas/WebGLDrawBuffers.idl: * html/canvas/WebGLLoseContext.idl: * html/canvas/WebGLRenderingContextBase.idl: * html/canvas/WebGLVertexArrayObjectOES.idl: * html/track/TextTrackCueGeneric.idl: * html/track/VTTRegionList.idl: * inspector/CommandLineAPIHost.idl: * inspector/InspectorFrontendHost.idl: * page/DOMWindow.idl: * page/GlobalCrypto.idl: * page/GlobalPerformance.idl: * page/Location.idl: * page/NavigatorID.idl: * page/NavigatorLanguage.idl: * page/NavigatorOnLine.idl: * page/NavigatorPlugins.idl: * page/NavigatorServiceWorker.idl: * page/NavigatorShare.idl: * page/RemoteDOMWindow.idl: * page/WindowEventHandlers.idl: * page/WindowOrWorkerGlobalScope.idl: * svg/SVGFilterPrimitiveStandardAttributes.idl: * svg/SVGFitToViewBox.idl: * svg/SVGTests.idl: * svg/SVGURIReference.idl: * svg/SVGZoomAndPan.idl: * testing/GCObservation.idl: * testing/InternalSettings.idl: * testing/Internals.idl: * testing/InternalsMapLike.idl: * testing/InternalsSetLike.idl: * testing/MallocStatistics.idl: * testing/MemoryInfo.idl: * testing/MockCDMFactory.idl: * testing/MockContentFilterSettings.idl: * testing/MockPageOverlay.idl: * testing/MockPaymentCoordinator.idl: * testing/ServiceWorkerInternals.idl: * testing/TypeConversions.idl: * testing/WebFakeXRDevice.idl: * testing/WebFakeXRInputController.idl: * testing/WebXRTest.idl: * workers/AbstractWorker.idl: * xml/XPathNSResolver.idl: Source/WebKit: * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp: (WebKit::InjectedBundleScriptWorld::disableOverrideBuiltinsBehavior): Update for new name WebCore::DOMWrapperWorld. Canonical link: https://commits.webkit.org/229031@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266662 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-05 17:14:23 +00:00
LegacyNoInterfaceObject,
Global=Window,
[WebIDL] Make Exposed mandatory for IDL interfaces https://bugs.webkit.org/show_bug.cgi?id=217101 Reviewed by Darin Adler. Add [Exposed] to all IDL interfaces that were missing it and enforce its requirement. * bindings/scripts/CodeGeneratorJS.pm: * bindings/scripts/preprocess-idls.pl: Remove default "Window" exposed behavior and require it on all interfaces and callback interfaces with constants that don't specify LegacyNoInterfaceObject. * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl: * Modules/applepay/ApplePayError.idl: * Modules/applepay/ApplePaySession.idl: * Modules/applepay/ApplePaySetup.idl: * Modules/applepay/ApplePaySetupFeature.idl: * Modules/encryptedmedia/MediaKeyEncryptionScheme.idl: * Modules/encryptedmedia/MediaKeyMessageEvent.idl: * Modules/encryptedmedia/MediaKeySession.idl: * Modules/encryptedmedia/MediaKeySessionType.idl: * Modules/encryptedmedia/MediaKeyStatusMap.idl: * Modules/encryptedmedia/MediaKeySystemAccess.idl: * Modules/encryptedmedia/MediaKeys.idl: * Modules/encryptedmedia/MediaKeysRequirement.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeySession.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/gamepad/Gamepad.idl: * Modules/gamepad/GamepadButton.idl: * Modules/gamepad/GamepadEvent.idl: * Modules/geolocation/Geolocation.idl: * Modules/geolocation/GeolocationCoordinates.idl: * Modules/geolocation/GeolocationPosition.idl: * Modules/geolocation/GeolocationPositionError.idl: * Modules/geolocation/PositionOptions.idl: * Modules/highlight/HighlightMap.idl: * Modules/highlight/HighlightRangeGroup.idl: * Modules/mediacapabilities/AudioConfiguration.idl: * Modules/mediacapabilities/MediaCapabilities.idl: * Modules/mediacapabilities/MediaCapabilitiesDecodingInfo.idl: * Modules/mediacapabilities/MediaCapabilitiesEncodingInfo.idl: * Modules/mediacapabilities/MediaCapabilitiesInfo.idl: * Modules/mediacapabilities/MediaDecodingConfiguration.idl: * Modules/mediacapabilities/MediaEncodingConfiguration.idl: * Modules/mediacapabilities/VideoConfiguration.idl: * Modules/mediasource/MediaSource.idl: * Modules/mediasource/SourceBuffer.idl: * Modules/mediasource/SourceBufferList.idl: * Modules/mediastream/CanvasCaptureMediaStreamTrack.idl: * Modules/mediastream/MediaDeviceInfo.idl: * Modules/mediastream/MediaDevices.idl: * Modules/mediastream/MediaStream.idl: * Modules/mediastream/MediaStreamTrack.idl: * Modules/mediastream/MediaStreamTrackEvent.idl: * Modules/mediastream/OverconstrainedError.idl: * Modules/mediastream/OverconstrainedErrorEvent.idl: * Modules/mediastream/RTCCertificate.idl: * Modules/mediastream/RTCConfiguration.idl: * Modules/mediastream/RTCDTMFSender.idl: * Modules/mediastream/RTCDTMFToneChangeEvent.idl: * Modules/mediastream/RTCDataChannel.idl: * Modules/mediastream/RTCDataChannelEvent.idl: * Modules/mediastream/RTCIceCandidate.idl: * Modules/mediastream/RTCIceTransport.idl: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCPeerConnectionIceEvent.idl: * Modules/mediastream/RTCRtpReceiver.idl: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/RTCRtpTransceiver.idl: * Modules/mediastream/RTCSessionDescription.idl: * Modules/mediastream/RTCStatsReport.idl: * Modules/mediastream/RTCTrackEvent.idl: * Modules/notifications/Notification.idl: * Modules/paymentrequest/PaymentRequest.idl: * Modules/remoteplayback/RemotePlayback.idl: * Modules/speech/SpeechSynthesis.idl: * Modules/speech/SpeechSynthesisEvent.idl: * Modules/speech/SpeechSynthesisUtterance.idl: * Modules/speech/SpeechSynthesisVoice.idl: * Modules/webaudio/AnalyserNode.idl: * Modules/webaudio/AudioBuffer.idl: * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/AudioContext.idl: * Modules/webaudio/AudioDestinationNode.idl: * Modules/webaudio/AudioListener.idl: * Modules/webaudio/AudioNode.idl: * Modules/webaudio/AudioParam.idl: * Modules/webaudio/AudioParamMap.idl: * Modules/webaudio/AudioProcessingEvent.idl: * Modules/webaudio/AudioScheduledSourceNode.idl: * Modules/webaudio/BaseAudioContext.idl: * Modules/webaudio/BiquadFilterNode.idl: * Modules/webaudio/ChannelMergerNode.idl: * Modules/webaudio/ChannelSplitterNode.idl: * Modules/webaudio/ConstantSourceNode.idl: * Modules/webaudio/ConvolverNode.idl: * Modules/webaudio/DelayNode.idl: * Modules/webaudio/DynamicsCompressorNode.idl: * Modules/webaudio/GainNode.idl: * Modules/webaudio/IIRFilterNode.idl: * Modules/webaudio/MediaElementAudioSourceNode.idl: * Modules/webaudio/MediaStreamAudioDestinationNode.idl: * Modules/webaudio/MediaStreamAudioSourceNode.idl: * Modules/webaudio/OfflineAudioCompletionEvent.idl: * Modules/webaudio/OfflineAudioContext.idl: * Modules/webaudio/OscillatorNode.idl: * Modules/webaudio/PannerNode.idl: * Modules/webaudio/PeriodicWave.idl: * Modules/webaudio/ScriptProcessorNode.idl: * Modules/webaudio/StereoPannerNode.idl: * Modules/webaudio/WaveShaperNode.idl: * Modules/webaudio/WebKitAudioContext.idl: * Modules/webaudio/WebKitAudioPannerNode.idl: * Modules/webaudio/WebKitOfflineAudioContext.idl: * Modules/webdatabase/Database.idl: * Modules/webdatabase/SQLError.idl: * Modules/webdatabase/SQLResultSet.idl: * Modules/webdatabase/SQLResultSetRowList.idl: * Modules/webdatabase/SQLTransaction.idl: * Modules/webgpu/GPUBufferUsage.idl: * Modules/webgpu/GPUCanvasContext.idl: * Modules/webgpu/GPUColorWrite.idl: * Modules/webgpu/GPUOutOfMemoryError.idl: * Modules/webgpu/GPUShaderStage.idl: * Modules/webgpu/GPUTextureUsage.idl: * Modules/webgpu/GPUValidationError.idl: * Modules/webgpu/Navigator+GPU.idl: * Modules/webgpu/WebGPU.idl: * Modules/webgpu/WebGPUAdapter.idl: * Modules/webgpu/WebGPUBindGroup.idl: * Modules/webgpu/WebGPUBindGroupLayout.idl: * Modules/webgpu/WebGPUBuffer.idl: * Modules/webgpu/WebGPUCommandBuffer.idl: * Modules/webgpu/WebGPUCommandEncoder.idl: * Modules/webgpu/WebGPUComputePassEncoder.idl: * Modules/webgpu/WebGPUComputePipeline.idl: * Modules/webgpu/WebGPUDevice.idl: * Modules/webgpu/WebGPUPipelineLayout.idl: * Modules/webgpu/WebGPUProgrammablePassEncoder.idl: * Modules/webgpu/WebGPUQueue.idl: * Modules/webgpu/WebGPURenderPassEncoder.idl: * Modules/webgpu/WebGPURenderPipeline.idl: * Modules/webgpu/WebGPUSampler.idl: * Modules/webgpu/WebGPUShaderModule.idl: * Modules/webgpu/WebGPUSwapChain.idl: * Modules/webgpu/WebGPUTexture.idl: * Modules/webgpu/WebGPUTextureView.idl: * Modules/webxr/XRInputSourceEvent.idl: * Modules/webxr/XRInputSourcesChangeEvent.idl: * Modules/webxr/XRReferenceSpaceEvent.idl: * Modules/webxr/XRSessionEvent.idl: * WebCore.xcodeproj/project.pbxproj: * animation/AnimationPlaybackEvent.idl: * animation/AnimationTimeline.idl: * animation/DocumentTimeline.idl: * animation/WebAnimation.idl: * css/CSSConditionRule.idl: * css/CSSFontFaceRule.idl: * css/CSSGroupingRule.idl: * css/CSSImportRule.idl: * css/CSSKeyframeRule.idl: * css/CSSKeyframesRule.idl: * css/CSSMediaRule.idl: * css/CSSNamespaceRule.idl: * css/CSSPageRule.idl: * css/CSSRuleList.idl: * css/CSSStyleDeclaration.idl: * css/CSSStyleRule.idl: * css/CSSStyleSheet.idl: * css/CSSSupportsRule.idl: * css/DOMCSSNamespace.idl: * css/DeprecatedCSSOMCounter.idl: * css/DeprecatedCSSOMPrimitiveValue.idl: * css/DeprecatedCSSOMRGBColor.idl: * css/DeprecatedCSSOMRect.idl: * css/DeprecatedCSSOMValue.idl: * css/DeprecatedCSSOMValueList.idl: * css/FontFace.idl: * css/FontFaceSet.idl: * css/MediaQueryListEvent.idl: * css/typedom/StylePropertyMap.idl: * dom/AbortAlgorithm.idl: * dom/AnimationEvent.idl: * dom/Attr.idl: * dom/BeforeLoadEvent.idl: * dom/BeforeUnloadEvent.idl: * dom/CDATASection.idl: * dom/CharacterData.idl: * dom/ClipboardEvent.idl: * dom/Comment.idl: * dom/CompositionEvent.idl: * dom/CustomElementRegistry.idl: * dom/DOMImplementation.idl: * dom/DOMRectList.idl: * dom/DOMStringList.idl: * dom/DOMStringMap.idl: * dom/DataTransfer.idl: * dom/DataTransferItem.idl: * dom/DataTransferItemList.idl: * dom/DeviceMotionEvent.idl: * dom/DeviceOrientationEvent.idl: * dom/Document.idl: * dom/DocumentFragment.idl: * dom/DocumentType.idl: * dom/DragEvent.idl: * dom/Element.idl: * dom/FocusEvent.idl: * dom/HashChangeEvent.idl: * dom/IdleDeadline.idl: * dom/InputEvent.idl: * dom/KeyboardEvent.idl: * dom/MouseEvent.idl: * dom/MutationEvent.idl: * dom/MutationObserver.idl: * dom/MutationRecord.idl: * dom/NamedNodeMap.idl: * dom/Node.idl: * dom/NodeFilter.idl: * dom/NodeIterator.idl: * dom/NodeList.idl: * dom/OverflowEvent.idl: * dom/PageTransitionEvent.idl: * dom/PopStateEvent.idl: * dom/ProcessingInstruction.idl: * dom/Range.idl: * dom/SecurityPolicyViolationEvent.idl: * dom/ShadowRoot.idl: * dom/StaticRange.idl: * dom/Text.idl: * dom/TextEvent.idl: * dom/Touch.idl: * dom/TouchEvent.idl: * dom/TouchList.idl: * dom/TransitionEvent.idl: * dom/TreeWalker.idl: * dom/UIEvent.idl: * dom/WebKitAnimationEvent.idl: * dom/WebKitTransitionEvent.idl: * dom/WheelEvent.idl: * dom/XMLDocument.idl: * html/DOMTokenList.idl: * html/HTMLAllCollection.idl: * html/HTMLAnchorElement.idl: * html/HTMLAppletElement.idl: * html/HTMLAreaElement.idl: * html/HTMLAttachmentElement.idl: * html/HTMLAudioElement.idl: * html/HTMLBRElement.idl: * html/HTMLBaseElement.idl: * html/HTMLBodyElement.idl: * html/HTMLButtonElement.idl: * html/HTMLCanvasElement.idl: * html/HTMLCollection.idl: * html/HTMLDListElement.idl: * html/HTMLDataElement.idl: * html/HTMLDataListElement.idl: * html/HTMLDetailsElement.idl: * html/HTMLDirectoryElement.idl: * html/HTMLDivElement.idl: * html/HTMLDocument.idl: * html/HTMLElement.idl: * html/HTMLEmbedElement.idl: * html/HTMLFieldSetElement.idl: * html/HTMLFontElement.idl: * html/HTMLFormControlsCollection.idl: * html/HTMLFormElement.idl: * html/HTMLFrameElement.idl: * html/HTMLFrameSetElement.idl: * html/HTMLHRElement.idl: * html/HTMLHeadElement.idl: * html/HTMLHeadingElement.idl: * html/HTMLHtmlElement.idl: * html/HTMLIFrameElement.idl: * html/HTMLImageElement.idl: * html/HTMLInputElement.idl: * html/HTMLKeygenElement.idl: * html/HTMLLIElement.idl: * html/HTMLLabelElement.idl: * html/HTMLLegendElement.idl: * html/HTMLLinkElement.idl: * html/HTMLMapElement.idl: * html/HTMLMarqueeElement.idl: * html/HTMLMediaElement.idl: * html/HTMLMenuElement.idl: * html/HTMLMenuItemElement.idl: * html/HTMLMetaElement.idl: * html/HTMLMeterElement.idl: * html/HTMLModElement.idl: * html/HTMLOListElement.idl: * html/HTMLObjectElement.idl: * html/HTMLOptGroupElement.idl: * html/HTMLOptionElement.idl: * html/HTMLOptionsCollection.idl: * html/HTMLOutputElement.idl: * html/HTMLParagraphElement.idl: * html/HTMLParamElement.idl: * html/HTMLPictureElement.idl: * html/HTMLPreElement.idl: * html/HTMLProgressElement.idl: * html/HTMLQuoteElement.idl: * html/HTMLScriptElement.idl: * html/HTMLSelectElement.idl: * html/HTMLSlotElement.idl: * html/HTMLSourceElement.idl: * html/HTMLSpanElement.idl: * html/HTMLStyleElement.idl: * html/HTMLTableCaptionElement.idl: * html/HTMLTableCellElement.idl: * html/HTMLTableColElement.idl: * html/HTMLTableElement.idl: * html/HTMLTableRowElement.idl: * html/HTMLTableSectionElement.idl: * html/HTMLTemplateElement.idl: * html/HTMLTextAreaElement.idl: * html/HTMLTimeElement.idl: * html/HTMLTitleElement.idl: * html/HTMLTrackElement.idl: * html/HTMLUListElement.idl: * html/HTMLUnknownElement.idl: * html/HTMLVideoElement.idl: * html/MediaController.idl: * html/MediaEncryptedEvent.idl: * html/MediaError.idl: * html/RadioNodeList.idl: * html/TimeRanges.idl: * html/ValidityState.idl: * html/WebKitMediaKeyError.idl: * html/canvas/CanvasCompositing.idl: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasDrawPath.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasFilters.idl: * html/canvas/CanvasImageData.idl: * html/canvas/CanvasImageSmoothing.idl: * html/canvas/CanvasPath.idl: * html/canvas/CanvasPathDrawingStyles.idl: * html/canvas/CanvasRect.idl: * html/canvas/CanvasRenderingContext2D.idl: * html/canvas/CanvasShadowStyles.idl: * html/canvas/CanvasState.idl: * html/canvas/CanvasText.idl: * html/canvas/CanvasTextDrawingStyles.idl: * html/canvas/CanvasTransform.idl: * html/canvas/CanvasUserInterface.idl: * html/canvas/PaintRenderingContext2D.idl: * html/canvas/WebGLActiveInfo.idl: * html/canvas/WebGLBuffer.idl: * html/canvas/WebGLContextEvent.idl: * html/canvas/WebGLFramebuffer.idl: * html/canvas/WebGLProgram.idl: * html/canvas/WebGLQuery.idl: * html/canvas/WebGLRenderbuffer.idl: * html/canvas/WebGLSampler.idl: * html/canvas/WebGLShader.idl: * html/canvas/WebGLShaderPrecisionFormat.idl: * html/canvas/WebGLSync.idl: * html/canvas/WebGLTexture.idl: * html/canvas/WebGLTransformFeedback.idl: * html/canvas/WebGLUniformLocation.idl: * html/canvas/WebGLVertexArrayObject.idl: * html/track/AudioTrack.idl: * html/track/AudioTrackList.idl: * html/track/DataCue.idl: * html/track/TextTrack.idl: * html/track/TextTrackCue.idl: * html/track/TextTrackCueGeneric.idl: * html/track/TextTrackCueList.idl: * html/track/TextTrackList.idl: * html/track/TrackEvent.idl: * html/track/VTTCue.idl: * html/track/VTTRegion.idl: * html/track/VTTRegionList.idl: * html/track/VideoTrack.idl: * html/track/VideoTrackList.idl: * loader/appcache/DOMApplicationCache.idl: * mathml/MathMLElement.idl: * mathml/MathMLMathElement.idl: * page/BarProp.idl: * page/Crypto.idl: * page/DOMSelection.idl: * page/DOMWindow.idl: * page/GlobalCrypto.idl: * page/GlobalPerformance.idl: * page/History.idl: * page/IntersectionObserver.idl: * page/IntersectionObserverEntry.idl: * page/Location.idl: * page/Navigator+IsLoggedIn.idl: * page/Navigator.idl: * page/PerformanceNavigation.idl: * page/PerformancePaintTiming.idl: * page/PerformanceTiming.idl: * page/RemoteDOMWindow.idl: * page/ResizeObserver.idl: * page/ResizeObserverEntry.idl: * page/Screen.idl: * page/UndoItem.idl: * page/UndoManager.idl: * page/UserMessageHandler.idl: * page/UserMessageHandlersNamespace.idl: * page/VisualViewport.idl: * page/WebKitNamespace.idl: * page/WebKitPoint.idl: * plugins/DOMMimeType.idl: * plugins/DOMMimeTypeArray.idl: * plugins/DOMPlugin.idl: * plugins/DOMPluginArray.idl: * storage/Storage.idl: * storage/StorageEvent.idl: * svg/SVGAElement.idl: * svg/SVGAltGlyphDefElement.idl: * svg/SVGAltGlyphElement.idl: * svg/SVGAltGlyphItemElement.idl: * svg/SVGAngle.idl: * svg/SVGAnimateColorElement.idl: * svg/SVGAnimateElement.idl: * svg/SVGAnimateMotionElement.idl: * svg/SVGAnimateTransformElement.idl: * svg/SVGAnimatedAngle.idl: * svg/SVGAnimatedBoolean.idl: * svg/SVGAnimatedEnumeration.idl: * svg/SVGAnimatedInteger.idl: * svg/SVGAnimatedLength.idl: * svg/SVGAnimatedLengthList.idl: * svg/SVGAnimatedNumber.idl: * svg/SVGAnimatedNumberList.idl: * svg/SVGAnimatedPreserveAspectRatio.idl: * svg/SVGAnimatedRect.idl: * svg/SVGAnimatedString.idl: * svg/SVGAnimatedTransformList.idl: * svg/SVGAnimationElement.idl: * svg/SVGCircleElement.idl: * svg/SVGClipPathElement.idl: * svg/SVGComponentTransferFunctionElement.idl: * svg/SVGCursorElement.idl: * svg/SVGDefsElement.idl: * svg/SVGDescElement.idl: * svg/SVGElement.idl: * svg/SVGEllipseElement.idl: * svg/SVGFEBlendElement.idl: * svg/SVGFEColorMatrixElement.idl: * svg/SVGFEComponentTransferElement.idl: * svg/SVGFECompositeElement.idl: * svg/SVGFEConvolveMatrixElement.idl: * svg/SVGFEDiffuseLightingElement.idl: * svg/SVGFEDisplacementMapElement.idl: * svg/SVGFEDistantLightElement.idl: * svg/SVGFEDropShadowElement.idl: * svg/SVGFEFloodElement.idl: * svg/SVGFEFuncAElement.idl: * svg/SVGFEFuncBElement.idl: * svg/SVGFEFuncGElement.idl: * svg/SVGFEFuncRElement.idl: * svg/SVGFEGaussianBlurElement.idl: * svg/SVGFEImageElement.idl: * svg/SVGFEMergeElement.idl: * svg/SVGFEMergeNodeElement.idl: * svg/SVGFEMorphologyElement.idl: * svg/SVGFEOffsetElement.idl: * svg/SVGFEPointLightElement.idl: * svg/SVGFESpecularLightingElement.idl: * svg/SVGFESpotLightElement.idl: * svg/SVGFETileElement.idl: * svg/SVGFETurbulenceElement.idl: * svg/SVGFilterElement.idl: * svg/SVGFontElement.idl: * svg/SVGFontFaceElement.idl: * svg/SVGFontFaceFormatElement.idl: * svg/SVGFontFaceNameElement.idl: * svg/SVGFontFaceSrcElement.idl: * svg/SVGFontFaceUriElement.idl: * svg/SVGForeignObjectElement.idl: * svg/SVGGElement.idl: * svg/SVGGeometryElement.idl: * svg/SVGGlyphElement.idl: * svg/SVGGlyphRefElement.idl: * svg/SVGGradientElement.idl: * svg/SVGGraphicsElement.idl: * svg/SVGHKernElement.idl: * svg/SVGImageElement.idl: * svg/SVGLength.idl: * svg/SVGLengthList.idl: * svg/SVGLineElement.idl: * svg/SVGLinearGradientElement.idl: * svg/SVGMPathElement.idl: * svg/SVGMarkerElement.idl: * svg/SVGMaskElement.idl: * svg/SVGMatrix.idl: * svg/SVGMetadataElement.idl: * svg/SVGMissingGlyphElement.idl: * svg/SVGNumber.idl: * svg/SVGNumberList.idl: * svg/SVGPathElement.idl: * svg/SVGPathSeg.idl: * svg/SVGPathSegArcAbs.idl: * svg/SVGPathSegArcRel.idl: * svg/SVGPathSegClosePath.idl: * svg/SVGPathSegCurvetoCubicAbs.idl: * svg/SVGPathSegCurvetoCubicRel.idl: * svg/SVGPathSegCurvetoCubicSmoothAbs.idl: * svg/SVGPathSegCurvetoCubicSmoothRel.idl: * svg/SVGPathSegCurvetoQuadraticAbs.idl: * svg/SVGPathSegCurvetoQuadraticRel.idl: * svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl: * svg/SVGPathSegCurvetoQuadraticSmoothRel.idl: * svg/SVGPathSegLinetoAbs.idl: * svg/SVGPathSegLinetoHorizontalAbs.idl: * svg/SVGPathSegLinetoHorizontalRel.idl: * svg/SVGPathSegLinetoRel.idl: * svg/SVGPathSegLinetoVerticalAbs.idl: * svg/SVGPathSegLinetoVerticalRel.idl: * svg/SVGPathSegList.idl: * svg/SVGPathSegMovetoAbs.idl: * svg/SVGPathSegMovetoRel.idl: * svg/SVGPatternElement.idl: * svg/SVGPoint.idl: * svg/SVGPointList.idl: * svg/SVGPolygonElement.idl: * svg/SVGPolylineElement.idl: * svg/SVGPreserveAspectRatio.idl: * svg/SVGRadialGradientElement.idl: * svg/SVGRect.idl: * svg/SVGRectElement.idl: * svg/SVGRenderingIntent.idl: * svg/SVGSVGElement.idl: * svg/SVGScriptElement.idl: * svg/SVGSetElement.idl: * svg/SVGStopElement.idl: * svg/SVGStringList.idl: * svg/SVGStyleElement.idl: * svg/SVGSwitchElement.idl: * svg/SVGSymbolElement.idl: * svg/SVGTRefElement.idl: * svg/SVGTSpanElement.idl: * svg/SVGTextContentElement.idl: * svg/SVGTextElement.idl: * svg/SVGTextPathElement.idl: * svg/SVGTextPositioningElement.idl: * svg/SVGTitleElement.idl: * svg/SVGTransform.idl: * svg/SVGTransformList.idl: * svg/SVGUnitTypes.idl: * svg/SVGUseElement.idl: * svg/SVGVKernElement.idl: * svg/SVGViewElement.idl: * svg/SVGViewSpec.idl: * svg/SVGZoomEvent.idl: * workers/Worker.idl: * workers/service/ExtendableEvent.idl: * workers/service/ExtendableEventInit.idl: * workers/service/FetchEvent.idl: * worklets/Worklet.idl: * xml/DOMParser.idl: * xml/XMLHttpRequestProgressEvent.idl: * xml/XMLSerializer.idl: * xml/XPathEvaluator.idl: * xml/XPathExpression.idl: * xml/XPathResult.idl: * xml/XSLTProcessor.idl: Canonical link: https://commits.webkit.org/229932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267813 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-01 00:15:51 +00:00
Exposed=Window
Add bindings code for RemoteDOMWindow https://bugs.webkit.org/show_bug.cgi?id=184653 Reviewed by Ryosuke Niwa. Add bindings code for RemoteDOMWindow. A RemoteDOMWindow behaves exactly like a cross-origin DOMWindow, which is backed by a RemoteDOMWindow object instead of a DOMWindow one. Since a RemoteDOMWindow is always cross origin, we do not need cross-origin checks and the bindings code is identical to the DOMWindow code paths from cross-origin handling. No new tests, this code will be used and tested via Bug 184515. * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/JSDOMWindowCustom.cpp: (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): (WebCore::JSDOMWindow::getOwnPropertySlot): (WebCore::JSDOMWindow::getOwnPropertySlotByIndex): (WebCore::addCrossOriginWindowOwnPropertyNames): * bindings/js/JSDOMWindowCustom.h: * bindings/js/JSRemoteDOMWindowBase.cpp: Added. (WebCore::JSRemoteDOMWindowBase::JSRemoteDOMWindowBase): (WebCore::JSRemoteDOMWindowBase::destroy): (WebCore::JSRemoteDOMWindowBase::javaScriptRuntimeFlags): (WebCore::toJS): (WebCore::toJSRemoteDOMWindow): * bindings/js/JSRemoteDOMWindowBase.h: Added. JSRemoteDOMWindow unfortunately currently needs to be a global object because of: 1. a JSProxy's target needs to be a JSGlobalObject currently 2. The 'structure()->setGlobalObject(vm, &window);' call in JSDOMWindowProxy::setWindow(VM&, JSDOMGlobalObject&) which requires a JSGlobalObject. Ideally, this wouldn't be the case in the future but this would require some code refactoring. Our DOM global objects normally subclass JSDOMGlobalObject so I decided to subclass JSDOMGlobalObject, which brings some things our bindings code expect. However, subclassing JSDOMGlobalObject directly is problematic because it does not hold the m_wrapped implementation pointer. To address this issue, all our our DOM global objects have a JS*Base base class which subclasses JSDOMGlobalObject and stores the m_wrapped implementation pointer. I followed the same pattern here. (WebCore::toJS): * bindings/js/JSRemoteDOMWindowCustom.cpp: Added. (WebCore::JSRemoteDOMWindow::getOwnPropertySlot): (WebCore::JSRemoteDOMWindow::getOwnPropertySlotByIndex): (WebCore::JSRemoteDOMWindow::put): (WebCore::JSRemoteDOMWindow::putByIndex): (WebCore::JSRemoteDOMWindow::deleteProperty): (WebCore::JSRemoteDOMWindow::deletePropertyByIndex): (WebCore::JSRemoteDOMWindow::getOwnPropertyNames): (WebCore::JSRemoteDOMWindow::defineOwnProperty): (WebCore::JSRemoteDOMWindow::getPrototype): (WebCore::JSRemoteDOMWindow::preventExtensions): (WebCore::JSRemoteDOMWindow::toStringName): * bindings/scripts/CodeGeneratorJS.pm: (IsDOMGlobalObject): (GenerateHeader): (GenerateOverloadDispatcher): (GenerateImplementation): * page/RemoteDOMWindow.idl: Added. Canonical link: https://commits.webkit.org/200204@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-17 16:59:34 +00:00
] interface RemoteDOMWindow {
[WebIDL] Realign our IDL extended attribute names with those specified in WebIDL https://bugs.webkit.org/show_bug.cgi?id=216194 Reviewed by Darin Adler. Source/WebCore: Over time, the WebIDL and HTML specifications have added / renamed extended attributes and we have not stayed up to date. This updates the names everywhere and URLs in IDLAttributes.json. [AllowShared] -> new, marked as unsupported [HTMLConstructor] - > new, marked as unsupported [LegacyLenientSetter] -> renamed from [LenientSetter], still unsupported [LegacyLenientThis] -> renamed from [LenientThis] [LegacyNamespace] -> new, marked as unsupported [LegacyNoInterfaceObject] -> renamed from [NoInterfaceObject] [LegacyNullToEmptyString] -> renamed from [TreatNullAs=EmptyString] [LegacyOverrideBuiltIns] -> renamed from OverrideBuiltins [LegacyTreatNonObjectAsNull] -> renamed from [TreatNonObjectAsNull], still unsupported [LegacyUnforgeable] -> renamed from [Unforgeable] [Serializable] -> new, marked as unsupported [Transferable] -> new, marked as unsupported * Modules/applepay/ApplePayCancelEvent.idl: * Modules/applepay/ApplePayPaymentAuthorizedEvent.idl: * Modules/applepay/ApplePayPaymentMethodSelectedEvent.idl: * Modules/applepay/ApplePayShippingContactSelectedEvent.idl: * Modules/applepay/ApplePayShippingMethodSelectedEvent.idl: * Modules/applepay/ApplePayValidateMerchantEvent.idl: * Modules/fetch/FetchBody.idl: * Modules/mediacontrols/MediaControlsHost.idl: * Modules/mediasource/VideoPlaybackQuality.idl: * Modules/mediastream/RTCPeerConnection.idl: * Modules/plugins/QuickTimePluginReplacement.idl: * Modules/quota/StorageInfo.idl: * Modules/quota/StorageQuota.idl: * Modules/speech/SpeechSynthesis.idl: * Modules/speech/SpeechSynthesisVoice.idl: * Modules/streams/ReadableStreamSink.idl: * Modules/streams/ReadableStreamSource.idl: * Modules/webaudio/WebKitAudioBufferSourceNode.idl: * Modules/webaudio/WebKitAudioListener.idl: * Modules/webaudio/WebKitDynamicsCompressorNode.idl: * Modules/webaudio/WebKitOscillatorNode.idl: * Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb: * accessibility/AccessibilityRole.idl: * accessibility/AriaAttributes.idl: * animation/Animatable.idl: * bindings/IDLTypes.h: * bindings/js/DOMWrapperWorld.h: (WebCore::DOMWrapperWorld::disableLegacyOverrideBuiltInsBehavior): (WebCore::DOMWrapperWorld::shouldDisableLegacyOverrideBuiltInsBehavior const): (WebCore::DOMWrapperWorld::disableOverrideBuiltinsBehavior): Deleted. (WebCore::DOMWrapperWorld::shouldDisableOverrideBuiltinsBehavior const): Deleted. * bindings/js/JSDOMAbstractOperations.h: (WebCore::isVisibleNamedProperty): (WebCore::accessVisibleNamedProperty): * bindings/js/JSDOMConvertNullable.h: * bindings/js/JSDOMConvertStrings.h: (WebCore::Converter<IDLTreatNullAsEmptyAdaptor<T>>::convert): Deleted. (WebCore::JSConverter<IDLTreatNullAsEmptyAdaptor<T>>::convert): Deleted. * bindings/scripts/CodeGeneratorJS.pm: (GenerateGetOwnPropertySlot): (GenerateGetOwnPropertySlotByIndex): (GeneratePut): (GeneratePutByIndex): (GenerateIsLegacyUnforgeablePropertyName): (GenerateDefineOwnProperty): (GenerateDeletePropertyCommon): (AttributeShouldBeOnInstance): (OperationShouldBeOnInstance): (IsAcceleratedDOMAttribute): (GetJSCAttributesForAttribute): (GenerateHeader): (GenerateImplementation): (GenerateAttributeGetterTrampolineDefinition): (GenerateAttributeSetterTrampolineDefinition): (IsAnnotatedType): (GetAnnotatedIDLType): (GenerateConstructorHelperMethods): (NeedsConstructorProperty): (IsLegacyUnforgeable): (ComputeFunctionSpecial): (GenerateIsUnforgeablePropertyName): Deleted. (IsUnforgeable): Deleted. * bindings/scripts/IDLAttributes.json: * bindings/scripts/preprocess-idls.pl: * bindings/scripts/test/BindingTestGlobalConstructors.idl: * bindings/scripts/test/JS/JSTestEventTarget.cpp: * bindings/scripts/test/JS/JSTestGlobalObject.cpp: * bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.cpp: Added. * bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.h: Added. * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.cpp: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.h: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.cpp: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.h: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h: Removed. * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: Removed. * bindings/scripts/test/JS/JSTestOverrideBuiltins.h: Removed. * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestIncludes.idl: * bindings/scripts/test/TestLegacyOverrideBuiltIns.idl: Added. * bindings/scripts/test/TestNamedSetterWithLegacyOverrideBuiltIns.idl: Added. * bindings/scripts/test/TestNamedSetterWithLegacyUnforgeableProperties.idl: Added. * bindings/scripts/test/TestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.idl: Added. * bindings/scripts/test/TestNamedSetterWithOverrideBuiltins.idl: Removed. * bindings/scripts/test/TestNamedSetterWithUnforgableProperties.idl: Removed. * bindings/scripts/test/TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.idl: Removed. * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestOperationBase.idl: * bindings/scripts/test/TestOverrideBuiltins.idl: Removed. * css/CSSStyleDeclaration.idl: * css/CSSUnknownRule.idl: * css/ElementCSSInlineStyle.idl: * css/MediaList.idl: * css/StyleMedia.idl: * dom/CharacterData.idl: * dom/ChildNode.idl: * dom/DOMImplementation.idl: * dom/DOMStringMap.idl: * dom/DeviceOrientationOrMotionEvent.idl: * dom/Document.idl: * dom/DocumentAndElementEventHandlers.idl: * dom/DocumentOrShadowRoot.idl: * dom/Element.idl: * dom/Event.idl: * dom/EventListener.idl: * dom/GlobalEventHandlers.idl: * dom/NavigatorMaxTouchPoints.idl: * dom/NonDocumentTypeChildNode.idl: * dom/NonElementParentNode.idl: * dom/ParentNode.idl: * dom/ShadowRoot.idl: * dom/Slotable.idl: * html/HTMLBodyElement.idl: * html/HTMLDocument.idl: * html/HTMLElement.idl: * html/HTMLFontElement.idl: * html/HTMLFormElement.idl: * html/HTMLFrameElement.idl: * html/HTMLHyperlinkElementUtils.idl: * html/HTMLIFrameElement.idl: * html/HTMLImageElement.idl: * html/HTMLInputElement.idl: * html/HTMLObjectElement.idl: * html/HTMLOrForeignElement.idl: * html/HTMLOutputElement.idl: * html/HTMLTableCellElement.idl: * html/HTMLTableElement.idl: * html/HTMLTableRowElement.idl: * html/HTMLTextAreaElement.idl: * html/canvas/ANGLEInstancedArrays.idl: * html/canvas/CanvasCompositing.idl: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasDrawPath.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasFilters.idl: * html/canvas/CanvasImageData.idl: * html/canvas/CanvasImageSmoothing.idl: * html/canvas/CanvasPath.idl: * html/canvas/CanvasPathDrawingStyles.idl: * html/canvas/CanvasRect.idl: * html/canvas/CanvasShadowStyles.idl: * html/canvas/CanvasState.idl: * html/canvas/CanvasText.idl: * html/canvas/CanvasTextDrawingStyles.idl: * html/canvas/CanvasTransform.idl: * html/canvas/CanvasUserInterface.idl: * html/canvas/EXTBlendMinMax.idl: * html/canvas/EXTColorBufferFloat.idl: * html/canvas/EXTColorBufferHalfFloat.idl: * html/canvas/EXTFragDepth.idl: * html/canvas/EXTShaderTextureLOD.idl: * html/canvas/EXTTextureFilterAnisotropic.idl: * html/canvas/EXTsRGB.idl: * html/canvas/OESElementIndexUint.idl: * html/canvas/OESStandardDerivatives.idl: * html/canvas/OESTextureFloat.idl: * html/canvas/OESTextureFloatLinear.idl: * html/canvas/OESTextureHalfFloat.idl: * html/canvas/OESTextureHalfFloatLinear.idl: * html/canvas/OESVertexArrayObject.idl: * html/canvas/WebGLColorBufferFloat.idl: * html/canvas/WebGLCompressedTextureASTC.idl: * html/canvas/WebGLCompressedTextureATC.idl: * html/canvas/WebGLCompressedTextureETC.idl: * html/canvas/WebGLCompressedTextureETC1.idl: * html/canvas/WebGLCompressedTexturePVRTC.idl: * html/canvas/WebGLCompressedTextureS3TC.idl: * html/canvas/WebGLCompressedTextureS3TCsRGB.idl: * html/canvas/WebGLDebugRendererInfo.idl: * html/canvas/WebGLDebugShaders.idl: * html/canvas/WebGLDepthTexture.idl: * html/canvas/WebGLDrawBuffers.idl: * html/canvas/WebGLLoseContext.idl: * html/canvas/WebGLRenderingContextBase.idl: * html/canvas/WebGLVertexArrayObjectOES.idl: * html/track/TextTrackCueGeneric.idl: * html/track/VTTRegionList.idl: * inspector/CommandLineAPIHost.idl: * inspector/InspectorFrontendHost.idl: * page/DOMWindow.idl: * page/GlobalCrypto.idl: * page/GlobalPerformance.idl: * page/Location.idl: * page/NavigatorID.idl: * page/NavigatorLanguage.idl: * page/NavigatorOnLine.idl: * page/NavigatorPlugins.idl: * page/NavigatorServiceWorker.idl: * page/NavigatorShare.idl: * page/RemoteDOMWindow.idl: * page/WindowEventHandlers.idl: * page/WindowOrWorkerGlobalScope.idl: * svg/SVGFilterPrimitiveStandardAttributes.idl: * svg/SVGFitToViewBox.idl: * svg/SVGTests.idl: * svg/SVGURIReference.idl: * svg/SVGZoomAndPan.idl: * testing/GCObservation.idl: * testing/InternalSettings.idl: * testing/Internals.idl: * testing/InternalsMapLike.idl: * testing/InternalsSetLike.idl: * testing/MallocStatistics.idl: * testing/MemoryInfo.idl: * testing/MockCDMFactory.idl: * testing/MockContentFilterSettings.idl: * testing/MockPageOverlay.idl: * testing/MockPaymentCoordinator.idl: * testing/ServiceWorkerInternals.idl: * testing/TypeConversions.idl: * testing/WebFakeXRDevice.idl: * testing/WebFakeXRInputController.idl: * testing/WebXRTest.idl: * workers/AbstractWorker.idl: * xml/XPathNSResolver.idl: Source/WebKit: * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp: (WebKit::InjectedBundleScriptWorld::disableOverrideBuiltinsBehavior): Update for new name WebCore::DOMWrapperWorld. Canonical link: https://commits.webkit.org/229031@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266662 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-05 17:14:23 +00:00
[LegacyUnforgeable, ImplementedAs=self] readonly attribute WindowProxy window;
Set RemoteDOMWindow's initial opener https://bugs.webkit.org/show_bug.cgi?id=184716 Reviewed by Sam Weinig. Source/WebCore: Add support for WindowProxy type in the IDL. The implementation should return a WindowProxyController and toJS() will take care of converting this into a JSValue via JSDOMWindowProxy. No new tests, rebaselined existing test. * WebCore.xcodeproj/project.pbxproj: * bindings/IDLTypes.h: * bindings/js/JSDOMConvertWindowProxy.h: Added. (WebCore::JSConverter<IDLWindowProxy>::convert): * bindings/js/JSDOMWindowBase.cpp: (WebCore::toJS): * bindings/js/JSDOMWindowBase.h: (WebCore::toJS): * bindings/js/JSDOMWindowProxy.cpp: (WebCore::toJS): (WebCore::toJSDOMWindowProxy): * bindings/js/JSDOMWindowProxy.h: (WebCore::toJS): (WebCore::toJSDOMWindowProxy): * bindings/js/JSRemoteDOMWindowBase.cpp: * bindings/js/JSRemoteDOMWindowBase.h: * bindings/scripts/CodeGenerator.pm: (IsBuiltinType): * bindings/scripts/CodeGeneratorJS.pm: (AddToIncludesForIDLType): (GetBaseIDLType): * page/RemoteDOMWindow.cpp: (WebCore::RemoteDOMWindow::self const): (WebCore::RemoteDOMWindow::top const): (WebCore::RemoteDOMWindow::opener const): (WebCore::RemoteDOMWindow::parent const): * page/RemoteDOMWindow.h: * page/RemoteDOMWindow.idl: * page/RemoteFrame.h: Source/WebKit: When a frame becomes remote, transfer the frame opener from the old frame to the new remote one. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::frameBecameRemote): LayoutTests: Rebaseline existing test now that remoteWindow.opener now returns its initial opener. * http/tests/navigation/process-swap-window-open-expected.txt: Canonical link: https://commits.webkit.org/200270@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230789 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-18 22:27:20 +00:00
[Replaceable] readonly attribute WindowProxy self;
[WebIDL] Realign our IDL extended attribute names with those specified in WebIDL https://bugs.webkit.org/show_bug.cgi?id=216194 Reviewed by Darin Adler. Source/WebCore: Over time, the WebIDL and HTML specifications have added / renamed extended attributes and we have not stayed up to date. This updates the names everywhere and URLs in IDLAttributes.json. [AllowShared] -> new, marked as unsupported [HTMLConstructor] - > new, marked as unsupported [LegacyLenientSetter] -> renamed from [LenientSetter], still unsupported [LegacyLenientThis] -> renamed from [LenientThis] [LegacyNamespace] -> new, marked as unsupported [LegacyNoInterfaceObject] -> renamed from [NoInterfaceObject] [LegacyNullToEmptyString] -> renamed from [TreatNullAs=EmptyString] [LegacyOverrideBuiltIns] -> renamed from OverrideBuiltins [LegacyTreatNonObjectAsNull] -> renamed from [TreatNonObjectAsNull], still unsupported [LegacyUnforgeable] -> renamed from [Unforgeable] [Serializable] -> new, marked as unsupported [Transferable] -> new, marked as unsupported * Modules/applepay/ApplePayCancelEvent.idl: * Modules/applepay/ApplePayPaymentAuthorizedEvent.idl: * Modules/applepay/ApplePayPaymentMethodSelectedEvent.idl: * Modules/applepay/ApplePayShippingContactSelectedEvent.idl: * Modules/applepay/ApplePayShippingMethodSelectedEvent.idl: * Modules/applepay/ApplePayValidateMerchantEvent.idl: * Modules/fetch/FetchBody.idl: * Modules/mediacontrols/MediaControlsHost.idl: * Modules/mediasource/VideoPlaybackQuality.idl: * Modules/mediastream/RTCPeerConnection.idl: * Modules/plugins/QuickTimePluginReplacement.idl: * Modules/quota/StorageInfo.idl: * Modules/quota/StorageQuota.idl: * Modules/speech/SpeechSynthesis.idl: * Modules/speech/SpeechSynthesisVoice.idl: * Modules/streams/ReadableStreamSink.idl: * Modules/streams/ReadableStreamSource.idl: * Modules/webaudio/WebKitAudioBufferSourceNode.idl: * Modules/webaudio/WebKitAudioListener.idl: * Modules/webaudio/WebKitDynamicsCompressorNode.idl: * Modules/webaudio/WebKitOscillatorNode.idl: * Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb: * accessibility/AccessibilityRole.idl: * accessibility/AriaAttributes.idl: * animation/Animatable.idl: * bindings/IDLTypes.h: * bindings/js/DOMWrapperWorld.h: (WebCore::DOMWrapperWorld::disableLegacyOverrideBuiltInsBehavior): (WebCore::DOMWrapperWorld::shouldDisableLegacyOverrideBuiltInsBehavior const): (WebCore::DOMWrapperWorld::disableOverrideBuiltinsBehavior): Deleted. (WebCore::DOMWrapperWorld::shouldDisableOverrideBuiltinsBehavior const): Deleted. * bindings/js/JSDOMAbstractOperations.h: (WebCore::isVisibleNamedProperty): (WebCore::accessVisibleNamedProperty): * bindings/js/JSDOMConvertNullable.h: * bindings/js/JSDOMConvertStrings.h: (WebCore::Converter<IDLTreatNullAsEmptyAdaptor<T>>::convert): Deleted. (WebCore::JSConverter<IDLTreatNullAsEmptyAdaptor<T>>::convert): Deleted. * bindings/scripts/CodeGeneratorJS.pm: (GenerateGetOwnPropertySlot): (GenerateGetOwnPropertySlotByIndex): (GeneratePut): (GeneratePutByIndex): (GenerateIsLegacyUnforgeablePropertyName): (GenerateDefineOwnProperty): (GenerateDeletePropertyCommon): (AttributeShouldBeOnInstance): (OperationShouldBeOnInstance): (IsAcceleratedDOMAttribute): (GetJSCAttributesForAttribute): (GenerateHeader): (GenerateImplementation): (GenerateAttributeGetterTrampolineDefinition): (GenerateAttributeSetterTrampolineDefinition): (IsAnnotatedType): (GetAnnotatedIDLType): (GenerateConstructorHelperMethods): (NeedsConstructorProperty): (IsLegacyUnforgeable): (ComputeFunctionSpecial): (GenerateIsUnforgeablePropertyName): Deleted. (IsUnforgeable): Deleted. * bindings/scripts/IDLAttributes.json: * bindings/scripts/preprocess-idls.pl: * bindings/scripts/test/BindingTestGlobalConstructors.idl: * bindings/scripts/test/JS/JSTestEventTarget.cpp: * bindings/scripts/test/JS/JSTestGlobalObject.cpp: * bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.cpp: Added. * bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.h: Added. * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.cpp: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.h: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.cpp: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.h: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h: Removed. * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: Removed. * bindings/scripts/test/JS/JSTestOverrideBuiltins.h: Removed. * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestIncludes.idl: * bindings/scripts/test/TestLegacyOverrideBuiltIns.idl: Added. * bindings/scripts/test/TestNamedSetterWithLegacyOverrideBuiltIns.idl: Added. * bindings/scripts/test/TestNamedSetterWithLegacyUnforgeableProperties.idl: Added. * bindings/scripts/test/TestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.idl: Added. * bindings/scripts/test/TestNamedSetterWithOverrideBuiltins.idl: Removed. * bindings/scripts/test/TestNamedSetterWithUnforgableProperties.idl: Removed. * bindings/scripts/test/TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.idl: Removed. * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestOperationBase.idl: * bindings/scripts/test/TestOverrideBuiltins.idl: Removed. * css/CSSStyleDeclaration.idl: * css/CSSUnknownRule.idl: * css/ElementCSSInlineStyle.idl: * css/MediaList.idl: * css/StyleMedia.idl: * dom/CharacterData.idl: * dom/ChildNode.idl: * dom/DOMImplementation.idl: * dom/DOMStringMap.idl: * dom/DeviceOrientationOrMotionEvent.idl: * dom/Document.idl: * dom/DocumentAndElementEventHandlers.idl: * dom/DocumentOrShadowRoot.idl: * dom/Element.idl: * dom/Event.idl: * dom/EventListener.idl: * dom/GlobalEventHandlers.idl: * dom/NavigatorMaxTouchPoints.idl: * dom/NonDocumentTypeChildNode.idl: * dom/NonElementParentNode.idl: * dom/ParentNode.idl: * dom/ShadowRoot.idl: * dom/Slotable.idl: * html/HTMLBodyElement.idl: * html/HTMLDocument.idl: * html/HTMLElement.idl: * html/HTMLFontElement.idl: * html/HTMLFormElement.idl: * html/HTMLFrameElement.idl: * html/HTMLHyperlinkElementUtils.idl: * html/HTMLIFrameElement.idl: * html/HTMLImageElement.idl: * html/HTMLInputElement.idl: * html/HTMLObjectElement.idl: * html/HTMLOrForeignElement.idl: * html/HTMLOutputElement.idl: * html/HTMLTableCellElement.idl: * html/HTMLTableElement.idl: * html/HTMLTableRowElement.idl: * html/HTMLTextAreaElement.idl: * html/canvas/ANGLEInstancedArrays.idl: * html/canvas/CanvasCompositing.idl: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasDrawPath.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasFilters.idl: * html/canvas/CanvasImageData.idl: * html/canvas/CanvasImageSmoothing.idl: * html/canvas/CanvasPath.idl: * html/canvas/CanvasPathDrawingStyles.idl: * html/canvas/CanvasRect.idl: * html/canvas/CanvasShadowStyles.idl: * html/canvas/CanvasState.idl: * html/canvas/CanvasText.idl: * html/canvas/CanvasTextDrawingStyles.idl: * html/canvas/CanvasTransform.idl: * html/canvas/CanvasUserInterface.idl: * html/canvas/EXTBlendMinMax.idl: * html/canvas/EXTColorBufferFloat.idl: * html/canvas/EXTColorBufferHalfFloat.idl: * html/canvas/EXTFragDepth.idl: * html/canvas/EXTShaderTextureLOD.idl: * html/canvas/EXTTextureFilterAnisotropic.idl: * html/canvas/EXTsRGB.idl: * html/canvas/OESElementIndexUint.idl: * html/canvas/OESStandardDerivatives.idl: * html/canvas/OESTextureFloat.idl: * html/canvas/OESTextureFloatLinear.idl: * html/canvas/OESTextureHalfFloat.idl: * html/canvas/OESTextureHalfFloatLinear.idl: * html/canvas/OESVertexArrayObject.idl: * html/canvas/WebGLColorBufferFloat.idl: * html/canvas/WebGLCompressedTextureASTC.idl: * html/canvas/WebGLCompressedTextureATC.idl: * html/canvas/WebGLCompressedTextureETC.idl: * html/canvas/WebGLCompressedTextureETC1.idl: * html/canvas/WebGLCompressedTexturePVRTC.idl: * html/canvas/WebGLCompressedTextureS3TC.idl: * html/canvas/WebGLCompressedTextureS3TCsRGB.idl: * html/canvas/WebGLDebugRendererInfo.idl: * html/canvas/WebGLDebugShaders.idl: * html/canvas/WebGLDepthTexture.idl: * html/canvas/WebGLDrawBuffers.idl: * html/canvas/WebGLLoseContext.idl: * html/canvas/WebGLRenderingContextBase.idl: * html/canvas/WebGLVertexArrayObjectOES.idl: * html/track/TextTrackCueGeneric.idl: * html/track/VTTRegionList.idl: * inspector/CommandLineAPIHost.idl: * inspector/InspectorFrontendHost.idl: * page/DOMWindow.idl: * page/GlobalCrypto.idl: * page/GlobalPerformance.idl: * page/Location.idl: * page/NavigatorID.idl: * page/NavigatorLanguage.idl: * page/NavigatorOnLine.idl: * page/NavigatorPlugins.idl: * page/NavigatorServiceWorker.idl: * page/NavigatorShare.idl: * page/RemoteDOMWindow.idl: * page/WindowEventHandlers.idl: * page/WindowOrWorkerGlobalScope.idl: * svg/SVGFilterPrimitiveStandardAttributes.idl: * svg/SVGFitToViewBox.idl: * svg/SVGTests.idl: * svg/SVGURIReference.idl: * svg/SVGZoomAndPan.idl: * testing/GCObservation.idl: * testing/InternalSettings.idl: * testing/Internals.idl: * testing/InternalsMapLike.idl: * testing/InternalsSetLike.idl: * testing/MallocStatistics.idl: * testing/MemoryInfo.idl: * testing/MockCDMFactory.idl: * testing/MockContentFilterSettings.idl: * testing/MockPageOverlay.idl: * testing/MockPaymentCoordinator.idl: * testing/ServiceWorkerInternals.idl: * testing/TypeConversions.idl: * testing/WebFakeXRDevice.idl: * testing/WebFakeXRInputController.idl: * testing/WebXRTest.idl: * workers/AbstractWorker.idl: * xml/XPathNSResolver.idl: Source/WebKit: * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp: (WebKit::InjectedBundleScriptWorld::disableOverrideBuiltinsBehavior): Update for new name WebCore::DOMWrapperWorld. Canonical link: https://commits.webkit.org/229031@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266662 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-05 17:14:23 +00:00
[PutForwards=href, LegacyUnforgeable] readonly attribute Location? location; // FIXME: Should not be nullable.
Cache cross-origin methods / accessors of Window and Location per lexical global object https://bugs.webkit.org/show_bug.cgi?id=222739 Reviewed by Darin Adler. LayoutTests/imported/w3c: * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-caching-expected.txt: Added. * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-caching.html: Added. * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-common.js: Added. * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-length-expected.txt: Added. * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-length.html: Added. * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-name-expected.txt: Added. * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-name.html: Added. Source/JavaScriptCore: 1. Introduce WeakGCMap::ensureValue() to clean up JSObject::getOwnPropertyDescriptor() and avoid double hashing. It decorates HashMap::ensure() to guarantee non-null return value. 2. Assert early that JSCustom{Getter,Setter}Function is created with non-null function pointer. 3. Rename getCustom{Getter,Setter}Function() to align with newly-added JSDOMGlobalObject methods. * runtime/JSCustomGetterFunction.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): (JSC::JSCustomGetterFunction::create): * runtime/JSCustomSetterFunction.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): (JSC::JSCustomSetterFunction::create): * runtime/JSObject.cpp: (JSC::createCustomGetterFunction): (JSC::createCustomSetterFunction): (JSC::JSObject::getOwnPropertyDescriptor): (JSC::getCustomGetterFunction): Deleted. (JSC::getCustomSetterFunction): Deleted. * runtime/Lookup.h: (JSC::nonCachingStaticFunctionGetterImpl): Deleted. * runtime/WeakGCMap.h: Source/WebCore: For cross-origin methods / accessors, Window and Location objects return different JSFunction instances on every [[Get]]. The intent was to ensure isolation by supplying different Realms with different function objects. However, within the same callee Realm, this makes subsequent lookups of a cross-origin method / accessor fail reference equality test, which is rather confusing: `crossOriginWindow.focus === crossOriginWindow.focus // => false` This patch implements [[CrossOriginPropertyDescriptorMap]], bringing consistent function identity and aligning WebKit with the spec [1], Blink, and Gecko. For convenience, cache maps are added to JSDOMGlobalObject (to accommodate RemoteDOMWindow) and cover both Window and Location objects. As a cache map key, a pair of lexical global object and raw function pointer is used, which guarantees correctness even if Window and Location would expose cross-origin property of the same name. This patch removes 9 custom getters, adds runtime lookup for "showModalDialog" (which is rare), and removes [ForwardDeclareInHeader] extended attribute as it's now unused and non-trivial to generate. Also, fixes cross-realm `postMessage.length` to equal 1 as per WebIDL. [1] https://html.spec.whatwg.org/multipage/browsers.html#crossorigingetownpropertyhelper-(-o,-p-) Tests: imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-caching.html imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-length.html imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-name.html * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::JSDOMGlobalObject): (WebCore::JSDOMGlobalObject::createCrossOriginFunction): (WebCore::JSDOMGlobalObject::createCrossOriginGetterSetter): * bindings/js/JSDOMGlobalObject.h: * bindings/js/JSDOMWindowCustom.cpp: (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): (WebCore::JSDOMWindow::getOwnPropertySlot): * bindings/js/JSLocationCustom.cpp: (WebCore::getOwnPropertySlotCommon): (WebCore::JSC_DEFINE_CUSTOM_GETTER): Deleted. * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GenerateImplementation): * bindings/scripts/IDLAttributes.json: * page/DOMWindow.idl: * page/History.idl: * page/Location.idl: * page/RemoteDOMWindow.idl: LayoutTests: * http/tests/navigation/process-swap-window-open-expected.txt: * http/tests/navigation/process-swap-window-open.html: Canonical link: https://commits.webkit.org/235379@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274528 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-16 23:00:57 +00:00
[CallWith=IncumbentDocument] undefined close();
readonly attribute boolean closed;
[CallWith=IncumbentWindow] undefined focus();
undefined blur();
Set RemoteDOMWindow's initial opener https://bugs.webkit.org/show_bug.cgi?id=184716 Reviewed by Sam Weinig. Source/WebCore: Add support for WindowProxy type in the IDL. The implementation should return a WindowProxyController and toJS() will take care of converting this into a JSValue via JSDOMWindowProxy. No new tests, rebaselined existing test. * WebCore.xcodeproj/project.pbxproj: * bindings/IDLTypes.h: * bindings/js/JSDOMConvertWindowProxy.h: Added. (WebCore::JSConverter<IDLWindowProxy>::convert): * bindings/js/JSDOMWindowBase.cpp: (WebCore::toJS): * bindings/js/JSDOMWindowBase.h: (WebCore::toJS): * bindings/js/JSDOMWindowProxy.cpp: (WebCore::toJS): (WebCore::toJSDOMWindowProxy): * bindings/js/JSDOMWindowProxy.h: (WebCore::toJS): (WebCore::toJSDOMWindowProxy): * bindings/js/JSRemoteDOMWindowBase.cpp: * bindings/js/JSRemoteDOMWindowBase.h: * bindings/scripts/CodeGenerator.pm: (IsBuiltinType): * bindings/scripts/CodeGeneratorJS.pm: (AddToIncludesForIDLType): (GetBaseIDLType): * page/RemoteDOMWindow.cpp: (WebCore::RemoteDOMWindow::self const): (WebCore::RemoteDOMWindow::top const): (WebCore::RemoteDOMWindow::opener const): (WebCore::RemoteDOMWindow::parent const): * page/RemoteDOMWindow.h: * page/RemoteDOMWindow.idl: * page/RemoteFrame.h: Source/WebKit: When a frame becomes remote, transfer the frame opener from the old frame to the new remote one. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::frameBecameRemote): LayoutTests: Rebaseline existing test now that remoteWindow.opener now returns its initial opener. * http/tests/navigation/process-swap-window-open-expected.txt: Canonical link: https://commits.webkit.org/200270@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230789 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-18 22:27:20 +00:00
[Replaceable, ImplementedAs=self] readonly attribute WindowProxy frames;
Add bindings code for RemoteDOMWindow https://bugs.webkit.org/show_bug.cgi?id=184653 Reviewed by Ryosuke Niwa. Add bindings code for RemoteDOMWindow. A RemoteDOMWindow behaves exactly like a cross-origin DOMWindow, which is backed by a RemoteDOMWindow object instead of a DOMWindow one. Since a RemoteDOMWindow is always cross origin, we do not need cross-origin checks and the bindings code is identical to the DOMWindow code paths from cross-origin handling. No new tests, this code will be used and tested via Bug 184515. * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/JSDOMWindowCustom.cpp: (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): (WebCore::JSDOMWindow::getOwnPropertySlot): (WebCore::JSDOMWindow::getOwnPropertySlotByIndex): (WebCore::addCrossOriginWindowOwnPropertyNames): * bindings/js/JSDOMWindowCustom.h: * bindings/js/JSRemoteDOMWindowBase.cpp: Added. (WebCore::JSRemoteDOMWindowBase::JSRemoteDOMWindowBase): (WebCore::JSRemoteDOMWindowBase::destroy): (WebCore::JSRemoteDOMWindowBase::javaScriptRuntimeFlags): (WebCore::toJS): (WebCore::toJSRemoteDOMWindow): * bindings/js/JSRemoteDOMWindowBase.h: Added. JSRemoteDOMWindow unfortunately currently needs to be a global object because of: 1. a JSProxy's target needs to be a JSGlobalObject currently 2. The 'structure()->setGlobalObject(vm, &window);' call in JSDOMWindowProxy::setWindow(VM&, JSDOMGlobalObject&) which requires a JSGlobalObject. Ideally, this wouldn't be the case in the future but this would require some code refactoring. Our DOM global objects normally subclass JSDOMGlobalObject so I decided to subclass JSDOMGlobalObject, which brings some things our bindings code expect. However, subclassing JSDOMGlobalObject directly is problematic because it does not hold the m_wrapped implementation pointer. To address this issue, all our our DOM global objects have a JS*Base base class which subclasses JSDOMGlobalObject and stores the m_wrapped implementation pointer. I followed the same pattern here. (WebCore::toJS): * bindings/js/JSRemoteDOMWindowCustom.cpp: Added. (WebCore::JSRemoteDOMWindow::getOwnPropertySlot): (WebCore::JSRemoteDOMWindow::getOwnPropertySlotByIndex): (WebCore::JSRemoteDOMWindow::put): (WebCore::JSRemoteDOMWindow::putByIndex): (WebCore::JSRemoteDOMWindow::deleteProperty): (WebCore::JSRemoteDOMWindow::deletePropertyByIndex): (WebCore::JSRemoteDOMWindow::getOwnPropertyNames): (WebCore::JSRemoteDOMWindow::defineOwnProperty): (WebCore::JSRemoteDOMWindow::getPrototype): (WebCore::JSRemoteDOMWindow::preventExtensions): (WebCore::JSRemoteDOMWindow::toStringName): * bindings/scripts/CodeGeneratorJS.pm: (IsDOMGlobalObject): (GenerateHeader): (GenerateOverloadDispatcher): (GenerateImplementation): * page/RemoteDOMWindow.idl: Added. Canonical link: https://commits.webkit.org/200204@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-17 16:59:34 +00:00
[Replaceable] readonly attribute unsigned long length;
[WebIDL] Realign our IDL extended attribute names with those specified in WebIDL https://bugs.webkit.org/show_bug.cgi?id=216194 Reviewed by Darin Adler. Source/WebCore: Over time, the WebIDL and HTML specifications have added / renamed extended attributes and we have not stayed up to date. This updates the names everywhere and URLs in IDLAttributes.json. [AllowShared] -> new, marked as unsupported [HTMLConstructor] - > new, marked as unsupported [LegacyLenientSetter] -> renamed from [LenientSetter], still unsupported [LegacyLenientThis] -> renamed from [LenientThis] [LegacyNamespace] -> new, marked as unsupported [LegacyNoInterfaceObject] -> renamed from [NoInterfaceObject] [LegacyNullToEmptyString] -> renamed from [TreatNullAs=EmptyString] [LegacyOverrideBuiltIns] -> renamed from OverrideBuiltins [LegacyTreatNonObjectAsNull] -> renamed from [TreatNonObjectAsNull], still unsupported [LegacyUnforgeable] -> renamed from [Unforgeable] [Serializable] -> new, marked as unsupported [Transferable] -> new, marked as unsupported * Modules/applepay/ApplePayCancelEvent.idl: * Modules/applepay/ApplePayPaymentAuthorizedEvent.idl: * Modules/applepay/ApplePayPaymentMethodSelectedEvent.idl: * Modules/applepay/ApplePayShippingContactSelectedEvent.idl: * Modules/applepay/ApplePayShippingMethodSelectedEvent.idl: * Modules/applepay/ApplePayValidateMerchantEvent.idl: * Modules/fetch/FetchBody.idl: * Modules/mediacontrols/MediaControlsHost.idl: * Modules/mediasource/VideoPlaybackQuality.idl: * Modules/mediastream/RTCPeerConnection.idl: * Modules/plugins/QuickTimePluginReplacement.idl: * Modules/quota/StorageInfo.idl: * Modules/quota/StorageQuota.idl: * Modules/speech/SpeechSynthesis.idl: * Modules/speech/SpeechSynthesisVoice.idl: * Modules/streams/ReadableStreamSink.idl: * Modules/streams/ReadableStreamSource.idl: * Modules/webaudio/WebKitAudioBufferSourceNode.idl: * Modules/webaudio/WebKitAudioListener.idl: * Modules/webaudio/WebKitDynamicsCompressorNode.idl: * Modules/webaudio/WebKitOscillatorNode.idl: * Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb: * accessibility/AccessibilityRole.idl: * accessibility/AriaAttributes.idl: * animation/Animatable.idl: * bindings/IDLTypes.h: * bindings/js/DOMWrapperWorld.h: (WebCore::DOMWrapperWorld::disableLegacyOverrideBuiltInsBehavior): (WebCore::DOMWrapperWorld::shouldDisableLegacyOverrideBuiltInsBehavior const): (WebCore::DOMWrapperWorld::disableOverrideBuiltinsBehavior): Deleted. (WebCore::DOMWrapperWorld::shouldDisableOverrideBuiltinsBehavior const): Deleted. * bindings/js/JSDOMAbstractOperations.h: (WebCore::isVisibleNamedProperty): (WebCore::accessVisibleNamedProperty): * bindings/js/JSDOMConvertNullable.h: * bindings/js/JSDOMConvertStrings.h: (WebCore::Converter<IDLTreatNullAsEmptyAdaptor<T>>::convert): Deleted. (WebCore::JSConverter<IDLTreatNullAsEmptyAdaptor<T>>::convert): Deleted. * bindings/scripts/CodeGeneratorJS.pm: (GenerateGetOwnPropertySlot): (GenerateGetOwnPropertySlotByIndex): (GeneratePut): (GeneratePutByIndex): (GenerateIsLegacyUnforgeablePropertyName): (GenerateDefineOwnProperty): (GenerateDeletePropertyCommon): (AttributeShouldBeOnInstance): (OperationShouldBeOnInstance): (IsAcceleratedDOMAttribute): (GetJSCAttributesForAttribute): (GenerateHeader): (GenerateImplementation): (GenerateAttributeGetterTrampolineDefinition): (GenerateAttributeSetterTrampolineDefinition): (IsAnnotatedType): (GetAnnotatedIDLType): (GenerateConstructorHelperMethods): (NeedsConstructorProperty): (IsLegacyUnforgeable): (ComputeFunctionSpecial): (GenerateIsUnforgeablePropertyName): Deleted. (IsUnforgeable): Deleted. * bindings/scripts/IDLAttributes.json: * bindings/scripts/preprocess-idls.pl: * bindings/scripts/test/BindingTestGlobalConstructors.idl: * bindings/scripts/test/JS/JSTestEventTarget.cpp: * bindings/scripts/test/JS/JSTestGlobalObject.cpp: * bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.cpp: Added. * bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.h: Added. * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.cpp: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.h: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.cpp: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.h: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h: Removed. * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: Removed. * bindings/scripts/test/JS/JSTestOverrideBuiltins.h: Removed. * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestIncludes.idl: * bindings/scripts/test/TestLegacyOverrideBuiltIns.idl: Added. * bindings/scripts/test/TestNamedSetterWithLegacyOverrideBuiltIns.idl: Added. * bindings/scripts/test/TestNamedSetterWithLegacyUnforgeableProperties.idl: Added. * bindings/scripts/test/TestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.idl: Added. * bindings/scripts/test/TestNamedSetterWithOverrideBuiltins.idl: Removed. * bindings/scripts/test/TestNamedSetterWithUnforgableProperties.idl: Removed. * bindings/scripts/test/TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.idl: Removed. * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestOperationBase.idl: * bindings/scripts/test/TestOverrideBuiltins.idl: Removed. * css/CSSStyleDeclaration.idl: * css/CSSUnknownRule.idl: * css/ElementCSSInlineStyle.idl: * css/MediaList.idl: * css/StyleMedia.idl: * dom/CharacterData.idl: * dom/ChildNode.idl: * dom/DOMImplementation.idl: * dom/DOMStringMap.idl: * dom/DeviceOrientationOrMotionEvent.idl: * dom/Document.idl: * dom/DocumentAndElementEventHandlers.idl: * dom/DocumentOrShadowRoot.idl: * dom/Element.idl: * dom/Event.idl: * dom/EventListener.idl: * dom/GlobalEventHandlers.idl: * dom/NavigatorMaxTouchPoints.idl: * dom/NonDocumentTypeChildNode.idl: * dom/NonElementParentNode.idl: * dom/ParentNode.idl: * dom/ShadowRoot.idl: * dom/Slotable.idl: * html/HTMLBodyElement.idl: * html/HTMLDocument.idl: * html/HTMLElement.idl: * html/HTMLFontElement.idl: * html/HTMLFormElement.idl: * html/HTMLFrameElement.idl: * html/HTMLHyperlinkElementUtils.idl: * html/HTMLIFrameElement.idl: * html/HTMLImageElement.idl: * html/HTMLInputElement.idl: * html/HTMLObjectElement.idl: * html/HTMLOrForeignElement.idl: * html/HTMLOutputElement.idl: * html/HTMLTableCellElement.idl: * html/HTMLTableElement.idl: * html/HTMLTableRowElement.idl: * html/HTMLTextAreaElement.idl: * html/canvas/ANGLEInstancedArrays.idl: * html/canvas/CanvasCompositing.idl: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasDrawPath.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasFilters.idl: * html/canvas/CanvasImageData.idl: * html/canvas/CanvasImageSmoothing.idl: * html/canvas/CanvasPath.idl: * html/canvas/CanvasPathDrawingStyles.idl: * html/canvas/CanvasRect.idl: * html/canvas/CanvasShadowStyles.idl: * html/canvas/CanvasState.idl: * html/canvas/CanvasText.idl: * html/canvas/CanvasTextDrawingStyles.idl: * html/canvas/CanvasTransform.idl: * html/canvas/CanvasUserInterface.idl: * html/canvas/EXTBlendMinMax.idl: * html/canvas/EXTColorBufferFloat.idl: * html/canvas/EXTColorBufferHalfFloat.idl: * html/canvas/EXTFragDepth.idl: * html/canvas/EXTShaderTextureLOD.idl: * html/canvas/EXTTextureFilterAnisotropic.idl: * html/canvas/EXTsRGB.idl: * html/canvas/OESElementIndexUint.idl: * html/canvas/OESStandardDerivatives.idl: * html/canvas/OESTextureFloat.idl: * html/canvas/OESTextureFloatLinear.idl: * html/canvas/OESTextureHalfFloat.idl: * html/canvas/OESTextureHalfFloatLinear.idl: * html/canvas/OESVertexArrayObject.idl: * html/canvas/WebGLColorBufferFloat.idl: * html/canvas/WebGLCompressedTextureASTC.idl: * html/canvas/WebGLCompressedTextureATC.idl: * html/canvas/WebGLCompressedTextureETC.idl: * html/canvas/WebGLCompressedTextureETC1.idl: * html/canvas/WebGLCompressedTexturePVRTC.idl: * html/canvas/WebGLCompressedTextureS3TC.idl: * html/canvas/WebGLCompressedTextureS3TCsRGB.idl: * html/canvas/WebGLDebugRendererInfo.idl: * html/canvas/WebGLDebugShaders.idl: * html/canvas/WebGLDepthTexture.idl: * html/canvas/WebGLDrawBuffers.idl: * html/canvas/WebGLLoseContext.idl: * html/canvas/WebGLRenderingContextBase.idl: * html/canvas/WebGLVertexArrayObjectOES.idl: * html/track/TextTrackCueGeneric.idl: * html/track/VTTRegionList.idl: * inspector/CommandLineAPIHost.idl: * inspector/InspectorFrontendHost.idl: * page/DOMWindow.idl: * page/GlobalCrypto.idl: * page/GlobalPerformance.idl: * page/Location.idl: * page/NavigatorID.idl: * page/NavigatorLanguage.idl: * page/NavigatorOnLine.idl: * page/NavigatorPlugins.idl: * page/NavigatorServiceWorker.idl: * page/NavigatorShare.idl: * page/RemoteDOMWindow.idl: * page/WindowEventHandlers.idl: * page/WindowOrWorkerGlobalScope.idl: * svg/SVGFilterPrimitiveStandardAttributes.idl: * svg/SVGFitToViewBox.idl: * svg/SVGTests.idl: * svg/SVGURIReference.idl: * svg/SVGZoomAndPan.idl: * testing/GCObservation.idl: * testing/InternalSettings.idl: * testing/Internals.idl: * testing/InternalsMapLike.idl: * testing/InternalsSetLike.idl: * testing/MallocStatistics.idl: * testing/MemoryInfo.idl: * testing/MockCDMFactory.idl: * testing/MockContentFilterSettings.idl: * testing/MockPageOverlay.idl: * testing/MockPaymentCoordinator.idl: * testing/ServiceWorkerInternals.idl: * testing/TypeConversions.idl: * testing/WebFakeXRDevice.idl: * testing/WebFakeXRInputController.idl: * testing/WebXRTest.idl: * workers/AbstractWorker.idl: * xml/XPathNSResolver.idl: Source/WebKit: * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp: (WebKit::InjectedBundleScriptWorld::disableOverrideBuiltinsBehavior): Update for new name WebCore::DOMWrapperWorld. Canonical link: https://commits.webkit.org/229031@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266662 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-05 17:14:23 +00:00
[LegacyUnforgeable] readonly attribute WindowProxy? top;
Set RemoteDOMWindow's initial opener https://bugs.webkit.org/show_bug.cgi?id=184716 Reviewed by Sam Weinig. Source/WebCore: Add support for WindowProxy type in the IDL. The implementation should return a WindowProxyController and toJS() will take care of converting this into a JSValue via JSDOMWindowProxy. No new tests, rebaselined existing test. * WebCore.xcodeproj/project.pbxproj: * bindings/IDLTypes.h: * bindings/js/JSDOMConvertWindowProxy.h: Added. (WebCore::JSConverter<IDLWindowProxy>::convert): * bindings/js/JSDOMWindowBase.cpp: (WebCore::toJS): * bindings/js/JSDOMWindowBase.h: (WebCore::toJS): * bindings/js/JSDOMWindowProxy.cpp: (WebCore::toJS): (WebCore::toJSDOMWindowProxy): * bindings/js/JSDOMWindowProxy.h: (WebCore::toJS): (WebCore::toJSDOMWindowProxy): * bindings/js/JSRemoteDOMWindowBase.cpp: * bindings/js/JSRemoteDOMWindowBase.h: * bindings/scripts/CodeGenerator.pm: (IsBuiltinType): * bindings/scripts/CodeGeneratorJS.pm: (AddToIncludesForIDLType): (GetBaseIDLType): * page/RemoteDOMWindow.cpp: (WebCore::RemoteDOMWindow::self const): (WebCore::RemoteDOMWindow::top const): (WebCore::RemoteDOMWindow::opener const): (WebCore::RemoteDOMWindow::parent const): * page/RemoteDOMWindow.h: * page/RemoteDOMWindow.idl: * page/RemoteFrame.h: Source/WebKit: When a frame becomes remote, transfer the frame opener from the old frame to the new remote one. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::frameBecameRemote): LayoutTests: Rebaseline existing test now that remoteWindow.opener now returns its initial opener. * http/tests/navigation/process-swap-window-open-expected.txt: Canonical link: https://commits.webkit.org/200270@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230789 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-18 22:27:20 +00:00
readonly attribute WindowProxy? opener;
[Replaceable] readonly attribute WindowProxy? parent;
Cache cross-origin methods / accessors of Window and Location per lexical global object https://bugs.webkit.org/show_bug.cgi?id=222739 Reviewed by Darin Adler. LayoutTests/imported/w3c: * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-caching-expected.txt: Added. * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-caching.html: Added. * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-common.js: Added. * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-length-expected.txt: Added. * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-length.html: Added. * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-name-expected.txt: Added. * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-name.html: Added. Source/JavaScriptCore: 1. Introduce WeakGCMap::ensureValue() to clean up JSObject::getOwnPropertyDescriptor() and avoid double hashing. It decorates HashMap::ensure() to guarantee non-null return value. 2. Assert early that JSCustom{Getter,Setter}Function is created with non-null function pointer. 3. Rename getCustom{Getter,Setter}Function() to align with newly-added JSDOMGlobalObject methods. * runtime/JSCustomGetterFunction.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): (JSC::JSCustomGetterFunction::create): * runtime/JSCustomSetterFunction.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): (JSC::JSCustomSetterFunction::create): * runtime/JSObject.cpp: (JSC::createCustomGetterFunction): (JSC::createCustomSetterFunction): (JSC::JSObject::getOwnPropertyDescriptor): (JSC::getCustomGetterFunction): Deleted. (JSC::getCustomSetterFunction): Deleted. * runtime/Lookup.h: (JSC::nonCachingStaticFunctionGetterImpl): Deleted. * runtime/WeakGCMap.h: Source/WebCore: For cross-origin methods / accessors, Window and Location objects return different JSFunction instances on every [[Get]]. The intent was to ensure isolation by supplying different Realms with different function objects. However, within the same callee Realm, this makes subsequent lookups of a cross-origin method / accessor fail reference equality test, which is rather confusing: `crossOriginWindow.focus === crossOriginWindow.focus // => false` This patch implements [[CrossOriginPropertyDescriptorMap]], bringing consistent function identity and aligning WebKit with the spec [1], Blink, and Gecko. For convenience, cache maps are added to JSDOMGlobalObject (to accommodate RemoteDOMWindow) and cover both Window and Location objects. As a cache map key, a pair of lexical global object and raw function pointer is used, which guarantees correctness even if Window and Location would expose cross-origin property of the same name. This patch removes 9 custom getters, adds runtime lookup for "showModalDialog" (which is rare), and removes [ForwardDeclareInHeader] extended attribute as it's now unused and non-trivial to generate. Also, fixes cross-realm `postMessage.length` to equal 1 as per WebIDL. [1] https://html.spec.whatwg.org/multipage/browsers.html#crossorigingetownpropertyhelper-(-o,-p-) Tests: imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-caching.html imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-length.html imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-name.html * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::JSDOMGlobalObject): (WebCore::JSDOMGlobalObject::createCrossOriginFunction): (WebCore::JSDOMGlobalObject::createCrossOriginGetterSetter): * bindings/js/JSDOMGlobalObject.h: * bindings/js/JSDOMWindowCustom.cpp: (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): (WebCore::JSDOMWindow::getOwnPropertySlot): * bindings/js/JSLocationCustom.cpp: (WebCore::getOwnPropertySlotCommon): (WebCore::JSC_DEFINE_CUSTOM_GETTER): Deleted. * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GenerateImplementation): * bindings/scripts/IDLAttributes.json: * page/DOMWindow.idl: * page/History.idl: * page/Location.idl: * page/RemoteDOMWindow.idl: LayoutTests: * http/tests/navigation/process-swap-window-open-expected.txt: * http/tests/navigation/process-swap-window-open.html: Canonical link: https://commits.webkit.org/235379@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274528 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-16 23:00:57 +00:00
[CallWith=GlobalObject&IncumbentWindow] undefined postMessage(any message, USVString targetOrigin, optional sequence<object> transfer = []);
Add bindings code for RemoteDOMWindow https://bugs.webkit.org/show_bug.cgi?id=184653 Reviewed by Ryosuke Niwa. Add bindings code for RemoteDOMWindow. A RemoteDOMWindow behaves exactly like a cross-origin DOMWindow, which is backed by a RemoteDOMWindow object instead of a DOMWindow one. Since a RemoteDOMWindow is always cross origin, we do not need cross-origin checks and the bindings code is identical to the DOMWindow code paths from cross-origin handling. No new tests, this code will be used and tested via Bug 184515. * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/JSDOMWindowCustom.cpp: (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): (WebCore::JSDOMWindow::getOwnPropertySlot): (WebCore::JSDOMWindow::getOwnPropertySlotByIndex): (WebCore::addCrossOriginWindowOwnPropertyNames): * bindings/js/JSDOMWindowCustom.h: * bindings/js/JSRemoteDOMWindowBase.cpp: Added. (WebCore::JSRemoteDOMWindowBase::JSRemoteDOMWindowBase): (WebCore::JSRemoteDOMWindowBase::destroy): (WebCore::JSRemoteDOMWindowBase::javaScriptRuntimeFlags): (WebCore::toJS): (WebCore::toJSRemoteDOMWindow): * bindings/js/JSRemoteDOMWindowBase.h: Added. JSRemoteDOMWindow unfortunately currently needs to be a global object because of: 1. a JSProxy's target needs to be a JSGlobalObject currently 2. The 'structure()->setGlobalObject(vm, &window);' call in JSDOMWindowProxy::setWindow(VM&, JSDOMGlobalObject&) which requires a JSGlobalObject. Ideally, this wouldn't be the case in the future but this would require some code refactoring. Our DOM global objects normally subclass JSDOMGlobalObject so I decided to subclass JSDOMGlobalObject, which brings some things our bindings code expect. However, subclassing JSDOMGlobalObject directly is problematic because it does not hold the m_wrapped implementation pointer. To address this issue, all our our DOM global objects have a JS*Base base class which subclasses JSDOMGlobalObject and stores the m_wrapped implementation pointer. I followed the same pattern here. (WebCore::toJS): * bindings/js/JSRemoteDOMWindowCustom.cpp: Added. (WebCore::JSRemoteDOMWindow::getOwnPropertySlot): (WebCore::JSRemoteDOMWindow::getOwnPropertySlotByIndex): (WebCore::JSRemoteDOMWindow::put): (WebCore::JSRemoteDOMWindow::putByIndex): (WebCore::JSRemoteDOMWindow::deleteProperty): (WebCore::JSRemoteDOMWindow::deletePropertyByIndex): (WebCore::JSRemoteDOMWindow::getOwnPropertyNames): (WebCore::JSRemoteDOMWindow::defineOwnProperty): (WebCore::JSRemoteDOMWindow::getPrototype): (WebCore::JSRemoteDOMWindow::preventExtensions): (WebCore::JSRemoteDOMWindow::toStringName): * bindings/scripts/CodeGeneratorJS.pm: (IsDOMGlobalObject): (GenerateHeader): (GenerateOverloadDispatcher): (GenerateImplementation): * page/RemoteDOMWindow.idl: Added. Canonical link: https://commits.webkit.org/200204@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-17 16:59:34 +00:00
};