WebKit-https.git
7 months ago[WebKitLegacy] Media playback pauses on scroll
jer.noble@apple.com [Fri, 4 Jan 2019 22:23:15 +0000 (22:23 +0000)]
[WebKitLegacy] Media playback pauses on scroll
https://bugs.webkit.org/show_bug.cgi?id=192829

Reviewed by Eric Carlson.

Source/WebCore:

New API tests:
    WebKitLegacy.ScrollingDoesNotPauseMedia
    WKWebView.StopAllMediaPlayback
    WKWebView.SuspendResumeAllMediaPlayback

Do not use suspendActiveDOMObjects(ReasonForSuspension::PageWillBeSuspended) to pause
video. Roll back the changes to HTMLMediaElement, and introduce a new set of Page calls
suspendAllMediaPlayback() & resumeAllMediaPlayback() which replaces the removed bahavior.

* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::stopAllMediaPlayback):
(WebCore::Document::suspendAllMediaPlayback):
(WebCore::Document::resumeAllMediaPlayback):
* dom/Document.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::parseAttribute):
(WebCore::HTMLMediaElement::didFinishInsertingNode):
(WebCore::HTMLMediaElement::setSrcObject):
(WebCore::HTMLMediaElement::updateActiveTextTrackCues):
(WebCore::HTMLMediaElement::suspend):
(WebCore::HTMLMediaElement::resume):
(WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const): Deleted.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted const):
* page/Page.cpp:
(WebCore::Page::stopAllMediaPlayback):
(WebCore::Page::suspendAllMediaPlayback):
(WebCore::Page::resumeAllMediaPlayback):
* page/Page.h:
(WebCore::Page::mediaPlaybackIsSuspended):
* platform/audio/PlatformMediaSession.h:
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::suspendAllMediaPlaybackForDocument):
(WebCore::PlatformMediaSessionManager::resumeAllMediaPlaybackForDocument):
* platform/audio/PlatformMediaSessionManager.h:

Source/WebKit:

Add a new WebPage, WebPageProxy, & WKWebView SPI to stop, suspend, and resume all
existing media playback in the page.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _stopAllMediaPlayback]):
(-[WKWebView _suspendAllMediaPlayback]):
(-[WKWebView _resumeAllMediaPlayback]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::stopAllMediaPlayback):
(WebKit::WebPageProxy::suspendAllMediaPlayback):
(WebKit::WebPageProxy::resumeAllMediaPlayback):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController _showPhishingAlert]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::stopAllMediaPlayback):
(WebKit::WebPage::suspendAllMediaPlayback):
(WebKit::WebPage::resumeAllMediaPlayback):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/StopSuspendResumeAllMedia.mm: Added.
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitLegacy/ios/ScrollingDoesNotPauseMedia.mm: Added.
(-[ScrollingDoesNotPauseMediaDelegate webViewDidFinishLoad:]):
(-[ScrollingDoesNotPauseMediaDelegate uiWebView:didCommitLoadForFrame:]):
(-[ScrollingDoesNotPauseMediaDelegate handleEvent:]):
(TestWebKitAPI::TEST):

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

7 months agoAdd support for toggling device orientation API support per site
cdumez@apple.com [Fri, 4 Jan 2019 22:11:58 +0000 (22:11 +0000)]
Add support for toggling device orientation API support per site
https://bugs.webkit.org/show_bug.cgi?id=193143
<rdar://problem/46605724>

Reviewed by Alex Christensen.

Source/WebCore:

Add support for toggling device orientation API support per site via _WKWebsitePolicies.

* dom/Document.cpp:
(WebCore::Document::simulateDeviceOrientationChange):
* dom/Document.h:
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::deviceOrientationEventEnabled const):
(WebCore::DocumentLoader::setDeviceOrientationEventEnabled):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):

Source/WebKit:

Add support for toggling device orientation API support per site via _WKWebsitePolicies.

* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _simulateDeviceOrientationChangeWithAlpha:beta:gamma:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setDeviceOrientationEventEnabled:]):
(-[_WKWebsitePolicies deviceOrientationEventEnabled]):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::simulateDeviceOrientationChange):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::simulateDeviceOrientationChange):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(-[DataMappingSchemeHandler setTaskHandler:]):
(-[DataMappingSchemeHandler webView:startURLSchemeTask:]):
(-[WebsitePoliciesDeviceOrientationDelegate initWithDeviceOrientationEventEnabled:]):
(-[WebsitePoliciesDeviceOrientationDelegate _webView:decidePolicyForNavigationAction:userInfo:decisionHandler:]):
(-[WebsitePoliciesDeviceOrientationDelegate webView:didFinishNavigation:]):

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

7 months agoCrash under WebPageProxy::continueNavigationInNewProcess()
cdumez@apple.com [Fri, 4 Jan 2019 22:10:21 +0000 (22:10 +0000)]
Crash under WebPageProxy::continueNavigationInNewProcess()
https://bugs.webkit.org/show_bug.cgi?id=193113
<rdar://problem/46938686>

Reviewed by Brady Eidson.

The crash was happening in continueNavigationInNewProcess() when dereferencing
the Optional<> value returned by API::Navigation::backForwardFrameLoadType(), after verifying
that API::Navigation::targetItem() is not null.

When constructing an API::Navigation object with a targetItem, you HAVE to pass
in a backForwardFrameLoadType as well so this normally is not possible. However,
it can happen because API::Navigation::setTargetItem() can get called later on and
set a target item on a Navigation object which potentially does not have a
backForwardFrameLoadType. This setter was only called in one place in
decidePolicyForNavigationAction() to update an existing Navigation object using
the targetItem provided by a NavigationAction. This logic was added with PSON
support.

Because I was unable to write a test case reproducing this and because I do not know
how it can happen in practice that we'd have a NavigationAction with a targetItem
even though the Navigation object itself is not for a back/forward navigation, I have
chosen to drop the unsafe API::Navigation::setTargetItem() setter and the call site.
When the call site was added, with ProcessSwap.NavigateToDataURLThenBack API test,
the intention was to create a back/forward navigation object instead of a standard load
navigation one if there is currently no existing Navigation object in the UIProcess.
This can happen when the back/forward navigation is triggered by the WebProcess via
JS (e.g. history.back()) and this is what the API test covers. The part of the logic
that updates an existing Navigation object with a targetItem coming from the
NavigationAction is untested and I have no evidence it does anything useful. However,
we DO have evidence that it can cause crashes.

* UIProcess/API/APINavigation.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):

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

7 months agoRemove some nonexistent files from the WebKit Xcode project
timothy_horton@apple.com [Fri, 4 Jan 2019 21:40:40 +0000 (21:40 +0000)]
Remove some nonexistent files from the WebKit Xcode project

* WebKit.xcodeproj/project.pbxproj:
r238468 and r237205 forgot to remove some files from the project.

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

7 months agoWeb Content process main thread blocked beneath ImageDecoderAVFObjC::readSamples...
jer.noble@apple.com [Fri, 4 Jan 2019 21:32:48 +0000 (21:32 +0000)]
Web Content process main thread blocked beneath ImageDecoderAVFObjC::readSamples for many seconds on imgur.com
https://bugs.webkit.org/show_bug.cgi?id=191806
<rdar://problem/46151477>

Reviewed by Dean Jackson.

Source/WebCore:

Test: http/tests/images/mp4-partial-load.html

Rather than use an AVAssetReaderTrackOutput, which will load both sample metadata and sample data
synchronously when a sample is requested, use AVAssetReaderSampleReferenceOutput, which only loads
sample metadata, including the byte offset and byte length of the sample data. By waiting until the
AVAsset signals that it's own metadata is loaded, we can safely parse all the sample metadata without
blocking on network loads. Once enough data is loaded, we can replace the byte reference and offset
attachements in the sample with actual data, and mark the sample as "complete".

Because the existing ImageSource assumes that image data parsing will occur synchronously, and that
synchronous parsing could cause a hang if the metadata is not loaded, add a new callback method which
allows the ImageSource to be notified when the encodedDataStatus changes. The ImageSource notifies the
CacheImage, which notifies the RenderImage, and thus the asynchronous parsing will kick off the
renderer's animation loop.

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::CachedImageObserver::encodedDataStatusChanged):
(WebCore::CachedImage::encodedDataStatusChanged):
* loader/cache/CachedImage.h:
* platform/graphics/ImageDecoder.h:
(WebCore::ImageDecoder::setEncodedDataStatusChangeCallback):
* platform/graphics/ImageObserver.h:
(WebCore::ImageObserver::encodedDataStatusChanged):
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::ensureDecoderAvailable):
(WebCore::ImageSource::encodedDataStatusChanged):
(WebCore::ImageSource::frameDecodingStatusAtIndex):
* platform/graphics/ImageSource.h:
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(-[WebCoreSharedBufferResourceLoaderDelegate data]):
(WebCore::ImageDecoderAVFObjCSample::byteRange const):
(WebCore::ImageDecoderAVFObjC::readSamples):
(WebCore::ImageDecoderAVFObjC::setEncodedDataStatusChangeCallback):
(WebCore::ImageDecoderAVFObjC::encodedDataStatus const):
(WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const):
(WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
(WebCore::ImageDecoderAVFObjC::sampleIsComplete const):

Source/WebCore/PAL:

* pal/cf/CoreMediaSoftLink.cpp:
* pal/cf/CoreMediaSoftLink.h:

LayoutTests:

* http/tests/images/mp4-partial-load-expected.txt: Added.
* http/tests/images/mp4-partial-load.html: Added.
* platform/win/http/tests/mp4-partial-load-expected.txt: Added.

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

7 months agoWeb Inspector: Add a Setting Toggle for Source Maps
commit-queue@webkit.org [Fri, 4 Jan 2019 21:27:34 +0000 (21:27 +0000)]
Web Inspector: Add a Setting Toggle for Source Maps
https://bugs.webkit.org/show_bug.cgi?id=193148

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-01-04
Reviewed by Devin Rousso.

* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.downloadSourceMap):
Don't download source maps if the setting is disabled.

* UserInterface/Base/Setting.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createGeneralSettingsView):
Settings toggle for source maps. Enabled by default.

* Localizations/en.lproj/localizedStrings.js:

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

7 months agoCSP violation reports should bypass CSP checks
youenn@apple.com [Fri, 4 Jan 2019 21:22:30 +0000 (21:22 +0000)]
CSP violation reports should bypass CSP checks
https://bugs.webkit.org/show_bug.cgi?id=192857
<rdar://problem/46887236>

Reviewed by Chris Dumez.

Source/WebCore:

For ping loads, pass the option to do CSP checks from PingLoader to LoaderStrategy.
This new option is unused by WebKit Legacy.
It is used by WebKit loader strategy to only send any CSP response header to network process
in case CSP checks should be done.

This option is used to disable CSP checks for Ping Loads that report CSP violations.

Test: http/wpt/fetch/csp-reports-bypass-csp-checks.html

* loader/LoaderStrategy.h:
* loader/PingLoader.cpp:
(WebCore::PingLoader::loadImage):
(WebCore::PingLoader::sendPing):
(WebCore::PingLoader::sendViolationReport):
(WebCore::PingLoader::startPingLoad):
* loader/PingLoader.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):

Source/WebKit:

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::startPingLoad):
* WebProcess/Network/WebLoaderStrategy.h:

Source/WebKitLegacy:

* WebCoreSupport/WebResourceLoadScheduler.cpp:
(WebResourceLoadScheduler::startPingLoad):
* WebCoreSupport/WebResourceLoadScheduler.h:

LayoutTests:

* http/wpt/fetch/csp-reports-bypass-csp-checks-expected.txt: Added.
* http/wpt/fetch/csp-reports-bypass-csp-checks.html: Added.
* http/wpt/fetch/csp-reports-bypass-csp-checks.html.headers: Added.
* http/wpt/fetch/resources/store-csp-report.py: Added.
(main):

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

7 months ago[ews-build] use svn-apply script to apply the patches
aakash_jain@apple.com [Fri, 4 Jan 2019 21:14:14 +0000 (21:14 +0000)]
[ews-build] use svn-apply script to apply the patches
https://bugs.webkit.org/show_bug.cgi?id=193138

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/factories.py:
(Factory.__init__): Add the ApplyPatch step.
* BuildSlaveSupport/ews-build/steps.py:
(CheckOutSource): Added step name.
(CheckOutSource.__init__): Used alwaysUseLatest so that it doesn't apply patch.
(ApplyPatch): Build step to apply patch using svn-apply script.
(UnApplyPatchIfRequired):
(UnApplyPatchIfRequired.__init__): Deleted, since the alwaysUseLatest parameter is now in base class.

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

7 months agoUse WebsiteDataStoreParameters instead of NetworkProcessCreationParameters for Indexe...
achristensen@apple.com [Fri, 4 Jan 2019 21:13:25 +0000 (21:13 +0000)]
Use WebsiteDataStoreParameters instead of NetworkProcessCreationParameters for IndexedDB directories
https://bugs.webkit.org/show_bug.cgi?id=193114

Reviewed by Brady Eidson.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):

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

7 months agoDeprecate WKContextCreate
achristensen@apple.com [Fri, 4 Jan 2019 21:12:15 +0000 (21:12 +0000)]
Deprecate WKContextCreate
https://bugs.webkit.org/show_bug.cgi?id=193118

Reviewed by Brady Eidson.

Source/WebKit:

It has only one use that is being removed in rdar://problem/47030792
This is a step towards removing ProcessPoolConfiguration::createWithLegacyOptions.
Also make WKContextCreateWithConfiguration accept a null configuration to make it easier to use.

* UIProcess/API/C/WKContext.cpp:
(WKContextCreateWithConfiguration):
* UIProcess/API/C/WKContext.h:

Tools:

