WebKit-https.git
4 months agoWebSocketHandshake should not know about a Document
achristensen@apple.com [Wed, 17 Apr 2019 18:49:53 +0000 (18:49 +0000)]
WebSocketHandshake should not know about a Document
https://bugs.webkit.org/show_bug.cgi?id=196468

Reviewed by Tim Horton.

I'll need to move WebSocketHandshake to the NetworkProcess for rdar://problem/46287028
It currently uses the Document pointer for 3 things:
1. To get the user agent, which we can pass in as a creation parameter.
2. To get the origin, which we can also pass in as a creation parameter.
3. To get cookies for the web inspector.  We can pass in a functor instead and have the inspector provide cookies itself.

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::connect):
(WebCore::WebSocketChannel::disconnect):
(WebCore::WebSocketChannel::didOpenSocketStream):
(WebCore::WebSocketChannel::clientHandshakeRequest):
* Modules/websockets/WebSocketChannel.h:
(WebCore::WebSocketChannel::document):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::WebSocketHandshake):
(WebCore::WebSocketHandshake::clientHandshakeMessage const):
(WebCore::WebSocketHandshake::clientHandshakeRequest const):
(WebCore::WebSocketHandshake::clientOrigin const): Deleted.
(WebCore::WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy const): Deleted.
(WebCore::WebSocketHandshake::clearDocument): Deleted.
* Modules/websockets/WebSocketHandshake.h:
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::enable):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244391 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWKRetainPtr's adoption constructor should be private
achristensen@apple.com [Wed, 17 Apr 2019 18:28:56 +0000 (18:28 +0000)]
WKRetainPtr's adoption constructor should be private
https://bugs.webkit.org/show_bug.cgi?id=197019

Reviewed by Tim Horton.

Source/WebKit:

RefPtr and RetainPtr have already done this.  It makes us use nicer syntax.

* UIProcess/API/C/WKContext.cpp:
(WKContextSetDownloadClient):
* UIProcess/API/cpp/WKRetainPtr.h:
(WebKit::WKRetainPtr::WKRetainPtr):
(WebKit::adoptWK):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(dumpFramesAsText):
* TestWebKitAPI/InjectedBundleController.cpp:
(TestWebKitAPI::InjectedBundleController::initialize):
* TestWebKitAPI/PlatformUtilities.cpp:
(TestWebKitAPI::Util::createContextWithInjectedBundle):
(TestWebKitAPI::Util::createInitializationDictionaryForInjectedBundleTest):
(TestWebKitAPI::Util::createContextForInjectedBundleTest):
(TestWebKitAPI::Util::toWK):
* TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/CloseFromWithinCreatePage.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/CloseThenTerminate.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/DOMWindowExtensionBasic.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/DOMWindowExtensionBasic_Bundle.cpp:
(TestWebKitAPI::DOMWindowExtensionBasic::initialize):
* TestWebKitAPI/Tests/WebKit/DOMWindowExtensionNoCache.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/DOMWindowExtensionNoCache_Bundle.cpp:
(TestWebKitAPI::DOMWindowExtensionNoCache::initialize):
* TestWebKitAPI/Tests/WebKit/DeferredViewInWindowStateChange.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/DidNotHandleKeyDown.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/DidRemoveFrameFromHiearchyInPageCache_Bundle.cpp:
(TestWebKitAPI::didRemoveFrameFromHierarchyCallback):
* TestWebKitAPI/Tests/WebKit/DocumentStartUserScriptAlertCrash.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/DocumentStartUserScriptAlertCrash_Bundle.cpp:
(TestWebKitAPI::DocumentStartUserScriptAlertCrashTest::initialize):
* TestWebKitAPI/Tests/WebKit/EnumerateMediaDevices.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/EphemeralSessionPushStateNoHistoryCallback.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/EvaluateJavaScript.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/EventModifiers.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/FailedLoad.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/Find.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/FindMatches.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/FirstMeaningfulPaintMilestone.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/ForceRepaint.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/FrameHandle.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/FrameMIMETypeHTML.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/FrameMIMETypePNG.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/Geolocation.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/GetInjectedBundleInitializationUserDataCallback.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/HitTestResultNodeHandle.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/HitTestResultNodeHandle_Bundle.cpp:
(TestWebKitAPI::HitTestResultNodeHandleTest::getContextMenuFromDefaultMenu):
* TestWebKitAPI/Tests/WebKit/InjectedBundleBasic.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/InjectedBundleDisableOverrideBuiltinsBehavior.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/InjectedBundleDisableOverrideBuiltinsBehavior_Bundle.cpp:
(TestWebKitAPI::InjectedBundleNoDisableOverrideBuiltinsBehaviorTest::initialize):
(TestWebKitAPI::InjectedBundleDisableOverrideBuiltinsBehaviorTest::initialize):
* TestWebKitAPI/Tests/WebKit/InjectedBundleFrameHitTest.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/InjectedBundleFrameHitTest_Bundle.cpp:
(TestWebKitAPI::InjectedBundleFrameHitTestTest::frameLoadFinished):
* TestWebKitAPI/Tests/WebKit/InjectedBundleInitializationUserDataCallbackWins.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/InjectedBundleMakeAllShadowRootsOpen.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/InjectedBundleMakeAllShadowRootsOpen_Bundle.cpp:
(TestWebKitAPI::InjectedBundleMakeAllShadowRootOpenTest::initialize):
* TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/LoadAlternateHTMLStringWithNonDirectoryURL.cpp:
(TestWebKitAPI::loadAlternateHTMLString):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/LoadCanceledNoServerRedirectCallback.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/LoadPageOnCrash.cpp:
(TestWebKitAPI::WebKit2CrashLoader::WebKit2CrashLoader):
* TestWebKitAPI/Tests/WebKit/MenuTypesForMouseEvents.cpp:
(TestWebKitAPI::buildAndPerformTest):
* TestWebKitAPI/Tests/WebKit/ModalAlertsSPI.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/MouseMoveAfterCrash.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayout.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutFails.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutForImages.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/NewFirstVisuallyNonEmptyLayoutFrames.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/PageLoadBasic.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/PageLoadDidChangeLocationWithinPageForFrame.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/PasteboardNotifications.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/PendingAPIRequestURL.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/PreventEmptyUserAgent.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/PrivateBrowsingPushStateNoHistoryCallback.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/ProcessDidTerminate.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/ReloadPageAfterCrash.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/ResizeReversePaginatedWebView.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/ResizeWindowAfterCrash.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/RestoreSessionState.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/RestoreSessionStateContainingFormData.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/ScrollPinningBehaviors.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/ShouldKeepCurrentBackForwardListItemInList.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/SpacebarScrolling.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/StopLoadingDuringDidFailProvisionalLoad.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/TerminateTwice.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/UserMedia.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/WKPageCopySessionStateWithFiltering.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/WKPageGetScaleFactorNotZero.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/WKPageIsPlayingAudio.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/WKPreferences.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/WKThumbnailView.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/WillSendSubmitEvent.cpp:
(TestWebKitAPI::didReceiveMessageFromInjectedBundle):
* TestWebKitAPI/Tests/WebKit/mac/AttributedSubstringForProposedRangeWithImage.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/mac/ContextMenuDownload.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/mac/CustomBundleParameter.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/mac/EditorCommands.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/mac/ForceLightAppearanceInBundle.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/mac/GetPIDAfterAbortedProcessLaunch.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/mac/InjectedBundleAppleEvent.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/mac/RestoreStateAfterTermination.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/FullscreenDelegate.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm:
* TestWebKitAPI/Tests/WebKitCocoa/ProcessSuspendMediaBuffering.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:
* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(TEST):
* TestWebKitAPI/Tests/mac/FirstResponderScrollingPosition.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm:
(TestWebKitAPI::FullscreenZoomInitialFrame::initializeView):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::getMenuItemTitleCallback):
(WTR::createMouseMessageBody):
(WTR::EventSendingController::mouseDown):
(WTR::EventSendingController::mouseUp):
(WTR::EventSendingController::mouseMoveTo):
(WTR::EventSendingController::mouseForceClick):
(WTR::EventSendingController::startAndCancelMouseForceClick):
(WTR::EventSendingController::mouseForceDown):
(WTR::EventSendingController::mouseForceUp):
(WTR::EventSendingController::mouseForceChanged):
(WTR::EventSendingController::leapForward):
(WTR::EventSendingController::scheduleAsynchronousClick):
(WTR::createKeyDownMessageBody):
(WTR::EventSendingController::keyDown):
(WTR::EventSendingController::scheduleAsynchronousKeyDown):
(WTR::EventSendingController::mouseScrollBy):
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::continuousMouseScrollBy):
(WTR::EventSendingController::addTouchPoint):
(WTR::EventSendingController::updateTouchPoint):
(WTR::EventSendingController::setTouchModifier):
(WTR::EventSendingController::setTouchPointRadius):
(WTR::EventSendingController::touchStart):
(WTR::EventSendingController::touchMove):
(WTR::EventSendingController::touchEnd):
(WTR::EventSendingController::touchCancel):
(WTR::EventSendingController::clearTouchPoints):
(WTR::EventSendingController::releaseTouchPoint):
(WTR::EventSendingController::cancelTouchPoint):
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didCreatePage):
(WTR::InjectedBundle::didReceiveMessage):
(WTR::InjectedBundle::didReceiveMessageToPage):
(WTR::InjectedBundle::booleanForKey):
(WTR::InjectedBundle::done):
(WTR::InjectedBundle::dumpToStdErr):
(WTR::InjectedBundle::outputText):
(WTR::InjectedBundle::postNewBeforeUnloadReturnValue):
(WTR::InjectedBundle::postAddChromeInputField):
(WTR::InjectedBundle::postRemoveChromeInputField):
(WTR::InjectedBundle::postFocusWebView):
(WTR::InjectedBundle::postSetBackingScaleFactor):
(WTR::InjectedBundle::postSetWindowIsKey):
(WTR::InjectedBundle::postSetViewSize):
(WTR::InjectedBundle::postSimulateWebNotificationClick):
(WTR::InjectedBundle::postSetAddsVisitedLinks):
(WTR::InjectedBundle::setGeolocationPermission):
(WTR::InjectedBundle::setMockGeolocationPosition):
(WTR::InjectedBundle::setMockGeolocationPositionUnavailableError):
(WTR::InjectedBundle::isGeolocationProviderActive const):
(WTR::InjectedBundle::imageCountInGeneralPasteboard const):
(WTR::InjectedBundle::setUserMediaPersistentPermissionForOrigin):
(WTR::InjectedBundle::userMediaPermissionRequestCountForOrigin const):
(WTR::InjectedBundle::resetUserMediaPermissionRequestCountForOrigin):
(WTR::InjectedBundle::setCustomPolicyDelegate):
(WTR::InjectedBundle::setHidden):
(WTR::InjectedBundle::setCacheModel):
(WTR::InjectedBundle::shouldProcessWorkQueue const):
(WTR::InjectedBundle::processWorkQueue):
(WTR::InjectedBundle::queueBackNavigation):
(WTR::InjectedBundle::queueForwardNavigation):
(WTR::InjectedBundle::queueLoad):
(WTR::InjectedBundle::queueLoadHTMLString):
(WTR::InjectedBundle::queueReload):
(WTR::InjectedBundle::queueLoadingScript):
(WTR::InjectedBundle::queueNonLoadingScript):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::frameToStr):
(WTR::InjectedBundlePage::InjectedBundlePage):
(WTR::dumpFrameDescriptionSuitableForTestResult):
(WTR::dumpFrameScrollPosition):
(WTR::dumpDescendantFrameScrollPositions):
(WTR::dumpFrameText):
(WTR::dumpDescendantFramesText):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::shouldDumpPixels const):
(WTR::TestRunner::setDumpPixels):
(WTR::TestRunner::whatToDump const):
(WTR::TestRunner::setWhatToDump):
(WTR::TestRunner::setWaitUntilDone):
(WTR::TestRunner::shouldWaitUntilDone const):
(WTR::TestRunner::setShouldDumpFrameLoadCallbacks):
(WTR::TestRunner::shouldDumpFrameLoadCallbacks):
(WTR::TestRunner::clearAllDatabases):
(WTR::TestRunner::setIDBPerOriginQuota):
(WTR::TestRunner::originsWithApplicationCache):
(WTR::TestRunner::setCanOpenWindows):
(WTR::TestRunner::setXSSAuditorEnabled):
(WTR::TestRunner::setMediaDevicesEnabled):
(WTR::TestRunner::setWebRTCMDNSICECandidatesEnabled):
(WTR::TestRunner::setWebRTCUnifiedPlanEnabled):
(WTR::TestRunner::setCustomUserAgent):
(WTR::TestRunner::setWebAPIStatisticsEnabled):
(WTR::TestRunner::setModernMediaControlsEnabled):
(WTR::TestRunner::setWebGL2Enabled):
(WTR::TestRunner::setWritableStreamAPIEnabled):
(WTR::TestRunner::setReadableByteStreamAPIEnabled):
(WTR::TestRunner::setEncryptedMediaAPIEnabled):
(WTR::TestRunner::setAllowsAnySSLCertificate):
(WTR::TestRunner::setPluginsEnabled):
(WTR::TestRunner::setValueForUser):
(WTR::TestRunner::setAudioResult):
(WTR::TestRunner::didReceiveServerRedirectForProvisionalNavigation const):
(WTR::TestRunner::clearDidReceiveServerRedirectForProvisionalNavigation):
(WTR::TestRunner::setAlwaysAcceptCookies):
(WTR::TestRunner::setOnlyAcceptFirstPartyCookies):
(WTR::TestRunner::isDoingMediaCapture const):
(WTR::TestRunner::queueLoad):
(WTR::TestRunner::setRejectsProtectionSpaceAndContinueForAuthenticationChallenges):
(WTR::TestRunner::setHandlesAuthenticationChallenges):
(WTR::TestRunner::setShouldLogCanAuthenticateAgainstProtectionSpace):
(WTR::TestRunner::setShouldLogDownloadCallbacks):
(WTR::TestRunner::setAuthenticationUsername):
(WTR::TestRunner::setAuthenticationPassword):
(WTR::TestRunner::secureEventInputIsEnabled const):
(WTR::TestRunner::setBlockAllPlugins):
(WTR::TestRunner::setPluginSupportedMode):
(WTR::TestRunner::setShouldDecideNavigationPolicyAfterDelay):
(WTR::TestRunner::setShouldDecideResponsePolicyAfterDelay):
(WTR::TestRunner::setNavigationGesturesEnabled):
(WTR::TestRunner::setIgnoresViewportScaleLimits):
(WTR::TestRunner::setShouldDownloadUndisplayableMIMETypes):
(WTR::TestRunner::setShouldAllowDeviceOrientationAndMotionAccess):
(WTR::TestRunner::terminateNetworkProcess):
(WTR::TestRunner::terminateServiceWorkerProcess):
(WTR::TestRunner::runUIScript):
(WTR::TestRunner::setStatisticsDebugMode):
(WTR::TestRunner::setStatisticsPrevalentResourceForDebugMode):
(WTR::TestRunner::setStatisticsLastSeen):
(WTR::TestRunner::setStatisticsPrevalentResource):
(WTR::TestRunner::setStatisticsVeryPrevalentResource):
(WTR::TestRunner::dumpResourceLoadStatistics):
(WTR::TestRunner::isStatisticsPrevalentResource):
(WTR::TestRunner::isStatisticsVeryPrevalentResource):
(WTR::TestRunner::isStatisticsRegisteredAsSubresourceUnder):
(WTR::TestRunner::isStatisticsRegisteredAsSubFrameUnder):
(WTR::TestRunner::isStatisticsRegisteredAsRedirectingTo):
(WTR::TestRunner::setStatisticsHasHadUserInteraction):
(WTR::TestRunner::isStatisticsHasHadUserInteraction):
(WTR::TestRunner::setStatisticsGrandfathered):
(WTR::TestRunner::isStatisticsGrandfathered):
(WTR::TestRunner::setStatisticsSubframeUnderTopFrameOrigin):
(WTR::TestRunner::setStatisticsSubresourceUnderTopFrameOrigin):
(WTR::TestRunner::setStatisticsSubresourceUniqueRedirectTo):
(WTR::TestRunner::setStatisticsSubresourceUniqueRedirectFrom):
(WTR::TestRunner::setStatisticsTopFrameUniqueRedirectTo):
(WTR::TestRunner::setStatisticsTopFrameUniqueRedirectFrom):
(WTR::TestRunner::setStatisticsCrossSiteLoadWithLinkDecoration):
(WTR::TestRunner::setStatisticsTimeToLiveUserInteraction):
(WTR::TestRunner::installStatisticsDidScanDataRecordsCallback):
(WTR::TestRunner::statisticsProcessStatisticsAndDataRecords):
(WTR::TestRunner::statisticsUpdateCookieBlocking):
(WTR::TestRunner::statisticsSubmitTelemetry):
(WTR::TestRunner::setStatisticsNotifyPagesWhenDataRecordsWereScanned):
(WTR::TestRunner::setStatisticsIsRunningTest):
(WTR::TestRunner::setStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
(WTR::TestRunner::setStatisticsNotifyPagesWhenTelemetryWasCaptured):
(WTR::TestRunner::setStatisticsMinimumTimeBetweenDataRecordsRemoval):
(WTR::TestRunner::setStatisticsGrandfatheringTime):
(WTR::TestRunner::setStatisticsMaxStatisticsEntries):
(WTR::TestRunner::setStatisticsPruneEntriesDownTo):
(WTR::TestRunner::statisticsClearInMemoryAndPersistentStore):
(WTR::TestRunner::statisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
(WTR::TestRunner::statisticsClearThroughWebsiteDataRemoval):
(WTR::TestRunner::statisticsDeleteCookiesForHost):
(WTR::TestRunner::setStatisticsCacheMaxAgeCap):
(WTR::TestRunner::statisticsResetToConsistentState):
(WTR::TestRunner::setStorageAccessAPIEnabled):
(WTR::TestRunner::getAllStorageAccessEntries):
(WTR::TestRunner::addMockMediaDevice):
(WTR::TestRunner::clearMockMediaDevices):
(WTR::TestRunner::removeMockMediaDevice):
(WTR::TestRunner::resetMockMediaDevices):
(WTR::TestRunner::connectMockGamepad):
(WTR::TestRunner::disconnectMockGamepad):
(WTR::TestRunner::setMockGamepadDetails):
(WTR::TestRunner::setMockGamepadAxisValue):
(WTR::TestRunner::setMockGamepadButtonValue):
(WTR::TestRunner::removeAllSessionCredentials):
(WTR::TestRunner::clearDOMCache):
(WTR::TestRunner::clearDOMCaches):
(WTR::TestRunner::hasDOMCache):
(WTR::TestRunner::domCacheSize):
(WTR::TestRunner::setAllowStorageQuotaIncrease):
(WTR::TestRunner::getApplicationManifestThen):
(WTR::TestRunner::injectUserScript):
(WTR::TestRunner::sendDisplayConfigurationChangedMessageForTesting):
(WTR::TestRunner::setWebAuthenticationMockConfiguration):
(WTR::TestRunner::addTestKeyToKeychain):
(WTR::TestRunner::cleanUpKeychain):
(WTR::TestRunner::keyExistsInKeychain):
(WTR::TestRunner::setCanHandleHTTPSServerTrustEvaluation):
(WTR::TestRunner::canDoServerTrustEvaluationInNetworkProcess):
(WTR::TestRunner::serverTrustEvaluationCallbackCallsCount):
(WTR::TestRunner::setShouldDismissJavaScriptAlertsAsynchronously):
(WTR::TestRunner::setAdClickAttributionOverrideTimerForTesting):
(WTR::TestRunner::setAdClickAttributionConversionURLForTesting):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):
(WTR::parseStringTestHeaderValueAsRelativePath):
(WTR::updateTestOptionsFromTestHeader):
(WTR::TestController::runTest):
(WTR::TestController::didReceiveLiveDocumentsList):
(WTR::TestController::didReceiveMessageFromInjectedBundle):
(WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle):
(WTR::TestController::didFinishNavigation):
(WTR::TestController::didReceiveAuthenticationChallenge):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
(WTR::TestInvocation::uiScriptDidComplete):
(WTR::TestInvocation::didReceiveAllStorageAccessEntries):
* WebKitTestRunner/WebNotificationProvider.cpp:
(WTR::WebNotificationProvider::closeWebNotification):
* WebKitTestRunner/WorkQueueManager.cpp:
(WTR::ScriptItem::ScriptItem):
(WTR::WorkQueueManager::queueLoad):
(WTR::WorkQueueManager::queueLoadHTMLString):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244390 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoFix crash during teardown of PingLoad
achristensen@apple.com [Wed, 17 Apr 2019 18:09:02 +0000 (18:09 +0000)]
Fix crash during teardown of PingLoad
https://bugs.webkit.org/show_bug.cgi?id=197024
<rdar://problem/49973077>

Reviewed by Jer Noble.

* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::initialize):
Early return if weakThis is null.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244389 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoREGRESSION (r243926): [iOS] Release assertion when computing editor state during...
wenson_hsieh@apple.com [Wed, 17 Apr 2019 18:04:29 +0000 (18:04 +0000)]
REGRESSION (r243926): [iOS] Release assertion when computing editor state during an overflow scroll triggered by layout
https://bugs.webkit.org/show_bug.cgi?id=197012
<rdar://problem/49908848>

