haikuwebkit/Source/WebCore/page/NavigatorShare.idl

33 lines
1.6 KiB
Plaintext
Raw Permalink Normal View History

Implement the Web Share API https://bugs.webkit.org/show_bug.cgi?id=171100 <rdar://problem/31751734> Patch by Olivia Barnett <obarnett@apple.com> on 2018-08-29 Reviewed by Tim Horton. LayoutTests/imported/w3c: * web-platform-tests/web-share/idlharness.https-expected.txt: * web-platform-tests/web-share/share-empty.https-expected.txt: * web-platform-tests/web-share/share-securecontext.http-expected.txt: * web-platform-tests/web-share/share-url-invalid.https-expected.txt: * web-platform-tests/web-share/share-without-user-gesture.https-expected.txt: Updated expected results. Source/WebCore: Added one test in fast/events/ios called share.html; adjusted expectations for existing tests. * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * features.json: * loader/EmptyClients.cpp: (WebCore::EmptyChromeClient::showShareSheet): * loader/EmptyClients.h: Added empty showShareSheet function. * page/Chrome.cpp: (WebCore::Chrome::showShareSheet): * page/Chrome.h: Added call to showShareSheet on client. * page/ChromeClient.h: Virtual showShareSheet function. * page/Navigator.cpp: (WebCore::Navigator::share): * page/Navigator.h: Share function that returns a promise and invokes the share sheet. * page/Navigator.idl: Implements NavigatorShare * page/NavigatorShare.idl: Added. Added definition of share function returning a promise. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebShareEnabled): (WebCore::RuntimeEnabledFeatures::webShareEnabled const): Added RuntimeEnabledFeature switch. * page/ShareData.h: Added. * page/ShareData.idl: Added. Definition of ShareData struct. Source/WebKit: * Platform/spi/ios/UIKitSPI.h: Added NSURL _title property as in the WebCore UIKitSPI. * Scripts/webkit/messages.py: ShareDataWithParsedURL special case for header for type. * Shared/ShareSheetCallbackID.h: Added a typedef for a share sheet callback id. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<ShareData>::encode): (IPC::ArgumentCoder<ShareData>::decode): (IPC::ArgumentCoder<ShareDataWithParsedURL>::encode): (IPC::ArgumentCoder<ShareDataWithParsedURL>::decode): * Shared/WebCoreArgumentCoders.h: Added encoding and decoding functionality for new structs. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetWebShareEnabled): (WKPreferencesGetWebShareEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: Added switch for RuntimeEnabledFeature. * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/API/Cocoa/WKWebViewPrivate.h: Added hook for share sheet testing. * UIProcess/PageClient.h: (WebKit::PageClient::showShareSheet): Page client call to invoke share sheet. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::showShareSheet): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Web page proxy handling of call to invoke share sheet. Creates completion handler to send to WKShareSheet.mm Completion handler sends message to WebPage with message id. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::showShareSheet): Page client implementation call to invoke share sheet. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): (-[WKContentView _showShareSheet:completionHandler:]): (-[WKContentView shareSheetDidDismiss:]): (-[WKContentView invokeShareSheetWithResolution:resolved): Call to WKShareSheet to invoke the share sheet and callback. Hook for share sheet resolution testing. * UIProcess/ios/forms/WKShareSheet.h: Added. * UIProcess/ios/forms/WKShareSheet.mm: Added. (-[WKShareSheet initWithView:]): (-[WKShareSheet presentWithParameters:completionHandler:]): (-[WKShareSheet _dispatchDidDismiss]): (-[WKShareSheet _cancel]): (-[WKShareSheet dismiss]): (-[WKShareSheet _dismissDisplayAnimated:]): (-[WKShareSheet _presentFullscreenViewController:animated:]): (-[WKShareSheet invokeShareSheetWithResolution:resolved:]): Completion handler call and creation of share sheet with parameters. Hook that force resolves the share sheet completion handler for testing. * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::showShareSheet): Call to page to invoke share sheet. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::nextShareSheetContextId): (WebKit::WebPage::showShareSheet): (WebKit::WebPage::showShareSheetResponse): WebPage calls proxy and saves context id for promise. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Callback for completed response. Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.h: * WebCoreSupport/WebChromeClientIOS.mm: (WebChromeClientIOS::showShareSheet): Empty declaration of showShareSheet. Source/WebKitLegacy/mac: * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::showShareSheet): Empty declaration of showShareSheet. LayoutTests: * fast/dom/navigator-detached-no-crash-expected.txt: Updated expected results. Canonical link: https://commits.webkit.org/204141@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235489 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-08-30 00:20:26 +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. ``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
* 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.
*/
[WebIDL] Add support for interface mixins https://bugs.webkit.org/show_bug.cgi?id=216217 Reviewed by Darin Adler. Implement support for WebIDL interface mixins, which are interface fragments that can be included into other interfaces (using an 'includes' statement), but do not create new types themselves. Prior to this, we have been emulating the behavior by allowing any interface to be included in another interface, and marking some interfaces with the [LegacyNoInterfaceObject] extended attribute. This change codifies that with in the spec approved way. - Updates IDL parser to parse mixin interfaces (and fixes the parsing of callback interfaces to be a bit more strict while I was there). - Updates IDL pre-processor to avoid creating global variables and IsoSubspaces for mixins. - Updates IDL code generator to only support including mixin interfaces during supplemental inclusion. - Updates IDL files to use interface mixin where appropriately specified. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * CMakeLists.txt: * DerivedSources-output.xcfilelist: * DerivedSources.make: * dom/DeviceOrientationOrMotionEvent.idl: Removed. Remove DeviceOrientationOrMotionEvent.idl and corresponding generated files, inlining it into DeviceMotionEvent.idl and DeviceOrientationEvent.idl as specified. This is needed as mixin interfaces do not support static operations or attributes. * bindings/scripts/CodeGenerator.pm: (IsValidSupplementalInterface): (IsValidSupplementalDictionary): (ProcessSupplementalDependencies): (GetInterfaceExtendedAttributesFromName): Update IDL code generator to only support including mixin interfaces during supplemental inclusion. Also removes some left of remnents of exception interface support. * bindings/scripts/IDLParser.pm: (parseCallbackRestOrInterface): (parseCallbackInterface): (parseCallbackInterfaceMembers): (parseCallbackInterfaceMember): (parseMixin): (parseMixinMembers): (parseMixinMember): (parseNamespace): (parsePartialInterfaceMember): (parseAttributeOrOperationForStringifierOrStatic): Update IDL parser to parse mixin interfaces and fix the parsing of callback interfaces to match the spec by restricting its members to constants and regular functions. * bindings/scripts/preprocess-idls.pl: (isMixinInterfaceFromIDL): (containsInterfaceFromIDL): (getInterfaceExtendedAttributesFromIDL): (containsInterfaceOrExceptionFromIDL): Deleted. Ensure mixin interfaces don't get exposed on any global objects and remove some left of remnents of exception interface support. * bindings/scripts/test/JS/JSTestInterface.cpp: * bindings/scripts/test/JS/JSTestLegacyNoInterfaceObject.cpp: Added. * bindings/scripts/test/JS/JSTestLegacyNoInterfaceObject.h: Added. * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestIncludes.idl: * bindings/scripts/test/TestLegacyNoInterfaceObject.idl: Added. * bindings/scripts/test/TestOperationBase.idl: Update bindings tests to use mixins for includes. Add new dedicated [LegacyNoInterfaceObject] since it was no longer being tested. * Modules/fetch/FetchBody.idl: * Modules/mediasource/VideoPlaybackQuality.idl: * Modules/speech/SpeechSynthesis.idl: * Modules/speech/SpeechSynthesisVoice.idl: * Modules/streams/ReadableStreamSink.idl: * accessibility/AccessibilityRole.idl: * accessibility/AriaAttributes.idl: * animation/Animatable.idl: * css/ElementCSSInlineStyle.idl: * css/StyleMedia.idl: * dom/ChildNode.idl: * dom/DeviceMotionEvent.idl: * dom/DeviceOrientationEvent.idl: * dom/Document.idl: * dom/DocumentAndElementEventHandlers.idl: * dom/DocumentOrShadowRoot.idl: * dom/EventListener.idl: * dom/GlobalEventHandlers.idl: * dom/NavigatorMaxTouchPoints.idl: * dom/NonDocumentTypeChildNode.idl: * dom/NonElementParentNode.idl: * dom/ParentNode.idl: * dom/Slotable.idl: * html/HTMLHyperlinkElementUtils.idl: * html/HTMLOrForeignElement.idl: * html/canvas/CanvasCompositing.idl: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasDrawPath.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasFilters.idl: * html/canvas/CanvasGradient.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/WebGLRenderingContextBase.idl: * page/GlobalCrypto.idl: * page/GlobalPerformance.idl: * page/Navigator.idl: * page/NavigatorID.idl: * page/NavigatorLanguage.idl: * page/NavigatorOnLine.idl: * page/NavigatorPlugins.idl: * page/NavigatorServiceWorker.idl: * page/NavigatorShare.idl: * page/WindowEventHandlers.idl: * page/WindowOrWorkerGlobalScope.idl: * svg/SVGFilterPrimitiveStandardAttributes.idl: * svg/SVGFitToViewBox.idl: * svg/SVGTests.idl: * svg/SVGURIReference.idl: * svg/SVGZoomAndPan.idl: * workers/AbstractWorker.idl: * xml/XPathEvaluator.idl: * xml/XPathNSResolver.idl: Update IDLs. Canonical link: https://commits.webkit.org/229047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266678 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-06 02:49:22 +00:00
// https://w3c.github.io/web-share/#extensions-to-the-navigator-interface
Implement the Web Share API https://bugs.webkit.org/show_bug.cgi?id=171100 <rdar://problem/31751734> Patch by Olivia Barnett <obarnett@apple.com> on 2018-08-29 Reviewed by Tim Horton. LayoutTests/imported/w3c: * web-platform-tests/web-share/idlharness.https-expected.txt: * web-platform-tests/web-share/share-empty.https-expected.txt: * web-platform-tests/web-share/share-securecontext.http-expected.txt: * web-platform-tests/web-share/share-url-invalid.https-expected.txt: * web-platform-tests/web-share/share-without-user-gesture.https-expected.txt: Updated expected results. Source/WebCore: Added one test in fast/events/ios called share.html; adjusted expectations for existing tests. * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * features.json: * loader/EmptyClients.cpp: (WebCore::EmptyChromeClient::showShareSheet): * loader/EmptyClients.h: Added empty showShareSheet function. * page/Chrome.cpp: (WebCore::Chrome::showShareSheet): * page/Chrome.h: Added call to showShareSheet on client. * page/ChromeClient.h: Virtual showShareSheet function. * page/Navigator.cpp: (WebCore::Navigator::share): * page/Navigator.h: Share function that returns a promise and invokes the share sheet. * page/Navigator.idl: Implements NavigatorShare * page/NavigatorShare.idl: Added. Added definition of share function returning a promise. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebShareEnabled): (WebCore::RuntimeEnabledFeatures::webShareEnabled const): Added RuntimeEnabledFeature switch. * page/ShareData.h: Added. * page/ShareData.idl: Added. Definition of ShareData struct. Source/WebKit: * Platform/spi/ios/UIKitSPI.h: Added NSURL _title property as in the WebCore UIKitSPI. * Scripts/webkit/messages.py: ShareDataWithParsedURL special case for header for type. * Shared/ShareSheetCallbackID.h: Added a typedef for a share sheet callback id. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<ShareData>::encode): (IPC::ArgumentCoder<ShareData>::decode): (IPC::ArgumentCoder<ShareDataWithParsedURL>::encode): (IPC::ArgumentCoder<ShareDataWithParsedURL>::decode): * Shared/WebCoreArgumentCoders.h: Added encoding and decoding functionality for new structs. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetWebShareEnabled): (WKPreferencesGetWebShareEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: Added switch for RuntimeEnabledFeature. * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/API/Cocoa/WKWebViewPrivate.h: Added hook for share sheet testing. * UIProcess/PageClient.h: (WebKit::PageClient::showShareSheet): Page client call to invoke share sheet. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::showShareSheet): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Web page proxy handling of call to invoke share sheet. Creates completion handler to send to WKShareSheet.mm Completion handler sends message to WebPage with message id. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::showShareSheet): Page client implementation call to invoke share sheet. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): (-[WKContentView _showShareSheet:completionHandler:]): (-[WKContentView shareSheetDidDismiss:]): (-[WKContentView invokeShareSheetWithResolution:resolved): Call to WKShareSheet to invoke the share sheet and callback. Hook for share sheet resolution testing. * UIProcess/ios/forms/WKShareSheet.h: Added. * UIProcess/ios/forms/WKShareSheet.mm: Added. (-[WKShareSheet initWithView:]): (-[WKShareSheet presentWithParameters:completionHandler:]): (-[WKShareSheet _dispatchDidDismiss]): (-[WKShareSheet _cancel]): (-[WKShareSheet dismiss]): (-[WKShareSheet _dismissDisplayAnimated:]): (-[WKShareSheet _presentFullscreenViewController:animated:]): (-[WKShareSheet invokeShareSheetWithResolution:resolved:]): Completion handler call and creation of share sheet with parameters. Hook that force resolves the share sheet completion handler for testing. * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::showShareSheet): Call to page to invoke share sheet. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::nextShareSheetContextId): (WebKit::WebPage::showShareSheet): (WebKit::WebPage::showShareSheetResponse): WebPage calls proxy and saves context id for promise. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Callback for completed response. Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.h: * WebCoreSupport/WebChromeClientIOS.mm: (WebChromeClientIOS::showShareSheet): Empty declaration of showShareSheet. Source/WebKitLegacy/mac: * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::showShareSheet): Empty declaration of showShareSheet. LayoutTests: * fast/dom/navigator-detached-no-crash-expected.txt: Updated expected results. Canonical link: https://commits.webkit.org/204141@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235489 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-08-30 00:20:26 +00:00
[
Many settings in RuntimeEnabledSettings should autogenerated Settings: Part 1 https://bugs.webkit.org/show_bug.cgi?id=215981 Reviewed by Darin Adler. This moves an initial chunk of RuntimeEnabledSettings settings to Settings.yaml, focusing on settings that don't require substantial refactoring or new features to work in Settings.yaml. Source/WebCore: The one "substantial" change to Settings generation was to switch the conditional key, to require the complete conditional form (e.g. require ENABLE(FOO) rather than FOO), which matches WebPreferences.yaml in WebKit, and is more versitile allowing non-ENABLE based conditionals. * Modules/credentialmanagement/BasicCredential.idl: * Modules/credentialmanagement/CredentialsContainer.idl: * Modules/credentialmanagement/NavigatorCredentials.idl: * Modules/encryptedmedia/MediaKeyMessageEvent.idl: * Modules/encryptedmedia/MediaKeySession.idl: * Modules/encryptedmedia/MediaKeyStatusMap.idl: * Modules/encryptedmedia/MediaKeySystemAccess.idl: * Modules/encryptedmedia/MediaKeys.idl: * Modules/encryptedmedia/NavigatorEME.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: * Modules/gamepad/Gamepad.idl: * Modules/gamepad/GamepadButton.idl: * Modules/gamepad/GamepadEvent.idl: * Modules/gamepad/NavigatorGamepad.idl: * Modules/mediarecorder/BlobEvent.idl: * Modules/mediarecorder/MediaRecorder.idl: * Modules/mediarecorder/MediaRecorderErrorEvent.idl: * Modules/mediastream/MediaDevices.idl: * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::updateCaptureAccordingToMutedState): * Modules/mediastream/NavigatorMediaDevices.idl: * Modules/webauthn/AuthenticatorAssertionResponse.idl: * Modules/webauthn/AuthenticatorAttestationResponse.idl: * Modules/webauthn/AuthenticatorResponse.idl: * Modules/webauthn/PublicKeyCredential.cpp: (WebCore::PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable): * Modules/webauthn/PublicKeyCredential.idl: * Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb: * Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb: * Scripts/SettingsTemplates/Settings.cpp.erb: * Scripts/SettingsTemplates/Settings.h.erb: * WebCore.xcodeproj/project.pbxproj: * css/DOMCSSCustomPropertyDescriptor.idl: * css/DOMCSSRegisterCustomProperty.idl: * dom/BeforeLoadEvent.idl: * dom/CustomElementRegistry.idl: * dom/DataTransfer.idl: * dom/DataTransferItem.idl: * dom/DataTransferItemList.idl: * dom/Document.cpp: (WebCore::createUpgradeCandidateElement): * dom/Document.idl: * dom/Element.idl: * dom/InputEvent.idl: * dom/Node.cpp: (WebCore::Node::dispatchBeforeLoadEvent): * dom/StaticRange.idl: * editing/Editor.cpp: (WebCore::Editor::registerCustomUndoStep): * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::isSystemPreviewLink): (WebCore::HTMLAnchorElement::parseAdClickAttribution const): (WebCore::HTMLAnchorElement::handleClick): (WebCore::HTMLAnchorElement::referrerPolicy const): * html/HTMLAnchorElement.idl: * html/HTMLAreaElement.idl: * html/HTMLButtonElement.idl: * html/HTMLFieldSetElement.idl: * html/HTMLFormElement.idl: * html/HTMLIFrameElement.cpp: (WebCore::HTMLIFrameElement::referrerPolicy const): * html/HTMLIFrameElement.idl: * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::attributeChanged): (WebCore::HTMLImageElement::isSystemPreviewImage const): (WebCore::HTMLImageElement::referrerPolicy const): * html/HTMLImageElement.idl: * html/HTMLInputElement.idl: * html/HTMLKeygenElement.idl: * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::as const): (WebCore::HTMLLinkElement::referrerPolicy const): * html/HTMLLinkElement.idl: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updateShouldContinueAfterNeedKey): (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded): (WebCore::HTMLMediaElement::webkitSetMediaKeys): (WebCore::HTMLMediaElement::keyAdded): (WebCore::HTMLMediaElement::mediaPlayerInitializationDataEncountered): * html/HTMLMediaElement.idl: * html/HTMLMetaElement.cpp: (WebCore::HTMLMetaElement::process): * html/HTMLObjectElement.idl: * html/HTMLOutputElement.idl: * html/HTMLPictureElement.cpp: (WebCore::HTMLPictureElement::isSystemPreviewImage): * html/HTMLScriptElement.cpp: (WebCore::HTMLScriptElement::referrerPolicy const): * html/HTMLScriptElement.idl: * html/HTMLSelectElement.idl: * html/HTMLTextAreaElement.idl: * html/LinkRelAttribute.cpp: (WebCore::LinkRelAttribute::LinkRelAttribute): (WebCore::LinkRelAttribute::isSupported): * html/MediaEncryptedEvent.idl: * html/WebKitMediaKeyError.idl: * html/parser/HTMLPreloadScanner.cpp: (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner): (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest): (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): (WebCore::TokenPreloadScanner::StartTagScanner::resourceType const): (WebCore::TokenPreloadScanner::scan): * loader/ImageLoader.cpp: (WebCore::ImageLoader::updateFromElement): * loader/LinkLoader.cpp: (WebCore::LinkLoader::resourceTypeFromAsAttribute): (WebCore::createLinkPreloadResourceClient): (WebCore::LinkLoader::isSupportedType): (WebCore::LinkLoader::preloadIfNeeded): (WebCore::LinkLoader::prefetchIfNeeded): * loader/LinkLoader.h: * page/DOMWindow.idl: * page/IntersectionObserver.idl: * page/IntersectionObserverEntry.idl: * page/Navigator.cpp: (WebCore::Navigator::canShare): (WebCore::Navigator::share): * page/Navigator.h: * page/NavigatorShare.idl: * page/RuntimeEnabledFeatures.cpp: (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): (WebCore::RuntimeEnabledFeatures::touchEventsEnabled const): Deleted. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setMouseEventsSimulationEnabled): (WebCore::RuntimeEnabledFeatures::setBlankAnchorTargetImpliesNoOpenerEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::blankAnchorTargetImpliesNoOpenerEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setLinkPreloadEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::linkPreloadEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setLinkPrefetchEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::linkPrefetchEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setMediaPreloadingEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::mediaPreloadingEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInputEventsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::inputEventsEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInteractiveFormValidationEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::interactiveFormValidationEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setCustomElementsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::customElementsEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setDataTransferItemsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::dataTransferItemsEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebShareEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webShareEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebAuthenticationEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webAuthenticationEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebAuthenticationLocalAuthenticatorEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webAuthenticationLocalAuthenticatorEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setDisabledAdaptationsMetaTagEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::disabledAdaptationsMetaTagEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setCSSCustomPropertiesAndValuesEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::cssCustomPropertiesAndValuesEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setSyntheticEditingCommandsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::syntheticEditingCommandsEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::mediaRecorderEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setMediaRecorderEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::mediaDevicesEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setMediaDevicesEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::mediaStreamEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setMediaStreamEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::screenCaptureEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setScreenCaptureEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::setGamepadsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::gamepadsEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setDownloadAttributeEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::downloadAttributeEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setIntersectionObserverEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::intersectionObserverEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setUndoManagerAPIEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::undoManagerAPIEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setEncryptedMediaAPIEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::encryptedMediaAPIEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setLegacyEncryptedMediaAPIEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::legacyEncryptedMediaAPIEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setSystemPreviewEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::systemPreviewEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setLegacyBeforeLoadEventEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::legacyBeforeLoadEventEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::adClickAttributionEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setAdClickAttributionEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::setTouchEventsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::referrerPolicyAttributeEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setReferrerPolicyAttributeEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::interruptAudioOnPageVisibilityChangeEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInterruptAudioOnPageVisibilityChangeEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::linkPreloadResponsiveImagesEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setLinkPreloadResponsiveImagesEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::setLazyImageLoadingEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::lazyImageLoadingEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setIsInAppBrowserPrivacyEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::isInAppBrowserPrivacyEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setNeedsInAppBrowserPrivacyQuirks): Deleted. (WebCore::RuntimeEnabledFeatures::needsInAppBrowserPrivacyQuirks const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebShareFileAPIEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webShareFileAPIEnabled const): Deleted. * page/Settings.yaml: * page/UndoItem.idl: * page/UndoManager.idl: * rendering/RenderImage.cpp: (WebCore::RenderImage::paintIntoRect): * testing/InternalSettings.cpp: (WebCore::InternalSettings::Backup::Backup): (WebCore::InternalSettings::Backup::restoreTo): (WebCore::InternalSettings::setScreenCaptureEnabled): Deleted. * testing/InternalSettings.h: * testing/InternalSettings.idl: * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::setShouldInterruptAudioOnPageVisibilityChange): (WebCore::Internals::addPrefetchLoadEventListener): Source/WebKit: In WebKit, this means mostly removing now unnecessary use of the webcoreBinding key in WebPreferences.yaml and removing now superfluous cases in InjectedBundle::overrideBoolPreferenceForTestRunner. * Shared/WebPreferences.yaml: Removing now unnecessary use of the webcoreBinding key and fix indentation of a few cases. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Remove now superfluous cases, as each boolean Settings based setting gets handled automatically. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Remove explicit setting of setInteractiveFormValidationEnabled now that we don't have the RuntimeEnabledSettings variant being set by the generator. Source/WebKitLegacy/mac: * WebView/WebView.mm: (-[WebView _preferencesChanged:]): Update changed settings to use Settings rather than RuntimeEnabledSettings. Source/WebKitLegacy/win: * WebView.cpp: (WebView::notifyPreferencesChanged): Update changed settings to use Settings rather than RuntimeEnabledSettings. Canonical link: https://commits.webkit.org/228796@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266360 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-31 18:16:31 +00:00
EnabledBySetting=WebShare
[WebIDL] Add support for interface mixins https://bugs.webkit.org/show_bug.cgi?id=216217 Reviewed by Darin Adler. Implement support for WebIDL interface mixins, which are interface fragments that can be included into other interfaces (using an 'includes' statement), but do not create new types themselves. Prior to this, we have been emulating the behavior by allowing any interface to be included in another interface, and marking some interfaces with the [LegacyNoInterfaceObject] extended attribute. This change codifies that with in the spec approved way. - Updates IDL parser to parse mixin interfaces (and fixes the parsing of callback interfaces to be a bit more strict while I was there). - Updates IDL pre-processor to avoid creating global variables and IsoSubspaces for mixins. - Updates IDL code generator to only support including mixin interfaces during supplemental inclusion. - Updates IDL files to use interface mixin where appropriately specified. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * CMakeLists.txt: * DerivedSources-output.xcfilelist: * DerivedSources.make: * dom/DeviceOrientationOrMotionEvent.idl: Removed. Remove DeviceOrientationOrMotionEvent.idl and corresponding generated files, inlining it into DeviceMotionEvent.idl and DeviceOrientationEvent.idl as specified. This is needed as mixin interfaces do not support static operations or attributes. * bindings/scripts/CodeGenerator.pm: (IsValidSupplementalInterface): (IsValidSupplementalDictionary): (ProcessSupplementalDependencies): (GetInterfaceExtendedAttributesFromName): Update IDL code generator to only support including mixin interfaces during supplemental inclusion. Also removes some left of remnents of exception interface support. * bindings/scripts/IDLParser.pm: (parseCallbackRestOrInterface): (parseCallbackInterface): (parseCallbackInterfaceMembers): (parseCallbackInterfaceMember): (parseMixin): (parseMixinMembers): (parseMixinMember): (parseNamespace): (parsePartialInterfaceMember): (parseAttributeOrOperationForStringifierOrStatic): Update IDL parser to parse mixin interfaces and fix the parsing of callback interfaces to match the spec by restricting its members to constants and regular functions. * bindings/scripts/preprocess-idls.pl: (isMixinInterfaceFromIDL): (containsInterfaceFromIDL): (getInterfaceExtendedAttributesFromIDL): (containsInterfaceOrExceptionFromIDL): Deleted. Ensure mixin interfaces don't get exposed on any global objects and remove some left of remnents of exception interface support. * bindings/scripts/test/JS/JSTestInterface.cpp: * bindings/scripts/test/JS/JSTestLegacyNoInterfaceObject.cpp: Added. * bindings/scripts/test/JS/JSTestLegacyNoInterfaceObject.h: Added. * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestIncludes.idl: * bindings/scripts/test/TestLegacyNoInterfaceObject.idl: Added. * bindings/scripts/test/TestOperationBase.idl: Update bindings tests to use mixins for includes. Add new dedicated [LegacyNoInterfaceObject] since it was no longer being tested. * Modules/fetch/FetchBody.idl: * Modules/mediasource/VideoPlaybackQuality.idl: * Modules/speech/SpeechSynthesis.idl: * Modules/speech/SpeechSynthesisVoice.idl: * Modules/streams/ReadableStreamSink.idl: * accessibility/AccessibilityRole.idl: * accessibility/AriaAttributes.idl: * animation/Animatable.idl: * css/ElementCSSInlineStyle.idl: * css/StyleMedia.idl: * dom/ChildNode.idl: * dom/DeviceMotionEvent.idl: * dom/DeviceOrientationEvent.idl: * dom/Document.idl: * dom/DocumentAndElementEventHandlers.idl: * dom/DocumentOrShadowRoot.idl: * dom/EventListener.idl: * dom/GlobalEventHandlers.idl: * dom/NavigatorMaxTouchPoints.idl: * dom/NonDocumentTypeChildNode.idl: * dom/NonElementParentNode.idl: * dom/ParentNode.idl: * dom/Slotable.idl: * html/HTMLHyperlinkElementUtils.idl: * html/HTMLOrForeignElement.idl: * html/canvas/CanvasCompositing.idl: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasDrawPath.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasFilters.idl: * html/canvas/CanvasGradient.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/WebGLRenderingContextBase.idl: * page/GlobalCrypto.idl: * page/GlobalPerformance.idl: * page/Navigator.idl: * page/NavigatorID.idl: * page/NavigatorLanguage.idl: * page/NavigatorOnLine.idl: * page/NavigatorPlugins.idl: * page/NavigatorServiceWorker.idl: * page/NavigatorShare.idl: * page/WindowEventHandlers.idl: * page/WindowOrWorkerGlobalScope.idl: * svg/SVGFilterPrimitiveStandardAttributes.idl: * svg/SVGFitToViewBox.idl: * svg/SVGTests.idl: * svg/SVGURIReference.idl: * svg/SVGZoomAndPan.idl: * workers/AbstractWorker.idl: * xml/XPathEvaluator.idl: * xml/XPathNSResolver.idl: Update IDLs. Canonical link: https://commits.webkit.org/229047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266678 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-06 02:49:22 +00:00
] interface mixin NavigatorShare {
Many settings in RuntimeEnabledSettings should autogenerated Settings: Part 1 https://bugs.webkit.org/show_bug.cgi?id=215981 Reviewed by Darin Adler. This moves an initial chunk of RuntimeEnabledSettings settings to Settings.yaml, focusing on settings that don't require substantial refactoring or new features to work in Settings.yaml. Source/WebCore: The one "substantial" change to Settings generation was to switch the conditional key, to require the complete conditional form (e.g. require ENABLE(FOO) rather than FOO), which matches WebPreferences.yaml in WebKit, and is more versitile allowing non-ENABLE based conditionals. * Modules/credentialmanagement/BasicCredential.idl: * Modules/credentialmanagement/CredentialsContainer.idl: * Modules/credentialmanagement/NavigatorCredentials.idl: * Modules/encryptedmedia/MediaKeyMessageEvent.idl: * Modules/encryptedmedia/MediaKeySession.idl: * Modules/encryptedmedia/MediaKeyStatusMap.idl: * Modules/encryptedmedia/MediaKeySystemAccess.idl: * Modules/encryptedmedia/MediaKeys.idl: * Modules/encryptedmedia/NavigatorEME.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: * Modules/gamepad/Gamepad.idl: * Modules/gamepad/GamepadButton.idl: * Modules/gamepad/GamepadEvent.idl: * Modules/gamepad/NavigatorGamepad.idl: * Modules/mediarecorder/BlobEvent.idl: * Modules/mediarecorder/MediaRecorder.idl: * Modules/mediarecorder/MediaRecorderErrorEvent.idl: * Modules/mediastream/MediaDevices.idl: * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::updateCaptureAccordingToMutedState): * Modules/mediastream/NavigatorMediaDevices.idl: * Modules/webauthn/AuthenticatorAssertionResponse.idl: * Modules/webauthn/AuthenticatorAttestationResponse.idl: * Modules/webauthn/AuthenticatorResponse.idl: * Modules/webauthn/PublicKeyCredential.cpp: (WebCore::PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable): * Modules/webauthn/PublicKeyCredential.idl: * Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb: * Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb: * Scripts/SettingsTemplates/Settings.cpp.erb: * Scripts/SettingsTemplates/Settings.h.erb: * WebCore.xcodeproj/project.pbxproj: * css/DOMCSSCustomPropertyDescriptor.idl: * css/DOMCSSRegisterCustomProperty.idl: * dom/BeforeLoadEvent.idl: * dom/CustomElementRegistry.idl: * dom/DataTransfer.idl: * dom/DataTransferItem.idl: * dom/DataTransferItemList.idl: * dom/Document.cpp: (WebCore::createUpgradeCandidateElement): * dom/Document.idl: * dom/Element.idl: * dom/InputEvent.idl: * dom/Node.cpp: (WebCore::Node::dispatchBeforeLoadEvent): * dom/StaticRange.idl: * editing/Editor.cpp: (WebCore::Editor::registerCustomUndoStep): * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::isSystemPreviewLink): (WebCore::HTMLAnchorElement::parseAdClickAttribution const): (WebCore::HTMLAnchorElement::handleClick): (WebCore::HTMLAnchorElement::referrerPolicy const): * html/HTMLAnchorElement.idl: * html/HTMLAreaElement.idl: * html/HTMLButtonElement.idl: * html/HTMLFieldSetElement.idl: * html/HTMLFormElement.idl: * html/HTMLIFrameElement.cpp: (WebCore::HTMLIFrameElement::referrerPolicy const): * html/HTMLIFrameElement.idl: * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::attributeChanged): (WebCore::HTMLImageElement::isSystemPreviewImage const): (WebCore::HTMLImageElement::referrerPolicy const): * html/HTMLImageElement.idl: * html/HTMLInputElement.idl: * html/HTMLKeygenElement.idl: * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::as const): (WebCore::HTMLLinkElement::referrerPolicy const): * html/HTMLLinkElement.idl: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updateShouldContinueAfterNeedKey): (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded): (WebCore::HTMLMediaElement::webkitSetMediaKeys): (WebCore::HTMLMediaElement::keyAdded): (WebCore::HTMLMediaElement::mediaPlayerInitializationDataEncountered): * html/HTMLMediaElement.idl: * html/HTMLMetaElement.cpp: (WebCore::HTMLMetaElement::process): * html/HTMLObjectElement.idl: * html/HTMLOutputElement.idl: * html/HTMLPictureElement.cpp: (WebCore::HTMLPictureElement::isSystemPreviewImage): * html/HTMLScriptElement.cpp: (WebCore::HTMLScriptElement::referrerPolicy const): * html/HTMLScriptElement.idl: * html/HTMLSelectElement.idl: * html/HTMLTextAreaElement.idl: * html/LinkRelAttribute.cpp: (WebCore::LinkRelAttribute::LinkRelAttribute): (WebCore::LinkRelAttribute::isSupported): * html/MediaEncryptedEvent.idl: * html/WebKitMediaKeyError.idl: * html/parser/HTMLPreloadScanner.cpp: (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner): (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest): (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): (WebCore::TokenPreloadScanner::StartTagScanner::resourceType const): (WebCore::TokenPreloadScanner::scan): * loader/ImageLoader.cpp: (WebCore::ImageLoader::updateFromElement): * loader/LinkLoader.cpp: (WebCore::LinkLoader::resourceTypeFromAsAttribute): (WebCore::createLinkPreloadResourceClient): (WebCore::LinkLoader::isSupportedType): (WebCore::LinkLoader::preloadIfNeeded): (WebCore::LinkLoader::prefetchIfNeeded): * loader/LinkLoader.h: * page/DOMWindow.idl: * page/IntersectionObserver.idl: * page/IntersectionObserverEntry.idl: * page/Navigator.cpp: (WebCore::Navigator::canShare): (WebCore::Navigator::share): * page/Navigator.h: * page/NavigatorShare.idl: * page/RuntimeEnabledFeatures.cpp: (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): (WebCore::RuntimeEnabledFeatures::touchEventsEnabled const): Deleted. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setMouseEventsSimulationEnabled): (WebCore::RuntimeEnabledFeatures::setBlankAnchorTargetImpliesNoOpenerEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::blankAnchorTargetImpliesNoOpenerEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setLinkPreloadEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::linkPreloadEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setLinkPrefetchEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::linkPrefetchEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setMediaPreloadingEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::mediaPreloadingEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInputEventsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::inputEventsEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInteractiveFormValidationEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::interactiveFormValidationEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setCustomElementsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::customElementsEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setDataTransferItemsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::dataTransferItemsEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebShareEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webShareEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebAuthenticationEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webAuthenticationEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebAuthenticationLocalAuthenticatorEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webAuthenticationLocalAuthenticatorEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setDisabledAdaptationsMetaTagEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::disabledAdaptationsMetaTagEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setCSSCustomPropertiesAndValuesEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::cssCustomPropertiesAndValuesEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setSyntheticEditingCommandsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::syntheticEditingCommandsEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::mediaRecorderEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setMediaRecorderEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::mediaDevicesEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setMediaDevicesEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::mediaStreamEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setMediaStreamEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::screenCaptureEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setScreenCaptureEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::setGamepadsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::gamepadsEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setDownloadAttributeEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::downloadAttributeEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setIntersectionObserverEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::intersectionObserverEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setUndoManagerAPIEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::undoManagerAPIEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setEncryptedMediaAPIEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::encryptedMediaAPIEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setLegacyEncryptedMediaAPIEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::legacyEncryptedMediaAPIEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setSystemPreviewEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::systemPreviewEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setLegacyBeforeLoadEventEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::legacyBeforeLoadEventEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::adClickAttributionEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setAdClickAttributionEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::setTouchEventsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::referrerPolicyAttributeEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setReferrerPolicyAttributeEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::interruptAudioOnPageVisibilityChangeEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInterruptAudioOnPageVisibilityChangeEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::linkPreloadResponsiveImagesEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setLinkPreloadResponsiveImagesEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::setLazyImageLoadingEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::lazyImageLoadingEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setIsInAppBrowserPrivacyEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::isInAppBrowserPrivacyEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setNeedsInAppBrowserPrivacyQuirks): Deleted. (WebCore::RuntimeEnabledFeatures::needsInAppBrowserPrivacyQuirks const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebShareFileAPIEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webShareFileAPIEnabled const): Deleted. * page/Settings.yaml: * page/UndoItem.idl: * page/UndoManager.idl: * rendering/RenderImage.cpp: (WebCore::RenderImage::paintIntoRect): * testing/InternalSettings.cpp: (WebCore::InternalSettings::Backup::Backup): (WebCore::InternalSettings::Backup::restoreTo): (WebCore::InternalSettings::setScreenCaptureEnabled): Deleted. * testing/InternalSettings.h: * testing/InternalSettings.idl: * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::setShouldInterruptAudioOnPageVisibilityChange): (WebCore::Internals::addPrefetchLoadEventListener): Source/WebKit: In WebKit, this means mostly removing now unnecessary use of the webcoreBinding key in WebPreferences.yaml and removing now superfluous cases in InjectedBundle::overrideBoolPreferenceForTestRunner. * Shared/WebPreferences.yaml: Removing now unnecessary use of the webcoreBinding key and fix indentation of a few cases. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Remove now superfluous cases, as each boolean Settings based setting gets handled automatically. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Remove explicit setting of setInteractiveFormValidationEnabled now that we don't have the RuntimeEnabledSettings variant being set by the generator. Source/WebKitLegacy/mac: * WebView/WebView.mm: (-[WebView _preferencesChanged:]): Update changed settings to use Settings rather than RuntimeEnabledSettings. Source/WebKitLegacy/win: * WebView.cpp: (WebView::notifyPreferencesChanged): Update changed settings to use Settings rather than RuntimeEnabledSettings. Canonical link: https://commits.webkit.org/228796@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266360 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-31 18:16:31 +00:00
[CallWith=Document, SecureContext] boolean canShare(optional ShareData shareData);
[CallWith=Document, SecureContext] Promise<undefined> share(optional ShareData shareData);
Implement the Web Share API https://bugs.webkit.org/show_bug.cgi?id=171100 <rdar://problem/31751734> Patch by Olivia Barnett <obarnett@apple.com> on 2018-08-29 Reviewed by Tim Horton. LayoutTests/imported/w3c: * web-platform-tests/web-share/idlharness.https-expected.txt: * web-platform-tests/web-share/share-empty.https-expected.txt: * web-platform-tests/web-share/share-securecontext.http-expected.txt: * web-platform-tests/web-share/share-url-invalid.https-expected.txt: * web-platform-tests/web-share/share-without-user-gesture.https-expected.txt: Updated expected results. Source/WebCore: Added one test in fast/events/ios called share.html; adjusted expectations for existing tests. * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * features.json: * loader/EmptyClients.cpp: (WebCore::EmptyChromeClient::showShareSheet): * loader/EmptyClients.h: Added empty showShareSheet function. * page/Chrome.cpp: (WebCore::Chrome::showShareSheet): * page/Chrome.h: Added call to showShareSheet on client. * page/ChromeClient.h: Virtual showShareSheet function. * page/Navigator.cpp: (WebCore::Navigator::share): * page/Navigator.h: Share function that returns a promise and invokes the share sheet. * page/Navigator.idl: Implements NavigatorShare * page/NavigatorShare.idl: Added. Added definition of share function returning a promise. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebShareEnabled): (WebCore::RuntimeEnabledFeatures::webShareEnabled const): Added RuntimeEnabledFeature switch. * page/ShareData.h: Added. * page/ShareData.idl: Added. Definition of ShareData struct. Source/WebKit: * Platform/spi/ios/UIKitSPI.h: Added NSURL _title property as in the WebCore UIKitSPI. * Scripts/webkit/messages.py: ShareDataWithParsedURL special case for header for type. * Shared/ShareSheetCallbackID.h: Added a typedef for a share sheet callback id. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<ShareData>::encode): (IPC::ArgumentCoder<ShareData>::decode): (IPC::ArgumentCoder<ShareDataWithParsedURL>::encode): (IPC::ArgumentCoder<ShareDataWithParsedURL>::decode): * Shared/WebCoreArgumentCoders.h: Added encoding and decoding functionality for new structs. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetWebShareEnabled): (WKPreferencesGetWebShareEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: Added switch for RuntimeEnabledFeature. * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/API/Cocoa/WKWebViewPrivate.h: Added hook for share sheet testing. * UIProcess/PageClient.h: (WebKit::PageClient::showShareSheet): Page client call to invoke share sheet. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::showShareSheet): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Web page proxy handling of call to invoke share sheet. Creates completion handler to send to WKShareSheet.mm Completion handler sends message to WebPage with message id. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::showShareSheet): Page client implementation call to invoke share sheet. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): (-[WKContentView _showShareSheet:completionHandler:]): (-[WKContentView shareSheetDidDismiss:]): (-[WKContentView invokeShareSheetWithResolution:resolved): Call to WKShareSheet to invoke the share sheet and callback. Hook for share sheet resolution testing. * UIProcess/ios/forms/WKShareSheet.h: Added. * UIProcess/ios/forms/WKShareSheet.mm: Added. (-[WKShareSheet initWithView:]): (-[WKShareSheet presentWithParameters:completionHandler:]): (-[WKShareSheet _dispatchDidDismiss]): (-[WKShareSheet _cancel]): (-[WKShareSheet dismiss]): (-[WKShareSheet _dismissDisplayAnimated:]): (-[WKShareSheet _presentFullscreenViewController:animated:]): (-[WKShareSheet invokeShareSheetWithResolution:resolved:]): Completion handler call and creation of share sheet with parameters. Hook that force resolves the share sheet completion handler for testing. * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::showShareSheet): Call to page to invoke share sheet. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::nextShareSheetContextId): (WebKit::WebPage::showShareSheet): (WebKit::WebPage::showShareSheetResponse): WebPage calls proxy and saves context id for promise. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Callback for completed response. Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.h: * WebCoreSupport/WebChromeClientIOS.mm: (WebChromeClientIOS::showShareSheet): Empty declaration of showShareSheet. Source/WebKitLegacy/mac: * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::showShareSheet): Empty declaration of showShareSheet. LayoutTests: * fast/dom/navigator-detached-no-crash-expected.txt: Updated expected results. Canonical link: https://commits.webkit.org/204141@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235489 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-08-30 00:20:26 +00:00
};