* MiniBrowser/win/WebKitBrowserWindow.cpp:
(WebKitBrowserWindow::WebKitBrowserWindow):
* TestWebKitAPI/Tests/WebKit/AboutBlankLoad.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/CloseFromWithinCreatePage.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/CloseThenTerminate.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/CookieManager.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/DownloadDecideDestinationCrash.cpp:
(TestWebKitAPI::TEST):
* 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/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/LayoutMilestonesWithAllContentInFrame.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/LoadAlternateHTMLStringWithNonDirectoryURL.cpp:
(TestWebKitAPI::loadAlternateHTMLString):
* 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/NavigationClientDefaultCrypto.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/PageGroup.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/PageLoadBasic.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/PageLoadDidChangeLocationWithinPageForFrame.cpp:
(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/TerminateTwice.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/UserMedia.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/WKPageConfiguration.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/WKThumbnailView.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/WebCoreStatisticsWithNoWebProcess.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/mac/GetPIDAfterAbortedProcessLaunch.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/mac/RestoreStateAfterTermination.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/CommandBackForward.mm:
(WebKit2_CommandBackForwardTestWKView::SetUp):
* TestWebKitAPI/Tests/WebKitCocoa/FullscreenDelegate.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/SchemeRegistry.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/mac/WebKitAgnosticTest.mm:
(TestWebKitAPI::WebKitAgnosticTest::runWebKit2Test):

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

7 months agoWeb Inspector: Include `globalThis` in default JavaScript completions
commit-queue@webkit.org [Fri, 4 Jan 2019 20:29:24 +0000 (20:29 +0000)]
Web Inspector: Include `globalThis` in default JavaScript completions
https://bugs.webkit.org/show_bug.cgi?id=193147

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-01-04
Reviewed by Devin Rousso.

* UserInterface/Controllers/CodeMirrorCompletionController.js:
Add `globalThis` which is a new global value.

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

7 months agoFix the build
timothy_horton@apple.com [Fri, 4 Jan 2019 20:29:15 +0000 (20:29 +0000)]
Fix the build

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

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

7 months agoShare ink choice and ruler between all editable images
timothy_horton@apple.com [Fri, 4 Jan 2019 20:24:26 +0000 (20:24 +0000)]
Share ink choice and ruler between all editable images
https://bugs.webkit.org/show_bug.cgi?id=193130
<rdar://problem/46826491>

Reviewed by Wenson Hsieh.

* SourcesCocoa.txt:
Add WKDrawingCoordinator, which maintains WKWebView-wide drawing state,
and manages a single shared ink picker.

* UIProcess/PageClient.h:
(WebKit::PageClient::createDrawingView):
* UIProcess/ios/EditableImageController.mm:
(WebKit::EditableImageController::ensureEditableImage):
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::createDrawingView):
Plumb WKDrawingView creation through PageClient, so that it can be instantiated
with knowledge of its owning WKContentView.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _elementDidBlur]):
(-[WKContentView _drawingCoordinator]):
(-[WKContentView _installInkPickerForDrawingViewWithID:]): Deleted.
(-[WKContentView _uninstallInkPicker]): Deleted.
Move ink picker management into WKDrawingCoordinator.

* UIProcess/ios/WKDrawingView.h:
* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView initWithEmbeddedViewID:contentView:]):
(-[WKDrawingView _canvasViewWillBeginDrawing:]):
(-[WKDrawingView invalidateAttachment]):
(-[WKDrawingView didChangeRulerState:]):
(-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]): Deleted.
(-[WKDrawingView canvasView]): Deleted.
Use a shared ruler, owned by WKDrawingCoordinator.
Update the editable image's ink when drawing begins. This way, we don't have
to push ink changes to all drawings as they happen.

* UIProcess/ios/WKInkPickerView.h:
* UIProcess/ios/WKInkPickerView.mm:
(-[WKInkPickerView initWithContentView:]):
(-[WKInkPickerView inlineInkPickerDidToggleRuler:]):
(-[WKInkPickerView viewControllerForPopoverPresentationFromInlineInkPicker:]):
(-[WKInkPickerView setInk:]):
(-[WKInkPickerView ink]):
(-[WKInkPickerView initWithDrawingView:]): Deleted.
(-[WKInkPickerView didPickInk]): Deleted.
(-[WKInkPickerView inlineInkPicker:didSelectTool:]): Deleted.
(-[WKInkPickerView inlineInkPicker:didSelectColor:]): Deleted.
* WebKit.xcodeproj/project.pbxproj:

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

7 months ago[Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into...
wenson_hsieh@apple.com [Fri, 4 Jan 2019 19:56:51 +0000 (19:56 +0000)]
[Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function
https://bugs.webkit.org/show_bug.cgi?id=193129

Reviewed by Tim Horton.

Source/WebCore:

Adds a new helper function that returns the undo/redo name for a given EditAction. No change in behavior.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* editing/EditAction.cpp: Copied from Source/WebKit/UIProcess/WebEditCommandProxy.cpp.
(WebCore::nameForUndoRedo):
* editing/EditAction.h:
* editing/Editor.cpp:

Source/WebKit:

Remove WebEditCommandProxy::nameForEditAction and use WebCore::nameForUndoRedo instead.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::registerEditCommand):
* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::WebEditCommandProxy):
(WebKit::WebEditCommandProxy::~WebEditCommandProxy):
(WebKit::WebEditCommandProxy::nameForEditAction): Deleted.
* UIProcess/WebEditCommandProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::addEditCommand):
(WebKit::WebPageProxy::removeEditCommand):
(WebKit::WebPageProxy::isValidEditCommand): Deleted.

Bit of drive-by refactoring: remove an unused function, and make addEditCommand and removeEditCommand take
references instead of pointers, since these are assumed to be nonnull.

* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::registerEditCommand):

Source/WebKitLegacy/mac:

Remove undoNameForEditAction and use WebCore::nameForUndoRedo instead.

* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::registerUndoOrRedoStep):
(undoNameForEditAction): Deleted.

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

7 months agoBaseline version of get_by_id may corrupt metadata
tzagallo@apple.com [Fri, 4 Jan 2019 19:52:26 +0000 (19:52 +0000)]
Baseline version of get_by_id may corrupt metadata
https://bugs.webkit.org/show_bug.cgi?id=193085
<rdar://problem/23453006>

Reviewed by Saam Barati.

JSTests:

* stress/get-by-id-change-mode.js: Added.
(forEach):

Source/JavaScriptCore:

The Baseline version of get_by_id unconditionally calls `emitArrayProfilingSiteForBytecodeIndexWithCell`
if the property is `length`. However, since the bytecode rewrite, get_by_id only has an ArrayProfile entry
in the metadata if its mode is `GetByIdMode::ArrayLength`. That might result in one of two bad things:
1) get_by_id's mode is not ArrayLength, and a duplicate, out-of-line ArrayProfile entry will be created by
`CodeBlock::getOrAddArrayProfile`.
2) get_by_id's mode *is* ArrayLength and we generate the array profiling code pointing to the ArrayProfile
that lives in the metadata table. This works fine as long as get_by_id does not change modes. If that happens,
the JIT code will write into the metadata table, overwriting the 'GetByIdModeMetadata` for another mode.

Add a check to the Baseline version of get_by_id so that we only do the ArrayProfiling if the get_by_id's
mode is ArrayLength

* bytecode/BytecodeList.rb:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::getArrayProfile):
(JSC::CodeBlock::addArrayProfile): Deleted.
(JSC::CodeBlock::getOrAddArrayProfile): Deleted.
* bytecode/CodeBlock.h:
(JSC::CodeBlock::numberOfArrayProfiles const): Deleted.
(JSC::CodeBlock::arrayProfiles): Deleted.
* bytecode/CodeBlockInlines.h:
(JSC::CodeBlock::forEachArrayProfile):
* jit/JIT.h:
* jit/JITInlines.h:
(JSC::JIT::emitArrayProfilingSiteForBytecodeIndexWithCell): Deleted.
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_get_by_id):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_get_by_id):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):

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

7 months agoMake DidPlayMediaPreventedFromPlaying autoplay event more generic.
mrajca@apple.com [Fri, 4 Jan 2019 19:45:09 +0000 (19:45 +0000)]
Make DidPlayMediaPreventedFromPlaying autoplay event more generic.
https://bugs.webkit.org/show_bug.cgi?id=193128
rdar://34554231

Reviewed by Jer Noble.

Today, the "DidPlayMediaPreventedFromPlaying" autoplay event is only sent for
media prevented from autoplaying. It could be generalized to a "DidPlayMediaWithUserGesture"
event along with a flag that indicates whether or not autoplay was actually prevented.
Source/WebCore:

Moreover, we can include a flag that indicates whether the media element in question
is main content. Clients will then know in more cases when media was played with a user
gesture, whether or not it has audio, as well as its main content status. While the main
content heuristics may not be perfect, they covered the top 20 video-centric websites that
this was tested with and are meant to be used by clients for data evaluation purposes.

As part of this, the PlaybackWithoutUserGesture enum was renamed to AutoplayEventPlaybackState
since it now also applies to cases where there is a user gesture. The
`m_playbackWithoutUserGestureStartedTime` member variable was also removed in favor of
`playbackStartedTime` which also covers all the cases we care about.

Tests: existing API tests were updated to reflect the new names. New API tests
were added for the new case in which the "DidPlayMediaWithUserGesture" event is sent.

* html/HTMLMediaElement.cpp:
(WebCore::convertEnumerationToString): Update to new enum cases.
(WebCore::HTMLMediaElement::setReadyState): Ditto.
(WebCore::HTMLMediaElement::play): Ditto.
(WebCore::HTMLMediaElement::playInternal): Also cover the case where
 playback was not prevented but there was a user gesture.
(WebCore::HTMLMediaElement::pauseInternal): Use new name.
(WebCore::HTMLMediaElement::setVolume): Use new name.
(WebCore::HTMLMediaElement::playbackProgressTimerFired): Dispatch the
 DidPlayMediaWithUserGesture event when playback was started with a user
 gesture as well.
(WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Use new name.
(WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Ditto.
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto.
(WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto.
(WebCore::HTMLMediaElement::handleAutoplayEvent): Pass along new media state.
(WebCore::HTMLMediaElement::userDidInterfereWithAutoplay): Use new name.
(WebCore::HTMLMediaElement::setAutoplayEventPlaybackState): Stop setting
 m_playbackWithoutUserGestureStartedTime in favor of using playbackStartedTime.
(WebCore::HTMLMediaElement::updateShouldPlay): Use new name.
(WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture): Renamed.
* html/HTMLMediaElement.h:
(WTF::LogArgument<WebCore::HTMLMediaElement::AutoplayEventPlaybackState>::toString): Renamed from...
(WTF::LogArgument<WebCore::HTMLMediaElement::PlaybackWithoutUserGesture>::toString):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::isMainContentForPurposesOfAutoplayEvents const): Don't
 do the hit testing check for the purposes of autoplay events. It seems to fail on the
 basic Vimeo player due to overlapping divs.
(WebCore::isElementMainContentForPurposesOfAutoplay):
(WebCore::MediaElementSession::updateIsMainContent const): Keep the existing behavior
 here of hit testing.
(WebCore::isMainContentForPurposesOfAutoplay): Renamed.
* html/MediaElementSession.h:
* page/AutoplayEvent.h:

Source/WebKit:

Tests: existing API tests were updated to reflect the new names. New API tests
were added for the new case in which the "DidPlayMediaWithUserGesture" event is sent.

* Shared/WebCoreArgumentCoders.h: Take into account new flags.
* UIProcess/API/C/WKPage.cpp: Ditto.
(WKPageSetPageUIClient):
* UIProcess/API/C/WKPageUIClient.h: Ditto.
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Ditto.
* UIProcess/Cocoa/UIDelegate.mm: Ditto.
(WebKit::toWKAutoplayEventFlags):
(WebKit::toWKAutoplayEvent):

Tools:

Tests: existing API tests were updated to reflect the new names. New API tests
were added for the new case in which the "DidPlayMediaWithUserGesture" event is sent.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/long-test.mp4: Added.
* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/audio-with-play-button.html: Added.
* TestWebKitAPI/Tests/WebKitCocoa/video-with-play-button.html: Added.

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

7 months ago[curl] Move cookiePersistentStorageFile from NetworkProcessCreationParameters to...
Hironori.Fujii@sony.com [Fri, 4 Jan 2019 19:07:13 +0000 (19:07 +0000)]
[curl] Move cookiePersistentStorageFile from NetworkProcessCreationParameters to NetworkSessionCreationParameters
https://bugs.webkit.org/show_bug.cgi?id=192970

Reviewed by Alex Christensen.

* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const): Removed code for cookiePersistentStorageFile.
(WebKit::NetworkProcessCreationParameters::decode): Ditto.
* NetworkProcess/NetworkProcessCreationParameters.h: Ditto.
* NetworkProcess/curl/NetworkProcessCurl.cpp:
(WebKit::NetworkProcess::platformInitializeNetworkProcess): Ditto.

* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::privateSessionParameters): Added code for cookiePersistentStorageFile.
(WebKit::NetworkSessionCreationParameters::encode const): Ditto.
(WebKit::NetworkSessionCreationParameters::decode): Ditto.
* NetworkProcess/NetworkSessionCreationParameters.h: Ditto.
* NetworkProcess/curl/NetworkSessionCurl.cpp:
(WebKit::NetworkSessionCurl::NetworkSessionCurl): Ditto.

* NetworkProcess/Cookies/WebCookieManager.h: Removed setCookiePersistentStorage method of curl port extension.
* NetworkProcess/Cookies/curl/WebCookieManagerCurl.cpp:
(WebKit::WebCookieManager::setCookiePersistentStorage): Deleted.

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

7 months ago[PSON] Calling history.back() from inside the load event handler prevents process...
cdumez@apple.com [Fri, 4 Jan 2019 19:02:19 +0000 (19:02 +0000)]
[PSON] Calling history.back() from inside the load event handler prevents process-swapping
https://bugs.webkit.org/show_bug.cgi?id=193120

Reviewed by Alex Christensen.

Source/WebKit:

A HistoryItem is created only *after* we've fired the load event. As a result, if you call
history.back() in JS from inside the load event handler, the current HistoryItem and and
the target HistoryItem will be the same. This is normally not an issue. However, there was
logic inside of WebProcessPool::processForNavigationInternal() which would compare the
processID of the source and destination BackForwardListItems and which would force a process
reuse if both BackForwardListItems came from the same WebContent process. So even though
we swapped when doing a standard load from site A to site B, we would fail to swap if site
B called history.back() from inside its load event handler.

To address the issue, stop relying on the source backforward item's processID. Instead, just
use the WebContent process matching the destination backforward item's processID if it still
exists.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

7 months agoBring back parent processID for logging
krollin@apple.com [Fri, 4 Jan 2019 19:02:00 +0000 (19:02 +0000)]
Bring back parent processID for logging
https://bugs.webkit.org/show_bug.cgi?id=193121
<rdar://problem/47031634>

Reviewed by Alex Christensen.

Bug 192961 removes presentingApplicationPID from
NetworkProcessCreationParameters because it was (a) stored in some
global state, the use of which is being minimized, and (b) it was
largely unused. However, it was actually still being used in some
useful logging in order to tie together child processes with their
parent process. Re-introduce this value in NetworkLoadParameters so
that we can log it.

* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::start):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
(WebKit::WebLoaderStrategy::loadResourceSynchronously):
(WebKit::WebLoaderStrategy::startPingLoad):
(WebKit::WebLoaderStrategy::preconnectTo):

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