Reviewed by Simon Fraser.

Source/WebKit:

We hit the release assertion due to the following sequence of events:
- Dispatch a queued event (in this case, a scroll event)
- Invoke the scroll event listener, which modifies layout in some way
- This scrolls an overflow scrollable container under the scope of layout
- Overflow scrolling then calls didChangeSelection and triggers an editor state update, which updates layout

In the case where the selection is in the main frame, we bail early due to the check for recursive layout (i.e.
frameView->layoutContext().isInRenderTreeLayout()). However, in the case where the selection is inside a
subframe, we end up skipping past this check, since the subframe's FrameView isn't currently laying out, and so
we end up hitting the release assertion underneath the early return.

To fix this, simply defer editor state updates due to overflow scrolling until the next remote layer tree commit
instead of computing and sending the information immediately. While this only defers editor state updates during
overflow scrolling, <rdar://problem/47258878> tracks making editor state updates deferred in the general case.

Test: editing/selection/overflow-scroll-while-selecting-text.html

* WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
(WebKit::WebEditorClient::overflowScrollPositionChanged):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didChangeOverflowScrollPosition):
(WebKit::WebPage::didChangeSelection):
(WebKit::WebPage::didChangeSelectionOrOverflowScrollPosition):
* WebProcess/WebPage/WebPage.h:

LayoutTests:

Adds a new layout test to exercise the crash.

* editing/selection/overflow-scroll-while-selecting-text-expected.txt: Added.
* editing/selection/overflow-scroll-while-selecting-text.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244388 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed build fix for iOSMac after r244223.
timothy@apple.com [Wed, 17 Apr 2019 17:59:21 +0000 (17:59 +0000)]
Unreviewed build fix for iOSMac after r244223.

* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::routeSharingPolicy const): Add ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END
around AVAudioSessionRouteSharingPolicyLongForm use.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244387 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoMove MiG .def files into their own "Copy files" build step
krollin@apple.com [Wed, 17 Apr 2019 17:58:09 +0000 (17:58 +0000)]
Move MiG .def files into their own "Copy files" build step
https://bugs.webkit.org/show_bug.cgi?id=196982

Reviewed by Alex Christensen.

WebKitLegacy's MiG files need to be processed differently from the
other files in the "Copy Headers" build phase, so move them into their
own "Copy Files" build phase. This arrangement removes them from any
post-processing performed on the main group of headers.

* WebKitLegacy.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244386 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoRemove JSCBuiltins.cpp from Copy Headers phase
krollin@apple.com [Wed, 17 Apr 2019 17:57:11 +0000 (17:57 +0000)]
Remove JSCBuiltins.cpp from Copy Headers phase
https://bugs.webkit.org/show_bug.cgi?id=196981
<rdar://problem/49952133>

Reviewed by Alex Christensen.

JSCBuiltins.cpp is not a header and so doesn't need to be in the Copy
Headers phase. Checking its history, it seems to have been added
accidentally at the same time that JSCBuiltins.h was added.

* JavaScriptCore.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244385 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoAdd a comment to make my test from r244139 less mysterious.
achristensen@apple.com [Wed, 17 Apr 2019 17:41:32 +0000 (17:41 +0000)]
Add a comment to make my test from r244139 less mysterious.
https://bugs.webkit.org/show_bug.cgi?id=196744

As suggested by Darin Adler.

* TestWebKitAPI/Tests/WebKitCocoa/BundleRetainPagePlugIn.mm:
(-[BundleRetainPagePlugIn webProcessPlugIn:didCreateBrowserContextController:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244384 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[Mac iOS WK2] Layout Test http/tests/resourceLoadStatistics/ping-to-prevalent-resourc...
achristensen@apple.com [Wed, 17 Apr 2019 17:28:04 +0000 (17:28 +0000)]
[Mac iOS WK2] Layout Test http/tests/resourceLoadStatistics/ping-to-prevalent-resource.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=196974

Reviewed by Brady Eidson.

* http/tests/resourceLoadStatistics/ping-to-prevalent-resource.html:
Make test do one thing at a time to avoid race conditions.
Clean up state on the server after test is finished to prevent corrupting future test state.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244383 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoRemember device orientation permission for the duration of the browsing session
cdumez@apple.com [Wed, 17 Apr 2019 17:03:59 +0000 (17:03 +0000)]
Remember device orientation permission for the duration of the browsing session
https://bugs.webkit.org/show_bug.cgi?id=196992
<rdar://problem/49946067>

Reviewed by Alex Christensen.

Source/WebCore:

Use DeviceOrientationOrMotionPermissionState type more consistently in the code base
instead of bool or Optional<bool>. Added "Prompt" value to this enumeration which is the
default state and which indicates we should ask the client.

* WebCore.xcodeproj/project.pbxproj:
* dom/DeviceOrientationAndMotionAccessController.cpp:
(WebCore::DeviceOrientationAndMotionAccessController::DeviceOrientationAndMotionAccessController):
(WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
* dom/DeviceOrientationAndMotionAccessController.h:
(WebCore::DeviceOrientationAndMotionAccessController::accessState const):
* dom/DeviceOrientationOrMotionEvent.cpp:
(WebCore::DeviceOrientationOrMotionEvent::requestPermission):
* dom/DeviceOrientationOrMotionPermissionState.h:
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::deviceOrientationAndMotionAccessState const):
(WebCore::DocumentLoader::setDeviceOrientationAndMotionAccessState):
* page/ChromeClient.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::isAllowedToAddDeviceMotionOrientationListener const):

Source/WebKit:

Implement caching of device orientation permission decisions on the WebDeviceOrientationAndMotionAccessController,
which is owned by the WebsiteDataStore. This way, if we already prompted the user of a given origin, we will
remember the previous decision for the duration of the session and not prompt again.

* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::copy const):
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/Cocoa/WKWebpagePreferences.mm:
(toDeviceOrientationOrMotionPermissionState):
(-[WKWebpagePreferences _setDeviceOrientationAndMotionAccessPolicy:]):
(toWKWebsiteDeviceOrientationAndMotionAccessPolicy):
(-[WKWebpagePreferences _deviceOrientationAndMotionAccessPolicy]):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::shouldAllowDeviceOrientationAndMotionAccess):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebsiteData/WebDeviceOrientationAndMotionAccessController.cpp: Added.
(WebKit::WebDeviceOrientationAndMotionAccessController::shouldAllowDeviceOrientationAndMotionAccess):
(WebKit::WebDeviceOrientationAndMotionAccessController::deviceOrientationPermission const):
* UIProcess/WebsiteData/WebDeviceOrientationAndMotionAccessController.h: Copied from Source/WebCore/dom/DeviceOrientationAndMotionAccessController.h.
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::deviceOrientationAndMotionAccessController):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::shouldAllowDeviceOrientationAndMotionAccess):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::shouldAllowDeviceOrientationAndMotionAccess):
* WebProcess/WebPage/WebPage.h:

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/DeviceOrientation.mm:
(-[DeviceOrientationPermissionUIDelegate _webView:shouldAllowDeviceOrientationAndMotionAccessRequestedByFrame:decisionHandler:]):
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244382 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoEnable HAVE_AVFOUNDATION_VIDEO_OUTPUT on PLATFORM(IOSMAC)
jer.noble@apple.com [Wed, 17 Apr 2019 16:47:44 +0000 (16:47 +0000)]
Enable HAVE_AVFOUNDATION_VIDEO_OUTPUT on PLATFORM(IOSMAC)
https://bugs.webkit.org/show_bug.cgi?id=196994
<rdar://problem/44158331>

Reviewed by Alex Christensen.

* wtf/Platform.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244381 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[ews-app] Clicking 'submit to new ews' doesn't reload status-bubble
aakash_jain@apple.com [Wed, 17 Apr 2019 16:20:01 +0000 (16:20 +0000)]
[ews-app] Clicking 'submit to new ews' doesn't reload status-bubble
https://bugs.webkit.org/show_bug.cgi?id=196675

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/views/submittoews.py:
(SubmitToEWS): Added @xframe_options_exempt similar to statusbubble.py

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244379 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago [iOS] Unreviewed gardening.
zalan@apple.com [Wed, 17 Apr 2019 16:10:09 +0000 (16:10 +0000)]
[iOS] Unreviewed gardening.

2 single taps in fast loading subsequent tests are recognized as double tap. Turn off double taps for content observation tests.

* fast/events/touch/ios/content-observation/0ms-delay-0ms-transition-on-mousemove.html:
* fast/events/touch/ios/content-observation/0ms-transition-on-touch-start.html:
* fast/events/touch/ios/content-observation/100ms-delay-10ms-transition-on-mousemove.html:
* fast/events/touch/ios/content-observation/100ms-transition-on-touch-start.html:
* fast/events/touch/ios/content-observation/10ms-delay-0ms-transition-on-mousemove.html:
* fast/events/touch/ios/content-observation/10ms-delay-0ms-transition-on-touch-start.html:
* fast/events/touch/ios/content-observation/10ms-delay-transition-on-touch-start-with-non-0px-end.html:
* fast/events/touch/ios/content-observation/10ms-delay-transition-on-touch-start.html:
* fast/events/touch/ios/content-observation/350ms-hover-intent.html:
* fast/events/touch/ios/content-observation/400ms-hover-intent.html:
* fast/events/touch/ios/content-observation/click-instead-of-hover-simple.html:
* fast/events/touch/ios/content-observation/clickable-content-is-inside-a-container.html:
* fast/events/touch/ios/content-observation/crash-on-anonymous-renderer.html:
* fast/events/touch/ios/content-observation/hover-when-style-change-is-async.html:
* fast/events/touch/ios/content-observation/hover-while-loading-subframe.html:
* fast/events/touch/ios/content-observation/iframe-is-shown-on-hover.html:
* fast/events/touch/ios/content-observation/mouse-out-event-should-fire-on-click.html:
* fast/events/touch/ios/content-observation/move-content-from-offscreen.html:
* fast/events/touch/ios/content-observation/new-content-covers-tap-target.html:
* fast/events/touch/ios/content-observation/non-visible-becomes-visible-and-gains-new-renderer.html:
* fast/events/touch/ios/content-observation/non-visible-content-gains-new-renderer.html:
* fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-with-opacity-and-left.html:
* fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-with-transition.html:
* fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove.html:
* fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart-with-transition.html:
* fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart.html:
* fast/events/touch/ios/content-observation/remove-subframe-while-observing.html:
* fast/events/touch/ios/content-observation/stuck-with-hover-state.html:
* fast/events/touch/ios/content-observation/style-recalc-schedule-and-force-relalc.html:
* fast/events/touch/ios/content-observation/tap-on-input-type-button-element.html:
* fast/events/touch/ios/content-observation/tap-on-input-type-text-element.html:
* fast/events/touch/ios/content-observation/transition-on-touch-start-and-remove.html:
* fast/events/touch/ios/content-observation/visibility-change-after-touch-end.html:
* fast/events/touch/ios/content-observation/visibility-change-happens-at-the-second-timer.html:
* fast/events/touch/ios/content-observation/visibility-change-happens-on-timer-hops.html:
* fast/events/touch/ios/content-observation/visibility-change-happens-while-in-mousemoved.html:
* fast/events/touch/ios/content-observation/visibility-change-is-max-height-change.html:
* fast/events/touch/ios/content-observation/visibility-change-on-touch-start-simple.html:
* fast/events/touch/ios/content-observation/visibility-change-with-image-content.html:
* fast/events/touch/ios/content-observation/visible-content-gains-new-renderer.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244378 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoXMLHttpRequest has the wrong fallback encoding
commit-queue@webkit.org [Wed, 17 Apr 2019 10:11:12 +0000 (10:11 +0000)]
XMLHttpRequest has the wrong fallback encoding
https://bugs.webkit.org/show_bug.cgi?id=191741

Patch by Rob Buis <rbuis@igalia.com> on 2019-04-17
Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Update improved test expectations and sync unsupported-encodings.any.js and
replacement-encodings.any.js tests.

* web-platform-tests/encoding/replacement-encodings.any-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/encoding/replacement-encodings-expected.txt.
* web-platform-tests/encoding/replacement-encodings.any.html: Added.
* web-platform-tests/encoding/replacement-encodings.any.js: Renamed from LayoutTests/imported/w3c/web-platform-tests/encoding/replacement-encodings.html.
* web-platform-tests/encoding/replacement-encodings.any.worker-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/encoding/replacement-encodings-expected.txt.
* web-platform-tests/encoding/replacement-encodings.any.worker.html: Added.
* web-platform-tests/encoding/unsupported-encodings-expected.txt: Removed.
* web-platform-tests/encoding/unsupported-encodings.any-expected.txt: Added.
* web-platform-tests/encoding/unsupported-encodings.any.html: Added.
* web-platform-tests/encoding/unsupported-encodings.any.js: Added.
* web-platform-tests/encoding/unsupported-encodings.any.worker-expected.txt: Added.
* web-platform-tests/encoding/unsupported-encodings.any.worker.html: Added.
* web-platform-tests/encoding/unsupported-encodings.html: Removed.
* web-platform-tests/xhr/overridemimetype-edge-cases.window-expected.txt:
* web-platform-tests/xhr/responsetext-decoding-expected.txt:

Source/WebCore:

Allow overriding the response charset as specified here:
https://xhr.spec.whatwg.org/#final-charset

Behavior matches Firefox and Chrome.

Tests: imported/w3c/web-platform-tests/encoding/replacement-encodings.any.html
       imported/w3c/web-platform-tests/encoding/replacement-encodings.any.worker.html
       imported/w3c/web-platform-tests/encoding/unsupported-encodings.any.html
       imported/w3c/web-platform-tests/encoding/unsupported-encodings.any.worker.html

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::finalResponseCharset const):
(WebCore::XMLHttpRequest::createDecoder const):
* xml/XMLHttpRequest.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244377 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUpdate the test result of resize-observer/eventloop.html.
commit-queue@webkit.org [Wed, 17 Apr 2019 09:21:50 +0000 (09:21 +0000)]
Update the test result of resize-observer/eventloop.html.
https://bugs.webkit.org/show_bug.cgi?id=197001

Patch by Cathie Chen <cathiechen@igalia.com> on 2019-04-17
Reviewed by Frédéric Wang.

LayoutTests/imported/w3c:

* web-platform-tests/resize-observer/eventloop-expected.txt:

LayoutTests:

Since 177484 has landed, the order of requestAnimationFrame and resizeobserver callback is right.
No need to mark eventloop.html as flaky.

* TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244376 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoOpt Google Maps into simulated mouse events dispatch quirk
graouts@webkit.org [Wed, 17 Apr 2019 07:36:35 +0000 (07:36 +0000)]
Opt Google Maps into simulated mouse events dispatch quirk
https://bugs.webkit.org/show_bug.cgi?id=196965
<rdar://problem/49934766>

Reviewed by Dean Jackson.

Use the correct Google Maps path.

* page/Quirks.cpp:
(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244375 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoOpt flipkart.com into simulated mouse events dispatch quirk
graouts@webkit.org [Wed, 17 Apr 2019 07:33:51 +0000 (07:33 +0000)]
Opt flipkart.com into simulated mouse events dispatch quirk
https://bugs.webkit.org/show_bug.cgi?id=196961
<rdar://problem/49648520>

Reviewed by Dean Jackson.

* page/Quirks.cpp:
(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244374 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoOpt MSN.com into simulated mouse events dispatch quirk
graouts@webkit.org [Wed, 17 Apr 2019 07:30:27 +0000 (07:30 +0000)]
Opt MSN.com into simulated mouse events dispatch quirk
https://bugs.webkit.org/show_bug.cgi?id=196960
<rdar://problem/49403260>

Reviewed by Dean Jackson.

* page/Quirks.cpp:
(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244373 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoScalableImageDecoder: don't forcefully decode image data when querying frame complete...
zandobersek@gmail.com [Wed, 17 Apr 2019 06:16:04 +0000 (06:16 +0000)]
ScalableImageDecoder: don't forcefully decode image data when querying frame completeness, duration
https://bugs.webkit.org/show_bug.cgi?id=191354
<rdar://problem/46123406>

Reviewed by Michael Catanzaro.

ScalableImageDecoder::frameIsCompleteAtIndex() should only check the
index validity and, if the index is valid, check for completeness of the
corresponding frame. ScalableImageDecoder::frameDurationAtIndex() should
also only retrieve duration for already-complete frames, or expand the
default 0-second value according to the flashing-protection rule when
the target frame is not yet complete.

Both methods avoid calling ScalableImageDecoder::frameBufferAtIndex()
as that method goes on and decodes image data to determine specific
information. The ImageSource class that's querying this information
doesn't anticipate this, and doesn't handle the increased memory
consumption of the decoded data, leaving MemoryCache in the blind about
the image resource's actual amount of consumed memory. ImageSource can
instead gracefully handle any incomplete frame by marking the decoding
status for this frame as only partial.

* platform/image-decoders/ScalableImageDecoder.cpp:
(WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
(WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
(WebCore::ScalableImageDecoder::frameDurationAtIndex const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244372 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[iOSMac] Use UIDocumentPickerViewController for picking files
aestes@apple.com [Wed, 17 Apr 2019 04:45:49 +0000 (04:45 +0000)]
[iOSMac] Use UIDocumentPickerViewController for picking files
https://bugs.webkit.org/show_bug.cgi?id=196999
<rdar://problem/49961414>

Reviewed by Tim Horton.

* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _showDocumentPickerMenu]):
Changed to present a UIDocumentPickerViewController on iOSMac.

(-[WKFileUploadPanel documentPicker:didPickDocumentsAtURLs:]):
(-[WKFileUploadPanel documentPicker:didPickDocumentAtURL:]):
Replaced a deprecated delegate method implementation.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244371 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[iOS] [WebKit2] Add support for honoring -[UIMenuItem dontDismiss]
wenson_hsieh@apple.com [Wed, 17 Apr 2019 03:34:10 +0000 (03:34 +0000)]
[iOS] [WebKit2] Add support for honoring -[UIMenuItem dontDismiss]
https://bugs.webkit.org/show_bug.cgi?id=196919
<rdar://problem/41630459>

Reviewed by Tim Horton.

Source/WebKit:

Adds modern WebKit support for -dontDismiss by implementing a couple of new platform hooks. Covered by a new
layout test: editing/selection/ios/selection-after-changing-text-with-callout-menu.html.

* Platform/spi/ios/UIKitSPI.h:

Declare the private -dontDismiss property of UIMenuItem.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView willFinishIgnoringCalloutBarFadeAfterPerformingAction]):

Additionally teach the web view (not just the content view) to respond to the hook. This matters in the case
where the WebKit client (most notably, Mail) overrides WKWebView methods to define custom actions in the menu
controller. This scenario is exercised by the new layout test.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView willFinishIgnoringCalloutBarFadeAfterPerformingAction]):

If an action was performed where callout bar fading was ignored, then in WebKit, don't allow selection changes
to fade the callout bar until after the next remote layer tree commit.

(-[WKContentView _updateChangedSelection:]):

Stop suppressing selection updates when showing B/I/U controls, now that we can properly honor the -dontDismiss
property. This was originally introduced in <rdar://problem/15199925>, presumably to ensure that B/I/U buttons
(which have -dontDismiss set to YES) don't trigger selection change and end up dismissing themselves; however,
if triggering B/I/U actually changes the selection rects, this also means that the selection rects on-screen
would be stale after triggering these actions. This effect is most noticeable when bolding text.

(-[WKContentView shouldAllowHidingSelectionCommands]):

Tools:

Add iOS support for several new testing hooks. See below for more detail.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::isDismissingMenu const):

Add a new script controller method to query whether the platform menu (on iOS, the callout bar) is done
dismissing. We consider the menu to be dismissing in between the `-WillHide` and `-DidHide` notifications sent
by UIKit when dismissing the callout bar (i.e. UIMenuController).

* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::isDismissingMenu const):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setAllowedMenuActions):

Add a new helper method to specify a list of allowed actions when bringing up the menu. On iOS, in the case of
actions supported by the platform, this matches against method selector names (for instance, "SelectAll", or
"Copy", or "Paste"). In the case of the custom actions installed via `installCustomMenuAction`, we instead match
against the name of the custom action.

(WTR::TestRunner::installCustomMenuAction):

Add a new helper method to install a custom action for the context menu (on iOS, this is the callout bar). This
takes the name of the action (which appears in a button in the callout bar), whether the action should cause
the callout bar to automatically dismiss, and finally, a JavaScript callback that is invoked when the action is
triggered.

(WTR::TestRunner::performCustomMenuAction):

Invoked when the custom menu action is triggered.

* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::installCustomMenuAction):
(WTR::TestController::setAllowedMenuActions):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
(WTR::TestInvocation::performCustomMenuAction):

Add plumbing to call back into the injected bundle when performing the custom action.

* WebKitTestRunner/TestInvocation.h:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::installCustomMenuAction):
(WTR::TestController::setAllowedMenuActions):
* WebKitTestRunner/cocoa/TestRunnerWKWebView.h:
* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(-[TestRunnerWKWebView initWithFrame:configuration:]):
(-[TestRunnerWKWebView becomeFirstResponder]):
(-[TestRunnerWKWebView _addCustomItemToMenuControllerIfNecessary]):

Helper method that converts web view's current custom menu action info into a UIMenuItem, and adds it to the
shared menu controller. This is also invoked when the web view becomes first responder, which matches behavior
in the Mail app on iOS.

(-[TestRunnerWKWebView installCustomMenuAction:dismissesAutomatically:callback:]):
(-[TestRunnerWKWebView setAllowedMenuActions:]):
(-[TestRunnerWKWebView resetCustomMenuAction]):
(-[TestRunnerWKWebView performCustomAction:]):
(-[TestRunnerWKWebView canPerformAction:withSender:]):
(-[TestRunnerWKWebView _willHideMenu]):
(-[TestRunnerWKWebView _didHideMenu]):
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformResetStateToConsistentValues):

Reset both any custom installed actions on the shared menu controller, as well as the list of allowed actions,
if specified.

* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::isDismissingMenu const):

LayoutTests:

Add a new iOS layout test that installs a custom, non-dismissing action in the callout menu that enlarges text.
The test then activates this custom menu item and checks that the selection rects after triggering this custom
action are updated, and the callout bar is still showing.

* editing/selection/ios/selection-after-changing-text-with-callout-menu-expected.txt: Added.
* editing/selection/ios/selection-after-changing-text-with-callout-menu.html: Added.

This test additionally suppresses all callout bar menu items except for the custom "Embiggen" action, to ensure
that the "Embiggen" option can be tapped from the layout test without having to navigate callout bar items by
tapping on the "Next" and "Show styles" buttons. This latter approach is very challenging to make reliable in
automation; when navigating submenus in the callout bar, the next button can't be tapped until the current
callout bar transition animation is complete, but there's no delegate method invoked or notification posted when
this happens.

* resources/ui-helper.js:
(window.UIHelper.isShowingMenu):
(window.UIHelper.isDismissingMenu):
(window.UIHelper.rectForMenuAction):
(window.UIHelper.async.chooseMenuAction):

Additionally add a few more UIHelper methods.

(window.UIHelper):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244370 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed non-unified build fix after r244307.
ross.kirsling@sony.com [Wed, 17 Apr 2019 02:56:33 +0000 (02:56 +0000)]
Unreviewed non-unified build fix after r244307.

Source/WebCore:

* page/DiagnosticLoggingClient.h:

Source/WebKit:

* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244369 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoAllow sharing from imageSheet on an image document
megan_gardner@apple.com [Wed, 17 Apr 2019 01:41:00 +0000 (01:41 +0000)]
Allow sharing from imageSheet on an image document
https://bugs.webkit.org/show_bug.cgi?id=196891
<rdar://problem/25377386>

Reviewed by Tim Horton.

Source/WebKit:

Allow sharing from an image sheet generated from an image document
by storing the image URL and using it as a fallback for the URL.
Store it as an image on WKElementAction to not accidentally trigger
any actions that should actually be associated with pure URLs.

* UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
* UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
(-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:]):
(-[_WKActivatedElementInfo _initWithType:URL:imageURL:location:title:ID:rect:image:]):
(-[_WKActivatedElementInfo _initWithType:URL:imageURL:location:title:ID:rect:image:userInfo:]):
(-[_WKActivatedElementInfo imageURL]):
(-[_WKActivatedElementInfo _initWithType:URL:location:title:ID:rect:image:]): Deleted.
(-[_WKActivatedElementInfo _initWithType:URL:location:title:ID:rect:image:userInfo:]): Deleted.
* UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:
* UIProcess/API/Cocoa/_WKElementAction.mm:
(+[_WKElementAction _elementActionWithType:customTitle:assistant:]):
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant showImageSheet]):
(-[WKActionSheetAssistant defaultActionsForImageSheet:]):
(-[WKActionSheetAssistant showLinkSheet]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showAttachmentSheet]):
(-[WKContentView _dataForPreviewItemController:atPosition:type:]):
(-[WKContentView _presentedViewControllerForPreviewItemController:]):

Tools:

Test to make sure that the correct imageURL is extracted from an image element.

* TestWebKitAPI/Tests/WebKitCocoa/WKRequestActivatedElementInfo.mm:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244368 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[Cocoa] Add a way for Apple-internal clients to opt into recommended compatibility...
wenson_hsieh@apple.com [Wed, 17 Apr 2019 01:32:38 +0000 (01:32 +0000)]
[Cocoa] Add a way for Apple-internal clients to opt into recommended compatibility mode
https://bugs.webkit.org/show_bug.cgi?id=196977
<rdar://problem/49871194>

Reviewed by Tim Horton.

Add a helper method to query whether the navigation client should bypass policy safeguards when determining the
recommended compatibility mode. We bypass policy safeguards in Cocoa platforms if the navigation delegate
implements the new navigation delegate API.

* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::shouldBypassCompatibilityModeSafeguards const):
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::shouldBypassCompatibilityModeSafeguards const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244367 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[PlayStation] Update port for system library changes
stephan.szabo@sony.com [Wed, 17 Apr 2019 01:27:21 +0000 (01:27 +0000)]
[PlayStation] Update port for system library changes
https://bugs.webkit.org/show_bug.cgi?id=196978

Reviewed by Ross Kirsling.

Source/JavaScriptCore:

* shell/playstation/Initializer.cpp:
Add reference to new posix compatibility library.

Source/WTF:

* wtf/PlatformPlayStation.cmake:
Remove reference to deleted system library

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244366 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:] never returns _WKWeb...
pvollan@apple.com [Wed, 17 Apr 2019 00:33:16 +0000 (00:33 +0000)]
-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:] never returns _WKWebsiteDataTypeCredentials
https://bugs.webkit.org/show_bug.cgi?id=196991
<rdar://problem/45507423>