7 months agoMake RestrictedHTTPResponseAccess an internal flag
youenn@apple.com [Fri, 4 Jan 2019 19:00:52 +0000 (19:00 +0000)]
Make RestrictedHTTPResponseAccess an internal flag
https://bugs.webkit.org/show_bug.cgi?id=193145

Reviewed by Chris Dumez.

* Shared/WebPreferences.yaml: This will ease debugging.

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

7 months agoCrash in WebCore::ServiceWorkerGlobalScope
youenn@apple.com [Fri, 4 Jan 2019 18:47:22 +0000 (18:47 +0000)]
Crash in WebCore::ServiceWorkerGlobalScope
https://bugs.webkit.org/show_bug.cgi?id=192513
<rdar://problem/46563880>

Reviewed by Alex Christensen.

Store the identifier in its own variable to make sure we do not use workerThread after being moved.

* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::skipWaiting):

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

7 months ago[iOS] Enable logging for services in sandbox
pvollan@apple.com [Fri, 4 Jan 2019 18:44:59 +0000 (18:44 +0000)]
[iOS] Enable logging for services in sandbox
https://bugs.webkit.org/show_bug.cgi?id=192705

Reviewed by Brent Fulgham.

When running layout tests, we didn’t see 107 services being looked up through launchd. We should
add logging to these services to determine which services we actually need in the sandbox.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

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

7 months agoUnreviewed, rolling out r239603.
commit-queue@webkit.org [Fri, 4 Jan 2019 18:29:35 +0000 (18:29 +0000)]
Unreviewed, rolling out r239603.
https://bugs.webkit.org/show_bug.cgi?id=193146

Breaks shipping tests (Requested by bfulgha__ on #webkit).

Reverted changeset:

"[iOS] Update sandbox profile to use iconservices instead of
lsdiconservice"
https://bugs.webkit.org/show_bug.cgi?id=193115
https://trac.webkit.org/changeset/239603

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

7 months agoCrash under WebProcessPool::addSuspendedPage()
cdumez@apple.com [Fri, 4 Jan 2019 18:01:10 +0000 (18:01 +0000)]
Crash under WebProcessPool::addSuspendedPage()
https://bugs.webkit.org/show_bug.cgi?id=193110

Reviewed by Youenn Fablet.

Source/WebKit:

When PageCache is disabled, WebProcessPool::m_maxSuspendedPageCount is 0 and WebProcessPool::addSuspendedPage()
would call m_suspendedPages.removeFirst() even though m_suspendedPages is empty, causing a crash.
Do an early return when m_maxSuspendedPageCount is 0 since we do not want to add any suspended page in this
case.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::addSuspendedPage):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

7 months ago[ews-build] Check patch relevance before applying the patch
aakash_jain@apple.com [Fri, 4 Jan 2019 18:00:01 +0000 (18:00 +0000)]
[ews-build] Check patch relevance before applying the patch
https://bugs.webkit.org/show_bug.cgi?id=193102

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/factories.py:
(Factory.__init__): Moved CheckPatchRelevance step to base class.

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

7 months ago[ews-build] Check patch relevance step should print patch id
aakash_jain@apple.com [Fri, 4 Jan 2019 17:58:37 +0000 (17:58 +0000)]
[ews-build] Check patch relevance step should print patch id
https://bugs.webkit.org/show_bug.cgi?id=193137

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(CheckPatchRelevance.start): Update the status to include patch id.

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

7 months agowebkitpy: Increase simulator teardown timeout
jbedard@apple.com [Fri, 4 Jan 2019 17:58:08 +0000 (17:58 +0000)]
webkitpy: Increase simulator teardown timeout
https://bugs.webkit.org/show_bug.cgi?id=193141
<rdar://problem/46174217>

Rubber-stamped by Aakash Jain.

* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDeviceManager.tear_down): Use SIMULATOR_BOOT_TIMEOUT.

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

7 months agoAX: String check: "Rule" does not reflect the meaning of the <hr> html tag
cfleizach@apple.com [Fri, 4 Jan 2019 17:18:17 +0000 (17:18 +0000)]
AX: String check: "Rule" does not reflect the meaning of the <hr> html tag
https://bugs.webkit.org/show_bug.cgi?id=193041
<rdar://problem/46954090>

Reviewed by Zalan Bujtas.

Source/WebCore:

* en.lproj/Localizable.strings:
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::AXHorizontalRuleDescriptionText):

LayoutTests:

* accessibility/mac/hr-element-expected.txt:
* platform/mac/accessibility/roles-exposed-expected.txt:
* platform/mac-wk2/accessibility/roles-exposed-expected.txt:

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

7 months ago[JSC] Optimize Object.prototype.toString
yusukesuzuki@slowstart.org [Fri, 4 Jan 2019 17:04:09 +0000 (17:04 +0000)]
[JSC] Optimize Object.prototype.toString
https://bugs.webkit.org/show_bug.cgi?id=193031

Reviewed by Saam Barati.

JSTests:

* stress/object-tostring-changed-proto.js: Added.
(shouldBe):
(test):
* stress/object-tostring-changed.js: Added.
(shouldBe):
(test):
* stress/object-tostring-misc.js: Added.
(shouldBe):
(test):
(i.switch):
* stress/object-tostring-other.js: Added.
(shouldBe):
(test):
* stress/object-tostring-untyped.js: Added.
(shouldBe):
(test):
(i.switch):

Source/JavaScriptCore:

Object.prototype.toString is frequently used for type checking.
It is called many times in wtb-lebab.js. This patch optimizes
Object.prototype.toString by the following two optimizations.

1. We should emit code looking up cached to string in DFG and FTL.

toString's result is cached in the Structure. We emit a fast path code
in DFG and FTL to lookup this cache.

2. We should not create objects for primitive values in major cases.

When Object.prototype.toString(primitive) is called, this primitive is converted
to an object by calling ToObject. But if the result is appropriately cached in
the Structure, we should get it in the fast path without creating this object.
When converting primitives to objects, Structures used in these newly created objects
are known (Structure for StringObject etc.). So we can first query the cached string
before actually converting primitives to objects.

This patch improves wtb-lebab.js by roughly 2%.

    before:    lebab:  8.90 runs/s
    after :    lebab:  9.09 runs/s

* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::fixupObjectToString):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileObjectToString):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileObjectToString):
* runtime/Intrinsic.cpp:
(JSC::intrinsicName):
* runtime/Intrinsic.h:
* runtime/ObjectPrototype.cpp:
(JSC::ObjectPrototype::finishCreation):
(JSC::objectProtoFuncToString):
* runtime/ObjectPrototype.h:
* runtime/ObjectPrototypeInlines.h: Added.
(JSC::structureForPrimitiveValue):
(JSC::objectToString):
* runtime/StructureRareData.h:

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

7 months ago[iOS] Silently deny access to mail settings triggered by MessageUI framework
bfulgham@apple.com [Fri, 4 Jan 2019 16:44:43 +0000 (16:44 +0000)]
[iOS] Silently deny access to mail settings triggered by MessageUI framework
https://bugs.webkit.org/show_bug.cgi?id=193123
<rdar://problem/42485581>

Reviewed by Alexey Proskuryakov.

Remove unhelpful logging generated when we block access to non-WebKit preferences. These
invalid checks are done by an system framework that we cannot modify.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

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

7 months agoWebDriver: element click command should handle user prompts
carlosgc@webkit.org [Fri, 4 Jan 2019 16:27:24 +0000 (16:27 +0000)]
WebDriver: element click command should handle user prompts
https://bugs.webkit.org/show_bug.cgi?id=193139

Reviewed by Michael Catanzaro.

* Session.cpp:
(WebDriver::Session::elementClick): Handle user prompts.

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

7 months ago[LFC] ComputedHorizontalMargin should have optional members
zalan@apple.com [Fri, 4 Jan 2019 15:32:01 +0000 (15:32 +0000)]
[LFC] ComputedHorizontalMargin should have optional members
https://bugs.webkit.org/show_bug.cgi?id=193131

Reviewed by Antti Koivisto.

Split HorizontalMargin into UsedHorizontalMargin and ComputedHorizontalMargin. ComputedHorizontalMargin's members are optional.
(see computed vs used values)

* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue): Deleted.
* layout/LayoutUnits.h:
* layout/MarginTypes.h:
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setHorizontalMargin):
(WebCore::Display::Box::setHorizontalComputedMargin):
(WebCore::Display::Box::computedMarginStart const):
(WebCore::Display::Box::computedMarginEnd const):
* layout/floats/FloatAvoider.h:
(WebCore::Layout::FloatAvoider::marginStart const):
(WebCore::Layout::FloatAvoider::marginEnd const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):

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

7 months ago[LFC][BFC] Use computedValue and usedValue consistently
zalan@apple.com [Fri, 4 Jan 2019 15:21:45 +0000 (15:21 +0000)]
[LFC][BFC] Use computedValue and usedValue consistently
https://bugs.webkit.org/show_bug.cgi?id=193059

Reviewed by Antti Koivisto.

https://www.w3.org/TR/CSS22/cascade.html#value-stages

6.1.2 Computed values
Specified values are resolved to computed values during the cascade; for example URIs are made absolute and 'em' and 'ex' units
are computed to pixel or absolute lengths. Computing a value never requires the user agent to render the document...

6.1.3 Used values
Computed values are processed as far as possible without formatting the document. Some values, however, can only be determined when the document
is being laid out. For example, if the width of an element is set to be a certain percentage of its containing block, the width cannot be determined
until the width of the containing block has been determined. The used value is the result of taking the computed value and resolving any remaining
dependencies into an absolute value.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::LayoutState):
* layout/LayoutUnits.h:
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::Box):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setHasValidHorizontalComputedMargin):
(WebCore::Display::Box::setHorizontalComputedMargin):
(WebCore::Display::Box::computedMarginStart const):
(WebCore::Display::Box::computedMarginEnd const):
(WebCore::Display::Box::setHasValidHorizontalNonComputedMargin): Deleted.
(WebCore::Display::Box::setHorizontalNonComputedMargin): Deleted.
(WebCore::Display::Box::nonComputedMarginStart const): Deleted.
(WebCore::Display::Box::nonComputedMarginEnd const): Deleted.
* layout/floats/FloatAvoider.h:
(WebCore::Layout::FloatAvoider::marginStart const):
(WebCore::Layout::FloatAvoider::marginEnd const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):

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

7 months agoFlaky Test: http/wpt/css/css-animations/start-animation-001.html
commit-queue@webkit.org [Fri, 4 Jan 2019 14:34:39 +0000 (14:34 +0000)]
Flaky Test: http/wpt/css/css-animations/start-animation-001.html
https://bugs.webkit.org/show_bug.cgi?id=190903

This patch modifies start-animation-001.html to rely on the square positions returned by the
Web Process in order to know when they are supposed to be rendered behind the covering rect.
This should make it more robust while still testing the original bug 186129.

Patch by Frederic Wang <fwang@igalia.com> on 2019-01-04
Reviewed by Antonio Gomes.

* http/wpt/css/css-animations/start-animation-001.html:

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

7 months ago[GLIB] WebDriver: browser close not correctly detected on session close in some cases
carlosgc@webkit.org [Fri, 4 Jan 2019 11:34:01 +0000 (11:34 +0000)]
[GLIB] WebDriver: browser close not correctly detected on session close in some cases
https://bugs.webkit.org/show_bug.cgi?id=193104

Reviewed by Michael Catanzaro.

This happens when the dbus connection is closed right before the response to SendMessageToBackend message is
going to be sent. In that case, g_dbus_connection_call async ready handler generates an error before the close
signal is emitted. Then, the close commands try to handle the error checking if SessionHost::isConnected(), but
it still returns true, because the browser is still alive, but the dbus connection has been closed.

* glib/SessionHostGlib.cpp:
(WebDriver::SessionHost::isConnected const): Session is connected when launching or when dbus connection hasn't
been closed.

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

7 months agotest262-runner misbehaves when test file YAML has a trailing space
ross.kirsling@sony.com [Fri, 4 Jan 2019 02:54:41 +0000 (02:54 +0000)]
test262-runner misbehaves when test file YAML has a trailing space
https://bugs.webkit.org/show_bug.cgi?id=193053

Reviewed by Yusuke Suzuki.

JSTests:

* test262/expectations.yaml:
Mark two dozen tests as passing (and correct the output of another).

Tools:

* Scripts/test262/Runner.pm:
(parseData):
Accept trailing space when parsing a test file's YAML block.

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

7 months agoREGRESSION: -webkit-appearance test case crashes
zalan@apple.com [Fri, 4 Jan 2019 02:34:19 +0000 (02:34 +0000)]
REGRESSION: -webkit-appearance test case crashes
https://bugs.webkit.org/show_bug.cgi?id=189302
<rdar://problem/44143049>

Reviewed by Wenson Hsieh.

Source/WebCore:

The painting and the layout positions of the cancel button need to match in order to be able to interact with it.
This patch removes the previous position inlining attempts.

Test: fast/forms/webkit-appearance-searchfield-cancel-button-crash.html

* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):

LayoutTests:

* fast/forms/webkit-appearance-searchfield-cancel-button-crash-expected.txt: Added.
* fast/forms/webkit-appearance-searchfield-cancel-button-crash.html: Added.

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

7 months ago[iOS] Update sandbox profile to use iconservices instead of lsdiconservice
bfulgham@apple.com [Fri, 4 Jan 2019 01:08:43 +0000 (01:08 +0000)]
[iOS] Update sandbox profile to use iconservices instead of lsdiconservice
https://bugs.webkit.org/show_bug.cgi?id=193115
<rdar://problem/44867379>

Reviewed by Eric Carlson.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

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

7 months agoLeak of WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback ...
ddkilzer@apple.com [Fri, 4 Jan 2019 00:22:22 +0000 (00:22 +0000)]
Leak of WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback (48 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
<https://webkit.org/b/193122>
<rdar://problem/47022987>

Reviewed by Youenn Fablet.

* Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
(WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::AddRef const):
(WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::Release const):
- Remove `final` keyword so that
  `new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()`
  can be called.
(WebCore::LibWebRTCCertificateGenerator::generateCertificate):
- To fix the leak call
  `new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()`
  to create the object.

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

7 months agoREGRESSION (r238090): After showing the Find banner or tab bar, hit tests are vertica...
simon.fraser@apple.com [Thu, 3 Jan 2019 23:47:59 +0000 (23:47 +0000)]
REGRESSION (r238090): After showing the Find banner or tab bar, hit tests are vertically offset (or painting is not offset)
https://bugs.webkit.org/show_bug.cgi?id=193124
rdar://problem/46755409

Reviewed by Tim Horton.

Top content inset feeds into scrolling tree geometry, so when it changes we need to trigger
an update of the root scrolling node, which happens via RenderLayerBacking::updateGeometry().
So set a dirty bit on the root layer in frameViewDidChangeSize(), which is called from the code
path that runs when top content inset changes.

Find banner behavior is not easily testable. platform/mac/fast/events/content-inset-hit-testing.html did not detect the regression.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::frameViewDidChangeSize):

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

7 months agoPotential infinite recursion in isFrameFamiliarWith(Frame&, Frame&)
cdumez@apple.com [Thu, 3 Jan 2019 23:25:57 +0000 (23:25 +0000)]
Potential infinite recursion in isFrameFamiliarWith(Frame&, Frame&)
https://bugs.webkit.org/show_bug.cgi?id=192997
<rdar://problem/46217271>

Reviewed by Antti Koivisto.

Source/WebCore:

isFrameFamiliarWith(Frame&, Frame&) was called recursively using the passed frames' openers.
The issue is that a Frame can be its opener. There could also be a cycle in the opener chain.

To address the issue, simplify isFrameFamiliarWith() so that it is no longer recursive. We now
only check if the frames belong to the same pages or if their openers do. We no longer check
openers' opener and up.

Note that this function is used to check if a frame is allowed to target another. In practice,
it is unlikely to be useful to navigate an opener's opener and an openee's openee.

Tests: fast/dom/Window/window-open-opener-cycle.html
       fast/dom/Window/window-open-self-as-opener.html

* page/FrameTree.cpp:
(WebCore::isFrameFamiliarWith):

LayoutTests:

Add layout test coverage.

* fast/dom/Window/resources/window-open-opener-cycle2.html: Added.
* fast/dom/Window/resources/window-open-opener-cycle3.html: Added.
* fast/dom/Window/resources/window-opens-self.html: Added.
* fast/dom/Window/window-open-opener-cycle-expected.txt: Added.
* fast/dom/Window/window-open-opener-cycle.html: Added.
* fast/dom/Window/window-open-self-as-opener-expected.txt: Added.
* fast/dom/Window/window-open-self-as-opener.html: Added.

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

7 months agoWeb Inspector: conic-gradient color picker doesn't accurately show color when saturat...
drousso@apple.com [Thu, 3 Jan 2019 21:58:23 +0000 (21:58 +0000)]
Web Inspector: conic-gradient color picker doesn't accurately show color when saturation value is not 100%
https://bugs.webkit.org/show_bug.cgi?id=192729
<rdar://problem/46746815>

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

Rework `WI.ColorWheel` to use similar canvas drawing logic as `WI.LegacyColorWheel` so that
it's able to adjust the saturation value as the pixels gets closer to the center.

* UserInterface/Models/Color.js:
(WI.Color.rgb2hsl): Added.
(WI.Color.hsl2rgb): Added.
(WI.Color.cmyk2rgb):
(WI.Color.prototype.isKeyword):
(WI.Color.prototype._toRGBString):
(WI.Color.prototype._toRGBAString):
(WI.Color.prototype._toHSLString):
(WI.Color.prototype._toHSLAString):
(WI.Color.prototype._rgbaToHSLA):
(WI.Color.prototype._hslaToRGBA):
(WI.Color.rgb2hsv): Deleted.
(WI.Color.hsv2rgb): Deleted.
(WI.Color.prototype._rgbToHSL): Deleted.
(WI.Color.prototype._hslToRGB): Deleted.
Adjust the conversion functions of `WI.Color` to be more accurate.

* UserInterface/Views/ColorWheel.js:
(WI.ColorWheel):
(WI.ColorWheel.prototype.set dimension):
(WI.ColorWheel.prototype.set brightness):
(WI.ColorWheel.prototype.get tintedColor):
(WI.ColorWheel.prototype.set tintedColor):
(WI.ColorWheel.prototype._updateColorForMouseEvent):
(WI.ColorWheel.prototype._updateCanvas): Added.
(WI.ColorWheel.prototype._updateGradient): Deleted.
* UserInterface/Views/ColorWheel.css:
(.color-wheel > canvas): Added.
(.color-wheel > .gradient): Deleted.

* UserInterface/Views/ColorPicker.js:
(WI.ColorPicker):
(WI.ColorPicker.prototype.set color):
(WI.ColorPicker.prototype.sliderValueDidChange):
(WI.ColorPicker.prototype._updateSliders):
(WI.ColorPicker.prototype._showColorComponentInputs):
(WI.ColorPicker.supportsConicGradient): Deleted.

* UserInterface/Main.html:

* UserInterface/Views/LegacyColorWheel.js: Removed.

LayoutTests:

* inspector/model/color.html:
* inspector/model/color-expected.txt:

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

7 months agoUserMedia test should use WKPageNavigationClient
mcatanzaro@igalia.com [Thu, 3 Jan 2019 18:20:57 +0000 (18:20 +0000)]
UserMedia test should use WKPageNavigationClient
https://bugs.webkit.org/show_bug.cgi?id=192913

Reviewed by Youenn Fablet.

The test currently uses the deprecated WKPageLoaderClient. It should use
WKPageNavigationClient instead, which provides the same callback under a similar name.

* TestWebKitAPI/Tests/WebKit/UserMedia.cpp:
(TestWebKitAPI::TEST):

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

7 months agoDFG IntegerRangeOptimization phase exceeding loop limit shouldn't ASSERT
msaboff@apple.com [Thu, 3 Jan 2019 17:58:32 +0000 (17:58 +0000)]
DFG IntegerRangeOptimization phase exceeding loop limit shouldn't ASSERT
https://bugs.webkit.org/show_bug.cgi?id=193094

Reviewed by Saam Barati.

Removed this debug only ASSERT as one can construct test cases that will exceed the giveUpThreshold
amount.   This can be done with a large switch statement with at least one const or variable case
clause.  Such code bytecompiles to compare / jtrue sequences.  Increasing the giveUpThreshold count
doesn't help with the eventual code generated as B3 has optimizations to coalesce compare / branch
code sequences even when we don't run the IntegerRangeOptimization phase.

* dfg/DFGIntegerRangeOptimizationPhase.cpp:

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

7 months agoRemove logic handling DNT header during redirects
bfulgham@apple.com [Thu, 3 Jan 2019 17:44:55 +0000 (17:44 +0000)]
Remove logic handling DNT header during redirects
https://bugs.webkit.org/show_bug.cgi?id=193082
<rdar://problem/45555965>

Reviewed by Chris Dumez.

Source/WebKit:

Test: http/wpt/fetch/dnt-header-after-redirection.html.

Don't bother looking for (or passing along) DNT headers during redirects.

* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::check):
(WebKit::NetworkLoadChecker::prepareRedirectedRequest): Deleted.
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::restartNetworkLoad):
(WebKit::NetworkResourceLoader::continueWillSendRequest):
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::willPerformHTTPRedirection):

LayoutTests:

Revise test case to reflect fact that we no longer include the DNT
header in redirects.

* http/wpt/fetch/dnt-header-after-redirection-expected.txt:
* http/wpt/fetch/dnt-header-after-redirection.html:

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

7 months agoAdd release logging to help debug HTTPS upgrade issues
cdumez@apple.com [Thu, 3 Jan 2019 17:03:44 +0000 (17:03 +0000)]
Add release logging to help debug HTTPS upgrade issues
https://bugs.webkit.org/show_bug.cgi?id=193075

Reviewed by Alex Christensen.

Add release logging to help debug HTTPS upgrade issues like Bug 193026.

* NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
(WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
(WebKit::NetworkHTTPSUpgradeChecker::query):

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

7 months agoNetworkProcess should initialize its default NetworkSession with parameters from...
achristensen@apple.com [Thu, 3 Jan 2019 16:51:44 +0000 (16:51 +0000)]
NetworkProcess should initialize its default NetworkSession with parameters from the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=192967

Reviewed by Brent Fulgham.

I moved 3 of the NetworkProcessCreationParameters to use corresponding values of a WebsiteDataStoreParameters.
More will be moved in the near future, like indexedDatabaseDirectory.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):

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

7 months agoREGRESSION (r239306): Don't disable font smoothing in transparent layers on macOS...
simon.fraser@apple.com [Thu, 3 Jan 2019 16:03:06 +0000 (16:03 +0000)]
REGRESSION (r239306): Don't disable font smoothing in transparent layers on macOS Mojave and later
https://bugs.webkit.org/show_bug.cgi?id=193095
<rdar://problem/47014944>

Reviewed by Zalan Bujtas.

Source/WebCore:

In r239306 we stopped making CALayers for font-smoothed text when not necessary on macOS Mojave
and later. However, we still turned off smoothing for non-opaque layers (setShouldSmoothFonts(false)),
which continues to affect the appearance of text.

Fix by only calling setShouldSmoothFonts(false) when the OS supports font smoothing.

Test: compositing/contents-format/subpixel-antialiased-text.html

* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayer::drawLayerContents):

LayoutTests:

A ref test that compares the rendering of layer and non-layer text with smoothing and antialiasing.

* compositing/contents-format/subpixel-antialiased-text-expected.html: Added.
* compositing/contents-format/subpixel-antialiased-text.html: Added.
* platform/mac/TestExpectations:

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

7 months ago[iOS] REGRESSION (r239441): Tab cycling to offscreen <select> may not scroll it into...
wenson_hsieh@apple.com [Thu, 3 Jan 2019 15:38:33 +0000 (15:38 +0000)]
[iOS] REGRESSION (r239441): Tab cycling to offscreen <select> may not scroll it into view
https://bugs.webkit.org/show_bug.cgi?id=193084
<rdar://problem/47006882>

Reviewed by Simon Fraser.

Source/WebKit:

In `WKWebView.mm`, `-_zoomToFocusRect:` will ignore the given selection rect if it is of size `{ 0, 0 }` and at
the origin. Prior to r239441, when using the tab key to move focus between non-editable form controls (or any
other method that doesn't involve tapping on the focused select element, with the exception of the next and
previous buttons in the input accessory view), we would compute a selection rect of `{{ 0, 0 }, { 0, 0 }}`, and
subsequently try to scroll the focused element to the center of the visible area, without taking the selection
rect into account.

However, after r239441, the web process sends the element interaction location to the UI process, which then
computes the selection rect by taking this location and adding a size of `{ 1, 1 }` (before r239441, this was
done in `WebPage::getAssistedNodeInformation`). However, our new implementation doesn't take into account the
case where the element interaction rect is null, which happens when the last interaction location is outside of
the bounding rect of the element. In this case, we set the element interaction location to { 0, 0 } and end up
computing a selection rect of `{{ 0, 0 }, { 1, 1 }}` instead of `{{ 0, 0 }, { 0, 0 }}` as we would have
previously done. This causes us to scroll up to the origin, instead of revealing the focused element.

To fix this, we restore the pre-r239441 behavior. See additional comments below for details.

Test: fast/forms/ios/scroll-to-reveal-focused-select.html

* Shared/FocusedElementInformation.cpp:
(WebKit::FocusedElementInformation::encode const):
(WebKit::FocusedElementInformation::decode):
* Shared/FocusedElementInformation.h:

Rename `elementInteractionLocation` to `lastInteractionLocation`. This was previously
`elementInteractionLocation` due to existing logic that tries to move the interaction location into the bounding
rect of the element in the case where visual viewports are disabled; however, since this feature has long been
enabled by default for all modern WebKit clients (internal and external), it's simpler to just use always send
the last interaction location over to the UI process, and have the UI process use `{{ 0, 0 }, { 0, 0 }}` if
the interaction location is outside of the element rect.

In the very unlikely event that any modern WebKit client disables visual viewports, this will still behave
reasonably, since we'll just use `{{ 0, 0 }, { 0, 0 }}` as the target rect and scroll to reveal the entire
element rather than the top left corner of the element.

* UIProcess/ios/WKContentViewInteraction.mm:
(rectToRevealWhenZoomingToFocusedElement):
* WebProcess/WebPage/ios/WebPageIOS.mm:

Move the check for whether the interaction location is inside the element's bounding rect from the web process
to the UI process. This relocates the logic to determine whether the selection rect should be a 1 by 1 fallback
interaction rect or the zero rect (`{{ 0, 0 }, { 0, 0 }}`) closer to the code that actually uses this rect.

(WebKit::WebPage::getFocusedElementInformation):

LayoutTests:

Add a layout test to verify that focusing a select element by tapping outside of it scrolls to reveal the
focused select element.

* fast/forms/ios/scroll-to-reveal-focused-select-expected.txt: Added.
* fast/forms/ios/scroll-to-reveal-focused-select.html: Added.

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

7 months agoWebUndoStep's monotonically increasing identifier should be a WebUndoStepID instead...
wenson_hsieh@apple.com [Thu, 3 Jan 2019 15:34:34 +0000 (15:34 +0000)]
WebUndoStep's monotonically increasing identifier should be a WebUndoStepID instead of uint64_t
https://bugs.webkit.org/show_bug.cgi?id=193100

Reviewed by Simon Fraser.

Add a type alias, WebUndoStepID, to represent the monotonically increasing undo step ID for each undoable
editing command, and use this type alias in lieu of `uint64_t`. No change in behavior.

* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::WebEditCommandProxy):
* UIProcess/WebEditCommandProxy.h:
(WebKit::WebEditCommandProxy::create):
(WebKit::WebEditCommandProxy::commandID const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::registerEditCommandForUndo):
* UIProcess/WebPageProxy.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::registerUndoStep):

Store the step ID in a temporary variable, since `webUndoStep` is now moved when calling `addWebUndoStep`.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::webUndoStep):
(WebKit::WebPage::addWebUndoStep):

Make this take a `Ref<WebUndoStep>&&` instead of a `WebUndoStep*`, and use move semantics to transfer the
given `Ref` to the table.

(WebKit::WebPage::removeWebEditCommand):
(WebKit::WebPage::unapplyEditCommand):
(WebKit::WebPage::reapplyEditCommand):

Use `auto*` in a couple of places.

(WebKit::WebPage::didRemoveEditCommand):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebUndoStep.cpp:
(WebKit::generateUndoStep):
* WebProcess/WebPage/WebUndoStep.h:
(WebKit::WebUndoStep::stepID const):
(WebKit::WebUndoStep::WebUndoStep):
* WebProcess/WebPage/WebUndoStepID.h: Copied from Source/WebKit/WebProcess/WebPage/WebUndoStep.cpp.

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

7 months agoWeb Inspector: Styles: selection lost when inspector is blurred
nvasilyev@apple.com [Thu, 3 Jan 2019 07:18:32 +0000 (07:18 +0000)]
Web Inspector: Styles: selection lost when inspector is blurred
https://bugs.webkit.org/show_bug.cgi?id=192124
<rdar://problem/46800965>