Reviewed by Brent Fulgham.

The credentials are stored in the Network process. To enable fetching credentials from the Network process,
a proper process access type needs to be set for the credential Website data type.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::computeNetworkProcessAccessTypeForDataFetch):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244365 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoREGRESSION(r244162) Clearing website data from ephemeral WKWebsiteDataStore should...
commit-queue@webkit.org [Wed, 17 Apr 2019 00:18:11 +0000 (00:18 +0000)]
REGRESSION(r244162) Clearing website data from ephemeral WKWebsiteDataStore should finish instead of asserting or hanging
https://bugs.webkit.org/show_bug.cgi?id=196995

Patch by Alex Christensen <achristensen@webkit.org> on 2019-04-16
Reviewed by Brady Eidson.

Source/WebKit:

Always call CompletionHandlers.  Otherwise things hang or assert.
I added an API test that asserts without this change so we don't regress this again.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::clearAllCaches):
(WebKit::CacheStorage::Engine::clearCachesForOrigin):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm:
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244364 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: Worker imported scripts not showing up in Open Quickly dialog if inspe...
pecoraro@apple.com [Tue, 16 Apr 2019 23:44:07 +0000 (23:44 +0000)]
Web Inspector: Worker imported scripts not showing up in Open Quickly dialog if inspector open after workers exist
https://bugs.webkit.org/show_bug.cgi?id=196986

Reviewed by Devin Rousso.

* UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype._addScriptsForTarget):
We were unnecessary skipping Scripts that do not have a sourceURL but do
have a URL, which ends up being Worker populated scripts.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244363 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoEnable HAVE_AVKIT on PLATFORM(IOSMAC)
jer.noble@apple.com [Tue, 16 Apr 2019 23:29:30 +0000 (23:29 +0000)]
Enable HAVE_AVKIT on PLATFORM(IOSMAC)
https://bugs.webkit.org/show_bug.cgi?id=196987

Reviewed by Tim Horton.

* wtf/Platform.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244362 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoURL set by document.open() is not communicated to the UIProcess
cdumez@apple.com [Tue, 16 Apr 2019 23:07:35 +0000 (23:07 +0000)]
URL set by document.open() is not communicated to the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=196941
<rdar://problem/49237544>

Reviewed by Geoff Garen.

Source/WebCore:

Notify the FrameLoaderClient whenever an explicit open was done and provide it with
the latest document URL.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didExplicitOpen):
* loader/FrameLoaderClient.h:

Source/WebKit:

Whenever the UIProcess is notified of an explicit document.open() call, update the
PageLoadState to make sure the URL is up-to-date. Also make sure the page / process
knows it committed a load (i.e. It is no longer showing the initially empty document).

* UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::didExplicitOpen):
* UIProcess/PageLoadState.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didExplicitOpenForFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidExplicitOpen):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

Tools:

Add API test coverage.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/open-window-then-write-to-it.html: Added.
* TestWebKitAPI/Tests/WebKitCocoa/OpenAndCloseWindow.mm:
(-[OpenWindowThenDocumentOpenUIDelegate webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:]):
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244361 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoShow prompt for device orientation access if the client does not implement the corres...
cdumez@apple.com [Tue, 16 Apr 2019 22:43:55 +0000 (22:43 +0000)]
Show prompt for device orientation access if the client does not implement the corresponding API delegate
https://bugs.webkit.org/show_bug.cgi?id=196971
<rdar://problem/49945840>

Reviewed by Alex Christensen.

Show prompt for device orientation access if the client does not implement the corresponding
API delegate, instead of rejecting access by default.

* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
* UIProcess/Cocoa/WKOrientationAccessAlert.h: Added.
* UIProcess/Cocoa/WKOrientationAccessAlert.mm: Added.
(WebKit::presentOrientationAccessAlert):
* WebKit.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244360 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoSet test conditions closer to conversion redirect in LayoutTests/http/tests/adClickAt...
wilander@apple.com [Tue, 16 Apr 2019 21:35:13 +0000 (21:35 +0000)]
Set test conditions closer to conversion redirect in LayoutTests/http/tests/adClickAttribution/send-attribution-conversion-request.html
https://bugs.webkit.org/show_bug.cgi?id=196983
<rdar://problem/49952679>

Unreviewed test gardening.

* http/tests/adClickAttribution/resources/redirectToConversion.php:
* http/tests/adClickAttribution/send-attribution-conversion-request.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244359 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoREGRESSION(r238168) Web Inspector: <iframe src=...> request does not show up in Netwo...
pecoraro@apple.com [Tue, 16 Apr 2019 21:28:24 +0000 (21:28 +0000)]
REGRESSION(r238168) Web Inspector: <iframe src=...> request does not show up in Network Tab
https://bugs.webkit.org/show_bug.cgi?id=193505
<rdar://problem/47325957>

Reviewed by Devin Rousso.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView):
(WI.NetworkTableContentView.prototype._handleFrameWasAdded):
Handle new frames by adding the frame's main resource.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244358 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[MotionMark] The text "kkkj" is causing Firefox console warning: `unreachable code...
jonlee@apple.com [Tue, 16 Apr 2019 20:52:20 +0000 (20:52 +0000)]
[MotionMark] The text "kkkj" is causing Firefox console warning: `unreachable code after return statement`
https://bugs.webkit.org/show_bug.cgi?id=196814

Reviewed by Wenson Hsieh.

* MotionMark/resources/extensions.js:
(subtract.subtract.sampleY):
Websites/browserbench.org:

* MotionMark1.1/resources/extensions.js:
(subtract.subtract.sampleY):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244357 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoREGRESSION(r243557)[ContentChangeObserver] Need to double tap text formatting element...
zalan@apple.com [Tue, 16 Apr 2019 20:39:34 +0000 (20:39 +0000)]
REGRESSION(r243557)[ContentChangeObserver] Need to double tap text formatting elements in MS Word web app
https://bugs.webkit.org/show_bug.cgi?id=196975
<rdar://problem/49489849>

Reviewed by Simon Fraser.

This patch ensures that we always proceed with synthetic click on form elements.

Covered by existing tests.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244356 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoFrameView base background color always starts white.
timothy@apple.com [Tue, 16 Apr 2019 20:32:49 +0000 (20:32 +0000)]
FrameView base background color always starts white.
https://bugs.webkit.org/show_bug.cgi?id=196976

Reviewed by Beth Dakin.

Source/WebCore:

* page/FrameView.cpp:
(WebCore::FrameView::setBaseBackgroundColor): Bail early if the base background
color did not change.

Source/WebKit:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage): Set m_backgroundColor before calling
WebFrame::createWithCoreMainFrame so the call to create the FrameView
for the empty page in transitionToCommittedForNewPage() gets
the correct color from WebPage.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244355 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: Uncaught Exception: TypeError: null is not an object (evaluating ...
drousso@apple.com [Tue, 16 Apr 2019 19:53:09 +0000 (19:53 +0000)]
Web Inspector: Uncaught Exception: TypeError: null is not an object (evaluating 'this._contentViewContainer.currentContentView.selectionPathComponents')
https://bugs.webkit.org/show_bug.cgi?id=196936
<rdar://problem/49917789>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/HeapAllocationsTimelineView.js:
(WI.HeapAllocationsTimelineView.prototype.showHeapSnapshotTimelineRecord):
(WI.HeapAllocationsTimelineView.prototype.get navigationItems):
(WI.HeapAllocationsTimelineView.prototype.get selectionPathComponents):
Drive-by: when selecting a record, force it to be visible before selecting it, as otherwise
the selection events won't be fired.

* UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js:
(WI.HeapAllocationsTimelineOverviewGraph.prototype.layout):
Drive-by: ensure that clicking on a [S] heap snapshot record icon actually selects the record.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244354 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnprefix -webkit-sticky
drousso@apple.com [Tue, 16 Apr 2019 19:48:37 +0000 (19:48 +0000)]
Unprefix -webkit-sticky
https://bugs.webkit.org/show_bug.cgi?id=196962
<rdar://problem/40903458>

Reviewed by Simon Fraser.

Source/WebCore:

Updated existing tests.

This change doesn't modify functionality, only exposing a new unprefixed CSS value.

* css/CSSProperties.json:
* css/CSSValueKeywords.in:

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator PositionType const):

* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):

* editing/EditingStyle.cpp:
(WebCore::EditingStyle::convertPositionStyle):

Source/WebInspectorUI:

Replace all `-webkit-sticky` with `sticky`.

* UserInterface/Models/CSSKeywordCompletions.js:
* UserInterface/Views/AuditTestCaseContentView.css:
(.content-view-container > .content-view.audit-test-case > header):
* UserInterface/Views/AuditTestGroupContentView.css:
(.content-view.audit-test-group.contains-test-case > header):
* UserInterface/Views/ChangesDetailsSidebarPanel.css:
(.changes-panel .resource-section > .header):
* UserInterface/Views/DetailsSection.css:
(.details-section > .header):
* UserInterface/Views/NetworkDetailView.css:
(.network-detail .navigation-bar):
* UserInterface/Views/SettingsTabContentView.css:
(.content-view.settings .navigation-bar):
* UserInterface/Views/Table.css:
(.table > .header):

LayoutTests:

* compositing/layer-creation/no-compositing-for-sticky.html:
* editing/pasteboard/copy-paste-converts-sticky.html:
* editing/pasteboard/copy-paste-converts-sticky-expected.txt:
* fast/block/positioning/fixed-container-with-sticky-parent.html:
* fast/block/sticky-position-containing-block-crash.html:
* fast/css/sticky/inflow-sticky.html:
* fast/css/sticky/inline-sticky-abspos-child.html:
* fast/css/sticky/inline-sticky.html:
* fast/css/sticky/multiple-layers-sticky-crash.html:
* fast/css/sticky/parsing-position-sticky-expected.txt:
* fast/css/sticky/remove-inline-sticky-crash.html:
* fast/css/sticky/remove-sticky-crash.html:
* fast/css/sticky/replaced-sticky.html:
* fast/css/sticky/resources/parsing-position-sticky.js:
* fast/css/sticky/sticky-as-positioning-container.html:
* fast/css/sticky/sticky-both-sides.html:
* fast/css/sticky/sticky-bottom-overflow-padding.html:
* fast/css/sticky/sticky-left-percentage.html:
* fast/css/sticky/sticky-left.html:
* fast/css/sticky/sticky-margins.html:
* fast/css/sticky/sticky-overflowing.html:
* fast/css/sticky/sticky-side-margins.html:
* fast/css/sticky/sticky-stacking-context.html:
* fast/css/sticky/sticky-stacking-context-expected.html:
* fast/css/sticky/sticky-table-row-top.html:
* fast/css/sticky/sticky-table-thead-top.html:
* fast/css/sticky/sticky-top-margins.html:
* fast/css/sticky/sticky-top-overflow-container-overflow.html:
* fast/css/sticky/sticky-top-overflow.html:
* fast/css/sticky/sticky-top-zoomed.html:
* fast/css/sticky/sticky-top-zoomed-expected.html:
* fast/css/sticky/sticky-top.html:
* fast/css/sticky/sticky-writing-mode-horizontal-bt.html:
* fast/css/sticky/sticky-writing-mode-vertical-lr.html:
* fast/css/sticky/sticky-writing-mode-vertical-rl.html:
* fast/multicol/newmulticol/table-section-crash.html:
* fast/scrolling/ios/reconcile-layer-position-recursive.html:
* fast/scrolling/rtl-scrollbars-sticky-document-2.html:
* fast/scrolling/rtl-scrollbars-sticky-document.html:
* fast/scrolling/rtl-scrollbars-sticky-iframe-2.html:
* fast/scrolling/rtl-scrollbars-sticky-iframe.html:
* fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2.html:
* fast/scrolling/rtl-scrollbars-sticky-overflow-scroll.html:
* fast/scrolling/sticky-to-fixed.html:
* legacy-animation-engine/fast/multicol/newmulticol/table-section-crash.html:
* scrollingcoordinator/scrolling-tree/resources/doc-with-sticky.html:
* svg/text/select-text-inside-non-static-position.html:
* tiled-drawing/scrolling/sticky/negative-scroll-offset.html:
* tiled-drawing/scrolling/sticky/sticky-horizontal.html:
* tiled-drawing/scrolling/sticky/sticky-layers.html:
* tiled-drawing/scrolling/sticky/sticky-vertical.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244353 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[WTF] holdLock should be marked WARN_UNUSED_RETURN
rmorisset@apple.com [Tue, 16 Apr 2019 19:46:27 +0000 (19:46 +0000)]
[WTF] holdLock should be marked WARN_UNUSED_RETURN
https://bugs.webkit.org/show_bug.cgi?id=196922

Reviewed by Keith Miller.

Source/JavaScriptCore:

There was one case where holdLock was used and the result ignored.
From a comment that was deleted in https://bugs.webkit.org/attachment.cgi?id=328438&action=prettypatch, I believe that it is on purpose.
So I brought back a variant of the comment, and made the ignoring of the return explicit.

* heap/BlockDirectory.cpp:
(JSC::BlockDirectory::isPagedOut):

Source/WTF:

* wtf/Locker.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244352 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: remove unused WI.DOMTreeDataGrid
drousso@apple.com [Tue, 16 Apr 2019 19:37:27 +0000 (19:37 +0000)]
Web Inspector: remove unused WI.DOMTreeDataGrid
https://bugs.webkit.org/show_bug.cgi?id=196958
<rdar://problem/49931383>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/DOMTreeDataGrid.css: Removed.
* UserInterface/Views/DOMTreeDataGrid.js: Removed.
* UserInterface/Views/DOMTreeDataGridNode.js: Removed.
* UserInterface/Main.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244351 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: Storage: values truncated in Local/Session table
drousso@apple.com [Tue, 16 Apr 2019 19:02:23 +0000 (19:02 +0000)]
Web Inspector: Storage: values truncated in Local/Session table
https://bugs.webkit.org/show_bug.cgi?id=178318
<rdar://problem/34998581>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/DataGrid.js:
(WI.DataGrid):
(WI.DataGrid.prototype._copyTextForDataGridNode):
* UserInterface/Views/TimelineDataGrid.js:
(WI.TimelineDataGrid):
Refactor `WI.DataGrid` constructor to allow for more optional arguments.
Introduce a new optional argument `copyCallback` that can be used to override the text that
would be copied for any `WI.DataGridNode` in any column.

* UserInterface/Views/DOMStorageContentView.js:
(WI.DOMStorageContentView):
(WI.DOMStorageContentView.prototype.itemAdded):
(WI.DOMStorageContentView.prototype.itemUpdated):
(WI.DOMStorageContentView.prototype._populate):
(WI.DOMStorageContentView.prototype._dataGridCopy): Added.
Save the full non-truncated value as part of the `WI.DataGridNode`'s `data`. When copying,
use the full non-truncated value instead of what was shown in the DOM.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244350 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[CMake] Set WTF_SCRIPTS_DIR
don.olmstead@sony.com [Tue, 16 Apr 2019 18:51:29 +0000 (18:51 +0000)]
[CMake] Set WTF_SCRIPTS_DIR
https://bugs.webkit.org/show_bug.cgi?id=196917

Reviewed by Konstantin Tokarev.

.:

Define WTF_SCRIPTS_DIR in WebKitFS.cmake and use that within the WEBKIT_COMPUTE_SOURCES
macro. This allows it to be overridden by a port such as the AppleWin internal build.

* Source/cmake/OptionsAppleWin.cmake:
* Source/cmake/OptionsWinCairo.cmake:
* Source/cmake/WebKitFS.cmake:
* Source/cmake/WebKitMacros.cmake:

Source/WTF:

Use WTF_SCRIPTS_DIR for copying the unified sources script.

* wtf/CMakeLists.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244349 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoIncrease timeout threshold in http/tests/adClickAttribution/send-attribution-conversi...
wilander@apple.com [Tue, 16 Apr 2019 18:25:34 +0000 (18:25 +0000)]
Increase timeout threshold in http/tests/adClickAttribution/send-attribution-conversion-request.html to address flakiness
https://bugs.webkit.org/show_bug.cgi?id=196970
<rdar://problem/49945327>