Reviewed by Devin Rousso.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(body:matches(.window-docked-inactive, .window-inactive) .spreadsheet-style-declaration-editor .property.selected):
Selection should be gray when Web Inspector window isn't focused.

* UserInterface/Views/SpreadsheetStyleProperty.js:

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

7 months agoLeak of CMSampleBuffer (752 bytes) in com.apple.WebKit.WebContent running WebKit...
ddkilzer@apple.com [Thu, 3 Jan 2019 06:42:52 +0000 (06:42 +0000)]
Leak of CMSampleBuffer (752 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
<https://webkit.org/b/193016>
<rdar://problem/46925703>

Reviewed by Simon Fraser.

* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
(WebCore::copySampleBufferWithCurrentTimeStamp):
- Change to return RetainPtr<CMSampleBufferRef>.
- Check return value of CMSampleBufferCreateCopyWithNewTiming().
(WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
- Check return value of copySampleBufferWithCurrentTimeStamp().
- Fix leak by using RetainPtr<CMSampleBufferRef> returned from
  copySampleBufferWithCurrentTimeStamp() instead of leaking
  `bufferWithCurrentTime` by using retainPtr().
(WebCore::createAudioFormatDescription):
- Extract method from appendAudioSampleBuffer() to return
  RetainPtr<CMFormatDescriptionRef> after calling
  CMAudioFormatDescriptionCreate().
- Check return value of CMAudioFormatDescriptionCreate().
(WebCore::createAudioSampleBufferWithPacketDescriptions):
- Extract method from appendAudioSampleBuffer() to return
  RetainPtr<CMSampleBufferRef> after calling
  CMAudioSampleBufferCreateWithPacketDescriptions().
(WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
- Check return values of createAudioFormatDescription() and
  createAudioSampleBufferWithPacketDescriptions().
- Fix leaks by extracting code into helper methods that return
  RetainPtr<> objects instead of leaking CMFormatDescriptionRef
  directly or leaking `sampleBuffer` by using retainPtr().

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

7 months agoHomograph with LATIN SMALL LETTER R WITH FISHHOOK
achristensen@apple.com [Thu, 3 Jan 2019 04:33:52 +0000 (04:33 +0000)]
Homograph with LATIN SMALL LETTER R WITH FISHHOOK
https://bugs.webkit.org/show_bug.cgi?id=192944

Reviewed by Tim Horton.

Source/WTF:

* wtf/cocoa/NSURLExtras.mm:
(WTF::isLookalikeCharacter):

Tools:

* TestWebKitAPI/Tests/WTF/cocoa/URLExtras.mm:
(TestWebKitAPI::TEST):

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

7 months agoWeb Inspector: Styles: it shouldn't be possible to delete read-only properties
nvasilyev@apple.com [Thu, 3 Jan 2019 04:05:04 +0000 (04:05 +0000)]
Web Inspector: Styles: it shouldn't be possible to delete read-only properties
https://bugs.webkit.org/show_bug.cgi?id=193099
<rdar://problem/47016335>

Reviewed by Devin Rousso.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor):
Drive-by: Forward Delete should work the same way as Delete (Backspace).
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239585 268f45cc-cd09-0410-ab3c-d52691b4dbfc

7 months agoAdd support for using the current text selection as the find string on iOS
wenson_hsieh@apple.com [Thu, 3 Jan 2019 04:00:47 +0000 (04:00 +0000)]
Add support for using the current text selection as the find string on iOS
https://bugs.webkit.org/show_bug.cgi?id=193034
<rdar://problem/45138739>

Reviewed by Tim Horton.

Source/WebCore:

Add support for "TakeFindStringFromSelection" on iOS. Unlike macOS, iOS does not have a notion of a "find
pasteboard" like macOS; instead, we handle this editing command by sending the selection string to the UI
process, where it is exposed via WebKit SPI so that clients that present find-in-page UI (i.e. MobileSafari) are
able to trigger find-in-page with this string.

Test: WebKit.UseSelectionAsFindString

* editing/Editor.cpp:
(WebCore::Editor::canCopyExcludingStandaloneImages const):

Make this helper function cross-platform.

* editing/Editor.h:
* editing/EditorCommand.cpp:
(WebCore::createCommandMap):
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::takeFindStringFromSelection):

Move this from EditorMac to EditorCocoa, and implement it on iOS by calling into the editor client to update the
find string (see WebKit/ChangeLog for more details).

* editing/mac/EditorMac.mm:
(WebCore::Editor::canCopyExcludingStandaloneImages): Deleted.
(WebCore::Editor::takeFindStringFromSelection): Deleted.
* loader/EmptyClients.cpp:
* page/EditorClient.h:

Add a new editor client method to send the string for find-in-page to the UI process.

Source/WebKit:

* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _takeFindStringFromSelection:]):

Provides a way to set the find string on iOS and macOS (an aside: takeFindStringFromSelection: already exists on
macOS, but there is no equivalent protocol method on iOS, so this new SPI acts as a cross-platform way for
WebKit clients to take the find string from the selection across all Cocoa platforms).

(+[WKWebView _stringForFind]):
(+[WKWebView _setStringForFind:]):

Call into find-in-page helper functions.

(-[WKWebView _findString:options:maxCount:]):

On iOS, additionally update the find-in-page string when exercising the _findString:options:maxCount: SPI. This
mirrors macOS behavior of updating the find pasteboard every time the find string changes; however, on macOS,
this is implemented by the platform (in AppKit), whereas there's no platform find pasteboard on iOS, let alone
logic to update it in UIKit. As such, we directly drive updates to the find string within WebKit.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:

Add some new cross-platform find-in-page SPI. See above for more details.

* UIProcess/Cocoa/GlobalFindInPageState.h: Added.
* UIProcess/Cocoa/GlobalFindInPageState.mm: Added.
(WebKit::findPasteboard):
(WebKit::globalStringForFind):

Fetch the string to use when finding text in the page. On macOS, this accesses the AppKit find pasteboard; on
iOS, this instead returns the current global find string.

(WebKit::updateStringForFind):

Sets the global find string. Uses the find pasteboard on macOS, and sets the global find string on iOS.

(WebKit::stringForFind):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:

Add plumbing to allow WebEditorClient to deliver the update the global find string in the UI process.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::updateStringForFind):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
(WebKit::WebEditorClient::updateStringForFind):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateStringForFind):

Source/WebKitLegacy/mac:

Add a method stub for WebKitLegacy.

* WebCoreSupport/WebEditorClient.h:

Tools:

Add a new API test to verify that the new WebKit SPI (_stringForFind, _takeFindStringFromSelection:, and
_setStringForFind) works as expected.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/UseSelectionAsFindString.mm: Added.

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

7 months agoWeb Inspector: Implement `queryObjects` Command Line API
webkit@devinrousso.com [Thu, 3 Jan 2019 03:48:19 +0000 (03:48 +0000)]
Web Inspector: Implement `queryObjects` Command Line API
https://bugs.webkit.org/show_bug.cgi?id=176766
<rdar://problem/34890689>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

Introduces a new Command Line function called `queryObjects` that will return an array of
object that have the given constructor/prototype argument in their prototype chain.
 - `queryObjects(Promise)` will return an array of all Promises.
 - `queryObjects(Foo)` will return all objects created with the constructor `Foo`.

Currently, an error is thrown if the first argument is one of the following:
 - Object
 - Object.prototype
 - Function
 - Function.prototype
 - Array
 - Array.prototype
 - Map
 - Map.prototype
 - Set
 - Set.prototype
 - Proxy

The reason for this is that we don't want to expose any internal/builtin objects, as some of
them are highly sensitive and undefined behaviour can occur if they are modified.

* inspector/JSInjectedScriptHost.h:
* inspector/JSInjectedScriptHost.cpp:
(Inspector::checkForbiddenPrototype): Added.
(Inspector::JSInjectedScriptHost::queryObjects): Added.
Does a GC and then iterates over all live JSCell in the heap to find these objects.

* inspector/JSInjectedScriptHostPrototype.cpp:
(Inspector::JSInjectedScriptHostPrototype::finishCreation):
(Inspector::jsInjectedScriptHostPrototypeFunctionQueryObjects): Added.

* inspector/InjectedScriptSource.js:
(queryObjects): Added.

* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::promisePrototype): Added.

Source/WebCore:

Test: inspector/console/queryObjects.html

* inspector/CommandLineAPIModuleSource.js:
(CommandLineAPI):
(CommandLineAPIImpl.prototype.queryObjects): Added.

Source/WebInspectorUI:

* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.completionControllerCompletionsNeeded.receivedPropertyNames):
Add `queryObjects` to the list of command line functions.

LayoutTests:

* inspector/console/queryObjects-expected.html: Added.
* inspector/console/queryObjects.html: Added.

* http/tests/inspector/console/cross-domain-inspected-node-access-expected.txt:

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

7 months ago[ews-build] Use git on OpenSource EWS bots
aakash_jain@apple.com [Thu, 3 Jan 2019 00:48:44 +0000 (00:48 +0000)]
[ews-build] Use git on OpenSource EWS bots
https://bugs.webkit.org/show_bug.cgi?id=193092

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(CheckOutSource): Use git instead of svn.
(CheckOutSource.__init__): Use timeout of 2 hours since the initial checkout might take a long time.

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

7 months agoAllow WebContent process access to some drawing-related IOKit properties
bfulgham@apple.com [Wed, 2 Jan 2019 23:50:22 +0000 (23:50 +0000)]
Allow WebContent process access to some drawing-related IOKit properties
https://bugs.webkit.org/show_bug.cgi?id=193086
<rdar://problem/46568088>

Reviewed by Eric Carlson.

Update the iOS WebContent process sandbox to allow access to some IOKit properties
that are needed for drawing and media playback operations.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* WebProcess/com.apple.WebKit.WebContent.sb.in:

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

7 months agoFix resourcetimingbufferfull bubbles attribute
commit-queue@webkit.org [Wed, 2 Jan 2019 23:41:56 +0000 (23:41 +0000)]
Fix resourcetimingbufferfull bubbles attribute
https://bugs.webkit.org/show_bug.cgi?id=193087

Patch by Charles Vazac <cvazac@gmail.com> on 2019-01-02
Reviewed by Chris Dumez.

Source/WebCore:

This change is covered by web-platform-tests [1].

[1] https://github.com/web-platform-tests/wpt/blob/master/resource-timing/buffer-full-when-populate-entries.html#L20

* page/Performance.cpp:
(WebCore::Performance::resourceTimingBufferFullTimerFired):

LayoutTests:

* http/wpt/resource-timing/rt-performance-extensions.js:
(promise_test):

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

7 months agoRemove unused logging service
bfulgham@apple.com [Wed, 2 Jan 2019 21:32:07 +0000 (21:32 +0000)]
Remove unused logging service
https://bugs.webkit.org/show_bug.cgi?id=193081
<rdar://problem/40414815>

Reviewed by Alexey Proskuryakov.

We don't use this logging service, so don't open an exception for it.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

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

7 months agoRemove temporary workaround for CVMS code signing objects
bfulgham@apple.com [Wed, 2 Jan 2019 21:30:54 +0000 (21:30 +0000)]
Remove temporary workaround for CVMS code signing objects
https://bugs.webkit.org/show_bug.cgi?id=193079
<rdar://problem/40139202>

Reviewed by Alexey Proskuryakov.

* WebProcess/com.apple.WebProcess.sb.in:

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

7 months agoRename LayerScrollCoordinationRole to ScrollCoordinationRole and make an enum class
simon.fraser@apple.com [Wed, 2 Jan 2019 21:22:07 +0000 (21:22 +0000)]
Rename LayerScrollCoordinationRole to ScrollCoordinationRole and make an enum class
https://bugs.webkit.org/show_bug.cgi?id=193010

Reviewed by Zalan Bujtas.

Move the enum LayerScrollCoordinationRole from RenderLayer.h to RenderLayerCompositor.h,
and make it an enum class.