Unreviewed test gardening.

* http/tests/adClickAttribution/send-attribution-conversion-request.html:
    Increased test timeout from 2 seconds to 4.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244346 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed test gardening, rebaseline HAR test after r244294.
joepeck@webkit.org [Tue, 16 Apr 2019 18:19:18 +0000 (18:19 +0000)]
Unreviewed test gardening, rebaseline HAR test after r244294.

* http/tests/inspector/network/har/har-page-expected.txt:
* http/tests/inspector/network/har/har-page.html:
Update for stricter SameSite parsing.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244345 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agomedia/W3C/video/events/event_progress_manual.html is a flaky failure
sroberts@apple.com [Tue, 16 Apr 2019 18:11:03 +0000 (18:11 +0000)]
media/W3C/video/events/event_progress_manual.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=177663

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations: Updating test expectations

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244344 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed, fix the build with recent SDKs.
ryanhaddad@apple.com [Tue, 16 Apr 2019 16:46:55 +0000 (16:46 +0000)]
Unreviewed, fix the build with recent SDKs.

* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(WebKit::WKWebViewState::store):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244333 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed test gardening.
ryanhaddad@apple.com [Tue, 16 Apr 2019 16:46:52 +0000 (16:46 +0000)]
Unreviewed test gardening.

* platform/mac-wk1/TestExpectations: Correct a typo in bug URL.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244332 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed, rolling out r244321.
commit-queue@webkit.org [Tue, 16 Apr 2019 16:28:28 +0000 (16:28 +0000)]
Unreviewed, rolling out r244321.
https://bugs.webkit.org/show_bug.cgi?id=196968

Causing all WK2 Debug builds to exit early after Assertion
failures. (Requested by ShawnRoberts on #webkit).

Reverted changeset:

"URL set by document.open() is not communicated to the
UIProcess"
https://bugs.webkit.org/show_bug.cgi?id=196941
https://trac.webkit.org/changeset/244321

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244331 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[JSC] Filter DontEnum properties in ProxyObject::getOwnPropertyNames()
caitp@igalia.com [Tue, 16 Apr 2019 15:58:59 +0000 (15:58 +0000)]
[JSC] Filter DontEnum properties in ProxyObject::getOwnPropertyNames()
https://bugs.webkit.org/show_bug.cgi?id=176810

Reviewed by Saam Barati.

JSTests:

Add tests for the DontEnum filtering, and variations of other tests
take the DontEnum-filtering path.

* stress/proxy-own-keys.js:
(i.catch):
(set assert):
(set add):
(let.set new):
(get let):

Source/JavaScriptCore:

This adds conditional logic following the invariant checks, to perform
filtering in common uses of getOwnPropertyNames.

While this would ideally only be done in JSPropertyNameEnumerator, adding
the filtering to ProxyObject::performGetOwnPropertyNames maintains the
invariant that the EnumerationMode is properly followed.

This was originally rolled out in r244020, as DontEnum filtering code
in ObjectConstructor.cpp's ownPropertyKeys() had not been removed. It's
now redundant due to being handled in ProxyObject::getOwnPropertyNames().

* runtime/PropertyNameArray.h:
(JSC::PropertyNameArray::reset):
* runtime/ProxyObject.cpp:
(JSC::ProxyObject::performGetOwnPropertyNames):

Source/WebCore:

Previously, there was a comment here indicating uncertainty of whether it
was necessary to filter DontEnum properties explicitly or not. It turns
out that it was necessary in the case of JSC ProxyObjects.

This patch adds DontEnum filtering for ProxyObjects, however we continue
to explicitly filter them in JSDOMConvertRecord, which needs to use the
property descriptor after filtering. This change prevents observably
fetching the property descriptor twice per property.

* bindings/js/JSDOMConvertRecord.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244330 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed, GTK gardening
philn@webkit.org [Tue, 16 Apr 2019 09:41:00 +0000 (09:41 +0000)]
Unreviewed, GTK gardening

* platform/gtk/TestExpectations:
media/media-controls-accessibility.html times out since r244182.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244329 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[iOS] Redundant pointer events causes material design buttons to flush twice
graouts@webkit.org [Tue, 16 Apr 2019 08:03:56 +0000 (08:03 +0000)]
[iOS] Redundant pointer events causes material design buttons to flush twice
https://bugs.webkit.org/show_bug.cgi?id=196914
<rdar://problem/49571860>

Reviewed by Dean Jackson.

Source/WebCore:

Test: pointerevents/ios/pointer-event-order.html

Do not dispatch pointer events for mouse events on iOS since we're already dispatching them when processing touch events.

* dom/Element.cpp:
(WebCore::Element::dispatchMouseEvent):

LayoutTests:

Add a new test that listens to all pointer event types as well as click, which forces the dispatch of compatibility mouse events
along with the click which would trigger duplicated pointer events prior to the source changes.

To ensure the new test added runs smoothly with a preceeding test that also uses ui.tap(), we add a delay to guarantee that no
double-taps are seen rather two successive single taps.

* pointerevents/ios/pointer-event-order-expected.txt: Added.
* pointerevents/ios/pointer-event-order.html: Added.
* pointerevents/utils.js:
(const.ui.new.UIController.prototype.tap):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244328 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: DOM Nodes should not show $0 when selected in Console area
pecoraro@apple.com [Tue, 16 Apr 2019 06:57:16 +0000 (06:57 +0000)]
Web Inspector: DOM Nodes should not show $0 when selected in Console area
https://bugs.webkit.org/show_bug.cgi?id=196953

Reviewed by Devin Rousso.

* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView):
Enable showing the last selected element.

* UserInterface/Views/DOMTreeOutline.js:
Make parameters explicit. Drop "selectable" which was always true.
And add a new option for adding a class name.

* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom.show-last-selected li.last-selected > span::after):
(.tree-outline.dom.show-last-selected:focus li.last-selected > span::after):
Only show the "= $0" for a DOM tree that has enabled showing the last selected element.

* UserInterface/Views/FormattedValue.css:
(.formatted-node > .tree-outline.dom li.selected .selection-area):
Don't show the selection-area for a console formatted node.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244327 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: CRASH when reopening tab with docked inspector on crashed page
pecoraro@apple.com [Tue, 16 Apr 2019 06:22:41 +0000 (06:22 +0000)]
Web Inspector: CRASH when reopening tab with docked inspector on crashed page
https://bugs.webkit.org/show_bug.cgi?id=196954
<rdar://problem/48716433>

Reviewed by Ryosuke Niwa.

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::inspectedViewFrameDidChange):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244326 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoAdd a query string nonce to LayoutTests/http/tests/adClickAttribution/send-attributio...
wilander@apple.com [Tue, 16 Apr 2019 04:24:23 +0000 (04:24 +0000)]
Add a query string nonce to LayoutTests/http/tests/adClickAttribution/send-attribution-conversion-request.html to address flakiness
https://bugs.webkit.org/show_bug.cgi?id=196955

Source/WebCore:

Unreviewed test gardening. The WebCore change is only in a dedicated
test function.

No new tests. Existing test updated.

* loader/AdClickAttribution.cpp:
(WebCore::AdClickAttribution::urlForTesting const):
    Now preserves the query string in the test URL.

LayoutTests:

Unreviewed test gardening.

* http/tests/adClickAttribution/resources/conversionFilePath.php:
* http/tests/adClickAttribution/resources/conversionReport.php:
* http/tests/adClickAttribution/resources/getConversionData.php:
* http/tests/adClickAttribution/send-attribution-conversion-request.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244325 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoModify how we do SetArgument when we inline varargs calls
sbarati@apple.com [Tue, 16 Apr 2019 02:41:38 +0000 (02:41 +0000)]
Modify how we do SetArgument when we inline varargs calls
https://bugs.webkit.org/show_bug.cgi?id=196712
<rdar://problem/49605012>

Reviewed by Michael Saboff.

JSTests:

* stress/get-stack-wrong-type-when-inline-varargs.js: Added.
(foo):

Source/JavaScriptCore:

When we inline varargs calls, we guarantee that the number of arguments that
go on the stack are somewhere between the "mandatoryMinimum" and the "limit - 1".
However, we can't statically guarantee that the arguments between these two
ranges was filled out by Load/ForwardVarargs. This is because in the general
case we don't know the argument count statically.

However, we used to always emit SetArgumentDefinitely up to "limit - 1" for
all arguments, even when some arguments aren't guaranteed to be in a valid
state. Emitting these SetArgumentDefinitely were helpful because they let us
handle variable liveness and OSR exit metadata. However, when we converted
to SSA, we ended up emitting a GetStack for each such SetArgumentDefinitely.

This is wrong, as we can't guarantee such SetArgumentDefinitely nodes are
actually looking at a range of the stack that are guaranteed to be initialized.
This patch introduces a new form of SetArgument node: SetArgumentMaybe. In terms
of OSR exit metadata and variable liveness tracking, it behaves like SetArgumentDefinitely.

However, it differs in a couple key ways:
1. In ThreadedCPS, GetLocal(@SetArgumentMaybe) is invalid IR, as this implies
you might be loading uninitialized stack. (This same rule applies when you do
the full data flow reachability analysis over CPS Phis.) If someone logically
wanted to emit code like this, the correct node to emit would be GetArgument,
not GetLocal. For similar reasons, PhantomLocal(@SetArgumentMaybe) is also
invalid IR.
2. To track liveness, Flush(@SetArgumentMaybe) is valid, and is the main user
of SetArgumentMaybe.
3. In SSA conversion, we don't lower SetArgumentMaybe to GetStack, as there
should be no data flow user of SetArgumentMaybe.

SetArgumentDefinitely guarantees that the stack slot is initialized.
SetArgumentMaybe makes no such guarantee.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleVarargsInlining):
* dfg/DFGCPSRethreadingPhase.cpp:
(JSC::DFG::CPSRethreadingPhase::freeUnnecessaryNodes):
(JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocalFor):
(JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
(JSC::DFG::CPSRethreadingPhase::canonicalizeLocalsInBlock):
(JSC::DFG::CPSRethreadingPhase::propagatePhis):
(JSC::DFG::CPSRethreadingPhase::computeIsFlushed):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGCommon.h:
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGInPlaceAbstractState.cpp:
(JSC::DFG::InPlaceAbstractState::endBasicBlock):
* dfg/DFGLiveCatchVariablePreservationPhase.cpp:
(JSC::DFG::LiveCatchVariablePreservationPhase::handleBlockForTryCatch):
* dfg/DFGMaximalFlushInsertionPhase.cpp:
(JSC::DFG::MaximalFlushInsertionPhase::treatRegularBlock):
(JSC::DFG::MaximalFlushInsertionPhase::treatRootBlock):
* dfg/DFGMayExit.cpp:
* dfg/DFGNode.cpp:
(JSC::DFG::Node::hasVariableAccessData):
* dfg/DFGNodeType.h:
* dfg/DFGPhantomInsertionPhase.cpp:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSSAConversionPhase.cpp:
(JSC::DFG::SSAConversionPhase::run):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGValidate.cpp:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244324 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed, rolling out r243672.
commit-queue@webkit.org [Tue, 16 Apr 2019 02:12:26 +0000 (02:12 +0000)]
Unreviewed, rolling out r243672.
https://bugs.webkit.org/show_bug.cgi?id=196952

[JSValue release] should be thread-safe (Requested by
yusukesuzuki on #webkit).

Reverted changeset:

"[JSC] JSWrapperMap should not use Objective-C Weak map
(NSMapTable with NSPointerFunctionsWeakMemory) for
m_cachedObjCWrappers"
https://bugs.webkit.org/show_bug.cgi?id=196392
https://trac.webkit.org/changeset/243672

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244323 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoRegression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
aakash_jain@apple.com [Tue, 16 Apr 2019 02:03:41 +0000 (02:03 +0000)]
Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
https://bugs.webkit.org/show_bug.cgi?id=196948

Reviewed by Zalan Bujtas.

* TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm:
(TEST): Disabling the test for now to keep infrastructure happy, while the root-cause is being investigated.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244322 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoURL set by document.open() is not communicated to the UIProcess
cdumez@apple.com [Tue, 16 Apr 2019 02:01:32 +0000 (02:01 +0000)]
URL set by document.open() is not communicated to the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=196941
<rdar://problem/49237544>

Reviewed by Geoffrey Garen.

Source/WebCore:

Notify the FrameLoaderClient whenever an explicit open was done and provide it with
the latest document URL.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didExplicitOpen):
* loader/FrameLoaderClient.h:

Source/WebKit:

Whenever the UIProcess is notified of an explicit document.open() call, update the
PageLoadState to make sure the URL is up-to-date. Also make sure the page / process
knows it committed a load (i.e. It is no longer showing the initially empty document).

* UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::didExplicitOpen):
* UIProcess/PageLoadState.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didExplicitOpenForFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidExplicitOpen):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

Tools:

Add API test coverage.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/open-window-then-write-to-it.html: Added.
* TestWebKitAPI/Tests/WebKitCocoa/OpenAndCloseWindow.mm:
(-[OpenWindowThenDocumentOpenUIDelegate webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:]):
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244321 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoFix logic flow for error log
commit-queue@webkit.org [Tue, 16 Apr 2019 01:55:50 +0000 (01:55 +0000)]
Fix logic flow for error log
https://bugs.webkit.org/show_bug.cgi?id=196933

Patch by Eike Rathke <erack@redhat.com> on 2019-04-15
Reviewed by Alexey Proskuryakov.

Missing block braces logged an error always, not just
if (actionIfInvalid == Complain).

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::isSafeToLoadURL):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244320 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoStop using hyphenationFactor
commit-queue@webkit.org [Tue, 16 Apr 2019 01:43:30 +0000 (01:43 +0000)]
Stop using hyphenationFactor
https://bugs.webkit.org/show_bug.cgi?id=196949
<rdar://problem/49779594>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-04-15
Reviewed by Geoffrey Garen.

* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
I added this use of hyphenationFactor in r241124 but the other changes in that revision make the use of hyphenationFactor redundant.
There is a reason to remove it in the radar.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244319 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: update sheet rect whenever inspector window size changes
drousso@apple.com [Tue, 16 Apr 2019 01:43:00 +0000 (01:43 +0000)]
Web Inspector: update sheet rect whenever inspector window size changes
https://bugs.webkit.org/show_bug.cgi?id=196942
<rdar://problem/49920241>

Reviewed by Joseph Pecoraro.

* UserInterface/Base/Main.js:
(WI.contentLoaded):
(WI._windowResized):
(WI._updateSheetRect): Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244318 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoForward declare WKWebView in _WKDiagnosticLoggingDelegate.h
achristensen@apple.com [Tue, 16 Apr 2019 01:26:08 +0000 (01:26 +0000)]
Forward declare WKWebView in _WKDiagnosticLoggingDelegate.h

* UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
This fixes builds where _WKDiagnosticLoggingDelegate.h is the only WebKit header included, such as my work on rdar://problem/35175989

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244317 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed. Build fix after r244244.
yoshiaki.jitsukawa@sony.com [Tue, 16 Apr 2019 01:19:27 +0000 (01:19 +0000)]
Unreviewed. Build fix after r244244.

* Source/bmalloc/bmalloc/AvailableMemory.cpp

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244316 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[Cocoa] FontPlatformData objects aren't cached at all when using font-family:system-ui
mmaxfield@apple.com [Tue, 16 Apr 2019 00:51:04 +0000 (00:51 +0000)]
[Cocoa] FontPlatformData objects aren't cached at all when using font-family:system-ui
https://bugs.webkit.org/show_bug.cgi?id=196846
<rdar://problem/49499971>

Reviewed by Simon Fraser and Darin Adler.

PerformanceTests:

* Layout/system-ui-rebuild-emoji.html: Added.

Source/WebCore:

When adding the special codepath for system-ui to behave as an entire list of fonts rather than a single item,
I never added a cache for the FontPlatformData objects that codepath creates. The non-system-ui codepath already
has a cache in fontPlatformDataCache() in FontCache.cpp.

This patch causes a 16.8x performance improvement on the attached benchmark.

Test: PerformanceTests/Layout/system-ui-rebuild-emoji.html

* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::platformReleaseMemory):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::invalidateFontCache):
* platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
(WebCore::FontFamilySpecificationKey::FontFamilySpecificationKey):
(WebCore::FontFamilySpecificationKey::operator== const):
(WebCore::FontFamilySpecificationKey::operator!= const):
(WebCore::FontFamilySpecificationKey::isHashTableDeletedValue const):
(WebCore::FontFamilySpecificationKey::computeHash const):
(WebCore::FontFamilySpecificationKeyHash::hash):
(WebCore::FontFamilySpecificationKeyHash::equal):
(WebCore::fontMap):
(WebCore::clearFontFamilySpecificationCoreTextCache):
(WebCore::FontFamilySpecificationCoreText::fontRanges const):
* platform/graphics/cocoa/FontFamilySpecificationCoreText.h:
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
(WebCore::safeCFEqual): Deleted.

Source/WTF:

* wtf/RetainPtr.h:
(WTF::safeCFEqual):
(WTF::safeCFHash):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244315 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoSafeToExecute for GetByOffset/GetGetterByOffset/PutByOffset is using the wrong child...
sbarati@apple.com [Tue, 16 Apr 2019 00:39:26 +0000 (00:39 +0000)]
SafeToExecute for GetByOffset/GetGetterByOffset/PutByOffset is using the wrong child for the base
https://bugs.webkit.org/show_bug.cgi?id=196945
<rdar://problem/49802750>

Reviewed by Filip Pizlo.

JSTests:

* stress/get-by-offset-should-use-correct-child.js: Added.
(foo.bar):
(foo):

Source/JavaScriptCore:

* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244314 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoDFG should be able to constant fold Object.create() with a constant prototype operand
rmorisset@apple.com [Tue, 16 Apr 2019 00:28:47 +0000 (00:28 +0000)]
DFG should be able to constant fold Object.create() with a constant prototype operand
https://bugs.webkit.org/show_bug.cgi?id=196886

Reviewed by Yusuke Suzuki.

JSTests:

Note that this new benchmark does not currently see a speedup with inlining removed.
The reason is that we do not yet have inline caching for Object.create(), we only optimize it when the DFG can see statically the prototype being passed.

* microbenchmarks/object-create-constant-prototype.js: Added.
(test):

Source/JavaScriptCore:

It is a fairly simple and limited patch, as it only works when the DFG can prove the exact object used as prototype.
But when it applies it can be a significant win:
                                                Baseline                   Optim
object-create-constant-prototype              3.6082+-0.0979     ^      1.6947+-0.0756        ^ definitely 2.1292x faster
object-create-null                           11.4492+-0.2510     ?     11.5030+-0.2402        ?
object-create-unknown-object-prototype       15.6067+-0.1851     ?     15.7500+-0.2322        ?
object-create-untyped-prototype               8.8873+-0.1240     ?      8.9806+-0.1202        ? might be 1.0105x slower
<geometric>                                   8.6967+-0.1208     ^      7.2408+-0.1367        ^ definitely 1.2011x faster

The only subtlety is that we need to to access the StructureCache concurrently from the compiler thread (see https://bugs.webkit.org/show_bug.cgi?id=186199)
I solved this with a simple lock, taken when the compiler thread tries to read it, and when the main thread tries to modify it.
I expect it to be extremely low contention, but will watch the bots just in case.
The lock is taken neither when the main thread is only reading the cache (it has no-one to race with), nor when the GC purges it of dead entries (it does not free anything while a compiler thread is in the middle of a phase).

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* runtime/StructureCache.cpp:
(JSC::StructureCache::createEmptyStructure):
(JSC::StructureCache::tryEmptyObjectStructureForPrototypeFromCompilerThread):
* runtime/StructureCache.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244313 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: fake value descriptors for promises add a catch handler, preventing...
drousso@apple.com [Tue, 16 Apr 2019 00:02:32 +0000 (00:02 +0000)]
Web Inspector: fake value descriptors for promises add a catch handler, preventing "rejectionhandled" events from being fired
https://bugs.webkit.org/show_bug.cgi?id=196484
<rdar://problem/49114725>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

Only add a catch handler when the promise is reachable via a native getter and is known to
have rejected. A non-rejected promise doesn't need a catch handler, and any promise that
isn't reachable via a getter won't actually be reached, as `InjectedScript` doesn't call any
functions, instead only getting the function object itself.

* inspector/InjectedScriptSource.js:
(InjectedScript.prototype._propertyDescriptors.createFakeValueDescriptor):

* inspector/JSInjectedScriptHost.h:
* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::isPromiseRejectedWithNativeGetterTypeError): Added.
* inspector/JSInjectedScriptHostPrototype.cpp:
(Inspector::JSInjectedScriptHostPrototype::finishCreation):
(Inspector::jsInjectedScriptHostPrototypeFunctionIsPromiseRejectedWithNativeGetterTypeError): Added.

* runtime/ErrorInstance.h:
(JSC::ErrorInstance::setNativeGetterTypeError): Added.
(JSC::ErrorInstance::isNativeGetterTypeError const): Added.

* runtime/Error.h:
(JSC::throwVMGetterTypeError): Added.
* runtime/Error.cpp:
(JSC::createGetterTypeError): Added.
(JSC::throwGetterTypeError): Added.
(JSC::throwDOMAttributeGetterTypeError):

Source/WebCore:

Test: inspector/runtime/promise-native-getter.html

Mark errors created from getters as being `isNativeGetterTypeError`.

* bindings/js/JSDOMExceptionHandling.cpp:
(WebCore::throwGetterTypeError):
(WebCore::rejectPromiseWithGetterTypeError):
(WebCore::rejectPromiseWithThisTypeError):

* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::makeGetterTypeErrorForBuiltins):

* bindings/js/JSDOMPromiseDeferred.h:
* bindings/js/JSDOMPromiseDeferred.cpp:
(WebCore::createRejectedPromiseWithTypeError):

* Modules/streams/WritableStream.js:
(getter.closed):
(getter.ready):

LayoutTests:

* inspector/runtime/promise-native-getter.html: Added.
* inspector/runtime/promise-native-getter-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244312 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed, fix typo in a comment.
nvasilyev@apple.com [Tue, 16 Apr 2019 00:00:58 +0000 (00:00 +0000)]
Unreviewed, fix typo in a comment.

* UserInterface/Views/SearchSidebarPanel.js:
(WI.SearchSidebarPanel.prototype.performSearch):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244311 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUsing Tools/Scripts/clean-webkit should not install requests
dean_johnson@apple.com [Tue, 16 Apr 2019 00:00:48 +0000 (00:00 +0000)]
Using Tools/Scripts/clean-webkit should not install requests
https://bugs.webkit.org/show_bug.cgi?id=196940

Reviewed by Lucas Forschler.

* Scripts/webkitpy/common/system/autoinstall.py: Drive-by fix for no logging handlers
existing, depending on the path autoinstalled is run through.
* Scripts/webkitpy/port/base.py: Import webkitpy.results.upload.Upload only where it's
needed.
(Port.configuration_for_upload):
(Port.commits_for_upload):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244310 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoB3::Value should have different kinds of adjacency lists
rmorisset@apple.com [Mon, 15 Apr 2019 23:53:23 +0000 (23:53 +0000)]
B3::Value should have different kinds of adjacency lists
https://bugs.webkit.org/show_bug.cgi?id=196091

Reviewed by Filip Pizlo.

The key idea of this optimization is to replace the Vector<Value*, 3> m_children in B3::Value (40 bytes on 64-bits platform) by one of the following:
- Nothing (0 bytes)
- 1 Value* (8 bytes)
- 2 Value* (16 bytes)
- 3 Value* (24 bytes)
- A Vector<Value*, 3>
after the end of the Value object, depending on the kind of the Value.
So for example, when allocating an Add, we would allocate an extra 16 bytes into which to store 2 Values.
This would halve the memory consumption of Const64/Const32/Nop/Identity and a bunch more kinds of values, and reduce by a more moderate amount the memory consumption of the rest of non-varargs values (e.g. Add would go from 72 to 48 bytes).

A few implementation points:
- Even if there is no children, we must remember to allocate at least enough space for replaceWithIdentity to work later. It needs sizeof(Value) (for the object itself) + sizeof(Value*) (for the pointer to its child)
- We must make sure to destroy the vector whenever we destroy a Value which is VarArgs
- We must remember how many elements there are in the case where we did not allocate a Vector. We cannot do it purely by relying on the kind, both for speed reasons and because Return can have either 0 or 1 argument in B3
  Thankfully, we have an extra byte of padding to use in the middle of B3::Value
- In order to support clone(), we must have a separate version of allocate, which extracts the opcode from the to-be-cloned object instead of from the call to the constructor
- Speaking of which, we need a special templated function opcodeFromConstructor, because some of the constructors of subclasses of Value don't take an explicit Opcode as argument, typically because they match a single one.
- To maximize performance, we provide specialized versions of child/lastChild/numChildren/children in the subclasses of Value, skipping checks when the actual type of the Value is already known.
  This is done through the B3_SPECIALIZE_VALUE_FOR_... defined at the bottom of B3Value.h
- In the constructors of Value, we convert all extra children arguments to Value* eagerly. It is not required for correctness (they will be converted when put into a Vector<Value*> or a Value* in the end), but it helps limit an explosion in the number of template instantiations.
- I moved DeepValueDump::dump from the .h to the .cpp, as there is no good reason to inline it, and recompiling JSC is already slow enough

* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3ArgumentRegValue.cpp:
(JSC::B3::ArgumentRegValue::cloneImpl const): Deleted.
* b3/B3ArgumentRegValue.h:
* b3/B3AtomicValue.cpp:
(JSC::B3::AtomicValue::AtomicValue):
(JSC::B3::AtomicValue::cloneImpl const): Deleted.
* b3/B3AtomicValue.h:
* b3/B3BasicBlock.h:
* b3/B3BasicBlockInlines.h:
(JSC::B3::BasicBlock::appendNewNonTerminal): Deleted.
* b3/B3CCallValue.cpp:
(JSC::B3::CCallValue::appendArgs):
(JSC::B3::CCallValue::cloneImpl const): Deleted.
* b3/B3CCallValue.h:
* b3/B3CheckValue.cpp:
(JSC::B3::CheckValue::cloneImpl const): Deleted.
* b3/B3CheckValue.h:
* b3/B3Const32Value.cpp:
(JSC::B3::Const32Value::cloneImpl const): Deleted.
* b3/B3Const32Value.h:
* b3/B3Const64Value.cpp:
(JSC::B3::Const64Value::cloneImpl const): Deleted.
* b3/B3Const64Value.h:
* b3/B3ConstDoubleValue.cpp:
(JSC::B3::ConstDoubleValue::cloneImpl const): Deleted.
* b3/B3ConstDoubleValue.h:
* b3/B3ConstFloatValue.cpp:
(JSC::B3::ConstFloatValue::cloneImpl const): Deleted.
* b3/B3ConstFloatValue.h:
* b3/B3ConstPtrValue.h:
(JSC::B3::ConstPtrValue::opcodeFromConstructor):
* b3/B3FenceValue.cpp:
(JSC::B3::FenceValue::FenceValue):
(JSC::B3::FenceValue::cloneImpl const): Deleted.
* b3/B3FenceValue.h:
* b3/B3MemoryValue.cpp:
(JSC::B3::MemoryValue::MemoryValue):
(JSC::B3::MemoryValue::cloneImpl const): Deleted.
* b3/B3MemoryValue.h:
* b3/B3MoveConstants.cpp:
* b3/B3PatchpointValue.cpp:
(JSC::B3::PatchpointValue::cloneImpl const): Deleted.
* b3/B3PatchpointValue.h:
(JSC::B3::PatchpointValue::opcodeFromConstructor):
* b3/B3Procedure.cpp:
* b3/B3Procedure.h:
* b3/B3ProcedureInlines.h:
(JSC::B3::Procedure::add):
* b3/B3SlotBaseValue.cpp:
(JSC::B3::SlotBaseValue::cloneImpl const): Deleted.
* b3/B3SlotBaseValue.h:
* b3/B3StackmapSpecial.cpp:
(JSC::B3::StackmapSpecial::forEachArgImpl):
(JSC::B3::StackmapSpecial::isValidImpl):
* b3/B3StackmapValue.cpp:
(JSC::B3::StackmapValue::append):
(JSC::B3::StackmapValue::StackmapValue):
* b3/B3StackmapValue.h:
* b3/B3SwitchValue.cpp:
(JSC::B3::SwitchValue::SwitchValue):
(JSC::B3::SwitchValue::cloneImpl const): Deleted.
* b3/B3SwitchValue.h:
(JSC::B3::SwitchValue::opcodeFromConstructor):
* b3/B3UpsilonValue.cpp:
(JSC::B3::UpsilonValue::cloneImpl const): Deleted.
* b3/B3UpsilonValue.h:
* b3/B3Value.cpp:
(JSC::B3::DeepValueDump::dump const):
(JSC::B3::Value::~Value):
(JSC::B3::Value::replaceWithIdentity):
(JSC::B3::Value::replaceWithNopIgnoringType):
(JSC::B3::Value::replaceWithPhi):
(JSC::B3::Value::replaceWithJump):
(JSC::B3::Value::replaceWithOops):
(JSC::B3::Value::replaceWith):
(JSC::B3::Value::invertedCompare const):
(JSC::B3::Value::returnsBool const):
(JSC::B3::Value::cloneImpl const): Deleted.
* b3/B3Value.h:
(JSC::B3::DeepValueDump::dump const): Deleted.
* b3/B3ValueInlines.h:
(JSC::B3::Value::adjacencyListOffset const):
(JSC::B3::Value::cloneImpl const):
* b3/B3VariableValue.cpp:
(JSC::B3::VariableValue::VariableValue):
(JSC::B3::VariableValue::cloneImpl const): Deleted.
* b3/B3VariableValue.h:
* b3/B3WasmAddressValue.cpp:
(JSC::B3::WasmAddressValue::WasmAddressValue):
(JSC::B3::WasmAddressValue::cloneImpl const): Deleted.
* b3/B3WasmAddressValue.h:
* b3/B3WasmBoundsCheckValue.cpp:
(JSC::B3::WasmBoundsCheckValue::WasmBoundsCheckValue):
(JSC::B3::WasmBoundsCheckValue::cloneImpl const): Deleted.
* b3/B3WasmBoundsCheckValue.h:
(JSC::B3::WasmBoundsCheckValue::accepts):
(JSC::B3::WasmBoundsCheckValue::opcodeFromConstructor):
* b3/testb3.cpp:
(JSC::B3::testCallFunctionWithHellaArguments):
(JSC::B3::testCallFunctionWithHellaArguments2):
(JSC::B3::testCallFunctionWithHellaArguments3):
(JSC::B3::testCallFunctionWithHellaDoubleArguments):
(JSC::B3::testCallFunctionWithHellaFloatArguments):
* ftl/FTLOutput.h:
(JSC::FTL::Output::call):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244309 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: Heap: don't use recursion when calculating root paths
drousso@apple.com [Mon, 15 Apr 2019 23:48:57 +0000 (23:48 +0000)]
Web Inspector: Heap: don't use recursion when calculating root paths
https://bugs.webkit.org/show_bug.cgi?id=196890
<rdar://problem/49870751>

Reviewed by Joseph Pecoraro.

* UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
(HeapSnapshot.prototype.shortestGCRootPath):
(HeapSnapshot.prototype._determineGCRootPaths):
(HeapSnapshot.prototype._gcRootPathes.visitNode): Deleted.
(HeapSnapshot.prototype._gcRootPathes): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244308 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoAdd a DiagnosticLogging method taking an arbitrary dictionary of values.
achristensen@apple.com [Mon, 15 Apr 2019 23:48:55 +0000 (23:48 +0000)]
Add a DiagnosticLogging method taking an arbitrary dictionary of values.
https://bugs.webkit.org/show_bug.cgi?id=196773

Source/WebCore:

Patch by Jer Noble <jer.noble@apple.com> on 2019-04-15
Reviewed by Alex Christensen.

* page/DiagnosticLoggingClient.h:

Source/WebKit:

Patch by Jer Noble <jer.noble@apple.com> on 2019-04-15
Reviewed by Alex Christensen.

In addition to adding the new logging delegate method (and piping everything into it),
add a new APIObject class to represent a signed integer.

* Shared/API/APINumber.h:
* Shared/API/APIObject.h:
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* Shared/Cocoa/WKNSNumber.mm:
(-[WKNSNumber dealloc]):
(-[WKNSNumber objCType]):
(-[WKNSNumber getValue:]):
(-[WKNSNumber longLongValue]):
(-[WKNSNumber _apiObject]):
* Shared/UserData.cpp:
(WebKit::UserData::encode):
(WebKit::UserData::decode):
* UIProcess/API/APIDiagnosticLoggingClient.h:
* UIProcess/API/C/WKPageDiagnosticLoggingClient.h:
* UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
* UIProcess/Cocoa/DiagnosticLoggingClient.h:
* UIProcess/Cocoa/DiagnosticLoggingClient.mm:
(WebKit::DiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary):
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::didReceiveMessage):
* UIProcess/WebPageDiagnosticLoggingClient.cpp:
(WebKit::WebPageDiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary):
* UIProcess/WebPageDiagnosticLoggingClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::logDiagnosticMessageWithValueDictionary):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
(WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary):
* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:

Tools:

Reviewed by Jer Noble.

* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewDiagnosticLogging.mm:
(-[TestLoggingDelegate _webView:logDiagnosticMessage:description:valueDictionary:]):
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244307 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoews-build should clearly indicate flaky test failures
aakash_jain@apple.com [Mon, 15 Apr 2019 23:36:25 +0000 (23:36 +0000)]
ews-build should clearly indicate flaky test failures
https://bugs.webkit.org/show_bug.cgi?id=196947

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(AnalyzeAPITestsResults.analyzeResults):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244306 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agostorage/indexeddb/modern/gc-closes-database-private.html is a flaky timeout
sroberts@apple.com [Mon, 15 Apr 2019 23:02:19 +0000 (23:02 +0000)]
storage/indexeddb/modern/gc-closes-database-private.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=194450

Unreviewed test gardening.

* platform/win/TestExpectations: Updating test expectations

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244304 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoProvide option to not create a longpress gesture recognizer
dino@apple.com [Mon, 15 Apr 2019 22:57:46 +0000 (22:57 +0000)]
Provide option to not create a longpress gesture recognizer
https://bugs.webkit.org/show_bug.cgi?id=196937
<rdar://problem/49918278>

Build fix for iOS platforms that don't have link preview.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244302 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoimported/w3c/web-platform-tests/hr-time/test_cross_frame_start.html is a flaky failure
sroberts@apple.com [Mon, 15 Apr 2019 22:35:31 +0000 (22:35 +0000)]
imported/w3c/web-platform-tests/hr-time/test_cross_frame_start.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=196944

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations: Updating test expecations for flaky failure

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244301 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoBytecode cache should not encode the SourceProvider for UnlinkedFunctionExecutable...
tzagallo@apple.com [Mon, 15 Apr 2019 22:23:38 +0000 (22:23 +0000)]
Bytecode cache should not encode the SourceProvider for UnlinkedFunctionExecutable's classSource
https://bugs.webkit.org/show_bug.cgi?id=196878

Reviewed by Saam Barati.

Every time we encode an (Unlinked)SourceCode, we encode its SourceProvider,
including the full source if it's a StringSourceProvider. This wasn't an issue,
since the SourceCode contains a RefPtr to the SourceProvider, and the Encoder
would avoid encoding the provider multiple times. With the addition of the
incremental cache, each UnlinkedFunctionCodeBlock is encoded in isolation, which
means we can no longer deduplicate it and the full program text was being encoded
multiple times in the cache.
As a work around, this patch adds a custom cached type for encoding the SourceCode
without its provider, and later injects the SourceProvider through the Decoder.

* parser/SourceCode.h:
* parser/UnlinkedSourceCode.h:
(JSC::UnlinkedSourceCode::provider const):
* runtime/CachedTypes.cpp:
(JSC::Decoder::Decoder):
(JSC::Decoder::create):
(JSC::Decoder::provider const):
(JSC::CachedSourceCodeWithoutProvider::encode):
(JSC::CachedSourceCodeWithoutProvider::decode const):
(JSC::decodeCodeBlockImpl):
* runtime/CachedTypes.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244300 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoInjectedBundle parameters often need initialization function called before unarchiving
bfulgham@apple.com [Mon, 15 Apr 2019 22:21:59 +0000 (22:21 +0000)]
InjectedBundle parameters often need initialization function called before unarchiving
https://bugs.webkit.org/show_bug.cgi?id=189709
<rdar://problem/44573653>

Reviewed by Ryosuke Niwa.

Source/WebKit:

Handle the case where the InjectedBundle parameters do not successfully decode because they contain
an unexpected class from the embedding program. If this happens, try decoding the bundle parameters
after the bundle initialiation function runs, which gives the embedding program the opportunity to
register additional classes that are safe for serialization.

Extend WKWebProcessPlugIn with a method that returns the names of any custom classes that need
to be serialized by the InjectedBundle.

Create a new 'decodeBundleParameters' method that contains the logic that used to live in 'initialize'.
Revise 'initialize' to call this new method.

* WebProcess/InjectedBundle/InjectedBundle.h:
* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::initialize): Use the new method.
(WebKit::InjectedBundle::decodeBundleParameters): Added.
(WebKit::InjectedBundle::setBundleParameters): Use 'decodeObjectOfClasses' with the more complete
'classesForCoder' method to unarchive the passed bundle parameters, rather than the
NSDictionary-specific method, since InjectedBundles often encode other types of objects, and the
NSDictionary object may itself hold other kinds of objects.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
(WebKit::WKWebProcessPlugIn::additionalClassesForParameterCoder): Added.

Tools:

* TestWebKitAPI/cocoa/WebProcessPlugIn/WebProcessPlugIn.mm:
(-[WebProcessPlugIn additionalClassesForParameterCoder]): Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244299 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoMarkedSpace.cpp is not in the Xcode workspace
rmorisset@apple.com [Mon, 15 Apr 2019 22:06:21 +0000 (22:06 +0000)]
MarkedSpace.cpp is not in the Xcode workspace
https://bugs.webkit.org/show_bug.cgi?id=196928

Reviewed by Saam Barati.

* JavaScriptCore.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244298 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoLet WTF::convertSafely deduce types from arguments.
justin_fan@apple.com [Mon, 15 Apr 2019 21:58:14 +0000 (21:58 +0000)]
Let WTF::convertSafely deduce types from arguments.

Reviewer's (Darin Adler) follow-up to https://bugs.webkit.org/show_bug.cgi?id=196793.

* platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::tryCreate):
* platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
(WebCore::GPUCommandBuffer::copyBufferToTexture):
(WebCore::GPUCommandBuffer::copyTextureToBuffer):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::trySetInputStateForPipelineDescriptor):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244297 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoProvide option to not create a longpress gesture recognizer
dino@apple.com [Mon, 15 Apr 2019 21:58:08 +0000 (21:58 +0000)]
Provide option to not create a longpress gesture recognizer
https://bugs.webkit.org/show_bug.cgi?id=196937
<rdar://problem/49918278>

Reviewed by Antoine Quint.

A WebKitAdditions file has changed name to WKContentViewInteractionWKInteraction.mm.

Add a property to toggle if we should add a long press gesture
recognizer.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(shouldUsePreviewForLongPress):
(-[WKContentView shouldUsePreviewForLongPress]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244296 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoIncremental bytecode cache should not append function updates when loaded from memory
tzagallo@apple.com [Mon, 15 Apr 2019 21:55:33 +0000 (21:55 +0000)]
Incremental bytecode cache should not append function updates when loaded from memory
https://bugs.webkit.org/show_bug.cgi?id=196865

Reviewed by Filip Pizlo.

JSTests:

* stress/bytecode-cache-shared-code-block.js: Added.
(b):
(program):

Source/JavaScriptCore:

Function updates hold the assumption that a function can only be executed/cached
after its containing code block has already been cached. This assumptions does
not hold if the UnlinkedCodeBlock is loaded from memory by the CodeCache, since
we might have two independent SourceProviders executing different paths of the
code and causing the same UnlinkedCodeBlock to be modified in memory.
Use a RefPtr instead of Ref for m_cachedBytecode in ShellSourceProvider to distinguish
between a new, empty cache and a cache that was not loaded and therefore cannot be updated.

* jsc.cpp:
(ShellSourceProvider::ShellSourceProvider):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244295 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: SameSite parsing should be stricter
pecoraro@apple.com [Mon, 15 Apr 2019 21:53:48 +0000 (21:53 +0000)]
Web Inspector: SameSite parsing should be stricter
https://bugs.webkit.org/show_bug.cgi?id=196927
<rdar://problem/42291601>

Reviewed by Devin Rousso.

Source/WebInspectorUI:

* UserInterface/Models/Cookie.js:
(WI.Cookie.parseSameSiteAttributeValue):

LayoutTests:

* inspector/unit-tests/cookie.html:
* inspector/unit-tests/cookie-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244294 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoThrow TypeError when custom element constructor returns a wrong element or tries...
rniwa@webkit.org [Mon, 15 Apr 2019 21:49:06 +0000 (21:49 +0000)]
Throw TypeError when custom element constructor returns a wrong element or tries to create itself
https://bugs.webkit.org/show_bug.cgi?id=196892

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Update the tests according to https://github.com/web-platform-tests/wpt/pull/16328.

* web-platform-tests/custom-elements/upgrading/Node-cloneNode-expected.txt:
* web-platform-tests/custom-elements/upgrading/Node-cloneNode.html:
* web-platform-tests/custom-elements/upgrading/upgrading-parser-created-element-expected.txt:
* web-platform-tests/custom-elements/upgrading/upgrading-parser-created-element.html:

Source/WebCore:

Throw TypeError instead of InvalidStateError for consistency. This updates WebKit's custom elements
implementation for https://github.com/whatwg/html/pull/4525.

Tests: imported/w3c/web-platform-tests/custom-elements/upgrading/Node-cloneNode.html
       imported/w3c/web-platform-tests/custom-elements/upgrading/upgrading-parser-created-element.html

* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::upgradeElement):
* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::constructJSHTMLElement):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244293 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[CMake] WebCore derived sources should only be referenced inside WebCore
don.olmstead@sony.com [Mon, 15 Apr 2019 21:46:36 +0000 (21:46 +0000)]
[CMake] WebCore derived sources should only be referenced inside WebCore
https://bugs.webkit.org/show_bug.cgi?id=196904

Reviewed by Konstantin Tokarev.

.:

Override WebCore_DERIVED_SOURCES_DIR for WinCairo.

* Source/cmake/OptionsWinCairo.cmake:

Source/WebCore:

Use WebCore_DERIVED_SOURCES_DIR instead of DERIVED_SOURCES_WEBCORE_DIR.

* CMakeLists.txt:
* PlatformGTK.cmake:
* PlatformWin.cmake:
* WebCoreMacros.cmake:

Source/WebCore/PAL:

Specify PAL_DERIVED_SOURCES_DIR as a private include directory.

* pal/CMakeLists.txt:
* pal/PlatformWin.cmake:

Source/WebKit:

Remove reference to DERIVED_SOURCES_WEBCORE_DIR in PlatformMac.cmake.

* PlatformMac.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244292 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoDrawingArea should only capture painting related milestones
zalan@apple.com [Mon, 15 Apr 2019 21:34:10 +0000 (21:34 +0000)]
DrawingArea should only capture painting related milestones
https://bugs.webkit.org/show_bug.cgi?id=196926
<rdar://problem/48003845>

Reviewed by Tim Horton.

While dispatching layout milestones (mixture of layout and painting items), the associated drawing areas should only capture the painting related milestones.
These captured milestones get dispatched later in the commit handler to ensure that they are not forwarded prematurely.
However the truly layout related milestones (e.g. DidFirstVisuallyNonEmptyLayout) should be dispatched right away with no delay.

* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::newlyReachedPaintingMilestones const):
(WebKit::RemoteLayerTreeTransaction::setNewlyReachedPaintingMilestones):
(WebKit::RemoteLayerTreeTransaction::newlyReachedLayoutMilestones const): Deleted.
(WebKit::RemoteLayerTreeTransaction::setNewlyReachedLayoutMilestones): Deleted.
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode const):
(WebKit::RemoteLayerTreeTransaction::decode):
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::addMilestonesToDispatch):
(WebKit::DrawingArea::dispatchDidReachLayoutMilestone): Deleted.
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
(WebKit::RemoteLayerTreeDrawingArea::addMilestonesToDispatch):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::dispatchDidReachLayoutMilestone): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::dispatchDidReachLayoutMilestone):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
(WebKit::TiledCoreAnimationDrawingArea::addMilestonesToDispatch):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedPaintingMilestones):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones): Deleted.
(WebKit::TiledCoreAnimationDrawingArea::dispatchDidReachLayoutMilestone): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244291 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: CPU Usage Timeline - Energy impact popover flickers
pecoraro@apple.com [Mon, 15 Apr 2019 21:33:58 +0000 (21:33 +0000)]
Web Inspector: CPU Usage Timeline - Energy impact popover flickers
https://bugs.webkit.org/show_bug.cgi?id=196931
<rdar://problem/49569122>

Reviewed by Devin Rousso.

* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.prototype.initialLayout):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244290 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoHashTable::removeIf always shrinks the hash table by half even if there is nothing...
rniwa@webkit.org [Mon, 15 Apr 2019 21:30:38 +0000 (21:30 +0000)]
HashTable::removeIf always shrinks the hash table by half even if there is nothing left
https://bugs.webkit.org/show_bug.cgi?id=196681

Reviewed by Darin Adler.

Source/WTF:

Made HashTable::removeIf shrink to the "best size", which is the least power of two bigger
than twice the key count as already used in the copy constructor.

* wtf/HashTable.h:
(WTF::HashTable::computeBestTableSize): Extracted from the copy constructor.
(WTF::HashTable::shrinkToBestSize): Added.
(WTF::HashTable::removeIf): Use shrinkToBestSize instead of shrink.
(WTF::HashTable::HashTable):

Tools:

Added tests.

* TestWebKitAPI/Tests/WTF/HashSet.cpp:
(WTF_HashSet.RemoveIf):
(WTF_HashSet.RemoveIfShrinkToBestSize):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244289 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoSend delayed Ad Click Attribution conversion requests to the click source
wilander@apple.com [Mon, 15 Apr 2019 21:10:03 +0000 (21:10 +0000)]
Send delayed Ad Click Attribution conversion requests to the click source
https://bugs.webkit.org/show_bug.cgi?id=196838
<rdar://problem/47650157>

Reviewed by Chris Dumez and Youenn Fablet.

Source/WebCore:

WebCore::AdClickAttribution now:
- Sets m_earliestTimeToSend correctly based on WallTime::now().
- Allows for a test override of the base URL for conversions.
- Holds state for whether or not a conversion request has been sent.
- Outputs m_earliestTimeToSend and m_conversion->hasBeenSent in toString().
- Returns m_earliestTimeToSend as a result of a call to
convertAndGetEarliestTimeToSend() which used to be called setConversion().

Test: http/tests/adClickAttribution/send-attribution-conversion-request.html

* loader/AdClickAttribution.cpp:
(WebCore::AdClickAttribution::convertAndGetEarliestTimeToSend):
(WebCore::AdClickAttribution::url const):
(WebCore::AdClickAttribution::urlForTesting const):
(WebCore::AdClickAttribution::markConversionAsSent):
(WebCore::AdClickAttribution::wasConversionSent const):
(WebCore::AdClickAttribution::toString const):
(WebCore::AdClickAttribution::setConversion): Deleted.
    Renamed convertAndGetEarliestTimeToSend().