* page/FrameView.cpp:
(WebCore::FrameView::scrollLayerID const):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::~RenderLayerBacking):
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
(WebCore::operator<<):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
(WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
(WebCore::scrollCoordinationRoleForNodeType):
(WebCore::RenderLayerCompositor::attachScrollingNode):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
* rendering/RenderLayerCompositor.h:

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

7 months agoDon't spin up a CalcParser if the current token is not a function token
simon.fraser@apple.com [Wed, 2 Jan 2019 21:09:13 +0000 (21:09 +0000)]
Don't spin up a CalcParser if the current token is not a function token
https://bugs.webkit.org/show_bug.cgi?id=193067

Reviewed by Zalan Bujtas.

Various functions in CSSPropertyParserHelpers fall back to trying to parse
a calc expression if the normal parsing fails. Don't do this unless the
current token is a function token, which should be slightly more efficient.

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeInteger):
(WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
(WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
(WebCore::CSSPropertyParserHelpers::consumeNumber):
(WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
(WebCore::CSSPropertyParserHelpers::consumeLength):
(WebCore::CSSPropertyParserHelpers::consumePercent):
(WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
(WebCore::CSSPropertyParserHelpers::consumeAngle):
(WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
(WebCore::CSSPropertyParserHelpers::consumeTime):

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

7 months agoSupport css-color-4 rgb functions
simon.fraser@apple.com [Wed, 2 Jan 2019 20:53:37 +0000 (20:53 +0000)]
Support css-color-4 rgb functions
https://bugs.webkit.org/show_bug.cgi?id=192321

Reviewed by Zalan Bujtas.
LayoutTests/imported/w3c:

New expected results.

* web-platform-tests/css/css-color/color-resolving-expected.txt:
* web-platform-tests/css/css-color/rgb-rounding-001-expected.txt:

Source/WebCore:

Support the new rgb()/rgba() syntax described in https://drafts.csswg.org/css-color/#rgb-functions.
The differences are:
1. There is a new comma-free syntax, where the optional alpha is separated by a slash:
    rgb(128 34 56)
    rgb(128 34 56 / 50%)
2. Floating point values are allowed, and rounded:
    rgb(128.5 34.2 56.5) becomes rgb(129 34 57)
3. rgba() is a pure alias for rgb(), so these are equivalent:
    rgb(128 34 56 / 50%)
    rgba(128 34 56 / 50%)

hsl()/hsla() parsing was already updated to this new syntax in r230861.

Tested by tests in imported/w3c/web-platform-tests/css/css-color/

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::clampRGBComponent):
(WebCore::CSSPropertyParserHelpers::parseRGBParameters):
(WebCore::CSSPropertyParserHelpers::parseColorFunction):

LayoutTests:

* TestExpectations: Unskip most of the WPT css-color rgb tests. Skip old imported WPT canvas tests.
* canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-1-expected.txt: Removed.
* canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-1.html: Removed.
* canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-2-expected.txt: Removed.
* canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-2.html: Removed.
* canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-5-expected.txt: Removed.
* canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-5.html: Removed.
* canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-7-expected.txt: Removed.
* canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-7.html: Removed.
* canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-1-expected.txt: Removed.
* canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-1.html: Removed.
* canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-2-expected.txt: Removed.
* canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-2.html: Removed.
* canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-4-expected.txt: Removed.
* canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-4.html: Removed.
* css3/calc/color-rgb-expected.txt:
* fast/canvas/gradient-addColorStop-with-invalid-color-expected.txt:
* fast/canvas/gradient-addColorStop-with-invalid-color.html: Remove a test that is no longer invalid.
* fast/css/rgb-float.html: Removed. This test is no longer value, since rgb() accepts floating point values.
* platform/gtk/css2.1/t040306-syntax-01-f-expected.txt:
* platform/gtk/fast/css/rgb-float-expected.png: Removed.
* platform/gtk/fast/css/rgb-float-expected.txt: Removed.
* platform/gtk/svg/hixie/perf/007-expected.txt:
* platform/ios/css2.1/t040306-syntax-01-f-expected.txt:
* platform/ios/fast/css/rgb-float-expected.txt: Removed.
* platform/mac/css2.1/t040306-syntax-01-f-expected.txt:
* platform/mac/fast/css/rgb-float-expected.png: Removed.
* platform/mac/fast/css/rgb-float-expected.txt: Removed.
* platform/mac/svg/hixie/perf/007-expected.txt:
* platform/win-future/svg/hixie/perf/007-expected.txt:
* platform/win/css2.1/t040306-syntax-01-f-expected.txt:
* platform/win/svg/hixie/perf/007-expected.txt:
* platform/wincairo/css2.1/t040306-syntax-01-f-expected.txt:
* platform/wincairo/fast/css/rgb-float-expected.txt: Removed.
* platform/wpe/css2.1/t040306-syntax-01-f-expected.txt:
* platform/wpe/fast/css/rgb-float-expected.txt: Removed.
* platform/wpe/svg/hixie/perf/007-expected.txt:
* svg/hixie/perf/007-expected.txt:

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

7 months agoREGRESSION (r239441): [iOS] Selection UI sometimes doesn't change after tapping ...
wenson_hsieh@apple.com [Wed, 2 Jan 2019 20:28:24 +0000 (20:28 +0000)]
REGRESSION (r239441): [iOS] Selection UI sometimes doesn't change after tapping "select all" in the callout bar
https://bugs.webkit.org/show_bug.cgi?id=193070
<rdar://problem/46921508>

Reviewed by Tim Horton.

Source/WebKit:

r239441 added logic to include an EditorState in the next layer tree commit when refocusing an element; this was
done to ensure that after tapping an element that has already been programmatically focused, we still send up-
to-date editor information to the UI process for the purposes of zooming to the selection rect, even if the
selection in the DOM is unchanged, since other aspects of the editor state may have changed since the element
was initially focused.

We currently try to flag the next layer tree commit by setting `m_hasPendingEditorStateUpdate` to `true`.
However, this is problematic since we aren't guaranteed in all cases that a compositing flush has been
scheduled. In the case where it hasn't, we'll end up in a state where the editor state update flag has been set,
yet the update will not make it over to the UI process until something happens that forces a layer tree commit
(e.g. scrolling, pinch zooming). Worse still, if the selection is then programmatically changed from the web
process, we will bail from sending a subsequent editor state update to the UI process because `WebPage` thinks
that a pending editor state has already been scheduled. This manifests in selection UI not updating after
tapping "Select All" in the callout bar, if the callout bar was brought up by tapping near the selection (since
this refocuses the element).

To fix this, we adjust this logic in `WebPage::elementDidRefocus` so that it sets the flag and then schedules a
compositing flush, but only if the user is actually interacting with the focused element (i.e., if the page
calls `focus` repeatedly, we won't continue to schedule compositing flushes).

Test: editing/selection/ios/change-selection-after-tapping-focused-element.html

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::elementDidRefocus):
(WebKit::WebPage::sendEditorStateUpdate):
(WebKit::WebPage::scheduleFullEditorStateUpdate):

Add a private helper method to schedule an editor state update by setting `m_hasPendingEditorStateUpdate` to
`true` and then scheduling a compositing layer flush. Also, add a FIXME aluding to the fact that scheduling an
entire compositing layer flush to send an editor state update is somewhat wasteful, and should be replaced by
just scheduling this work to be done before the next frame (see: <rdar://problem/36523583> for more detail).

We also use this helper method in a few places where we currently turn on the editor state flag and schedule a
subsequent compositing flush.

(WebKit::WebPage::sendPartialEditorStateAndSchedulePostLayoutUpdate):
* WebProcess/WebPage/WebPage.h:

LayoutTests:

Add a test to ensure that selection UI is shown after tapping on a focused element and then changing the
selection programmatically.

* editing/selection/ios/change-selection-after-tapping-focused-element-expected.txt: Added.
* editing/selection/ios/change-selection-after-tapping-focused-element.html: Added.

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

7 months agoUnreviewed, rolling out r239524.
commit-queue@webkit.org [Wed, 2 Jan 2019 19:40:05 +0000 (19:40 +0000)]
Unreviewed, rolling out r239524.
https://bugs.webkit.org/show_bug.cgi?id=193083

basic browsing seems not to work (Requested by thorton on
#webkit).

Reverted changeset:

"Expand use of sourceApplicationAuditData"
https://bugs.webkit.org/show_bug.cgi?id=192995
https://trac.webkit.org/changeset/239524

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

7 months agoHandle calc() expressions in gradient color stops
simon.fraser@apple.com [Wed, 2 Jan 2019 19:24:48 +0000 (19:24 +0000)]
Handle calc() expressions in gradient color stops
https://bugs.webkit.org/show_bug.cgi?id=193066
rdar://problem/46961985

Reviewed by Sam Weinig.
Source/WebCore:

Fix two issues that prevented calc() expressions from working in conic-gradient color stops,
for the angle or percent value. First, consumeAngleOrPercent() needs to look for CalculationCategory::Percent
calc values as well as angle ones.

Second, CSSPrimitiveValue::isAngle() needs to use primitiveType() (which takes calc into account),
just as isPx() etc do.

Test: fast/gradients/conic-calc-stop-position.html

* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::isAngle const):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
(WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):

LayoutTests:

* fast/gradients/conic-calc-stop-position-expected.html: Added.
* fast/gradients/conic-calc-stop-position.html: Added.

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

7 months ago[lldb-webkit] Remove broken code to print WTF::OptionSet::m_storage
dbates@webkit.org [Wed, 2 Jan 2019 18:50:16 +0000 (18:50 +0000)]
[lldb-webkit] Remove broken code to print WTF::OptionSet::m_storage
https://bugs.webkit.org/show_bug.cgi?id=193023

Reviewed by Simon Fraser.

The code to print WTF::OptionSet::m_storage as an item in the set never worked and does
not seem meaningful to fix because WTF::OptionSet::m_storage is just the sum of the printed
enumerator values. We should just remove this code.

* lldb/lldb_webkit.py:
(WTFOptionSetProvider.has_children):
(WTFOptionSetProvider.num_children):
(WTFOptionSetProvider.get_child_index):
(WTFOptionSetProvider.get_child_at_index):

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

7 months agoSourceProviders should use an actual URL instead of a string
keith_miller@apple.com [Wed, 2 Jan 2019 17:59:08 +0000 (17:59 +0000)]
SourceProviders should use an actual URL instead of a string
https://bugs.webkit.org/show_bug.cgi?id=192734

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

This will be useful for the Module loader API in the future where
by default it will use the relative path from the referring module
to resolve dependencies.

I didn't change the JSC shell's urls to be absolute paths as it
caused problems with the stack traces in our Chakra tests. Since
the absolute paths included system directories the diff would
appear incorrect.
See: https://bugs.webkit.org/show_bug.cgi?id=193077

* API/JSBase.cpp:
(JSEvaluateScript):
(JSCheckScriptSyntax):
* API/JSScriptRef.cpp:
(OpaqueJSScript::create):
(OpaqueJSScript::OpaqueJSScript):
* API/glib/JSCContext.cpp:
(jsc_context_check_syntax):
* jsc.cpp:
(jscSource):
(GlobalObject::moduleLoaderFetch):
(functionCheckModuleSyntax):
(runWithOptions):
* parser/SourceCode.h:
(JSC::makeSource):
* parser/SourceProvider.cpp:
(JSC::SourceProvider::SourceProvider):
* parser/SourceProvider.h:
(JSC::SourceProvider::url const):
(JSC::StringSourceProvider::create):
(JSC::StringSourceProvider::StringSourceProvider):
(JSC::WebAssemblySourceProvider::create):
(JSC::WebAssemblySourceProvider::WebAssemblySourceProvider):
* runtime/FunctionConstructor.cpp:
(JSC::constructFunctionSkippingEvalEnabledCheck):
* tools/CodeProfile.h:
(JSC::CodeProfile::CodeProfile):
* tools/FunctionOverrides.cpp:
(JSC::initializeOverrideInfo):

Source/WebCore:

Remove ScriptSourceCode's URL member and make the url() method
reference the URL on the SourceProvider. Also, avoid some
ref count churn.

Additionally, this patch fixes an existing bug in
WorkletGlobalScope() that would use a ScriptSourceCode after
WTFMoving it.

* bindings/js/CachedScriptSourceProvider.h:
(WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::execute):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeScriptInWorld):
(WebCore::ScriptController::executeScript):
* bindings/js/ScriptSourceCode.h:
(WebCore::ScriptSourceCode::ScriptSourceCode):
(WebCore::ScriptSourceCode::m_code):
(WebCore::ScriptSourceCode::url const):
(WebCore::ScriptSourceCode::m_url): Deleted.
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::prepareScript):
(WebCore::ScriptElement::requestModuleScript):
(WebCore::ScriptElement::executePendingScript):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
* page/Frame.cpp:
(WebCore::Frame::injectUserScriptImmediately):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::importScripts):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::workerThread):
* worklets/WorkletGlobalScope.cpp:
(WebCore::WorkletGlobalScope::WorkletGlobalScope):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::endElementNs):

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

7 months agoUpdate user-visible copyright strings to include 2019
jeffm@apple.com [Tue, 1 Jan 2019 19:29:55 +0000 (19:29 +0000)]
Update user-visible copyright strings to include 2019
https://bugs.webkit.org/show_bug.cgi?id=192811

Reviewed by Mark Lam.

Source/JavaScriptCore:

* Info.plist:

Source/WebCore:

* Info.plist:

Source/WebKit:

* Info.plist:
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist:
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist:
* PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
* WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
* WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:

Source/WebKitLegacy/mac:

* Info.plist:

WebKitLibraries:

* win/tools/scripts/COPYRIGHT-END-YEAR:

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

7 months ago.ycm_extra_conf.py should handle XXXInlines.h
yusukesuzuki@slowstart.org [Mon, 31 Dec 2018 15:31:15 +0000 (15:31 +0000)]
.ycm_extra_conf.py should handle XXXInlines.h
https://bugs.webkit.org/show_bug.cgi?id=193055

Reviewed by Carlos Garcia Campos.

compile_commands.json database only records flags and options for cpp source files.
So, when we open headers, this database does not have any information for that.
Our .ycm_extra_conf.py alleviates this by using XXX.cpp's configuration for XXX.h.
But this mitigation does not handle XXXInlines.h well since we do not have XXXInlines.cpp.
This patch adds support for XXXInlines.h in .ycm_extra_conf.py. When XXXInlines.h is queried,
we attempt to find XXX.cpp and use the configuration if it exists.

* gtk/ycm_extra_conf.py:
(getImplementationFilename):
(FlagsForFile):

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

7 months agoUnreviewed. Support PHP 7.3 in Debian.
carlosgc@webkit.org [Mon, 31 Dec 2018 14:53:38 +0000 (14:53 +0000)]
Unreviewed. Support PHP 7.3 in Debian.

Tools:

Add 7.3 to the list of php versions supported in Debian.

* Scripts/webkitpy/port/base.py:
(Port._debian_php_version):

LayoutTests:

* http/conf/debian-httpd-2.4-php7.3.conf: Added.

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

7 months agoUnreviewed GTK+ gardening. Rebaseline several tests after r239156.
carlosgc@webkit.org [Mon, 31 Dec 2018 14:08:21 +0000 (14:08 +0000)]
Unreviewed GTK+ gardening. Rebaseline several tests after r239156.

* platform/gtk/fast/frames/onlyCommentInIFrame-expected.txt:
* platform/gtk/fast/invalid/junk-data-expected.txt:
* platform/gtk/fast/invalid/missing-end-tag-expected.txt:
* platform/gtk/fast/parser/xhtml-alternate-entities-expected.txt:
* platform/gtk/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.png:
* platform/gtk/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.txt:
* platform/gtk/fast/xsl/xslt-extra-content-at-end-expected.txt:
* platform/gtk/fast/xsl/xslt-missing-namespace-in-xslt-expected.txt:
* platform/gtk/svg/custom/bug45331-expected.txt:
* platform/gtk/svg/custom/junk-data-expected.txt:
* platform/gtk/svg/custom/missing-xlink-expected.txt:
* platform/gtk/svg/custom/path-bad-data-expected.txt:
* platform/gtk/svg/custom/use-font-face-crash-expected.txt:
* platform/gtk/svg/hixie/error/012-expected.txt:

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

7 months agoUnreviewed GTK+ gardening. Rebaseline several tests after r238730.
carlosgc@webkit.org [Mon, 31 Dec 2018 13:36:20 +0000 (13:36 +0000)]
Unreviewed GTK+ gardening. Rebaseline several tests after r238730.

innerText works differently when using complex text path.
See https://bugs.webkit.org/show_bug.cgi?id=192750.

* platform/gtk/fast/events/nested-window-event-expected.txt: Added.
* platform/gtk/fast/events/window-events-bubble-expected.txt: Added.
* platform/gtk/fast/events/window-events-bubble2-expected.txt: Added.
* platform/gtk/fast/tokenizer/script_extra_close-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-row-axis-alignment-positioned-items-015-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-row-axis-alignment-positioned-items-016-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-badInput-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-willValidate-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/selection-expected.txt:
* platform/gtk/legacy-animation-engine/animations/lineheight-animation-expected.txt: Added.
* platform/gtk/legacy-animation-engine/animations/simultaneous-start-transform-expected.txt: Added.
* platform/gtk/legacy-animation-engine/animations/width-using-ems-expected.txt: Added.

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