* loader/AdClickAttribution.h:
(WebCore::AdClickAttribution::Conversion::Conversion):
(WebCore::AdClickAttribution::Conversion::encode const):
(WebCore::AdClickAttribution::Conversion::decode):
* platform/Timer.h:
    Now exports nextFireInterval.

Source/WebKit:

This patch schedules a conversion request with appropriate data going to the
click source as a result of an ad click conversion.

WebKit::AdClickAttributionManager makes use of existing WebKit::PingLoad
infrastructure to make the request. This will probably be reworked into a
dedicated load class further on.

New test infrastructure allows for an override of both the conversion URL
and the 24-48 hour timer.

* NetworkProcess/AdClickAttributionManager.cpp: Added.
(WebKit::AdClickAttributionManager::ensureDestinationMapForSource):
(WebKit::AdClickAttributionManager::store):
(WebKit::AdClickAttributionManager::startTimer):
    Convenience function to support test override.
(WebKit::AdClickAttributionManager::convert):
    This function now sets the timer.
(WebKit::AdClickAttributionManager::fireConversionRequest):
    Fire an individual request.
(WebKit::AdClickAttributionManager::firePendingConversionRequests):
    This is the timer function that iterates over all pending attributions.
(WebKit::AdClickAttributionManager::clear):
    Now clears the two new test settings members.
(WebKit::AdClickAttributionManager::toString const):
* NetworkProcess/AdClickAttributionManager.h: Renamed from Source/WebKit/NetworkProcess/NetworkAdClickAttribution.h.
(WebKit::AdClickAttributionManager::AdClickAttributionManager):
(WebKit::AdClickAttributionManager::setPingLoadFunction):
(WebKit::AdClickAttributionManager::setOverrideTimerForTesting):
(WebKit::AdClickAttributionManager::setConversionURLForTesting):
* NetworkProcess/NetworkAdClickAttribution.cpp: Renamed from Source/WebKit/NetworkProcess/NetworkAdClickAttribution.cpp.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::storeAdClickAttribution):
(WebKit::NetworkProcess::dumpAdClickAttribution):
(WebKit::NetworkProcess::clearAdClickAttribution):
(WebKit::NetworkProcess::setAdClickAttributionOverrideTimerForTesting):
(WebKit::NetworkProcess::setAdClickAttributionConversionURLForTesting):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
(WebKit::NetworkSession::setAdClickAttributionOverrideTimerForTesting):
(WebKit::NetworkSession::setAdClickAttributionConversionURLForTesting):
* NetworkProcess/NetworkSession.h:
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::PingLoad):
(WebKit::m_blobFiles):
(WebKit::PingLoad::initialize):
    The PingLoad constructor is now split in two to allow for construction
    without a WebKit::NetworkConnectionToWebProcess object. The body of
    the constructor was moved into the new initialize() function which is
    shared between constructors.
* NetworkProcess/PingLoad.h:
* Sources.txt:
    Removed NetworkProcess/NetworkAdClickAttribution.cpp and added
    NetworkProcess/NetworkAdClickAttribution.cpp.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetAdClickAttributionOverrideTimerForTesting):
(WKPageSetAdClickAttributionConversionURLForTesting):
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::dumpAdClickAttribution): Deleted.
(WebKit::NetworkProcessProxy::clearAdClickAttribution): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::dumpAdClickAttribution):
(WebKit::WebPageProxy::clearAdClickAttribution):
(WebKit::WebPageProxy::setAdClickAttributionOverrideTimerForTesting):
(WebKit::WebPageProxy::setAdClickAttributionConversionURLForTesting):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::dumpAdClickAttribution): Deleted.
(WebKit::WebProcessPool::clearAdClickAttribution): Deleted.
* UIProcess/WebProcessPool.h:
* WebKit.xcodeproj/project.pbxproj:

Tools:

This patch adds test infrastructure to override the default behavior in
WebKit::NetworkAdClickAttribution.

* TestWebKitAPI/Tests/WebCore/AdClickAttribution.cpp:
(TestWebKitAPI::TEST):
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::dumpAdClickAttribution):
(WTR::TestRunner::clearAdClickAttribution):
(WTR::TestRunner::setAdClickAttributionOverrideTimerForTesting):
(WTR::TestRunner::setAdClickAttributionConversionURLForTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::setAdClickAttributionOverrideTimerForTesting):
(WTR::TestController::setAdClickAttributionConversionURLForTesting):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:

* http/tests/adClickAttribution/attribution-conversion-through-image-redirect-with-priority-expected.txt:
* http/tests/adClickAttribution/attribution-conversion-through-image-redirect-without-priority-expected.txt:
* http/tests/adClickAttribution/resources/conversionFilePath.php: Added.
* http/tests/adClickAttribution/resources/conversionReport.php: Added.
* http/tests/adClickAttribution/resources/getConversionData.php: Added.
* http/tests/adClickAttribution/send-attribution-conversion-request-expected.txt: Added.
* http/tests/adClickAttribution/send-attribution-conversion-request.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244288 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agomergeOSREntryValue is wrong when the incoming value does not match up with the flush...
sbarati@apple.com [Mon, 15 Apr 2019 20:44:33 +0000 (20:44 +0000)]
mergeOSREntryValue is wrong when the incoming value does not match up with the flush format
https://bugs.webkit.org/show_bug.cgi?id=196918

Reviewed by Yusuke Suzuki.

r244238 lead to some debug failures because we were calling checkConsistency()
before doing fixTypeForRepresentation when merging in must handle values in
CFA. This patch fixes that.

However, as I was reading over mergeOSREntryValue, I realized it was wrong. It
was possible it could merge in a value/type outside of the variable's flushed type.
Once the flush format types are locked in, we can't introduce a type out of
that range. This probably never lead to any crashes as our profiling injection
and speculation decision code is solid. However, what we were doing is clearly
wrong, and something a fuzzer could have found if we fuzzed the must handle
values inside prediction injection. We should do that fuzzing:
https://bugs.webkit.org/show_bug.cgi?id=196924

* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::mergeOSREntryValue):
* dfg/DFGAbstractValue.h:
* dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::injectOSR):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244287 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoSeveral structures and enums in the Yarr interpreter can be shrunk
rmorisset@apple.com [Mon, 15 Apr 2019 20:39:11 +0000 (20:39 +0000)]
Several structures and enums in the Yarr interpreter can be shrunk
https://bugs.webkit.org/show_bug.cgi?id=196923

Reviewed by Saam Barati.

YarrOp: 88 -> 80
RegularExpression: 40 -> 32
ByteTerm: 56 -> 48
PatternTerm: 56 -> 48

* yarr/RegularExpression.cpp:
* yarr/YarrInterpreter.h:
* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::YarrOp::YarrOp):
* yarr/YarrParser.h:
* yarr/YarrPattern.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244286 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: REGRESSION(r244172): crash when trying to add extra domain while inspe...
drousso@apple.com [Mon, 15 Apr 2019 20:29:30 +0000 (20:29 +0000)]
Web Inspector: REGRESSION(r244172): crash when trying to add extra domain while inspecting JSContext
https://bugs.webkit.org/show_bug.cgi?id=196925
<rdar://problem/49873994>

Reviewed by Joseph Pecoraro.

Move the logic for creating the `InspectorAgent` and `InspectorDebuggerAgent` into separate
functions so that callers can be guaranteed to have a valid instance of the agent.

* inspector/JSGlobalObjectInspectorController.h:
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::connectFrontend):
(Inspector::JSGlobalObjectInspectorController::frontendInitialized):
(Inspector::JSGlobalObjectInspectorController::appendExtraAgent):
(Inspector::JSGlobalObjectInspectorController::ensureInspectorAgent): Added.
(Inspector::JSGlobalObjectInspectorController::ensureDebuggerAgent): Added.
(Inspector::JSGlobalObjectInspectorController::createLazyAgents):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244285 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[ews-app] status-bubble should display position in queue
aakash_jain@apple.com [Mon, 15 Apr 2019 20:18:48 +0000 (20:18 +0000)]
[ews-app] status-bubble should display position in queue
https://bugs.webkit.org/show_bug.cgi?id=196607

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/views/statusbubble.py:
(StatusBubble._build_bubble):
(StatusBubble._queue_position): Method to calculate patch's position in queue.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244284 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[ews-build] Do not run clean build by default on EWS builders
aakash_jain@apple.com [Mon, 15 Apr 2019 20:12:39 +0000 (20:12 +0000)]
[ews-build] Do not run clean build by default on EWS builders
https://bugs.webkit.org/show_bug.cgi?id=196897

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(ApplyPatch.start): Do not create .buildbot-patched file. This is a special file for Buildbot and if this
file is present, during the Source checkout, Buildbot cleans the working directory completely (including removing
untracked directories like WebKitBuild).
(CheckOutSource.__init__): Pass method=clean so that Buildbot clean the working directory. This does not remove
untracked files/directories (like WebKitBuild).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244283 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: REGRESSION(r244268): Canvas: navigation sidebar no longer appears
drousso@apple.com [Mon, 15 Apr 2019 19:56:59 +0000 (19:56 +0000)]
Web Inspector: REGRESSION(r244268): Canvas: navigation sidebar no longer appears
https://bugs.webkit.org/show_bug.cgi?id=196920
<rdar://problem/49910618>

Reviewed by Timothy Hatcher.

* UserInterface/Views/ContentBrowserTabContentView.js:
(WI.ContentBrowserTabContentView.prototype.showNavigationSidebarPanel):
Now that we no longer call `addSubview` when adding a sidebar panel, we can't check to see
if `parentSidebar` has been set, as that is just an alias for `parentView`.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244282 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWebDriver: Set Cookie endpoint does not correctly set subdomain cookies
drousso@apple.com [Mon, 15 Apr 2019 19:49:08 +0000 (19:49 +0000)]
WebDriver: Set Cookie endpoint does not correctly set subdomain cookies
https://bugs.webkit.org/show_bug.cgi?id=196872
<rdar://problem/49233240>

Reviewed by Joseph Pecoraro.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::addSingleCookie):
Rather than try to "force" the cookie to be set on the current active URL, use the cookie
itself to figure out which domain it should be set on.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244281 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoREGRESSION (r240644): Layout Test inspector/page/overrideSetting-ICECandidateFilterin...
drousso@apple.com [Mon, 15 Apr 2019 19:46:34 +0000 (19:46 +0000)]
REGRESSION (r240644): Layout Test inspector/page/overrideSetting-ICECandidateFilteringEnabled.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=194437
<rdar://problem/48008005>

Reviewed by Joseph Pecoraro.

* inspector/page/overrideSetting-ICECandidateFilteringEnabled.html:
* inspector/page/overrideSetting-ICECandidateFilteringEnabled-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244280 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: DOMDebugger: move breakpoint storage to use `WI.ObjectStore`
drousso@apple.com [Mon, 15 Apr 2019 19:17:14 +0000 (19:17 +0000)]
Web Inspector: DOMDebugger: move breakpoint storage to use `WI.ObjectStore`
https://bugs.webkit.org/show_bug.cgi?id=196231
<rdar://problem/49236864>

Reviewed by Joseph Pecoraro.

* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager):
(WI.DOMDebuggerManager.prototype.addDOMBreakpoint):
(WI.DOMDebuggerManager.prototype.removeDOMBreakpoint):
(WI.DOMDebuggerManager.prototype.removeDOMBreakpointsForNode):
(WI.DOMDebuggerManager.prototype.addEventBreakpoint):
(WI.DOMDebuggerManager.prototype.removeEventBreakpoint):
(WI.DOMDebuggerManager.prototype.addURLBreakpoint):
(WI.DOMDebuggerManager.prototype.removeURLBreakpoint):
(WI.DOMDebuggerManager.prototype._handleDOMBreakpointDisabledStateChanged):
(WI.DOMDebuggerManager.prototype._handleEventBreakpointDisabledStateChanged):
(WI.DOMDebuggerManager.prototype._handleURLBreakpointDisabledStateChanged):
(WI.DOMDebuggerManager.prototype._saveDOMBreakpoints): Deleted.
(WI.DOMDebuggerManager.prototype._saveEventBreakpoints): Deleted.
(WI.DOMDebuggerManager.prototype._saveURLBreakpoints): Deleted.

* UserInterface/Models/DOMBreakpoint.js:
(WI.DOMBreakpoint.prototype.saveIdentityToCookie):
(WI.DOMBreakpoint.prototype.toJSON): Added.
(WI.DOMBreakpoint.prototype.get serializableInfo): Deleted.
* UserInterface/Models/EventBreakpoint.js:
(WI.EventBreakpoint.prototype.saveIdentityToCookie):
(WI.EventBreakpoint.prototype.toJSON): Added.
(WI.EventBreakpoint.prototype.get serializableInfo): Deleted.
* UserInterface/Models/URLBreakpoint.js:
(WI.URLBreakpoint.prototype.saveIdentityToCookie):
(WI.URLBreakpoint.prototype.toJSON): Added.
(WI.URLBreakpoint.prototype.get serializableInfo): Deleted.
Replace `get serializableInfo` with `toJSON` as required by `WI.ObjectStore`.

* UserInterface/Base/ObjectStore.js:
(WI.ObjectStore._open):
Increment version.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244279 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: drag/drop over the sidebar should load an imported file in Canvas...
drousso@apple.com [Mon, 15 Apr 2019 18:58:27 +0000 (18:58 +0000)]
Web Inspector: drag/drop over the sidebar should load an imported file in Canvas/Audit tab
https://bugs.webkit.org/show_bug.cgi?id=196873
<rdar://problem/49858190>

Reviewed by Timothy Hatcher.

* UserInterface/Base/Main.js:
(WI.contentLoaded):
(WI._handleDragOver): Added.
(WI._handleDrop): Added.
(WI._dragOver): Deleted.
* UserInterface/Views/AuditTabContentView.js:
(WI.AuditTabContentView):
(WI.AuditTabContentView.prototype.async handleFileDrop): Added.
(WI.AuditTabContentView.prototype._handleDragOver): Deleted.
(WI.AuditTabContentView.prototype._handleDrop): Deleted.
* UserInterface/Views/CanvasTabContentView.js:
(WI.CanvasTabContentView):
(WI.CanvasTabContentView.prototype.async handleFileDrop): Added.
(WI.CanvasTabContentView.prototype._handleDragOver): Deleted.
(WI.CanvasTabContentView.prototype._handleDrop): Deleted.
* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView.prototype.async handleFileDrop): Added.
Check whether the current tab is able to handle a file drop, and if so, don't prevent the
drag from occuring. This now allows the user to drop anywhere on the Web Inspector area to
import files, so long as the relevant tab is currently selected.

* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.async processJSON): Added.
(WI.CanvasManager.prototype.processJSON): Deleted.
* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.prototype.async processJSON): Added.
(WI.TimelineManager.prototype.processJSON): Deleted.
Make `async` to match other `processJSON` functions.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244278 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoRegression(r237903) Speedometer 2 is 1-2% regressed on iOS
cdumez@apple.com [Mon, 15 Apr 2019 18:56:52 +0000 (18:56 +0000)]
Regression(r237903) Speedometer 2 is 1-2% regressed on iOS
https://bugs.webkit.org/show_bug.cgi?id=196841
<rdar://problem/45957016>

Reviewed by Myles C. Maxfield.

Speedometer 2 content does not use the text-underline-offset and text-decoration-thickness
features that were added in r237903 so I looked for behavior changes in the context of
Speedometer from r237903. I found that RenderStyle::changeAffectsVisualOverflow() started
returning true a lot more often after r237903. The reason is that r237903 dropped the
visualOverflowForDecorations() checks in this method and started returning true a lot
more as a result.

To restore previous behavior, this patch adds back the visualOverflowForDecorations() checks
that were dropped in r237903. I have verified that with this patch,
RenderStyle::changeAffectsVisualOverflow() returns true as many times as it used to before
r237903.

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeAffectsVisualOverflow const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244277 268f45cc-cd09-0410-ab3c-d52691b4dbfc