7 months agoclang-tidy: Save 8 padding bytes on WebCore::BorderEdge
ddkilzer@apple.com [Sun, 30 Dec 2018 21:56:50 +0000 (21:56 +0000)]
clang-tidy: Save 8 padding bytes on WebCore::BorderEdge
<https://webkit.org/b/193058>
<rdar://problem/46979275>

Reviewed by Yusuke Suzuki.

* rendering/BorderEdge.cpp:
(WebCore::BorderEdge::BorderEdge): Reorder initialization to
match new instance variable order.
* rendering/BorderEdge.h: Reorder instance variables to save
8 padding bytes.

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

7 months agogperf is only used in WebCore
yusukesuzuki@slowstart.org [Sun, 30 Dec 2018 21:23:11 +0000 (21:23 +0000)]
gperf is only used in WebCore
https://bugs.webkit.org/show_bug.cgi?id=193061

Reviewed by Don Olmstead.

gperf is only used in WebCore. So if the port does not have WebCore,
it is not necessary. For example, JSCOnly port does not require it.
This patch removes gperf dependency in these ports by checking
ENABLE_WEBCORE.

* Source/cmake/WebKitCommon.cmake:

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

7 months agoAdd ENABLE_UNIFIED_BUILDS option to cmake ports
yusukesuzuki@slowstart.org [Sun, 30 Dec 2018 21:19:09 +0000 (21:19 +0000)]
Add ENABLE_UNIFIED_BUILDS option to cmake ports
https://bugs.webkit.org/show_bug.cgi?id=193045

Reviewed by Don Olmstead.

.:

This patch adds ENABLE_UNIFIED_BUILDS option to cmake ports, which allows us to disable Unified Builds in WebKit.
This makes `compile_commands.json` sane when the unified builds is disabled, and various tools can use this
compilation database. For example, YouCompleteMe completion server can use it.

* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/WebKitMacros.cmake:

Source/WTF:

* Scripts/generate-unified-source-bundles.rb:

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

7 months agoUnreviewed, JSTests gardening with memoryLimited
yusukesuzuki@slowstart.org [Sun, 30 Dec 2018 20:53:48 +0000 (20:53 +0000)]
Unreviewed, JSTests gardening with memoryLimited

* stress/string-overflow-createError.js:

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

7 months ago[JSC] Identifier validity should be based on ID_Start / ID_Continue properties
ross.kirsling@sony.com [Sun, 30 Dec 2018 17:38:56 +0000 (17:38 +0000)]
[JSC] Identifier validity should be based on ID_Start / ID_Continue properties
https://bugs.webkit.org/show_bug.cgi?id=193050

Reviewed by Yusuke Suzuki.

JSTests:

* test262.yaml:
* test262/expectations.yaml:
Mark 16 tests as passing.

Source/JavaScriptCore:

From https://tc39.github.io/ecma262/#sec-names-and-keywords:
    UnicodeIDStart::
        any Unicode code point with the Unicode property "ID_Start"
    UnicodeIDContinue::
        any Unicode code point with the Unicode property "ID_Continue"

* parser/Lexer.cpp:
(JSC::Lexer<T>::Lexer):
(JSC::isNonLatin1IdentStart):
(JSC::isNonLatin1IdentPart):
(JSC::isIdentPart):
(JSC::Lexer<T>::lex):
Ensure identifier start / part is based on ID_Start / ID_Continue.
(Implies a special case for U+00B7, which is Latin-1 but Other_ID_Continue.)

LayoutTests:

* sputnik/Unicode/Unicode_218/S7.6_A1.1_T2-expected.txt:
* sputnik/Unicode/Unicode_218/S7.6_A1.1_T6-expected.txt:
* sputnik/Unicode/Unicode_218/S7.6_A5.2_T2-expected.txt:
* sputnik/Unicode/Unicode_218/S7.6_A5.2_T6-expected.txt:
* sputnik/Unicode/Unicode_218/S7.6_A5.3_T1-expected.txt:
* sputnik/Unicode/Unicode_218/S7.6_A5.3_T2-expected.txt:
* sputnik/Unicode/Unicode_320/S7.6_A1.1_T6-expected.txt:
* sputnik/Unicode/Unicode_320/S7.6_A2.3-expected.txt:
* sputnik/Unicode/Unicode_320/S7.6_A3.1-expected.txt:
* sputnik/Unicode/Unicode_320/S7.6_A5.2_T6-expected.txt:
* sputnik/Unicode/Unicode_320/S7.6_A5.2_T9-expected.txt:
* sputnik/Unicode/Unicode_320/S7.6_A5.3_T1-expected.txt:
* sputnik/Unicode/Unicode_320/S7.6_A5.3_T2-expected.txt:
* sputnik/Unicode/Unicode_410/S7.6_A1.1_T6-expected.txt:
* sputnik/Unicode/Unicode_410/S7.6_A3.1-expected.txt:
* sputnik/Unicode/Unicode_410/S7.6_A5.2_T6-expected.txt:
* sputnik/Unicode/Unicode_410/S7.6_A5.3_T1-expected.txt:
* sputnik/Unicode/Unicode_410/S7.6_A5.3_T2-expected.txt:
* sputnik/Unicode/Unicode_500/S7.6_A1.1_T6-expected.txt:
* sputnik/Unicode/Unicode_500/S7.6_A3.1-expected.txt:
* sputnik/Unicode/Unicode_500/S7.6_A5.2_T6-expected.txt:
* sputnik/Unicode/Unicode_500/S7.6_A5.3_T1-expected.txt:
* sputnik/Unicode/Unicode_500/S7.6_A5.3_T2-expected.txt:
* sputnik/Unicode/Unicode_510/S7.6_A1.1_T4-expected.txt:
* sputnik/Unicode/Unicode_510/S7.6_A1.1_T6-expected.txt:
* sputnik/Unicode/Unicode_510/S7.6_A5.2_T4-expected.txt:
* sputnik/Unicode/Unicode_510/S7.6_A5.2_T6-expected.txt:
Update expectations for outdated tests.

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

7 months agoMove WKEditCommandObjC and WKEditorUndoTargetObjC into a separate file
wenson_hsieh@apple.com [Sat, 29 Dec 2018 05:50:04 +0000 (05:50 +0000)]
Move WKEditCommandObjC and WKEditorUndoTargetObjC into a separate file
https://bugs.webkit.org/show_bug.cgi?id=193049

Reviewed by Sam Weinig.

Pull common code (WKEditCommandObjC and WKEditorUndoTargetObjC) on iOS and macOS out into a separate file. No
change in behavior.

* SourcesCocoa.txt:
* UIProcess/Cocoa/WKEditCommand.h: Added.
* UIProcess/Cocoa/WKEditCommand.mm: Added.

Rename WKEditCommandObjC to WKEditCommand, and WKEditorUndoTargetObjC to WKEditorUndoTarget. The ObjC suffix in
the name seems to diverge from the common naming scheme in other parts of WebKit, where most WK- and _WK-
prefixed names already refer to Objective-C objects. Additionally, mark -[WKEditCommand init] as unavailable.

(-[WKEditCommand initWithWebEditCommandProxy:]):

Make the return type instancetype instead of id, and also make this take a Ref<WebEditCommandProxy>&& instead
of a RefPtr.

(-[WKEditCommand command]):

Make this return a reference to the WebEditCommandProxy, rather than a pointer, since the WebEditCommandProxy
should always be non-null.

(-[WKEditorUndoTarget undoEditing:]):
(-[WKEditorUndoTarget redoEditing:]):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::registerEditCommand):

Use WTFMove instead of copying the Ref when creating a WKEditCommand.

(-[WKEditCommandObjC initWithWebEditCommandProxy:]): Deleted.
(-[WKEditCommandObjC command]): Deleted.
(-[WKEditorUndoTargetObjC undoEditing:]): Deleted.
(-[WKEditorUndoTargetObjC redoEditing:]): Deleted.
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::PageClientImpl):
(WebKit::PageClientImpl::registerEditCommand):

Use WTFMove instead of creating a new RefPtr when creating a WKEditCommand.

(-[WKEditCommandObjC initWithWebEditCommandProxy:]): Deleted.
(-[WKEditCommandObjC command]): Deleted.
(-[WKEditorUndoTargetObjC undoEditing:]): Deleted.
(-[WKEditorUndoTargetObjC redoEditing:]): Deleted.
* UIProcess/mac/PageClientImplMac.h:
* WebKit.xcodeproj/project.pbxproj:

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

7 months ago[JSC] Remove one indirection in JSObject::toStringName
yusukesuzuki@slowstart.org [Sat, 29 Dec 2018 04:24:29 +0000 (04:24 +0000)]
[JSC] Remove one indirection in JSObject::toStringName
https://bugs.webkit.org/show_bug.cgi?id=193037

Reviewed by Keith Miller.

Source/JavaScriptCore:

We should not have additional one-level indirection in JSObject::toStringName.
JSObject::toStringName is dispatched through methodTable. Even after that, we
need to call JSObject::className function through methodTable again. But className
function is rarely defined. So instead of introducing this indirection here,
classes having className functions should have toStringName function too. This can
remove one-level indirection in toStringName in major cases.

* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(JSC::JSCallbackObject<Parent>::toStringName):
* debugger/DebuggerScope.cpp:
(JSC::DebuggerScope::toStringName):
* debugger/DebuggerScope.h:
* runtime/JSObject.cpp:
(JSC::JSObject::toStringName):

Source/WebCore:

Use old JSObject::toStringName function here.

* bindings/js/JSDOMConstructorBase.cpp:
(WebCore::JSDOMConstructorBase::className):
(WebCore::JSDOMConstructorBase::toStringName):
* bindings/js/JSDOMConstructorBase.h:
(WebCore::JSDOMConstructorBase::className): Deleted.

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

7 months agoResurrect Mac CMake build
achristensen@apple.com [Thu, 27 Dec 2018 16:13:47 +0000 (16:13 +0000)]
Resurrect Mac CMake build
https://bugs.webkit.org/show_bug.cgi?id=192658

Reviewed by Yusuke Suzuki.

.:

* Source/cmake/OptionsMac.cmake:

Source/JavaScriptCore:

* PlatformMac.cmake:

Source/WebCore:

This makes it so JSC and most of WebCore builds.
WebCore's use of ARC seems inconsistent, so I'll fix that later.

* PlatformMac.cmake:
* config.h:

Source/WebCore/PAL:

* pal/PlatformMac.cmake:

Source/WebKit:

* PlatformMac.cmake:

Source/WebKitLegacy:

* PlatformMac.cmake:

Source/WTF:

* wtf/PlatformMac.cmake:
* wtf/cf/CFURLExtras.cpp:
* wtf/cf/CFURLExtras.h:
* wtf/cf/URLCF.cpp:
* wtf/cocoa/NSURLExtras.h:
* wtf/cocoa/NSURLExtras.mm:
* wtf/cocoa/URLCocoa.mm:

Tools:

* DumpRenderTree/PlatformMac.cmake:
* MiniBrowser/mac/CMakeLists.txt:
* TestWebKitAPI/PlatformMac.cmake:

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

7 months ago[MSVC] error C2381: 'WebKit::NetworkHTTPSUpgradeChecker::~NetworkHTTPSUpgradeChecker...
Hironori.Fujii@sony.com [Thu, 27 Dec 2018 04:01:23 +0000 (04:01 +0000)]
[MSVC] error C2381: 'WebKit::NetworkHTTPSUpgradeChecker::~NetworkHTTPSUpgradeChecker': redefinition; '__declspec(noreturn)' or '[[noreturn]]' differs
https://bugs.webkit.org/show_bug.cgi?id=193030

Reviewed by Ross Kirsling.

Windows Debug builds are failing to compile due to
NO_RETURN_DUE_TO_ASSERT inconsistency of
NetworkHTTPSUpgradeChecker destructor's definition and
declaration.

* NetworkProcess/NetworkHTTPSUpgradeChecker.h: Added
NO_RETURN_DUE_TO_ASSERT to NetworkHTTPSUpgradeChecker destructor
declaration.
* NetworkProcess/NetworkHTTPSUpgradeChecker.cpp: Removed
NO_RETURN_DUE_TO_ASSERT from the definition.

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

7 months ago[FreeType] Restore conditional compilation logic for recent HarfBuzz refactoring
commit-queue@webkit.org [Wed, 26 Dec 2018 20:42:47 +0000 (20:42 +0000)]
[FreeType] Restore conditional compilation logic for recent HarfBuzz refactoring
https://bugs.webkit.org/show_bug.cgi?id=193036

Patch by Jim Mason <jmason@ibinx.com> on 2018-12-26
Reviewed by Michael Catanzaro.

* platform/graphics/FontPlatformData.h:
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:

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

7 months ago[Tools] Remove references to Bison and Flex
aperez@igalia.com [Wed, 26 Dec 2018 18:30:10 +0000 (18:30 +0000)]
[Tools] Remove references to Bison and Flex
https://bugs.webkit.org/show_bug.cgi?id=193033

Reviewed by Michael Catanzaro.

The Bison and Flex tools are not needed anymore since r209883.

* CygwinDownloader/cygwin-downloader.py:
* EWSTools/ubuntu-ews-packages:
* Scripts/filter-build-webkit:
(shouldIgnoreLine):
* gtk/install-dependencies:
* wpe/install-dependencies:

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

7 months ago[JSC][Win][Clang] warning: implicit conversion from 'size_t' (aka 'unsigned long...
Hironori.Fujii@sony.com [Wed, 26 Dec 2018 07:52:38 +0000 (07:52 +0000)]
[JSC][Win][Clang] warning: implicit conversion from 'size_t' (aka 'unsigned long long') to 'int32_t' (aka 'int') changes value from 18446744073709551552 to -64 [-Wconstant-conversion]
https://bugs.webkit.org/show_bug.cgi?id=193035

Reviewed by Yusuke Suzuki.

Clang-cl reports a compilation warning for implicit conversion
from -64 size_t to int. Replaced '-maxFrameExtentForSlowPathCall'
with '-static_cast<int32_t>(maxFrameExtentForSlowPathCall)'.

* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compile):
(JSC::DFG::JITCompiler::compileFunction):
* jit/JIT.cpp:
(JSC::JIT::compileWithoutLinking):
* jit/ThunkGenerators.cpp:
(JSC::slowPathFor):

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

8 months agoRemove "using namespace std;"
Hironori.Fujii@sony.com [Tue, 25 Dec 2018 04:40:16 +0000 (04:40 +0000)]
Remove "using namespace std;"
https://bugs.webkit.org/show_bug.cgi?id=192973
<rdar://problem/46937309>

Unreviewed Windows port Debug builds fix.

No new tests since no behavior changes.

* accessibility/win/AXObjectCacheWin.cpp:
(WebCore::AXObjectCache::postPlatformNotification): Add "std::" prefix to numeric_limits in ASSERT macro.

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

8 months ago[WebKit][Win] Remove using namespace in the global scope
Hironori.Fujii@sony.com [Tue, 25 Dec 2018 02:14:37 +0000 (02:14 +0000)]
[WebKit][Win] Remove using namespace in the global scope
https://bugs.webkit.org/show_bug.cgi?id=192968

Reviewed by Alex Christensen.

Moved using namespace statements in the global scope to inside
namespaces.
<https://webkit.org/code-style-guidelines/#using-position>

* NetworkProcess/Cookies/curl/WebCookieManagerCurl.cpp:
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
* NetworkProcess/curl/NetworkProcessCurl.cpp:
* NetworkProcess/curl/NetworkSessionCurl.cpp:
* NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
* Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp:
* Shared/WebWheelEvent.cpp:
* Shared/curl/WebCoreArgumentCodersCurl.cpp:
* Shared/win/NativeWebKeyboardEventWin.cpp:
* Shared/win/WebEventFactory.cpp:
* UIProcess/Automation/WebAutomationSession.cpp:

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

8 months agoRemove "using namespace std;"
Hironori.Fujii@sony.com [Tue, 25 Dec 2018 02:00:11 +0000 (02:00 +0000)]
Remove "using namespace std;"
https://bugs.webkit.org/show_bug.cgi?id=192973

Reviewed by Alex Christensen.

Source/WebCore:

Removed "using namespace std" statement, and use std:: prefix.

No new tests since no behavior changes.

* accessibility/win/AXObjectCacheWin.cpp:
* platform/graphics/GraphicsContext3DPrivate.cpp:
* platform/graphics/cairo/ImageBufferCairo.cpp:
* platform/graphics/win/FontPlatformDataCairoWin.cpp:
* platform/graphics/win/FontWin.cpp:
(WebCore::FontCascade::floatWidthForComplexText const):
* platform/graphics/win/GraphicsContextCGWin.cpp:
* platform/graphics/win/GraphicsContextCairoWin.cpp:
* platform/graphics/win/GraphicsContextDirect2D.cpp:
* platform/graphics/win/GraphicsContextWin.cpp:
* platform/graphics/win/SimpleFontDataCGWin.cpp:
* platform/graphics/win/UniscribeController.cpp:
(WebCore::UniscribeController::UniscribeController):
(WebCore::UniscribeController::shapeAndPlaceItem):
* platform/image-decoders/ScalableImageDecoder.cpp:
* platform/text/LocaleICU.cpp:
* platform/text/win/LocaleWin.cpp:
* platform/win/ScrollbarThemeWin.cpp:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::layoutBlock):
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::adjustMenuListButtonStyle const):
(WebCore::RenderThemeWin::paintSearchFieldCancelButton):
(WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle const):
(WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle const):
(WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
(WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle const):
(WebCore::RenderThemeWin::paintSearchFieldResultsButton):

Source/WebKit:

* Platform/IPC/win/ConnectionWin.cpp:

Source/WebKitLegacy/win:

* FullscreenVideoController.cpp:
* WebFrame.cpp:
(WebFrame::drawFooter):
* WebHistory.cpp:
* WebKitQuartzCoreAdditions/CAD3DRenderer.cpp:
* WebKitQuartzCoreAdditions/CAView.cpp:
* WebView.cpp:
(PreferencesChangedOrRemovedObserver::notifyPreferencesChanged):
(PreferencesChangedOrRemovedObserver::notifyPreferencesRemoved):
(WebView::setCacheModel):
(WebView::maxCacheModelInAnyInstance):

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

8 months agoChange ScrollingNodeType to an enum class
simon.fraser@apple.com [Mon, 24 Dec 2018 19:20:18 +0000 (19:20 +0000)]
Change ScrollingNodeType to an enum class
https://bugs.webkit.org/show_bug.cgi?id=193009

Reviewed by Zalan Bujtas.

Change the ScrollingNodeType enum to an enum class.

No behavior change.

Source/WebCore:

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::operator<<):
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::ScrollingStateFixedNode):
* page/scrolling/ScrollingStateNode.h:
(WebCore::ScrollingStateNode::isFixedNode const):
(WebCore::ScrollingStateNode::isStickyNode const):
(WebCore::ScrollingStateNode::isFrameScrollingNode const):
(WebCore::ScrollingStateNode::isOverflowScrollingNode const):
* page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
(WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::ScrollingStateStickyNode):
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::createNode):
(WebCore::ScrollingStateTree::attachNode):
* page/scrolling/ScrollingTreeNode.h:
(WebCore::ScrollingTreeNode::isFixedNode const):
(WebCore::ScrollingTreeNode::isStickyNode const):
(WebCore::ScrollingTreeNode::isFrameScrollingNode const):
(WebCore::ScrollingTreeNode::isOverflowScrollingNode const):
* page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
(WebCore::ScrollingTreeOverflowScrollingNode::ScrollingTreeOverflowScrollingNode):
* page/scrolling/ios/ScrollingTreeIOS.cpp:
(WebCore::ScrollingTreeIOS::createScrollingTreeNode):
* page/scrolling/mac/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
* page/scrolling/mac/ScrollingTreeMac.cpp:
(ScrollingTreeMac::createScrollingTreeNode):
* page/scrolling/mac/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
* platform/graphics/GraphicsLayerClient.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
(WebCore::scrollCoordinationRoleForNodeType):
(WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):

Source/WebKit:

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(WebKit::encodeNodeAndDescendants):
(WebKit::RemoteScrollingCoordinatorTransaction::decode):
(WebKit::dump):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::createScrollingTreeNode):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll):

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

8 months ago[iOS] Remove some unnecessary editing SPI after <rdar://problem/46047546>
wenson_hsieh@apple.com [Mon, 24 Dec 2018 05:07:01 +0000 (05:07 +0000)]
[iOS] Remove some unnecessary editing SPI after <rdar://problem/46047546>
https://bugs.webkit.org/show_bug.cgi?id=193019

Reviewed by Dan Bernstein.

Remove these SPI method declarations, as well as method forwarding in WKContentView. Mail was the only adoptee
of these methods; after <rdar://problem/46047546>, they have moved to the underscore-prefixed versions, so we
we have no need for these erroneously-named SPI methods anymore. There is no change in behavior; verified this
through existing API tests (WKWebViewEditActions), as well as building iOS Mail against WebKit with these
changes to WKWebViewPrivate.h.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView canPerformAction:withSender:]):
(-[WKWebView targetForAction:withSender:]):
(-[WKWebView _setFont:sender:]):
(-[WKWebView _setFontSize:sender:]):
(-[WKWebView _setTextColor:sender:]):
(-[WKWebView setFont:sender:]): Deleted.
(-[WKWebView setTextColor:sender:]): Deleted.
(-[WKWebView setFontSize:sender:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformActionForWebView:withSender:]):
(-[WKContentView setFontForWebView:sender:]): Deleted.
(-[WKContentView setFontSizeForWebView:sender:]): Deleted.
(-[WKContentView setTextColorForWebView:sender:]): Deleted.

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

8 months agoFix fast/ruby/ruby-base-merge-block-children-crash-2.html after r239543
wenson_hsieh@apple.com [Sun, 23 Dec 2018 23:51:30 +0000 (23:51 +0000)]
Fix fast/ruby/ruby-base-merge-block-children-crash-2.html after r239543
https://bugs.webkit.org/show_bug.cgi?id=193015
<rdar://problem/46583527>

Reviewed by Tim Horton.

Fix the crash by gracefully handling integer overflow when computing the area of a very large editable element.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _updateChangedSelection:]):

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

8 months agoUnreviewed GTK+ gardening. Rebaseline fast/text/zero-font-size.html after r239539.
carlosgc@webkit.org [Sun, 23 Dec 2018 10:46:38 +0000 (10:46 +0000)]
Unreviewed GTK+ gardening. Rebaseline fast/text/zero-font-size.html after r239539.

* platform/gtk/fast/text/zero-font-size-expected.txt:

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

8 months ago[BigInt] Support BigInt in JSON.stringify
yusukesuzuki@slowstart.org [Sun, 23 Dec 2018 10:09:09 +0000 (10:09 +0000)]
[BigInt] Support BigInt in JSON.stringify
https://bugs.webkit.org/show_bug.cgi?id=192624

Reviewed by Saam Barati.

JSTests:

* stress/big-int-json-stringify-to-json.js: Added.
(shouldBe):
(shouldThrow):
(BigInt.prototype.toJSON):
(shouldBe.JSON.stringify):
* stress/big-int-json-stringify.js: Added.
(shouldBe):
(shouldThrow):

Source/JavaScriptCore:

This patch adds BigInt support to JSON.stringify, specified in [1].

[1]: https://tc39.github.io/proposal-bigint/#sec-serializejsonproperty

* runtime/JSONObject.cpp:
(JSC::unwrapBoxedPrimitive):
(JSC::Stringifier::toJSON):
(JSC::Stringifier::toJSONImpl):
(JSC::Stringifier::appendStringifiedValue):

LayoutTests:

The test is wrong according to the spec[1]. valueOf of Boolean object won't be called.

[1]: https://tc39.github.io/ecma262/#sec-serializejsonproperty

* js/resources/JSON-stringify.js:
* js/resources/json2-es5-compat.js:
(str):

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

8 months ago[iOS] Suppress native selection behaviors when focusing a very small editable element
wenson_hsieh@apple.com [Sun, 23 Dec 2018 06:38:24 +0000 (06:38 +0000)]
[iOS] Suppress native selection behaviors when focusing a very small editable element
https://bugs.webkit.org/show_bug.cgi?id=193005
<rdar://problem/46583527>

Reviewed by Tim Horton.

Source/WebKit:

In r238146, I added a mechanism to detect when the selection is hidden within transparent editable elements, and
used this to suppress native selection on iOS (such as selection handles, highlight, callout bar, etc.) to avoid
conflicts between the page's editing UI and the platform.

However, one additional technique observed on some websites involves hiding the selection by moving it into a
tiny (1x1) editable element. Here, we currently still present a callout bar with editing actions, as well as
show a selection caret or handles on iOS. To fix this, we extend the mechanism added in r238146 by also
suppressing the selection assistant in the case where the editable element's area is beneath a tiny minimum
threshold.

Test: editing/selection/ios/hide-selection-in-tiny-contenteditable.html

* Shared/EditorState.cpp:
(WebKit::EditorState::PostLayoutData::encode const):
(WebKit::EditorState::PostLayoutData::decode):
(WebKit::operator<<):
* Shared/EditorState.h:

Rename selectionClipRect to focusedElementRect. We currently propagate the bounds of the focused element to the
UI process through EditorState updates, but only for the purpose of returning it in the computed selection clip
rect; instead, rename this member to something more general-purpose, so we can also use it when determining
whether to suppress the selection assistant.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _candidateRect]):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::handleRequestedCandidates):
* UIProcess/ios/WKContentViewInteraction.h:

Add a new SuppressSelectionAssistantReason that corresponds to focusing tiny editable elements.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _zoomToRevealFocusedElement]):
(-[WKContentView _selectionClipRect]):
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _updateChangedSelection:]):

Check the size of the focused element, and begin or stop suppressing the selection assistant accordingly.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::platformEditorState const):

LayoutTests:

Add a new layout test to verify that native selection UI is suppressed when focusing a tiny (1px by 1px)
editable element.

* editing/selection/ios/hide-selection-in-tiny-contenteditable-expected.txt: Added.
* editing/selection/ios/hide-selection-in-tiny-contenteditable.html: Added.
* resources/ui-helper.js:
(window.UIHelper.zoomToScale):

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

8 months agoFixed Apple production builds.
mitz@apple.com [Sat, 22 Dec 2018 22:54:38 +0000 (22:54 +0000)]
Fixed Apple production builds.

* Configurations/Base.xcconfig: Exclude the Source/third_party/boringssl/src/util
  subdirectory, which contains binaries, from installsrc. Its contents are not used for
  building any of the targets in the project.

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

8 months agoWebDriver: warn about non existing tests when parsing expectations
carlosgc@webkit.org [Sat, 22 Dec 2018 12:37:15 +0000 (12:37 +0000)]
WebDriver: warn about non existing tests when parsing expectations
https://bugs.webkit.org/show_bug.cgi?id=192979

Reviewed by Michael Catanzaro.

It's common to update web driver tests and forget updating the test expectations in case of tests removed or
renamed.

* Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py:
(WebDriverTestRunner.__init__):

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

8 months ago[HarfBuzz] Width not correctly reported as 0 for zero font size
carlosgc@webkit.org [Sat, 22 Dec 2018 12:33:52 +0000 (12:33 +0000)]
[HarfBuzz] Width not correctly reported as 0 for zero font size
https://bugs.webkit.org/show_bug.cgi?id=192986

Reviewed by Michael Catanzaro.

Fixes test fast/text/font-size-zero.html

* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Use empty advances for glyphs when the font
size is zero.

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

8 months agoFixed building for macOS 10.13 using the macOS 10.14 SDK.
mitz@apple.com [Sat, 22 Dec 2018 07:53:26 +0000 (07:53 +0000)]
Fixed building for macOS 10.13 using the macOS 10.14 SDK.

* wtf/Platform.h: Changed HAVE_AUTHORIZATION_STATUS_FOR_MEDIA_TYPE to depend on the
  deployment target, not the SDK.

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

8 months ago[JSC] Implement "well-formed JSON.stringify" proposal
yusukesuzuki@slowstart.org [Sat, 22 Dec 2018 06:41:03 +0000 (06:41 +0000)]
[JSC] Implement "well-formed JSON.stringify" proposal
https://bugs.webkit.org/show_bug.cgi?id=191677

Reviewed by Darin Adler.

JSTests:

* stress/json-surrogate-pair.js: Added.
(shouldBe):
* test262/expectations.yaml:

Source/WTF:

This patch implements "well-formed JSON.stringify" proposal[1], which is now stage 3.
JSON.stringify appended surrogate pair codes even if it is not paired appropriately.
The proposal requires that broken surrogate pairs are unicode-escaped.

[1]: https://github.com/tc39/proposal-well-formed-stringify

* wtf/text/StringBuilderJSON.cpp:
(WTF::appendQuotedJSONStringInternal):

LayoutTests:

* css3/escape-dom-api-expected.txt:
* js/dom/webidl-type-mapping-expected.txt:
* js/resources/json2-es5-compat.js:
(isHighSurrogate):
(isLowSurrogate):
(isSurrogate):
(quote):

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