WebKit-https.git
14 months agoCommitSet range bisector should use commits occur in commit sets which specify the...
dewei_zhu@apple.com [Fri, 8 Jun 2018 18:23:17 +0000 (18:23 +0000)]
CommitSet range bisector should use commits occur in commit sets which specify the range as valid commits for commits without ordering.
https://bugs.webkit.org/show_bug.cgi?id=186062

Reviewed by Ryosuke Niwa.

For commits without ordering, we should use the commits occurs in the commit sets which specify the range as valid commits.
Commit sets in range should only contain those valid commits for corresponding repositories.

* public/v3/commit-set-range-bisector.js: Updated logic to add check on commits without ordering.
(CommitSetRangeBisector.async.commitSetClosestToMiddleOfAllCommits):
* unit-tests/commit-set-range-bisector-tests.js: Added a unit test for this case.

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

14 months agoREGRESSION (r230930): Link drag image is very blurry
bfulgham@apple.com [Fri, 8 Jun 2018 18:20:44 +0000 (18:20 +0000)]
REGRESSION (r230930): Link drag image is very blurry
https://bugs.webkit.org/show_bug.cgi?id=186435
<rdar://problem/40797202>

Reviewed by Tim Horton.

Source/WebCore:

Tell NSImage the proper display scale factor it needs when performing a 'lockFocus' by passing
the correct scaling transform as an NSImageHintCTM.

I reviewed the other drag operations (selection, image, and attachment) and confirmed through
manual testing that these operations already properly scale the images. It appears that links
were the only place where we relied on NSImage to determine and use the relevant device scale
factor.

* SourcesCocoa.txt: Add new WebKitNSImageExtras.mm file.
* WebCore.xcodeproj/project.pbxproj: Update for new files.
* platform/graphics/mac/WebKitNSImageExtras.h: Added.
* platform/graphics/mac/WebKitNSImageExtras.mm: Added.
(-[NSImage _web_lockFocusWithTransform:]): Helper method that takes a device scale factor, creates the
relevant scaling NSAffineTransform and passes it to the internal NSImage 'lockFocusWithRect' as the
NSImageHintCTM hint.
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageForLink): Use the new helper function.

Source/WebCore/PAL:

Add the necessary NSImage SPI to our SPI headers.

* PAL.xcodeproj/project.pbxproj:
* pal/spi/mac/NSImageSPI.h: Added.

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

14 months agoVersioning.
kocsen_chung@apple.com [Fri, 8 Jun 2018 17:30:14 +0000 (17:30 +0000)]
Versioning.

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

14 months ago[Cocoa] Turn on ARC for the single Objective-C++ source file in bmalloc
darin@apple.com [Fri, 8 Jun 2018 17:23:58 +0000 (17:23 +0000)]
[Cocoa] Turn on ARC for the single Objective-C++ source file in bmalloc
https://bugs.webkit.org/show_bug.cgi?id=186398

Reviewed by Saam Barati.

* Configurations/Base.xcconfig: Turn on ARC.
* bmalloc/ProcessCheck.mm:
(bmalloc::gigacageEnabledForProcess): Removed the globals from this function,
since it's only called once. If it was called more than once, we could optimize
that with a single boolean global rather than two strings and two booleans.

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

14 months ago[LFC] Add vertical margin computation for inline, block-level, inline-block and float...
zalan@apple.com [Fri, 8 Jun 2018 16:35:35 +0000 (16:35 +0000)]
[LFC] Add vertical margin computation for inline, block-level, inline-block and floating replaced elements
https://bugs.webkit.org/show_bug.cgi?id=186432

Reviewed by Antti Koivisto.

* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): Use the computed non-auto values when margin is not auto.
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):

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

14 months ago[WTF] Add WorkerPool
utatane.tea@gmail.com [Fri, 8 Jun 2018 08:47:06 +0000 (08:47 +0000)]
[WTF] Add WorkerPool
https://bugs.webkit.org/show_bug.cgi?id=174569

Reviewed by Carlos Garcia Campos.

Source/WebCore:

We start using WorkerPool for NicosiaPaintingEngineThreaded instead of glib thread pool.
This makes NicosiaPaintingEngineThreaded platform-independent and usable for WinCairo.

* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
(Nicosia::PaintingEngineThreaded::PaintingEngineThreaded):
(Nicosia::PaintingEngineThreaded::~PaintingEngineThreaded):
(Nicosia::PaintingEngineThreaded::paint):
(Nicosia::s_threadFunc): Deleted.
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:

Source/WTF:

This patch adds WorkerPool, which is a thread pool that consists of AutomaticThread.
Since it is based on AutomaticThread, this WorkerPool can take `timeout`: once `timeout`
passes without any tasks, threads in WorkerPool will be destroyed.

We add shouldSleep handler to AutomaticThread to make destruction of threads in WorkerPool moderate.
Without this, all threads are destroyed at once after `timeout` passes.

* WTF.xcodeproj/project.pbxproj:
* wtf/AutomaticThread.cpp:
(WTF::AutomaticThread::AutomaticThread):
(WTF::AutomaticThread::start):
* wtf/AutomaticThread.h:
* wtf/CMakeLists.txt:
* wtf/WorkerPool.cpp: Added.
(WTF::WorkerPool::WorkerPool):
(WTF::WorkerPool::~WorkerPool):
(WTF::WorkerPool::shouldSleep):
(WTF::WorkerPool::postTask):
* wtf/WorkerPool.h: Added.
(WTF::WorkerPool::create):

Tools:

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/WorkerPool.cpp: Added.
(TestWebKitAPI::TEST):

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

14 months ago[GTK][WPE] Wrong result when calling ImageBufferCairo's getImageData()
magomez@igalia.com [Fri, 8 Jun 2018 07:59:08 +0000 (07:59 +0000)]
[GTK][WPE] Wrong result when calling ImageBufferCairo's getImageData()
https://bugs.webkit.org/show_bug.cgi?id=186384

Reviewed by Michael Catanzaro.

Fix calculations so the result is the expected one.

* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::getImageData):

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

14 months agoRelated task may not have a metric or platform.
dewei_zhu@apple.com [Fri, 8 Jun 2018 06:02:47 +0000 (06:02 +0000)]
Related task may not have a metric or platform.
https://bugs.webkit.org/show_bug.cgi?id=186426

Reviewed by Ryosuke Niwa.

Related task in the related task list can be a custom analysis task which
may not have platform or metric.

* public/v3/pages/analysis-task-page.js: Added null checks for platform and metric.
(AnalysisTaskPage.prototype._renderRelatedTasks):

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

14 months ago[Win][MiniBrowser] Add a new BrowserWindow interface to abstract WK1 and WK2 BrowserW...
Hironori.Fujii@sony.com [Fri, 8 Jun 2018 05:14:03 +0000 (05:14 +0000)]
[Win][MiniBrowser] Add a new BrowserWindow interface to abstract WK1 and WK2 BrowserWindow
https://bugs.webkit.org/show_bug.cgi?id=186421

Reviewed by Ryosuke Niwa.

This is the core patch to make MiniBrowser to support WK1 and WK2
windows (Bug 184770).

I will rename MiniBrowser class to WK1BrowserWindow in a follow-up
patch (Bug 184770 Comment 12).

* MiniBrowser/win/BrowserWindow.h: Added.
* MiniBrowser/win/MainWindow.cpp:
(MainWindow::WndProc):
* MiniBrowser/win/MainWindow.h:
(MainWindow::browserWindow const):
* MiniBrowser/win/MiniBrowser.cpp:
(MiniBrowser::create):
(MiniBrowser::navigateForwardOrBackward): Removed the unsed first argument hWnd.
(MiniBrowser::navigateToHistory): Ditto.
* MiniBrowser/win/MiniBrowser.h: Inherit BrowserWindow interface.
Make all other methods private and make delegates classes friends.
* MiniBrowser/win/PrintWebUIDelegate.cpp:
(PrintWebUIDelegate::createWebViewWithRequest):

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

14 months agoAdd base class to get WeakPtrFactory member and avoid some boilerplate code
Hironori.Fujii@sony.com [Fri, 8 Jun 2018 04:55:02 +0000 (04:55 +0000)]
Add base class to get WeakPtrFactory member and avoid some boilerplate code
https://bugs.webkit.org/show_bug.cgi?id=186407
<rdar://problem/40922716>

Unreviewed WinCairo build fix

MediaPlayerPrivateMediaFoundation.cpp(1726): error C2039: 'makeWeakPtr': is not a member of 'WebCore::MediaPlayerPrivateMediaFoundation'

No new tests (No behavior change).

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):

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

14 months agoFix browser test failed assertions and a bug in 'common-component-base'
dewei_zhu@apple.com [Fri, 8 Jun 2018 04:40:42 +0000 (04:40 +0000)]
Fix browser test failed assertions and a bug in 'common-component-base'
https://bugs.webkit.org/show_bug.cgi?id=186423

Reviewed by Ryosuke Niwa.

Fixed serveral assertion failures in browser tests.
Fixed a bug in common-component-base that null/undefined as attribute value is not allowed.

* browser-tests/chart-revision-range-tests.js: Should not import 'lazily-evaluated-function.js' twice.
* browser-tests/chart-status-evaluator-tests.js: Should not import 'lazily-evaluated-function.js' twice.
* browser-tests/component-base-tests.js: Added a unit test for element attributes being null or undefined.
* browser-tests/index.html: Make mocked data from makeSampleCluster also contains commit_order.
* public/shared/common-component-base.js: Make it allow to take null as attribute value.
(CommonComponentBase.createElement):

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

14 months agoAdd base class to get WeakPtrFactory member and avoid some boilerplate code
cdumez@apple.com [Fri, 8 Jun 2018 03:56:04 +0000 (03:56 +0000)]
Add base class to get WeakPtrFactory member and avoid some boilerplate code
https://bugs.webkit.org/show_bug.cgi?id=186407

Reviewed by Brent Fulgham.

Source/JavaScriptCore:

Add CanMakeWeakPtr base class to get WeakPtrFactory member and its getter, in
order to avoid some boilerplate code in every class needing a WeakPtrFactory.
This also gets rid of old-style createWeakPtr() methods in favor of the newer
makeWeakPtr().

* wasm/WasmInstance.h:
* wasm/WasmMemory.cpp:
(JSC::Wasm::Memory::registerInstance):

Source/WebCore:

Add CanMakeWeakPtr base class to get WeakPtrFactory member and its getter, in
order to avoid some boilerplate code in every class needing a WeakPtrFactory.
This also gets rid of old-style createWeakPtr() methods in favor of the newer
makeWeakPtr().

* Modules/credentialmanagement/CredentialsMessenger.h:
* Modules/credentialmanagement/NavigatorCredentials.cpp:
(WebCore::NavigatorCredentials::credentials):
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::doSupportedConfigurationStep):
(WebCore::CDM::getConsentStatus):
* Modules/encryptedmedia/CDM.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::generateRequest):
(WebCore::MediaKeySession::load):
(WebCore::MediaKeySession::update):
(WebCore::MediaKeySession::close):
(WebCore::MediaKeySession::remove):
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::createSession):
* Modules/encryptedmedia/MediaKeys.h:
* Modules/gamepad/GamepadManager.cpp:
(WebCore::GamepadManager::platformGamepadDisconnected):
(WebCore::GamepadManager::makeGamepadVisible):
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::MediaDevices):
* Modules/mediastream/MediaDevices.h:
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::applyConstraints):
* Modules/mediastream/MediaStreamTrack.h:
* Modules/webauthn/cocoa/LocalAuthenticator.h:
* Modules/webauthn/cocoa/LocalAuthenticator.mm:
(WebCore::LocalAuthenticator::makeCredential):
* accessibility/AccessibilityRenderObject.h:
* accessibility/AccessibilitySVGRoot.cpp:
(WebCore::AccessibilitySVGRoot::setParent):
* crypto/SubtleCrypto.cpp:
(WebCore::SubtleCrypto::encrypt):
(WebCore::SubtleCrypto::decrypt):
(WebCore::SubtleCrypto::sign):
(WebCore::SubtleCrypto::verify):
(WebCore::SubtleCrypto::digest):
(WebCore::SubtleCrypto::generateKey):
(WebCore::SubtleCrypto::deriveKey):
(WebCore::SubtleCrypto::deriveBits):
(WebCore::SubtleCrypto::importKey):
(WebCore::SubtleCrypto::exportKey):
(WebCore::SubtleCrypto::wrapKey):
(WebCore::SubtleCrypto::unwrapKey):
* crypto/SubtleCrypto.h:
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::CSSFontFace):
(WebCore::CSSFontFace::wrapper):
(WebCore::CSSFontFace::setWrapper):
* css/DeprecatedCSSOMValue.h:
* css/FontFace.cpp:
* css/FontFace.h:
* css/MediaQueryEvaluator.cpp:
(WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
* css/StyleSheetContents.h:
* css/parser/CSSDeferredParser.cpp:
(WebCore::CSSDeferredParser::CSSDeferredParser):
* dom/DataTransferItemList.cpp:
(WebCore::DataTransferItemList::add):
(WebCore::DataTransferItemList::ensureItems const):
(WebCore::DataTransferItemList::didSetStringData):
* dom/DataTransferItemList.h:
* dom/Document.cpp:
(WebCore::Document::postTask):
(WebCore::Document::hasStorageAccess):
(WebCore::Document::requestStorageAccess):
* dom/Document.h:
(WebCore::Document::setContextDocument):
* dom/MessagePort.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setPictureElement):
* html/HTMLInputElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
* html/HTMLMediaElement.h:
* html/HTMLPictureElement.h:
* html/parser/HTMLResourcePreloader.h:
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::style const):
* loader/FormState.h:
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preconnectIfNeeded):
* loader/LinkLoader.h:
* loader/LinkPreloadResourceClients.cpp:
(WebCore::LinkPreloadResourceClient::LinkPreloadResourceClient):
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::MediaResourceLoader):
* loader/MediaResourceLoader.h:
* page/DOMWindow.h:
* page/EventHandler.cpp:
(WebCore::widgetForElement):
(WebCore::EventHandler::updateLastScrollbarUnderMouse):
* platform/GenericTaskQueue.cpp:
(WebCore::TaskDispatcher<Timer>::postTask):
* platform/GenericTaskQueue.h:
(WebCore::GenericTaskQueue::enqueueTask):
(WebCore::GenericTaskQueue::cancelAllTasks):
* platform/ScrollView.h:
* platform/ScrollableArea.h:
* platform/Scrollbar.h:
* platform/Widget.cpp:
(WebCore::Widget::setParent):
* platform/Widget.h:
* platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
(WebCore::AudioFileReader::decodeAudioForBusCreation):
* platform/audio/mac/AudioHardwareListenerMac.cpp:
(WebCore::AudioHardwareListenerMac::AudioHardwareListenerMac):
* platform/audio/mac/AudioHardwareListenerMac.h:
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::CDMInstanceClearKey::requestLicense):
(WebCore::CDMInstanceClearKey::updateLicense):
(WebCore::CDMInstanceClearKey::loadSession):
(WebCore::CDMInstanceClearKey::closeSession):
(WebCore::CDMInstanceClearKey::removeSessionData):
* platform/encryptedmedia/clearkey/CDMClearKey.h:
* platform/graphics/FontCascade.h:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
(WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest):
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
(WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::checkPlayability):
(WebCore::MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata):
(WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createSession):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::scheduleDeferredTask):
* platform/graphics/cv/TextureCacheCV.h:
* platform/graphics/cv/TextureCacheCV.mm:
(WebCore::TextureCacheCV::textureFromImage):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
(WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
* platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
(WebCore::DisplayRefreshMonitorMac::displayLinkFired):
* platform/graphics/mac/DisplayRefreshMonitorMac.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::setMaskLayer):
(WebCore::TextureMapperLayer::setReplicaLayer):
* platform/graphics/texmap/TextureMapperLayer.h:
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::endCreatedMediaSource):
(WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
* platform/ios/RemoteCommandListenerIOS.h:
* platform/ios/RemoteCommandListenerIOS.mm:
(WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS):
* platform/mac/RemoteCommandListenerMac.h:
* platform/mac/RemoteCommandListenerMac.mm:
(WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac):
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::scheduleDeferredTask):
* platform/mediastream/MediaStreamPrivate.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::scheduleDeferredTask):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
* platform/vr/VRPlatformDisplay.h:
* platform/vr/openvr/VRPlatformManagerOpenVR.cpp:
(WebCore::VRPlatformManagerOpenVR::getVRDisplays):
* rendering/FloatingObjects.h:
(WebCore::FloatingObject::setOriginatingLine):
* rendering/RenderObject.h:
* rendering/RootInlineBox.cpp:
* rendering/RootInlineBox.h:
* svg/SVGPathElement.h:
* svg/SVGPathSegWithContext.h:
(WebCore::SVGPathSegWithContext::SVGPathSegWithContext):
(WebCore::SVGPathSegWithContext::setContextAndRole):
* svg/SVGTransformList.h:
* svg/properties/SVGAnimatedListPropertyTearOff.h:
(WebCore::SVGAnimatedListPropertyTearOff::baseVal):
(WebCore::SVGAnimatedListPropertyTearOff::animVal):
* svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
* svg/properties/SVGAnimatedPropertyTearOff.h:
* svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
* svg/properties/SVGListProperty.h:
(WebCore::SVGListProperty::initializeValuesAndWrappers):
(WebCore::SVGListProperty::getItemValuesAndWrappers):
(WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
(WebCore::SVGListProperty::replaceItemValuesAndWrappers):
(WebCore::SVGListProperty::appendItemValuesAndWrappers):
* svg/properties/SVGMatrixTearOff.h:
* svg/properties/SVGPropertyTearOff.h:
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMFactory::createCDM):
(WebCore::MockCDM::createInstance):
* testing/MockCDMFactory.h:
* workers/service/ExtendableEvent.h:
* workers/service/FetchEvent.cpp:
(WebCore::FetchEvent::respondWith):
* workers/service/server/SWServer.h:
* xml/DOMParser.cpp:
(WebCore::DOMParser::DOMParser):

Source/WebCore/PAL:

186407_CanMakeWeakPtr

* pal/system/mac/SystemSleepListenerMac.h:
* pal/system/mac/SystemSleepListenerMac.mm:
(PAL::SystemSleepListenerMac::SystemSleepListenerMac):

Source/WebKit:

Add CanMakeWeakPtr base class to get WeakPtrFactory member and its getter, in
order to avoid some boilerplate code in every class needing a WeakPtrFactory.
This also gets rid of old-style createWeakPtr() methods in favor of the newer
makeWeakPtr().

* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace):
* NetworkProcess/PreconnectTask.h:
* NetworkProcess/cache/CacheStorageEngine.h:
* Shared/Authentication/AuthenticationManager.h:
* UIProcess/API/APIAttachment.cpp:
(API::Attachment::Attachment):
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard):
(WebKit::WebPaymentCoordinatorProxy::openPaymentSetup):
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
* UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
* UIProcess/ApplicationStateTracker.h:
* UIProcess/ApplicationStateTracker.mm:
(WebKit::ApplicationStateTracker::ApplicationStateTracker):
* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateWindowAndViewFrames):
(WebKit::WebViewImpl::setTopContentInset):
(WebKit::WebViewImpl::viewDidMoveToWindow):
(WebKit::WebViewImpl::prepareForMoveToWindow):
(WebKit::WebViewImpl::validateUserInterfaceItem):
(WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
(WebKit::WebViewImpl::interpretKeyEvent):
(WebKit::WebViewImpl::firstRectForCharacterRange):
(WebKit::WebViewImpl::performKeyEquivalent):
(WebKit::WebViewImpl::keyUp):
(WebKit::WebViewImpl::keyDown):
* UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
(WebKit::WebCredentialsMessengerProxy::makeCredential):
(WebKit::WebCredentialsMessengerProxy::getAssertion):
* UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::setOriginatingPage):
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/ProcessAssertion.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.h:
* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::Surface::attachBuffer):
* UIProcess/gtk/WaylandCompositor.h:
* UIProcess/ios/ProcessAssertionIOS.mm:
(WebKit::ProcessAssertion::ProcessAssertion):
* UIProcess/mac/DisplayLink.cpp:
(WebKit::DisplayLink::displayLinkCallback):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
(WebKit::RemoteLayerTreeDisplayRefreshMonitor::RemoteLayerTreeDisplayRefreshMonitor):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:

Source/WebKitLegacy/mac:

Add CanMakeWeakPtr base class to get WeakPtrFactory member and its getter, in
order to avoid some boilerplate code in every class needing a WeakPtrFactory.
This also gets rid of old-style createWeakPtr() methods in favor of the newer
makeWeakPtr().

* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::requestCandidatesForSelection):

Source/WTF:

Add CanMakeWeakPtr base class to get WeakPtrFactory member and its getter, in
order to avoid some boilerplate code in every class needing a WeakPtrFactory.
This also gets rid of old-style createWeakPtr() methods in favor of the newer
makeWeakPtr().

* wtf/WeakPtr.h:
(WTF::CanMakeWeakPtr::weakPtrFactory const):
(WTF::CanMakeWeakPtr::weakPtrFactory):

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

14 months agoAdded sending notification feature when test group finishes.
dewei_zhu@apple.com [Fri, 8 Jun 2018 03:44:28 +0000 (03:44 +0000)]
Added sending notification feature when test group finishes.
https://bugs.webkit.org/show_bug.cgi?id=184340

Reviewed by Ryosuke Niwa.

Added 'testgroup_needs_notification' filed to 'analysis_test_group' table to indicate whether a test group
has a pending notification.
Added 'testgroup_notification_sent_at' to record the last notification sent time.
SQL queries to update existing database are:
    'ALTER TABLE analysis_test_groups ADD COLUMN testgroup_needs_notification boolean NOT NULL DEFAULT FALSE;'
    'ALTER TABLE analysis_test_groups ADD COLUMN testgroup_notification_sent_at timestamp DEFAULT NULL;'
Updated 'run-analysis' script to be able to send notification when test group finishes.
Added 'Notify on completion' checkbox while creating/retrying/bisecting a test group.

* browser-tests/test-group-form-tests.js: Updated existing tests and added a new test.
* browser-tests/test-group-result-page-tests.js: Added unit tests for TestGroupResultPage.
* init-database.sql: Added 'testgroup_needs_notification' filed to 'analysis_test_group' table.
* public/api/test-groups.php: Added '/api/test-groups/ready-for-notification' API to 'test-group' to show all
test groups that need to send notification. Only the ones with 'completed', 'failed' or 'cancelled' status and its
'testgroup_needs_notification' is true will be returned by this API.
* public/include/build-requests-fetcher.php: Added 'fetch_requests_for_groups' to return test groups with given ids.
* public/include/commit-sets-helpers.php: Updated the logic to support setting 'testgroup_needs_notification'
while create an analysis_test_groups.
* public/privileged-api/create-analysis-task.php: Updated the logic to support setting 'testgroup_needs_notification'.
* public/privileged-api/create-test-group.php: Updated the logic to support setting 'testgroup_needs_notification'.
* public/privileged-api/update-test-group.php: Updated the logic to support updating 'testgroup_needs_notification'.
Extended this API to allow authentication both from CSRF token and slave.
* public/v3/components/custom-configuration-test-group-form.js:
(CustomConfigurationTestGroupForm.prototype.startTesting): Pass 'notifyOnCompletion' information which represents
'testgroup_needs_notification' from API perspective.
* public/v3/components/customizable-test-group-form.js:
(CustomizableTestGroupForm.prototype.startTesting): Pass 'notifyOnCompletion' information which represents
'testgroup_needs_notification' from API perspective.
(CustomizableTestGroupForm.cssTemplate): Added space between 'Notify on completion' checkbox and test group iteration selection list.
* public/v3/components/test-group-form.js:
(TestGroupForm): Added '_notifyOnCompletion' instance variable.
(TestGroupForm.prototype.didConstructShadowTree): Added 'onchange' event for notify on completion checkbox.
(TestGroupForm.prototype.startTesting): Pass 'notifyOnCompletion' information which represents
'testgroup_needs_notification' from API perspective.
(TestGroupForm.cssTemplate): Added space between 'Notify on completion' checkbox and test group iteration selection list.
* public/v3/models/analysis-results.js: Export 'AnalysisResults'.
(AnalysisResults.fetch): Update API path to use absolute url.
(AnalysisResults):
* public/v3/models/analysis-task.js:
(AnalysisTask.async.create): Extend this function to take notifyOnCompletion as argument which will be used as
'needsNotification' to send to server.
(AnalysisTask):
* public/v3/models/test-group.js:
(TestGroup): Added '_needsNotification' field.
(TestGroup.prototype.updateSingleton): Added logic to update '_needsNotification' field.
(TestGroup.prototype.needsNotification): Returns '_needsNotification' field.
(TestGroup.prototype.author): Returns author information.
(TestGroup.prototype.async.didSendNotification): API that updates 'testgroup_needs_notification' to true.
(TestGroup.prototype.async.fetchTask): API to fetch the task when it has not been fetched.
(TestGroup.createWithTask): Updated this function to accept 'notifyOnCompletion' which will be used as
'needsNotification' to send to server.
(TestGroup.createWithCustomConfiguration): Updated this function to accept 'notifyOnCompletion' which will be used as
'needsNotification' to send to server.
(TestGroup.createAndRefetchTestGroups): Updated this function to accept 'notifyOnCompletion' which will be used as
'needsNotification' to send to server.
(TestGroup.fetchAllWithNotificationReady): New function that invokes '/api/test-groups/ready-for-notification'.
* public/v3/pages/analysis-task-page.js: Update logic to 'notifyOnCompletion' around
(AnalysisTaskChartPane.prototype.didConstructShadowTree):
(AnalysisTaskResultsPane.prototype.didConstructShadowTree):
(AnalysisTaskTestGroupPane.prototype.didConstructShadowTree):
(AnalysisTaskPage.prototype.didConstructShadowTree):
(AnalysisTaskPage.prototype._retryCurrentTestGroup):
(AnalysisTaskPage.prototype.async._bisectCurrentTestGroup):
(AnalysisTaskPage.prototype._createTestGroupAfterVerifyingCommitSetList.set const):
(AnalysisTaskPage.prototype._createTestGroupAfterVerifyingCommitSetList):
(AnalysisTaskPage.prototype._createCustomTestGroup):
* public/v3/pages/chart-pane.js: Added 'Notify on completion' checkbox.
(ChartPane.prototype.didConstructShadowTree):
(ChartPane.prototype.async._analyzeRange):
* public/v3/pages/create-analysis-task-page.js: Adapted API change.
(CreateAnalysisTaskPage.prototype._createAnalysisTaskWithGroup):
* server-tests/api-test-groups.js: Added tests for '/api/test-groups/ready-for-notification'.
* server-tests/privileged-api-create-analysis-task-tests.js: Updated tests to adapt this change.
Added new tests.
* server-tests/privileged-api-create-test-group-tests.js: Added new tests.
* server-tests/privileged-api-update-test-group-tests.js: Added unit test for 'update-test-group' API.
* server-tests/resources/mock-data.js: addMockData should set 'testgroup_needs_notification' to be true.
* server-tests/tools-sync-buildbot-integration-tests.js: Updated tests to adapt this change.
(async.createTestGroupWihPatch):
(createTestGroupWihOwnedCommit):
* tools/js/analysis-results-notifier.js: Added notifier to send notification for completed test groups.
(AnalysisResultsNotifier):
(AnalysisResultsNotifier.prototype.async.sendNotificationsForTestGroups):
(AnalysisResultsNotifier.prototype._sendNotification): Invoke remote API to send notification.
(AnalysisResultsNotifier.prototype._constructMessageByRules):
(AnalysisResultsNotifier._matchesRule):
(AnalysisResultsNotifier._applyUpdate):
(AnalysisResultsNotifier.async._messageForTestGroup): Build html as message body for a test group.
(AnalysisResultsNotifier._URLForAnalysisTask): Returns URL for an analysis task.
(AnalysisResultsNotifier._instantiateNotificationTemplate):
* tools/js/test-group-result-page.js: Added 'TestGroupResultPage' and 'BarGraph' to show test group result.
(TestGroupResultPage):
(TestGroupResultPage.prototype.async.setTestGroup):
(TestGroupResultPage._urlForAnalysisTask):
(TestGroupResultPage.prototype._URLForAnalysisTask):
(TestGroupResultPage.prototype.constructTables):
(TestGroupResultPage.prototype._constructTableForMetric):
(TestGroupResultPage.):
(TestGroupResultPage.prototype.get pageContent):
(TestGroupResultPage.prototype.get styleTemplate):
(BarGraph):
(BarGraph.prototype.setWidth):
(BarGraph.prototype._constructBarGraph):
(BarGraph.prototype.get pageContent):
(BarGraph.prototype.get styleTemplate):
* tools/js/measurement-set-analyzer.js: Adapted 'AnalysisTask.create' change.
(MeasurementSetAnalyzer.prototype.async._analyzeMeasurementSet):
(MeasurementSetAnalyzer):
* tools/js/v3-models.js:
* tools/run-analysis.js: Added the logic that sends notification for completed test groups.
(main):
(async.analysisLoop):
* unit-tests/analysis-task-tests.js:
* unit-tests/analysis-results-notifier-tests.js: Added a unit test for 'AnalysisResultsNotifier' and 'NotificationService'.
* unit-tests/measurement-set-analyzer-tests.js: Updated unit tests per this change.
* unit-tests/test-groups-tests.js: Added unit tests for 'TestGroup.needsNotification'.
* unit-tests/resources/mock-remote-api.js: Only set 'privilegedAPI' when it exits.

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

14 months agoDon’t install process-webcontent-entitlements.sh into the built XPC services.
mitz@apple.com [Fri, 8 Jun 2018 03:44:27 +0000 (03:44 +0000)]
Don’t install process-webcontent-entitlements.sh into the built XPC services.

* WebKit.xcodeproj/project.pbxproj:

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

14 months agoPopStateEvent should not be cancelable by default
cdumez@apple.com [Fri, 8 Jun 2018 03:08:14 +0000 (03:08 +0000)]
PopStateEvent should not be cancelable by default
https://bugs.webkit.org/show_bug.cgi?id=186420

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Resync web-platform-tests after:
https://github.com/web-platform-tests/wpt/pull/11355

* web-platform-tests/html/browsers/browsing-the-web/history-traversal/hashchange_event-expected.txt:
* web-platform-tests/html/browsers/browsing-the-web/history-traversal/hashchange_event.html:
* web-platform-tests/html/browsers/browsing-the-web/history-traversal/popstate_event.html:

Source/WebCore:

PopStateEvent should not be cancelable by default:
- https://github.com/web-platform-tests/wpt/pull/11355
- https://html.spec.whatwg.org/#history-traversal

All other browsers agree with the specification.

No new tests, updated existing tests.

* dom/PopStateEvent.cpp:
(WebCore::PopStateEvent::PopStateEvent):

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

14 months ago[Win][MiniBrowser] MiniBrowser::updateDeviceScaleFactor should be a MainWindow's...
Hironori.Fujii@sony.com [Fri, 8 Jun 2018 02:19:39 +0000 (02:19 +0000)]
[Win][MiniBrowser] MiniBrowser::updateDeviceScaleFactor should be a MainWindow's method
https://bugs.webkit.org/show_bug.cgi?id=186387

Reviewed by Ryosuke Niwa.

MiniBrowser::updateDeviceScaleFactor does nothing for MiniBrowser.
It should be a MainWindow's method.

* MiniBrowser/win/MainWindow.cpp:
(MainWindow::init): Call MainWindow::updateDeviceScaleFactor.
(MainWindow::resizeSubViews): Do not set a font every time window size is changed.
(MainWindow::WndProc): Call MainWindow::updateDeviceScaleFactor on WM_DPICHANGED.
(MainWindow::updateDeviceScaleFactor): Converted from
MiniBrowser::updateDeviceScaleFactor and
MiniBrowser::generateFontForScaleFactor. Set a URL bar's font if DPI is changed.
* MiniBrowser/win/MainWindow.h:
* MiniBrowser/win/MiniBrowser.cpp:
(MiniBrowser::init):
(MiniBrowser::generateFontForScaleFactor): Deleted.
(MiniBrowser::updateDeviceScaleFactor): Deleted.
* MiniBrowser/win/MiniBrowser.h:
(MiniBrowser::deviceScaleFactor): Deleted.
(MiniBrowser::urlBarFont): Deleted.

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

14 months ago[iOS] Inform the client when PDFKit's extension process crashes
aestes@apple.com [Fri, 8 Jun 2018 01:03:16 +0000 (01:03 +0000)]
[iOS] Inform the client when PDFKit's extension process crashes
https://bugs.webkit.org/show_bug.cgi?id=186418
<rdar://problem/40175864>

Reviewed by Tim Horton.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processDidTerminate):
(WebKit::WebPageProxy::dispatchProcessDidTerminate):

Separated the dispatching of delegate methods from the rest of the web
process-specific processDidTerminate logic.

* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView web_setContentProviderData:suggestedFilename:]):

Minor style fix.

(-[WKPDFView pdfHostViewControllerExtensionProcessDidCrash:]):

Called WebPageProxy::dispatchProcessDidTerminate on the main thread.

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

14 months ago[iOS] Unable to present the share sheet after saving a PDF to Files.app
aestes@apple.com [Thu, 7 Jun 2018 23:23:55 +0000 (23:23 +0000)]
[iOS] Unable to present the share sheet after saving a PDF to Files.app
https://bugs.webkit.org/show_bug.cgi?id=186413
<rdar://problem/39937488>

Reviewed by Tim Horton.

WKApplicationStateTrackingView (WKPDFView's superclass) keeps track of whether
it's in a window so that it can suspend and resume the web process accordingly.
However, in WKPDFView's case, PDFKit's host view is in the window instead of
WKPDFView itself when a PDF is being displayed (WKPDFView is only in a window as a
placeholder while the PDF loads). Since WKApplicationStateTrackingView doesn't
think its in a window, it suspends the web process, preventing messages necessary
to displaying the share sheet from being delivered.

Fix this by teaching WKApplicationStateTrackingView to consider the in-windowness
of the proper content view. For all cases other than WKPDFView, this is |self|.
For WKPDFView, it is the PDFHostViewController's root view if it exists, otherwise
it's |self|.

* UIProcess/ios/WKApplicationStateTrackingView.h:
* UIProcess/ios/WKApplicationStateTrackingView.mm:
(-[WKApplicationStateTrackingView willMoveToWindow:]):
(-[WKApplicationStateTrackingView didMoveToWindow]):
(-[WKApplicationStateTrackingView _contentView]):
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView _contentView]):
(-[WKPDFView web_contentView]):

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

14 months agoMatch HI spec for thumbnail view sizing and location
dino@apple.com [Thu, 7 Jun 2018 23:20:28 +0000 (23:20 +0000)]
Match HI spec for thumbnail view sizing and location
https://bugs.webkit.org/show_bug.cgi?id=186412
<rdar://problem/40226192>

Reviewed by Tim Horton.

Use the computed obscured inset to position the QuickLook
view inside the WKSystemPreviewView.

* UIProcess/ios/WKSystemPreviewView.mm:
(-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
(-[WKSystemPreviewView _layoutThumbnailView]):

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

14 months ago[webkitpy] Treat svn versions as Version objects
jbedard@apple.com [Thu, 7 Jun 2018 23:15:41 +0000 (23:15 +0000)]
[webkitpy] Treat svn versions as Version objects
https://bugs.webkit.org/show_bug.cgi?id=186403
<rdar://problem/40904860>

Reviewed by Dan Bernstein.

* Scripts/webkitpy/common/checkout/scm/scm_unittest.py:
* Scripts/webkitpy/common/checkout/scm/svn.py:
(SVN.svn_version): Return Version object instead of string.
(SVN._status_regexp): Convert version string to Version object.
(SVN.add_list): Ditto.

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

14 months agoDon't try to allocate JIT memory if we don't have the JIT entitlement
commit-queue@webkit.org [Thu, 7 Jun 2018 23:14:04 +0000 (23:14 +0000)]
Don't try to allocate JIT memory if we don't have the JIT entitlement
https://bugs.webkit.org/show_bug.cgi?id=182605
<rdar://problem/38271229>

Patch by Tadeu Zagallo <tzagallo@apple.com> on 2018-06-07
Reviewed by Mark Lam.

Source/JavaScriptCore:

Check that the current process has the correct entitlements before
trying to allocate JIT memory to silence warnings.

* jit/ExecutableAllocator.cpp:
(JSC::allowJIT): Helper that checks entitlements on iOS and returns true in other platforms
(JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): check allowJIT before trying to allocate

Source/WebKit:

Remove processHasEntitlement, which was moved into WTF and update all call sites.

* Shared/mac/SandboxUtilities.h:
* Shared/mac/SandboxUtilities.mm:
(WebKit::processHasEntitlement): Deleted.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/ApplicationStateTracker.mm:
(WebKit::applicationType):
* UIProcess/ios/WKActionSheetAssistant.mm:
(applicationHasAppLinkEntitlements):

Source/WTF:

Move processHasEntitlement from Source/WebKit/Shared/mac/SandboxUtilities.h
into WTF so JavaScriptCore can also use it.

* WTF.xcodeproj/project.pbxproj:
* wtf/PlatformMac.cmake:
* wtf/cocoa/Entitlements.cpp:
(WTF::processHasEntitlement):
* wtf/cocoa/Entitlements.h:
* wtf/spi/cocoa/SecuritySPI.h:

Tools:

Add the Security framework to the TestWTF target, since it's required by the new function to check the entitlements.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:

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

14 months agoEnhance run-jsc-stress-tests to allow a test to specify test specific options require...
mark.lam@apple.com [Thu, 7 Jun 2018 22:07:37 +0000 (22:07 +0000)]
Enhance run-jsc-stress-tests to allow a test to specify test specific options required for it to run.
https://bugs.webkit.org/show_bug.cgi?id=186409
<rdar://problem/40909007>

Reviewed by Saam Barati.

Tools:

This is needed because some tests are written with specific features in mind, and
we may not necessarily want to enable that option for all tests.

We can now specify something like this at the top of a test file:
    //@ requireOptions("--useIntlPluralRules=true")

... and ensure that that test will be run with the --useIntlPluralRules=true
option for all test configurations that run the test.

* Scripts/run-jsc-stress-tests:

LayoutTests:

* js/script-tests/intl-pluralrules.js:

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

14 months agoTierUpCheckInjectionPhase systematically never puts the outer-most loop in an inner...
sbarati@apple.com [Thu, 7 Jun 2018 22:06:43 +0000 (22:06 +0000)]
TierUpCheckInjectionPhase systematically never puts the outer-most loop in an inner loop's vector of outer loops
https://bugs.webkit.org/show_bug.cgi?id=186386

Reviewed by Filip Pizlo.

This looks like an 8% speedup on Kraken's imaging-gaussian-blur subtest.

* dfg/DFGTierUpCheckInjectionPhase.cpp:
(JSC::DFG::TierUpCheckInjectionPhase::run):

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

14 months agoREGRESSION (r232544): Pages are blank after homing out and then resuming on iPad
timothy_horton@apple.com [Thu, 7 Jun 2018 22:03:15 +0000 (22:03 +0000)]
REGRESSION (r232544): Pages are blank after homing out and then resuming on iPad
https://bugs.webkit.org/show_bug.cgi?id=186408
<rdar://problem/40907111>

Reviewed by Wenson Hsieh.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _resizeWhileHidingContentWithUpdates:]):
Clients who use _resizeWhileHidingContentWithUpdates don't call
_endAnimatedResize; the former API is a one-shot. We can't wait for
_endAnimatedResize to complete the animation (and don't need to, since
the content is hidden), but instead should just finish it when the
commit with the resized tiles arrives.

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

14 months agobmalloc: Fix 'noreturn' warnings when compiling with -std=gnu++17
ddkilzer@apple.com [Thu, 7 Jun 2018 21:05:29 +0000 (21:05 +0000)]
bmalloc: Fix 'noreturn' warnings when compiling with -std=gnu++17
<https://webkit.org/b/186400>

Reviewed by Saam Barati.

Fixes the following warnings when compiling with gnu++17:

    Source/bmalloc/bmalloc/Scavenger.cpp:363:1: error: function 'threadRunLoop' could be declared with attribute 'noreturn' [-Werror,-Wmissing-noreturn]
    {
    ^
    Source/bmalloc/bmalloc/Scavenger.cpp:358:1: error: function 'threadEntryPoint' could be declared with attribute 'noreturn' [-Werror,-Wmissing-noreturn]
    {
    ^

* bmalloc/BCompiler.h:
(BCOMPILER): Add support for the BCOMPILER() macro, then add
BCOMPILER(GCC_OR_CLANG).  Taken from Source/WTF/wtf/Compiler.h.
(BNO_RETURN): Implement 'norerturn' support using the new
BCOMPILER() macros.  Taken from Source/WTF/wtf/Compiler.h.
* bmalloc/Scavenger.cpp:
(bmalloc::Scavenger::threadRunLoop): Remove the workaround that
tricked older compilers into thinking the while() loop wasn't
infinite.
* bmalloc/Scavenger.h:
(bmalloc::Scavenger::threadEntryPoint): Add BNO_RETURN attribute.
(bmalloc::Scavenger::threadRunLoop): Ditto.

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

14 months agoFunctionRareData::m_objectAllocationProfileWatchpoint is racy
fpizlo@apple.com [Thu, 7 Jun 2018 21:01:19 +0000 (21:01 +0000)]
FunctionRareData::m_objectAllocationProfileWatchpoint is racy
https://bugs.webkit.org/show_bug.cgi?id=186237

Reviewed by Saam Barati.

We initialize it blind and let it go into auto-watch mode once the DFG adds a watchpoint, but
that means that we never notice that it fired if it fires between when the DFG decides to
watch it and when it actually adds the watchpoint.

Most watchpoints are initialized watched for this purpose. This one had a somewhat good
reason for being initialized blind: that's how we knew to ignore changes to the prototype
before the first allocation. However, that functionality also arose out of the fact that the
rare data is created lazily and usually won't exist until the first allocation.

The fix here is to make the watchpoint go into watched mode as soon as we initialize the
object allocation profile.

It's hard to repro this race, however it started causing spurious test failures for me after
bug 164904.

* runtime/FunctionRareData.cpp:
(JSC::FunctionRareData::FunctionRareData):
(JSC::FunctionRareData::initializeObjectAllocationProfile):

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

14 months agoRemove a log that was left in by mistake.
simon.fraser@apple.com [Thu, 7 Jun 2018 20:45:19 +0000 (20:45 +0000)]
Remove a log that was left in by mistake.

* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::pruneLiveResourcesToSize):

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

14 months ago[ASan / StressGC] DumpRenderTree crashed in com.apple.WebCore: WebCore::EventTarget...
graouts@webkit.org [Thu, 7 Jun 2018 19:51:43 +0000 (19:51 +0000)]
[ASan / StressGC] DumpRenderTree crashed in com.apple.WebCore: WebCore::EventTarget::ref + 16
https://bugs.webkit.org/show_bug.cgi?id=186207
<rdar://problem/40568747>

Reviewed by Dean Jackson.

Ensure that we clear the DOM event queue for declarative animations once an animation is cleared for
an element since the element can be deleted before events get dispatched asynchronouly for this animation.

We also only call AnimationTimeline::removeAnimationsForElement() from RenderTreeUpdater::tearDownRenderers()
in the case where we're tearing down the whole document as otherwise this would yield early clearing of the event
queue in the case where an element would get a "display: none" style.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::removeAnimationsForElement):
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::~DeclarativeAnimation):
(WebCore::DeclarativeAnimation::prepareAnimationForRemoval):
* animation/DeclarativeAnimation.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::prepareAnimationForRemoval):
* animation/WebAnimation.h:
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):

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

14 months agoUse the same overloaded addInputString in WKContentViewInteraction
jiewen_tan@apple.com [Thu, 7 Jun 2018 19:48:48 +0000 (19:48 +0000)]
Use the same overloaded addInputString in WKContentViewInteraction
https://bugs.webkit.org/show_bug.cgi?id=186376
<rdar://problem/18498360>

Reviewed by Brent Fulgham.

Different overloaded variants of [UIKeyboardImpl -addInputString] behaves differently. We should use the same
overloaded variant consistently: [UIKeyboardImpl -addInputString:withFlags:withInputManagerHint:].

Sadly, there is no test case for this change as:
1) UIScriptController has troubles simulating '\r' keyboard event, and
2) API test couldn't simulate proper UI keyboard events.

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

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

14 months agoREGRESSION(r224134) Client certificate challenges don't always appear
commit-queue@webkit.org [Thu, 7 Jun 2018 19:19:31 +0000 (19:19 +0000)]
REGRESSION(r224134) Client certificate challenges don't always appear
https://bugs.webkit.org/show_bug.cgi?id=186402
<rdar://problem/35967150>

Patch by Alex Christensen <achristensen@webkit.org> on 2018-06-07
Reviewed by Brian Weinstein.

* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::completeAuthenticationChallenge):
Add an exception for all TLS-handshake-related challenges, not just server trust.

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

14 months agoREGRESSION (r232544): [iOS] TestWebKitAPI.WebKit.OverrideLayoutSizeChangesDuringAnima...
timothy_horton@apple.com [Thu, 7 Jun 2018 19:17:39 +0000 (19:17 +0000)]
REGRESSION (r232544): [iOS] TestWebKitAPI.WebKit.OverrideLayoutSizeChangesDuringAnimatedResizeSucceed is failing
https://bugs.webkit.org/show_bug.cgi?id=186395
<rdar://problem/40902427>

Reviewed by Wenson Hsieh.

* TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm:
(TEST):
endAnimatedResize no longer synchronizes, so we have to wait for the next presentation update.

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

14 months agoRelease assert in Document::updateLayout() in WebPage::determinePrimarySnapshottedPlu...
rniwa@webkit.org [Thu, 7 Jun 2018 18:38:40 +0000 (18:38 +0000)]
Release assert in Document::updateLayout() in WebPage::determinePrimarySnapshottedPlugIn()
https://bugs.webkit.org/show_bug.cgi?id=186383
<rdar://problem/40849498>

Reviewed by Jon Lee.

Source/WebKit:

The release assert was hit because the descendent elemenet iterator, which instantiates ScriptDisallowedScope,
was alive as determinePrimarySnapshottedPlugIn invoked Document::updateLayout. Avoid this by copying
the list of plugin image elements into a vector first.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::determinePrimarySnapshottedPlugIn): Fixed the release assert, and deployed Ref and RefPtr
to make this code safe.

LayoutTests:

Added a regression test.

* plugins/snapshotting/determine-primary-snapshotted-plugin-crash-expected.txt: Added.
* plugins/snapshotting/determine-primary-snapshotted-plugin-crash.html: Added.

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

14 months ago[CoordGraphics] Fix compilation errors around USE(COORDINATED_GRAPHICS)
don.olmstead@sony.com [Thu, 7 Jun 2018 18:36:47 +0000 (18:36 +0000)]
[CoordGraphics] Fix compilation errors around USE(COORDINATED_GRAPHICS)
https://bugs.webkit.org/show_bug.cgi?id=186374

Reviewed by Žan Doberšek.

Source/WebCore:

No new tests. No change in behavior.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
(WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions):
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
* page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp:
* page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp:
* platform/PlatformWheelEvent.h:
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:

Source/WebKit:

* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::sceneUpdateFinished):

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

14 months ago[GTK][WPE] Start implementing MediaStream API
commit-queue@webkit.org [Thu, 7 Jun 2018 18:31:47 +0000 (18:31 +0000)]
[GTK][WPE] Start implementing MediaStream API
https://bugs.webkit.org/show_bug.cgi?id=185787

Source/WebCore:

Patch by Thibault Saunier  <tsaunier@igalia.com> and Alejandro G. Castro <alex@igalia.com> on 2018-06-07
Reviewed by Philippe Normand.

We are adding all the required classes to make the
MediaStream API work, that means our own RealtimeMediaSourceCenterLibWebRTC
for the platform, the GStreamerCaptureDeviceManager, the audio/video capturers
and their respective audio/video sources as well as a dedicated GStreamer Source
that adds support for using MediaStream stream inside playbin3.
We are using the GstDeviceMonitor to list devices on the devices.

Enable mediastream tests.

* platform/GStreamer.cmake: Added the new files to the compilation.
* platform/audio/AudioStreamDescription.h: Added new GStreamer type.
* platform/audio/PlatformAudioData.h: Added new GStreamer type for
the GStreamerAudioData class.
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::simpleBusMessageCallback): This function and the next
one help us to connect a monitoring callback to a pipeline for
debugging.
(WebCore::connectSimpleBusMessageCallback): Ditto.
* platform/graphics/gstreamer/GStreamerCommon.h: Ditto
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::load): Make use of the loadFull() method.
(WebCore::MediaPlayerPrivateGStreamer::loadFull): Very similar to load()
but allows specifying what pipeline type to use (null to let the function determine
which one should be used). This is required as we force to always use playbin3 for the
mediastream source as it relies on the GstStream API.
(WebCore::MediaPlayerPrivateGStreamer::playbackPosition const): Style fix.
(WebCore::MediaPlayerPrivateGStreamer::naturalSize const): Added, use MediaStream specific information if available.
(WebCore::MediaPlayerPrivateGStreamer::updateTracks): Some style fixes.
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Enhance dotfiles names.
(WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): Minor formatting fix.
(WebCore::MediaPlayerPrivateGStreamer::sourceSetup): Set MediaStream on WebKitMediaStreamSource when setting it up.
(WebCore::MediaPlayerPrivateGStreamer::supportsType): Advertise that we support MediaStream if support is built.
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Make sure playbin3 is forced when loading a MediaStream.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add a reference to the MediaStream object and declare loadFull and naturalSize override.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::registerWebKitGStreamerElements): Register the new MediaStreamSrc element.
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
(WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer): Make sure that MediaStream MAIN tracks are selected by default. We have no way to do it in MediaStreamSrc now as the GstStreamCollection is recreated by parsebin.
* platform/mediastream/RealtimeMediaSource.h: Make CaptureFailed a virtual method as in our mocks we require need to make
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::singleton): Remove the code
used for compilation for the platform when we do not have a
RealtimeMediaSourceCenterLibWebRTC. Now we return the proper class
for the platform.
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
Added class representing the RealtimeMediaSource for the Audio
with GStreamer.
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
Ditto.
* platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp: Added
this class that represents the GStreamer pipeline that captures
audio from the system devices, it inherits from GStreamerCapturer.
* platform/mediastream/gstreamer/GStreamerAudioCapturer.h: Dito.
* platform/mediastream/gstreamer/GStreamerAudioData.h: Added this
class implementing PlatformAudioData for the GStreamer platform,
used to pass the samples information.
* platform/mediastream/gstreamer/GStreamerAudioStreamDescription.h:
Added this class implementing AudioStreamDescription to export the
information about the audio stream to libwebrtc.
* platform/mediastream/gstreamer/GStreamerCaptureDevice.h: Added
this base class for the audio and video capturing devices, it
implements general WebKit CaptureDevice class.
* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
Added this class that implements the system monitor to get the
list of available devices in the system. It uses GstDeviceMonitor
to handle the operation. It uses two singleton device managers one
for audio and another one for video, as required by the
RealtimeMediaSourceCenter design.
* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h: Ditto.
* platform/mediastream/gstreamer/GStreamerCapturer.cpp: Added this
base class representing how GStreamer captures the media from the
input devices in the system. Two classes inherit from this one to
capture audio and video. It setups the GStreamer pipeline and adds
functions to control it.
* platform/mediastream/gstreamer/GStreamerCapturer.h: Ditto.
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: Added.
Implements a subclass of GstBin as a source element that will contain several
GstAppSrc, basically one per MediaStreamTrackPrivate of the MediaStreamPrivate
passed in parameter. It adds Observers on the MediaStreamTracks and
pushes the data to the sources as required. The element implements the GstURIHandler
interface so it can be used in playbin. The MediaPlayerPrivateGStreamer is responsible
for passing the MediaStreamPrivate object to the source when required.
(WebCore::webkitMediaStreamSrcPadProbeCb): Event probe that fixes stream_start events (setting the ID etc)
and finally add src pads to the pipeline.
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.h: Ditto.
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
Added this RealtimeMediaSource representing the source of the
video data for the GStreamer platform. It handles the settings and
capabilities of the source and creates the capturer used to
control the operation of the stream.
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h: Ditto.
* platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp: Added
this class that inherits from the GStreamerCapturer and controls
the GStreamer pipelines of the video streams of the system.
* platform/mediastream/gstreamer/GStreamerVideoCapturer.h: Ditto.
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp: Added. Implementation of a Mock capturer for audio stream.
Subclasses GStreamerAudioCapturer and wraps a MockRealtimeAudioSource so that the behaviour is the same a MockRealtimeAudioSource
but still the GStreamer implementation code paths are tested.
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h: Ditto.
* platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp: Added. Implementation of a Mock capturer for video stream.
Subclasses GStreamerVideoCapturer and wraps a MockRealtimeVideoSource so that the behaviour is the same a MockRealtimeVideoSource
but still the GStreamer implementation code paths are tested.
* platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h: Ditto.
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
Added this class that implements the key RealtimeMediaSourceCenter
functions to configure the base class for the platform, using the
other GStreamer classes.
* platform/mock/MockRealtimeAudioSource.cpp: Do not build ::create if GStreamer implementation is built
* platform/mock/MockRealtimeVideoSource.cpp: Do not build ::create if GStreamer implementation is built

Tools:

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-06-07
Reviewed by Philippe Normand.

* Scripts/webkitpy/style/checker.py: Apply special formatting rules for new GObject subclasses.
* gstreamer/jhbuild.modules: Added a patch for the gst-plugins-base.
* gstreamer/patches/gst-plugins-base-0001-parsebin-Post-STREAM_COLLECTION-on-EVENT_STREAM_COLL.patch:
Added this fix to gst-plugings-base to fix the decodebin3. Merged as 89d0e9cc92a86aa0227ee87406737b6d31670aea

LayoutTests:

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-06-07
Reviewed by Philippe Normand.

* platform/gtk/TestExpectations: Reactivate MediaStream tests and enable all tests
related to the mediaDevice.enumerateDevices and MediaStream (not RTCPeerConnection nor
webaudio).

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

14 months agoAdd the basic support for writing components in node.js
rniwa@webkit.org [Thu, 7 Jun 2018 18:25:35 +0000 (18:25 +0000)]
Add the basic support for writing components in node.js
https://bugs.webkit.org/show_bug.cgi?id=186299

Reviewed by Antti Koivisto.

Add the basic support for writing components in node.js for generating rich email notifications.

To do this, this patch introduces MarkupComponentBase and MarkupPage which implement similar API
to ComponentBase and Page classes of v3 UI code. This enables us to share code between frontend
and the backend in the future. Because there is no support for declarative custom elements or
shadow root in HTML, MarkupComponentBase uses a similar but distinct concept of "content" tree
to represent the "DOM" tree for a component. When generating the HTML, MarkupComponentBase and
MarkupPage collectively transforms stylesheets and flattens the tree into a single HTML. In order
to keep this flatteneing logic simple, MarkupComponentBase only supports a very small subset of
CSS selectors to select elements by their local names and class names.

Specifically, each class name and element name based selectors are replaced by a globally unique
class name based selector, and each element which matches the selector is applied of the same
globally unique class name. The transformation is applied when constructing the "content" tree
as well as calls to renderReplace.

Because much of v3 frontend code relies on DOM API, this patch also implements the simplest form
of a fake DOM API as MarkupNode, MarkupParentNode, MarkupElement, and MarkupText. In order to avoid
reimplementing HTML & CSS parsers, this patch introduces the concept of content and style templates
to ComponentBase which are JSON alternatives to HTML & CSS template strings which can be used in
both frontend & backend.

* browser-tests/close-button-tests.js: Include CommonComponentBase.
* browser-tests/commit-log-viewer-tests.js: Ditto.
* browser-tests/component-base-tests.js: Ditto. Added a test cases for content & style templates.
(async.importComponentBase): Added.
* browser-tests/editable-text-tests.js: Include CommonComponentBase.
* browser-tests/index.html:
* browser-tests/markup-page-tests.js: Added.
* browser-tests/page-router-tests.js: Include CommonComponentBase.
* browser-tests/page-tests.js: Ditto.
* browser-tests/test-group-form-tests.js: Ditto.
* public/shared/common-component-base.js: Added.
(CommonComponentBase): Extracted out of ComponentBase.
(CommonComponentBase.prototype.renderReplace): Added.
(CommonComponentBase.renderReplace): Moved from ComponentBase.
(CommonComponentBase.prototype._recursivelyUpgradeUnknownElements): Moved and renamed from
ComponentBase's _recursivelyReplaceUnknownElementsByComponents.
(CommonComponentBase.prototype._upgradeUnknownElement): Extracted out of the same function.
(CommonComponentBase._constructStylesheetFromTemplate): Added.
(CommonComponentBase._constructNodeTreeFromTemplate): Added.
(CommonComponentBase.prototype.createElement): Added.
(CommonComponentBase.createElement): Moved from ComponentBase.
(CommonComponentBase._addContentToElement): Moved from ComponentBase.
(CommonComponentBase.prototype.createLink): Added.
(CommonComponentBase.createLink): Moved from ComponentBase.
(CommonComponentBase._context): Added. Set to document in a browser and MarkupDocument in node.js.
(CommonComponentBase._isNode): Added. Set to a function which does instanceof Node/MarkupNode check.
(CommonComponentBase._baseClass): Added. Set to ComponentBase or MarkupComponentBase.
* public/v3/components/base.js:
(ComponentBase):
(ComponentBase.prototype._ensureShadowTree): Added the support for the content and style templates.
Also avoid parsing the html template each time a component is instantiated by caching the result.
* public/v3/index.html:
* tools/js/markup-component.js: Added.
(MarkupDocument): Added. A fake Document.
(MarkupDocument.prototype.createContentRoot): A substitude for attachShadow.
(MarkupDocument.prototype.createElement):
(MarkupDocument.prototype.createTextNode):
(MarkupDocument.prototype._idForClone):
(MarkupDocument.prototype.reset):
(MarkupDocument.prototype.markup):
(MarkupDocument.prototype.escapeAttributeValue):
(MarkupDocument.prototype.escapeNodeData):
(MarkupNode): Added. A fake Node. Each node gets an unique ID.
(MarkupNode.prototype._markup):
(MarkupNode.prototype.clone): Implemented by the leave class.
(MarkupNode.prototype._cloneNodeData):
(MarkupNode.prototype.remove):
(MarkupParentNode): Added. An equivalent of ContainerNode in WebCore.
(MarkupParentNode.prototype.get childNodes):
(MarkupParentNode.prototype._cloneNodeData):
(MarkupParentNode.prototype.appendChild):
(MarkupParentNode.prototype.removeChild):
(MarkupParentNode.prototype.removeAllChildren):
(MarkupParentNode.prototype.replaceChild):
(MarkupContentRoot): Added. Used like a shadow tree.
(MarkupContentRoot.prototype._markup): Added.
(MarkupElement): Added. A fake Element. It also implements a subset of IDL attributes implemented by
subclasses such as HTMLInputElement for simplicity.
(MarkupElement.prototype.get id): Added.
(MarkupElement.prototype.get localName): Added.
(MarkupElement.prototype.clone): Added.
(MarkupElement.prototype.appendChild): Added.
(MarkupElement.prototype.addEventListener): Added.
(MarkupElement.prototype.setAttribute): Added.
(MarkupElement.prototype.getAttribute): Added.
(MarkupElement.prototype.get attributes): Added.
(MarkupElement.prototype.get textContent): Added.
(MarkupElement.prototype.set textContent): Added.
(MarkupElement.prototype._serializeStyle): Added.
(MarkupElement.prototype._markup): Added. Flattens the tree with content tree like copy & paste so
this can't be used to implement innerHTML.
(MarkupElement.prototype.get value): Added.
(MarkupElement.prototype.set value): Added.
(MarkupElement.prototype.get style): Added. Returns a fake writeonly CSSStyleDeclaration.
(MarkupElement.prototype.set style): Added.
(MarkupElement.get selfClosingNames): Added. A small list of self-closing tags for the HTML generation.
(MarkupText): Added.
(MarkupText.prototype.clone): Added.
(MarkupText.prototype._markup): Added.
(MarkupText.prototype.get data): Added.
(MarkupText.prototype.set data): Added.
(MarkupComponentBase): Added.
(MarkupComponentBase.prototype.element): Added. Like ComponentBase's element.
(MarkupComponentBase.prototype.content): Added. Like ComponentBase's content.
(MarkupComponentBase.prototype._findElementRecursivelyById): Added. A fake getElementById.
(MarkupComponentBase.prototype.render): Added. Like ComponentBase's render.
(MarkupComponentBase.prototype.runRenderLoop): Added. In ComponentBase, we use requestAnimationFrame.
In MarkupComponentBase, we keep rendering until the queue drains empty.
(MarkupComponentBase.prototype.renderReplace): Added. Like ComponentBase's renderReplace but applies
the transformation of classes to workaround the lack of shadow tree support in scriptless HTML.
(MarkupComponentBase.prototype._applyStyleOverrides): Added. Recursively applies the transformation.
(MarkupComponentBase.prototype._ensureContentTree): Added. Like ComponentBase's _ensureShadowTree.
(MarkupComponentBase.reset): Added.
(MarkupComponentBase._parseTemplates): Added. Parses the content & style templates, and generates the
transformed fake DOM tree and stylesheet text whereby selectors in each component is modified to be
unique across all components. The function to apply the necessary changes to an element is saved in
the global map of components, and later used in renderReplace via _applyStyleOverrides.
(MarkupComponentBase.defineElement): Added. Like ComponentBase's defineElement.
(MarkupComponentBase.prototype.createEventHandler): Added.
(MarkupComponentBase.createEventHandler): Added.
(MarkupPage): Added. The top-level component responsible for generating a DOCTYPE, head, and body.
(MarkupPage.prototype.pageTitle): Added.
(MarkupPage.prototype.content): Added. Overrides the one in MarkupComponentBase to return what would
be the content of the body element as opposed to the html element for the connivance of subclasses,
and to match the behavior of the frontend Page class.
(MarkupPage.prototype.render): Added.
(MarkupPage.prototype._updateComponentsStylesheet): Added. Concatenates the transformed stylesheet of
all components used.
(MarkupPage.get contentTemplate): Added.
(MarkupPage.prototype.generateMarkup): Added. Enqueues the page to render, spin the render loop, and
generates the HTML. We enqueue the page twice in order to invoke _updateComponentsStylesheet after
all subcomponent had finished rendering.
* unit-tests/markup-component-base-tests.js: Added.
* unit-tests/markup-element-tests.js: Added.
(.createElement): Added.
* unit-tests/markup-page-tests.js: Added.

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

14 months agoUpdate web-platform-tests github location in webkitpy.w3c.test_importer
commit-queue@webkit.org [Thu, 7 Jun 2018 17:43:47 +0000 (17:43 +0000)]
Update web-platform-tests github location in webkitpy.w3c.test_importer
https://bugs.webkit.org/show_bug.cgi?id=186392

Patch by Brendan McLoughlin <brendan@bocoup.com> on 2018-06-07
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* resources/TestRepositories:

Tools:

* Scripts/webkitpy/w3c/test_importer.py:
(TestImporter.write_import_log):

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

14 months agoRemove unused debug mode conditions
bfulgham@apple.com [Thu, 7 Jun 2018 17:05:08 +0000 (17:05 +0000)]
Remove unused debug mode conditions
https://bugs.webkit.org/show_bug.cgi?id=186358
<rdar://problem/39117121>

Reviewed by Zalan Bujtas.

Source/WebKit:

Remove some unused code paths related to ResourceLoadStatistics debug mode.

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies const):

LayoutTests:

Rebase test expectations after behavior change.

* http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-expected.txt:
* http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html:
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout-expected.txt:
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html:
* http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction-expected.txt:
* http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction.html:
* http/tests/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction-expected.txt:
* http/tests/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction.html:
* http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-recent-user-interaction-expected.txt
* http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-recent-user-interaction.html

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

14 months agoHandle Storage Access API calls in the absence of an attached frame
bfulgham@apple.com [Thu, 7 Jun 2018 16:46:47 +0000 (16:46 +0000)]
Handle Storage Access API calls in the absence of an attached frame
https://bugs.webkit.org/show_bug.cgi?id=186373
<rdar://problem/40028265>

Reviewed by Daniel Bates.

Source/WebCore:

Tests: http/tests/storageAccess/has-storage-access-crash.html
       http/tests/storageAccess/request-storage-access-crash.html

The new frame-specific storage access checks were done without confirming a
frame was present, although the frame state was validated in other parts of
the same method.

This patch checks for a non-null frame before making frame-specific calls.

* dom/Document.cpp:
(WebCore::Document::hasStorageAccess):
(WebCore::Document::requestStorageAccess):

LayoutTests:

* http/tests/storageAccess/has-storage-access-crash-expected.txt: Added.
* http/tests/storageAccess/has-storage-access-crash.html: Added.
* http/tests/storageAccess/request-storage-access-crash-expected.txt: Added.
* http/tests/storageAccess/request-storage-access-crash.html: Added.
* platform/mac-wk2/TestExpectations: Add the two new tests for HighSierra+

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

14 months agowebkitperl: Generalize .internal SDK suffix
jbedard@apple.com [Thu, 7 Jun 2018 16:24:49 +0000 (16:24 +0000)]
webkitperl: Generalize .internal SDK suffix
https://bugs.webkit.org/show_bug.cgi?id=186352
<rdar://problem/40853947>

Reviewed by Alexey Proskuryakov.

* Scripts/build-webkit:
* Scripts/package-root:
(usage):
* Scripts/webkitdirs.pm:
(parseAvailableXcodeSDKS): Parse 'xcodebuild -showsdks' output.
(availableXcodeSDKS): Generate a list of all available Xcode SDKs on this machine.
(determineXcodeSDK): Always prefer .internal SDKs if available.
* Scripts/webkitperl/webkitdirs_unittest/availableXcodeSDKS.pl:

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

14 months ago[LFC] Merge height and vertical margin computation
zalan@apple.com [Thu, 7 Jun 2018 15:39:06 +0000 (15:39 +0000)]
[LFC] Merge height and vertical margin computation
https://bugs.webkit.org/show_bug.cgi?id=186394

Reviewed by Antti Koivisto.

To match the spec (and the width/horizontal margin computation). -currently with default values.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
(WebCore::Layout::FormattingContext::computeFloatingHeight const): Deleted.
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::outOfFlowNonReplacedHeight): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeight): Deleted.
(WebCore::Layout::floatingNonReplacedHeight): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeight): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHeight): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingHeight): Deleted.
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeight): Deleted.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeHeight const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeInFlowHeight const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeight): Deleted.

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

14 months agoDon't start service worker fetch when there is substitute data
antti@apple.com [Thu, 7 Jun 2018 14:59:03 +0000 (14:59 +0000)]
Don't start service worker fetch when there is substitute data
https://bugs.webkit.org/show_bug.cgi?id=186349
<rdar://problem/38881568>

Reviewed by Youenn Fablet.

Loading content via WKWebView.loadData may also end up starting a main resource service worker fetch.
This breaks DocumentWriter assumptions.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::tryLoadingRequestFromApplicationCache):
(WebCore::DocumentLoader::tryLoadingSubstituteData):

Factor substitute resource loading out from tryLoadingRequestFromApplicationCache.

(WebCore::DocumentLoader::startLoadingMainResource):

If we have substitute data already (typically from WKWebView.loadData), allow service worker registration
but load the main resource using the substitute data.

(WebCore::DocumentLoader::handleSubstituteDataLoadSoon): Deleted.

Merge to tryLoadingSubstituteData.

* loader/DocumentLoader.h:

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

14 months ago[GStreamer] Fix the way GstStreamCollection is handled
commit-queue@webkit.org [Thu, 7 Jun 2018 09:36:00 +0000 (09:36 +0000)]
[GStreamer] Fix the way GstStreamCollection is handled
https://bugs.webkit.org/show_bug.cgi?id=184588

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-06-07
Reviewed by Philippe Normand.

The stream collection message replaces the collection of stream previously
advertised, this means that we should rebuild our set of Track from scratch
and not update previously exposed tracks.

In the end, this simplifies the code as we do not care about what
tracks existed previously, we just need to expose what GStreamer tells
us, deleting any previous state.

Handle the STREAM_COLLECTION message from the sync handler so that tracks
are updated before we mark the pipeline as READY for the live case (everything
happen synchronously with the call to the `load()` method in that case),
the update still always happens on the main thread.

No new tests is added as this is mostly refactoring, it is already tested and it
will fix MediaStream tests that are currently disabled as the support is being
implemented in #185787.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::clearTracks): Removes all tracks.
(WebCore::MediaPlayerPrivateGStreamer::updateTracks): Updates configured tracks from the new GstStreamColection track.
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Stop handling GST_STREAM_COLLECTION event.
(WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Handle stream collection event synchronously.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add handleSyncMessage

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

14 months agoMake DFG to FTL OSR entry code more sane by removing bad RELEASE_ASSERTS and making...
sbarati@apple.com [Thu, 7 Jun 2018 08:44:59 +0000 (08:44 +0000)]
Make DFG to FTL OSR entry code more sane by removing bad RELEASE_ASSERTS and making it trigger compiles in outer loops before inner ones
https://bugs.webkit.org/show_bug.cgi?id=186218
<rdar://problem/38449540>

Reviewed by Filip Pizlo.

JSTests:

* stress/dont-crash-ftl-osr-entry.js: Added.

Source/JavaScriptCore:

This patch makes tierUpCommon a tad bit more sane. There are a few things
that I did:
- There were a few release asserts that were crashing. Those release asserts
were incorrect. They were making assumptions about how the code and data
structures were ordered that were wrong. This patch removes them. The code
was using the loop hierarchy vector to make assumptions about which loop we
were currently executing in, which is incorrect. The only information that
can be used about where we're currently executing is the bytecode index we're
at.
- This makes it so that we go back to trying to compile outer loops before
inner loops. JF accidentally reverted this behavior that Ben implemented.
JF made it so that we just compiled the inner most loop. I make this
functionality work by first triggering a compile for the outer most loop
that the code is currently executing in and that can perform OSR entry.
However, some programs can get stuck in inner loops. The code works by
progressively asking inner loops to compile if program execution has not
yet reached an outer loop.

* dfg/DFGOperations.cpp:

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

14 months ago[Win][MiniBrowser] Support multiple windows properly
Hironori.Fujii@sony.com [Thu, 7 Jun 2018 07:32:00 +0000 (07:32 +0000)]
[Win][MiniBrowser] Support multiple windows properly
https://bugs.webkit.org/show_bug.cgi?id=186263

Reviewed by Ryosuke Niwa.

The current implementation of
PrintWebUIDelegate::createWebViewWithRequest is wrong. It is using
CreateProcess to open a new window, and doesn't return the new
instance of IWebView. As the result, for example, window.close
doesn't work as expected.

In this change, a new MainWindow is created and return the
IWebView in PrintWebUIDelegate::createWebViewWithRequest.

In addition to it, this change unifies the lifetime of MiniBrowser
and its delegates AccessibilityDelegate, PrintWebUIDelegate,
ResourceLoadDelegate and WebDownloadDelegate in order to keep
MiniBrowser alive as long as the delegates live. Because the
window of webview keeps references of such delegates and accesses
those after MiniBrowser destruction.

* MiniBrowser/win/MainWindow.h: Added s_numInstances class member
to count the number of instance to close the application. Do not
use unique_ptr for m_browserWindow because it has ref count now.
* MiniBrowser/win/MainWindow.cpp:
(MainWindow::MainWindow): Increment s_numInstances.
(MainWindow::~MainWindow): Decrement s_numInstances.
(MainWindow::create):
(MainWindow::init):
(MainWindow::WndProc): Rename thiz to thisWindow. Keep this
instance alive during this function by using RefPtr<MainWindow>.
Deref the MainWindow instance on WM_DESTROY. Quit the application
when the last MainWindow is closed.
(MainWindow::cachesDialogProc): Rename thiz to thisWindow.
(MainWindow::customUserAgentDialogProc): Ditto.
* MiniBrowser/win/MiniBrowser.h: Added declarations AddRef and Release.
* MiniBrowser/win/MiniBrowser.cpp:
(MiniBrowser::create):
(MiniBrowser::AddRef):
(MiniBrowser::Release):
(MiniBrowser::init): Passes this to the constructors of delegates.
* MiniBrowser/win/AccessibilityDelegate.cpp:
(AccessibilityDelegate::AddRef): Delegate to MiniBrowser.
(AccessibilityDelegate::Release): Ditto.
* MiniBrowser/win/AccessibilityDelegate.h: Removed m_refCount.
(AccessibilityDelegate::AccessibilityDelegate):
* MiniBrowser/win/MiniBrowserWebHost.cpp:
(MiniBrowserWebHost::AddRef): Delegate to MiniBrowser.
(MiniBrowserWebHost::Release): Ditto.
* MiniBrowser/win/MiniBrowserWebHost.h: Removed m_refCount.
* MiniBrowser/win/PrintWebUIDelegate.cpp:
(PrintWebUIDelegate::createWebViewWithRequest): Create a new
MainWindow and return the IWebView.
(PrintWebUIDelegate::AddRef): Delegate to MiniBrowser.
(PrintWebUIDelegate::Release): Ditto.
* MiniBrowser/win/PrintWebUIDelegate.h: Removed m_refCount.
(PrintWebUIDelegate::PrintWebUIDelegate):
* MiniBrowser/win/ResourceLoadDelegate.cpp:
(ResourceLoadDelegate::AddRef): Delegate to MiniBrowser.
(ResourceLoadDelegate::Release): Ditto.
* MiniBrowser/win/ResourceLoadDelegate.h: Removed m_refCount.
* MiniBrowser/win/WebDownloadDelegate.cpp:
(WebDownloadDelegate::WebDownloadDelegate):
(WebDownloadDelegate::AddRef): Delegate to MiniBrowser.
(WebDownloadDelegate::Release): Ditto.
* MiniBrowser/win/WebDownloadDelegate.h: Removed m_refCount.

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

14 months agoREGRESSION (r232520): Crash under IPC::ArgumentCoder<WebCore::Credential>::encodePlat...
mitz@apple.com [Thu, 7 Jun 2018 07:05:55 +0000 (07:05 +0000)]
REGRESSION (r232520): Crash under IPC::ArgumentCoder<WebCore::Credential>::encodePlatformData
https://bugs.webkit.org/show_bug.cgi?id=186385
<rdar://problem/40853796>

Reviewed by Daniel Bates.

* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<Credential>::encodePlatformData): Fixed an incorrect cast.

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

14 months agoRemove unused image encoders
mcatanzaro@igalia.com [Thu, 7 Jun 2018 07:04:21 +0000 (07:04 +0000)]
Remove unused image encoders
https://bugs.webkit.org/show_bug.cgi?id=186365

Reviewed by Carlos Garcia Campos.

* platform/image-encoders/JPEGImageEncoder.cpp: Removed.
* platform/image-encoders/JPEGImageEncoder.h: Removed.
* platform/image-encoders/PNGImageEncoder.cpp: Removed.
* platform/image-encoders/PNGImageEncoder.h: Removed.

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

14 months ago[Win][MiniBrowser] Remove gMainWindow global variable
Hironori.Fujii@sony.com [Thu, 7 Jun 2018 06:25:41 +0000 (06:25 +0000)]
[Win][MiniBrowser] Remove gMainWindow global variable
https://bugs.webkit.org/show_bug.cgi?id=186378

Reviewed by Ryosuke Niwa.

I'm going to support multiple MainWindow in Bug 186263. It should
not be assumed that MainWindow has only one instance. gMainWindow
is used only in DisplayAuthDialog.

* MiniBrowser/win/Common.cpp:
(authDialogProc): Use DWLP_USER to store the dialog data.
(displayAuthDialog): Moved and renamed from
MainWindow::displayAuthDialog. Use DialogBoxParam instead of
DialogBox to pass a data pointer. Do not return S_OK if
DialogBoxParam returns -1. Take a HWND argument as the parent
window.
(DisplayAuthDialog): Deleted.
* MiniBrowser/win/Common.h:
* MiniBrowser/win/MainWindow.cpp:
(authDialogProc): Moved to Common.cpp.
(MainWindow::displayAuthDialog): Ditto.
* MiniBrowser/win/MainWindow.h:
* MiniBrowser/win/ResourceLoadDelegate.cpp:
(ResourceLoadDelegate::didReceiveAuthenticationChallenge):
* MiniBrowser/win/WinMain.cpp:
(wWinMain): Added a local variable mainWindow instead of using
gMainWindow.

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

14 months ago[Xcode] Opt out of the New Build System
mitz@apple.com [Thu, 7 Jun 2018 05:09:23 +0000 (05:09 +0000)]
[Xcode] Opt out of the New Build System
https://bugs.webkit.org/show_bug.cgi?id=186380

Reviewed by Alexey Proskuryakov.

.:

* WebKit.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: Use the Legacy Build System.

Tools:

* Scripts/webkitdirs.pm:
(XcodeOptions): Have -UseNewBuildSystem=NO passed to xcodebuild.

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

14 months agoHTTP Header values validation is too strict
youenn@apple.com [Thu, 7 Jun 2018 04:21:21 +0000 (04:21 +0000)]
HTTP Header values validation is too strict
https://bugs.webkit.org/show_bug.cgi?id=167112

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebased from WPT repository.

* web-platform-tests/fetch/api/headers/header-values-normalize-exptected.txt: Added.
* web-platform-tests/fetch/api/headers/header-values-expected.txt: Added.

Source/WebCore:

Moving header values and names from DOMString to ByteString as per spec.
Updating WebCore::isValidHTTPHeaderValue as per https://fetch.spec.whatwg.org/#terminology-headers.

Covered by rebased and updated tests.
Updated test is now also passing in other browsers.

* platform/network/HTTPParsers.cpp:
(WebCore::isValidHTTPHeaderValue):

LayoutTests:

* http/tests/xmlhttprequest/set-bad-headervalue.html:

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

14 months agoAdd Accept-Encoding: identity to Range requests
youenn@apple.com [Thu, 7 Jun 2018 04:03:31 +0000 (04:03 +0000)]
Add Accept-Encoding: identity to Range requests
https://bugs.webkit.org/show_bug.cgi?id=186335
<rdar://problem/40837190>

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* resources/import-expectations.json:
* web-platform-tests/fetch/range/general.any-expected.txt: Added.
* web-platform-tests/fetch/range/general.any.html: Added.
* web-platform-tests/fetch/range/general.any.js: Added.
* web-platform-tests/fetch/range/general.any.worker-expected.txt: Added.
* web-platform-tests/fetch/range/general.any.worker.html: Added.
* web-platform-tests/fetch/range/general.window.js: Added.
* web-platform-tests/fetch/range/resources/basic.html: Added.
* web-platform-tests/fetch/range/resources/long-wav.py: Added.
* web-platform-tests/fetch/range/resources/partial-script.py: Added.
* web-platform-tests/fetch/range/resources/range-sw.js: Added.
* web-platform-tests/fetch/range/resources/stash-take.py: Added.
* web-platform-tests/fetch/range/resources/utils.js: Added.
* web-platform-tests/fetch/range/resources/w3c-import.log: Added.
* web-platform-tests/fetch/range/sw.https.window.js: Added.
* web-platform-tests/fetch/range/w3c-import.log: Added.

Source/WebCore:

Tests: imported/w3c/web-platform-tests/fetch/range/general.any.html
       imported/w3c/web-platform-tests/fetch/range/general.any.worker.html

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::updateAcceptEncodingHeader):
* loader/cache/CachedResourceRequest.h:

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

14 months agoCheck in a file created by the Xcode 10 beta.
mitz@apple.com [Thu, 7 Jun 2018 03:08:44 +0000 (03:08 +0000)]
Check in a file created by the Xcode 10 beta.

* WebKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: Added.

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

14 months agoArityFixup should adjust SP first on 32-bit platforms too
guijemont@igalia.com [Thu, 7 Jun 2018 02:43:30 +0000 (02:43 +0000)]
ArityFixup should adjust SP first on 32-bit platforms too
https://bugs.webkit.org/show_bug.cgi?id=186351

Reviewed by Yusuke Suzuki.

* jit/ThunkGenerators.cpp:
(JSC::arityFixupGenerator):

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

14 months ago[DFG] Compare operations do not respect negative zeros
utatane.tea@gmail.com [Thu, 7 Jun 2018 02:28:01 +0000 (02:28 +0000)]
[DFG] Compare operations do not respect negative zeros
https://bugs.webkit.org/show_bug.cgi?id=183729

Reviewed by Saam Barati.

JSTests:

* stress/comparison-ignore-negative-zero.js: Added.
(shouldBe):
(zero):
(negativeZero):
(object.valueOf):
(test):

Source/JavaScriptCore:

Compare operations do not respect negative zeros. So propagating this can
reduce the size of the produced code for negative zero case. This pattern
can be seen in Kraken stanford-crypto-aes.

This also causes an existing bug which converts CompareEq(Int32Only, NonIntAsdouble) to false.
However, NonIntAsdouble includes negative zero, which can be equal to Int32 positive zero.
This issue is covered by fold-based-on-int32-proof-mul-branch.js, and we fix this.

* bytecode/SpeculatedType.cpp:
(JSC::leastUpperBoundOfStrictlyEquivalentSpeculations):
SpecNonIntAsDouble includes negative zero (-0.0), which can be equal to 0 and 0.0.
To emphasize this, we use SpecAnyIntAsDouble | SpecNonIntAsDouble directly instead of
SpecDoubleReal.

* dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::propagate):

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

14 months agoLayout Test imported/w3c/web-platform-tests/html/browsers/history/the-location-interf...
commit-queue@webkit.org [Thu, 7 Jun 2018 00:57:34 +0000 (00:57 +0000)]
Layout Test imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html is a flaky failure.
https://bugs.webkit.org/show_bug.cgi?id=184060

Unreviewed test gardening.

Patch by David Fenton <david_fenton@apple.com> on 2018-06-06

* platform/mac/TestExpectations:

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

14 months agoAllow the ramp controller to run tests that take less time than the initial ramp...
jonlee@apple.com [Thu, 7 Jun 2018 00:45:34 +0000 (00:45 +0000)]
Allow the ramp controller to run tests that take less time than the initial ramp-up phase
https://bugs.webkit.org/show_bug.cgi?id=186257

Reviewed by Said Abou-Hallawa.

* MotionMark/tests/resources/main.js: Extend the desired end timestamp when ramp-up occurs.
Previously the controller assumed that the duration of the test was always longer than the
time it took to figure out the order of magnitude of particles to render. When that range
is determined, the end timestamp is then extended. If the duration is too short, the controller
would throw an exception. The fix is to continue extending the timestamp every time the order of
magnitude tiers up.

In general testing with really short durations isn't practical, but sometimes it is
desired for debugging.

To avoid confusion of the private variables, I renamed Benchmark._startTimestamp to
Benchmark._benchmarkStartTimestamp, to disambiguate from Controller._startTimestamp.
Benchmark._startTimestamp is set once and never changed, after the initial 100ms warm-up.
Controller._startTimestamp is initialized to 0 (which means "not initialized"), and then after
the warm up is complete, set in Controller.start() to the same wall clock timestamp, and never
changed afterwards.

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

14 months agoCrash in lambda function WTF::Function<void ()>::CallableWrapper<WebKit::DisplayLink...
pvollan@apple.com [Thu, 7 Jun 2018 00:42:43 +0000 (00:42 +0000)]
Crash in lambda function WTF::Function<void ()>::CallableWrapper<WebKit::DisplayLink::displayLinkCallback
https://bugs.webkit.org/show_bug.cgi?id=186370
<rdar://problem/39791647>

Reviewed by Brent Fulgham.

When the display link is firing, the callback function is called on the display link thread, where a lambda function
is created to be executed on the main thread. The WebPageProxy object is captured as a RefPtr in the lambda. This
might crash when executing on the main thread, since the WebPageProxy object is possibly deleted then. Capturing
the WebPageProxy will not prevent the object from being deleted if the destruction of the WebPageProxy object already
has started on the main thread when the object is captured, which sometimes is the case. Instead, we can create a
weak pointer to the object, which will work as intended, even if the WebPageProxy object is in the process of being
deleted. This also matches the display link implementation used when the WebContent process has access to the
WindowServer. This is not a frequent crash. I have not been able to reproduce it.

* UIProcess/mac/DisplayLink.cpp:
(WebKit::DisplayLink::displayLinkCallback):

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

14 months agoDisplay links are sometimes not notifying WebCore when fired.
pvollan@apple.com [Thu, 7 Jun 2018 00:37:47 +0000 (00:37 +0000)]
Display links are sometimes not notifying WebCore when fired.
https://bugs.webkit.org/show_bug.cgi?id=186367
<rdar://problem/40439109>

Reviewed by Brent Fulgham.

When the WebContent process is receiving an IPC message notifying about a screen update, all display refresh monitors
are notified by the manager in DisplayRefreshMonitorManager::displayWasUpdated(). The manager checks that the monitor
is scheduled before notifying. This is a problem, since the scheduled flag is always set to false in the
DisplayRefreshMonitor::displayDidRefresh() method, when the monitor is first notified about a screen update. This can
lead to display links running without notifying the monitors, causing extra CPU usage. It can also prevent them from
being deleted, since the monitors are not notified. Instead, we can check that the display refresh monitor is active
before notifying it. This matches the original display link implementation used when the WebContent process has
WindowServer access, where the monitors are always notified.

No new tests, since I have not been able to reproduce this in a test case yet.

* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::displayWasUpdated):

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

14 months agogenerateConditionsForInstanceOf needs to see if the object has a poly proto structure...
sbarati@apple.com [Thu, 7 Jun 2018 00:01:31 +0000 (00:01 +0000)]
generateConditionsForInstanceOf needs to see if the object has a poly proto structure before assuming it has a constant prototype
https://bugs.webkit.org/show_bug.cgi?id=186363

Rubber-stamped by Filip Pizlo.

JSTests:

* stress/instance-of-on-poly-proto-opc-should-not-crash.js: Added.

Source/JavaScriptCore:

The code was assuming that the object it was creating an OPC for always
had a non-poly-proto structure. However, this assumption was wrong. For
example, an object in the prototype chain could be poly proto. That type
of object graph would cause a crash in this code. This patch makes it so
that we fail to generate an ObjectPropertyConditionSet if we see a poly proto
object as we traverse the prototype chain.

* bytecode/ObjectPropertyConditionSet.cpp:
(JSC::generateConditionsForInstanceOf):

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

14 months agoRemove unneeded data processing in MotionMark
jonlee@apple.com [Wed, 6 Jun 2018 23:46:43 +0000 (23:46 +0000)]
Remove unneeded data processing in MotionMark
https://bugs.webkit.org/show_bug.cgi?id=186256

Reviewed by Said Abou-Hallawa.

Remove calculation of average frame rate based on multiple samples at a given complexity.
It is not used in the calculation of the score, and is just extra work to do at the end
of a test.

* MotionMark/developer.html: Remove options to show average data and regression based on
that data.
* MotionMark/resources/debug-runner/graph.js: Remove data. Update the time graph that
shows the relationship between the break point in the regression against the complexity
graph.
* MotionMark/resources/debug-runner/motionmark.css: Make the confidence intervals easier
to see.
* MotionMark/resources/runner/motionmark.js: Simplify score calculation now that we are
only calculating regressions on the raw data. We were calculating it based on the averages,
but that was just for analysis, and not used in the actual score. Get rid of the
|complexitySamples| local variable.
* MotionMark/resources/strings.js: Remove unneeded string constant.
* MotionMark/tests/resources/main.js:
(processSamples): Refactor so that more of it can be shared between Controller and
RampController. It also avoids processing the raw samples (controllerSamples) twice for
the ramp controller.
(_processComplexitySamples): Remove logic to calculate averages based on complexity.
(_processMarks): Split this out from the old processSamples.
(_processControllerSamples): Split this out from the old processSamples.

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

14 months agoLayout Test http/tests/resourceLoadStatistics/prevalent-resource-with-user-interactio...
ryanhaddad@apple.com [Wed, 6 Jun 2018 23:38:51 +0000 (23:38 +0000)]
Layout Test http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction.html is flaky on macOS WK2 [ Release ]
https://bugs.webkit.org/show_bug.cgi?id=186362

Unreviewed test gardening.

Patch by David Fenton <david_fenton@apple.com> on 2018-06-06

* platform/mac-wk2/TestExpectations:

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

14 months agoRename color-filter to -apple-color-filter and do not expose it to Web content
graouts@webkit.org [Wed, 6 Jun 2018 22:27:20 +0000 (22:27 +0000)]
Rename color-filter to -apple-color-filter and do not expose it to Web content
https://bugs.webkit.org/show_bug.cgi?id=186306
<rdar://problem/39874167>

Reviewed by Simon Fraser.

Source/WebCore:

Rename the color-filter CSS property to -apple-color-filter.

* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::checkForMatchingColorFilterFunctionLists):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSGradientValue.cpp:
(WebCore::CSSGradientValue::image):
(WebCore::CSSGradientValue::computeStops):
(WebCore::CSSGradientValue::knownToBeOpaque const):
* css/CSSProperties.json:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::checkForMatchingColorFilterFunctionLists):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::checkForMatchingColorFilterFunctionLists):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintMarkedTextForeground):
(WebCore::InlineTextBox::paintMarkedTextDecoration):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresRepaint const):
(WebCore::RenderStyle::visitedDependentColorWithColorFilter const):
(WebCore::RenderStyle::colorByApplyingColorFilter const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::mutableAppleColorFilter):
(WebCore::RenderStyle::appleColorFilter const):
(WebCore::RenderStyle::hasAppleColorFilter const):
(WebCore::RenderStyle::setAppleColorFilter):
(WebCore::RenderStyle::initialAppleColorFilter):
(WebCore::RenderStyle::mutableColorFilter): Deleted.
(WebCore::RenderStyle::colorFilter const): Deleted.
(WebCore::RenderStyle::hasColorFilter const): Deleted.
(WebCore::RenderStyle::setColorFilter): Deleted.
(WebCore::RenderStyle::initialColorFilter): Deleted.
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
(WebCore::StyleRareInheritedData::hasColorFilters const):
* rendering/style/StyleRareInheritedData.h:

Source/WebKit:

Change the ColorFilter setting to no longer be exposed as an experimental feature and ensure it's turned off by default.
To allow internal clients to use the -apple-color-filter property, we expose a new _colorFilterEnabled property as SPI
to WKWebViewConfigurationPrivate.

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetColorFilterEnabled):
(WKPreferencesGetColorFilterEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _setAttachmentElementEnabled:]):
(-[WKWebViewConfiguration _colorFilterEnabled]):
(-[WKWebViewConfiguration _setColorFilterEnabled:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:

Tools:

Adding an option to turn support for the -apple-color-filter property on via an HTML comment.

* DumpRenderTree/TestOptions.cpp:
(TestOptions::TestOptions):
* DumpRenderTree/TestOptions.h:
* DumpRenderTree/mac/DumpRenderTree.mm:
(setWebPreferencesForTestOptions):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::platformCreateWebView):

LayoutTests:

Update tests for color-filter to test -apple-color-filter and explicitly turn the feature on since it's disabled by default.
We also update a test to not use the colorFilter accessor and setter on CSSStyleDeclaration because using an -apple- prefix
will no longer expose such a getter or setter, using getPropertyValue() and setProperty() instead.

* animations/resources/animation-test-helpers.js:
(getPropertyValue):
(comparePropertyValue):
* css3/color-filters/color-filter-animation-expected.txt:
* css3/color-filters/color-filter-animation.html:
* css3/color-filters/color-filter-backgrounds-borders-expected.html:
* css3/color-filters/color-filter-backgrounds-borders.html:
* css3/color-filters/color-filter-box-shadow-expected.html:
* css3/color-filters/color-filter-box-shadow.html:
* css3/color-filters/color-filter-brightness-expected.html:
* css3/color-filters/color-filter-brightness.html:
* css3/color-filters/color-filter-caret-color-expected.html:
* css3/color-filters/color-filter-caret-color.html:
* css3/color-filters/color-filter-color-property-expected.html:
* css3/color-filters/color-filter-color-property-list-item-expected.html:
* css3/color-filters/color-filter-color-property-list-item.html:
* css3/color-filters/color-filter-color-property.html:
* css3/color-filters/color-filter-color-text-decorations-expected.html:
* css3/color-filters/color-filter-color-text-decorations.html:
* css3/color-filters/color-filter-column-rule-expected.html:
* css3/color-filters/color-filter-column-rule.html:
* css3/color-filters/color-filter-contrast-expected.html:
* css3/color-filters/color-filter-contrast.html:
* css3/color-filters/color-filter-current-color-expected.html:
* css3/color-filters/color-filter-current-color.html:
* css3/color-filters/color-filter-filter-list-expected.html:
* css3/color-filters/color-filter-filter-list.html:
* css3/color-filters/color-filter-gradients-expected.html:
* css3/color-filters/color-filter-gradients.html:
* css3/color-filters/color-filter-grayscale-expected.html:
* css3/color-filters/color-filter-grayscale.html:
* css3/color-filters/color-filter-hue-rotate-expected.html:
* css3/color-filters/color-filter-hue-rotate.html:
* css3/color-filters/color-filter-inherits-expected.html:
* css3/color-filters/color-filter-inherits.html:
* css3/color-filters/color-filter-invert-expected.html:
* css3/color-filters/color-filter-invert.html:
* css3/color-filters/color-filter-opacity-expected.html:
* css3/color-filters/color-filter-opacity.html:
* css3/color-filters/color-filter-outline-expected.html:
* css3/color-filters/color-filter-outline.html:
* css3/color-filters/color-filter-parsing-expected.txt:
* css3/color-filters/color-filter-parsing.html:
* css3/color-filters/color-filter-saturate-expected.html:
* css3/color-filters/color-filter-saturate.html:
* css3/color-filters/color-filter-sepia-expected.html:
* css3/color-filters/color-filter-sepia.html:
* css3/color-filters/color-filter-text-decoration-shadow-expected.html:
* css3/color-filters/color-filter-text-decoration-shadow.html:
* css3/color-filters/color-filter-text-emphasis-expected.html:
* css3/color-filters/color-filter-text-emphasis.html:
* css3/color-filters/color-filter-text-shadow-expected.html:
* css3/color-filters/color-filter-text-shadow.html:
* css3/color-filters/color-filter-text-stroke-expected.html:
* css3/color-filters/color-filter-text-stroke.html:
* css3/color-filters/svg/color-filter-inline-svg-expected.html:
* css3/color-filters/svg/color-filter-inline-svg.html:

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

14 months ago[macOS WK2 Release] Layout Test media/video-trackmenu-selection.html is flaky
ryanhaddad@apple.com [Wed, 6 Jun 2018 20:51:11 +0000 (20:51 +0000)]
[macOS WK2 Release] Layout Test media/video-trackmenu-selection.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=186055

Unreviewed test gardening.

Patch by David Fenton <david_fenton@apple.com> on 2018-06-06

* platform/mac-wk2/TestExpectations:

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

14 months agoREGRESSION (r231817?): Layout Test media/track/track-delete-during-setup.html is...
jer.noble@apple.com [Wed, 6 Jun 2018 20:37:23 +0000 (20:37 +0000)]
REGRESSION (r231817?): Layout Test media/track/track-delete-during-setup.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=185889
<rdar://problem/40583180>

Reviewed by Eric Carlson.

Source/WebCore:

Explicitly update the network and ready states when detaching the AVPlayerItem
from the AVPlayer.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData):

LayoutTests:

Modify the track-delete-during-setup.html test to end on video element suspend in
addition to canplaythrough.

* media/track/track-delete-during-setup.html:

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

14 months agoUse the default label for snapshotted plug-ins if no mime-type is available
commit-queue@webkit.org [Wed, 6 Jun 2018 18:24:38 +0000 (18:24 +0000)]
Use the default label for snapshotted plug-ins if no mime-type is available
https://bugs.webkit.org/show_bug.cgi?id=186348

Patch by Antoine Quint <graouts@apple.com> on 2018-06-06
Reviewed by Jon Lee.

In case the mime-type is not available, use the default labels otherwise we'd crash trying to look up the empty string in the HashMap.

* html/HTMLPlugInImageElement.cpp:
(WebCore::titleText):
(WebCore::subtitleText):

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

14 months agoLogging macros are sensitive to pal/Logging.h vs Logging.h include order
simon.fraser@apple.com [Wed, 6 Jun 2018 18:20:31 +0000 (18:20 +0000)]
Logging macros are sensitive to pal/Logging.h vs Logging.h include order
https://bugs.webkit.org/show_bug.cgi?id=185893

Reviewed by Zalan Bujtas.

Remove unused functionality from pal/Logging code until we need it. Primarily this removes the
#define LOG_CHANNEL_PREFIX from pal/Logging.h, which caused include-order problems with unified sources.

Future work should move shared logging code up to WTF (or into PAL).

* PAL.xcodeproj/project.pbxproj:
* pal/CMakeLists.txt:
* pal/LogInitialization.h: Removed.
* pal/Logging.cpp:
(PAL::isLogChannelEnabled): Deleted.
(PAL::setLogChannelToAccumulate): Deleted.
(PAL::initializeLogChannelsIfNecessary): Deleted.
* pal/Logging.h:
* pal/cocoa/LoggingCocoa.mm: Removed.

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

14 months agoAdjust compile and runtime flags to match shippable state of features (Part 2)
bfulgham@apple.com [Wed, 6 Jun 2018 18:07:50 +0000 (18:07 +0000)]
Adjust compile and runtime flags to match shippable state of features (Part 2)
https://bugs.webkit.org/show_bug.cgi?id=186319
<rdar://problem/40352045>

Unreviewed test fix.

TestWebKitAPI was timing out because 'color' input types are no longer support. I also discovered that the
ASSERT_STREQ macro returns on error, which causes tests to time out whenever a 'done = true' call (needed to
end the test) is done after ASSERT_STREQ, which might fail and return early, preventing the flag from being
set.

* TestWebKitAPI/Tests/WebKitCocoa/InjectedBundleNodeHandleIsTextField.mm:
(-[InjectedBundleNodeHandleIsTextField webProcessPlugIn:didCreateBrowserContextController:]): Make testing of
the 'color' input type conditional on the feature being part of the build.
* TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
(-[AutoFillDelegate _webView:didClickAutoFillButtonWithUserInfo:]): Set the 'done=true' state before performing
string equality assertions, since they do an early return and bypass the end state of the test.
(-[DidResignInputElementStrongPasswordAppearanceDelegate _webView:didResignInputElementStrongPasswordAppearanceWithUserInfo:]): Ditto.
(-[AutoFillAvailableDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]): Ditto.
(-[InjectedBundleNodeHandleIsTextFieldDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]): Ditto.

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

14 months agoREGRESSION (r232301) - Unable to enter video fullscreen
jer.noble@apple.com [Wed, 6 Jun 2018 18:02:02 +0000 (18:02 +0000)]
REGRESSION (r232301) - Unable to enter video fullscreen
https://bugs.webkit.org/show_bug.cgi?id=186357
<rdar://problem/40838449>

Reviewed by Jon Lee.

Only set up the standby fullscreen element if we are in element fullscreen.

* WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::WebFullScreenManager::videoControlsManagerDidChange):

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

14 months agoStrip out more characters when creating permalinks
jonlee@apple.com [Wed, 6 Jun 2018 17:40:42 +0000 (17:40 +0000)]
Strip out more characters when creating permalinks
https://bugs.webkit.org/show_bug.cgi?id=186259

Reviewed by Said Abou-Hallawa.

Tests and suites may have names that make permalinks to the tests less readable when
shared. Expand the set of characters that are stripped out of the names.

* MotionMark/resources/debug-runner/motionmark.js: Refactor to call
stripUnwantedCharactersForURL. For existing links, decode the suite and test names.
* MotionMark/resources/extensions.js:
(Utilities.stripUnwantedCharactersForURL): Rename from stripNonASCIICharacters.
Remove any non-alphanumeric character.

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

14 months agoWrong NSVisualEffectMaterial used for exit full screen overlay in dark mode.
timothy@apple.com [Wed, 6 Jun 2018 16:42:05 +0000 (16:42 +0000)]
Wrong NSVisualEffectMaterial used for exit full screen overlay in dark mode.

https://bugs.webkit.org/show_bug.cgi?id=186350
rdar://problem/39135535

Reviewed by Anders Carlsson.

* platform/mac/WebCoreFullScreenPlaceholderView.mm:
(-[WebCoreFullScreenPlaceholderView initWithFrame:]):
Use the NSVisualEffectMaterialFullScreenUI on macOS 10.14 and don't
set an explicit NSAppearance.

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

14 months agoattenuationFactor should be in range [0,1]
commit-queue@webkit.org [Wed, 6 Jun 2018 16:36:12 +0000 (16:36 +0000)]
attenuationFactor should be in range [0,1]
https://bugs.webkit.org/show_bug.cgi?id=186320
rdar://problem/40821456

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-06-06
Reviewed by Jer Noble.

If attenuationFactor is outside of this range it can cause false positives.

* UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.cpp:
(WebKit::FullscreenTouchSecheuristic::attenuationFactor):

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

14 months agoMove animated resize into the layer tree transaction, and make it asynchronous
timothy_horton@apple.com [Wed, 6 Jun 2018 16:32:26 +0000 (16:32 +0000)]
Move animated resize into the layer tree transaction, and make it asynchronous
https://bugs.webkit.org/show_bug.cgi?id=186130
<rdar://problem/38477288>

Reviewed by Simon Fraser.

* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::setScrollPosition):
(WebKit::RemoteLayerTreeTransaction::dynamicViewportSizeUpdateID const):
(WebKit::RemoteLayerTreeTransaction::setDynamicViewportSizeUpdateID):
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode const):
(WebKit::RemoteLayerTreeTransaction::decode):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::willCommitLayerTree):
Add scrollPosition to the transaction on all platforms, not just Mac.
Add the optional dynamicViewportSizeUpdateID to the transaction, representing
the most recent dynamicViewportSizeUpdate that commit contains, if any.

* Shared/ios/DynamicViewportSizeUpdate.h:
Added a typedef for DynamicViewportSizeUpdateID, and move the mode enum here.

* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::dynamicViewportUpdateChangedTarget): Deleted.
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::dynamicViewportSizeUpdate):
(WebKit::WebPageProxy::didCommitLayerTree):
(WebKit::WebPageProxy::synchronizeDynamicViewportUpdate): Deleted.
(WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::synchronizeDynamicViewportUpdate): Deleted.
Remove dynamicViewportUpdateChangedTarget and synchronizeDynamicViewportUpdate.
Move dynamicViewportSizeUpdateID maintenance into WKWebView.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _processDidExit]):
Remove _resizeAnimationTransformTransactionID. We now instead pack
the resize ID inside the transaction, instead of separately sending
back a transaction ID to wait for.

(-[WKWebView _didCommitLayerTreeDuringAnimatedResize:]):
(-[WKWebView _didCommitLayerTree:]):
Added, factored out of _didCommitLayerTree:.
If the transaction includes the result of the most recently-sent resize,
store the requisite adjustments required to counter the new scale and
scroll offset, update the resizeAnimationView, and, if endAnimatedResize
has already been called, call _didCompleteAnimatedResize to tear down
the animation view and put things back together.

Add some code so that if a commit arrives before the resize, we update
the scale of the resize animation view to keep the width fitting.

(activeMaximumUnobscuredSize):
(activeOrientation):
Move these because the code that depends on them moved.

(-[WKWebView _didCompleteAnimatedResize]):
Broken out of _endAnimatedResize. This can now be called from
either endAnimatedResize or _didCommitLayerTreeDuringAnimatedResize,
depending on which is called first.

(-[WKWebView _beginAnimatedResizeWithUpdates:]):
Don't create a new resize view if we still have one. Otherwise, we'll
get the view ordering all wrong when making the second one. This
didn't previously cause trouble, because we don't have a lot of
WKScrollView subviews, but it totally could.

Adopt _initialContentOffsetForScrollView just to make this code more clear.

(-[WKWebView _endAnimatedResize]):
(-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewInternal.h:

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

14 months agoRegions outside of the fullscreen window are exposed during zoom operations
jer.noble@apple.com [Wed, 6 Jun 2018 16:13:31 +0000 (16:13 +0000)]
Regions outside of the fullscreen window are exposed during zoom operations
https://bugs.webkit.org/show_bug.cgi?id=186330
<rdar://problem/34698009>

Reviewed by Simon Fraser.

Source/WebCore:

Test: fullscreen/full-screen-layer-dump.html

Introduce the concept of "requiresBackgroundLayer" to RenderLayerBacking, for use by
RenderFullScreen. Previously, the backgroundLayer in RenderLayerBacking was only used
by the root renderer with fixed backgrounds. Give the RenderFullScreen a background layer
that's approximately 3x as tall and wide as the renderer itself, so nothing is exposed
during pinch operations.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::updateDrawsContent):
(WebCore::RenderLayerBacking::setRequiresBackgroundLayer):
(WebCore::RenderLayerBacking::updateBackgroundLayer):
(WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor):
(WebCore::RenderLayerBacking::paintIntoLayer):
* rendering/RenderLayerBacking.h:

LayoutTests:

* fullscreen/full-screen-layer-dump-expected.txt: Added.
* fullscreen/full-screen-layer-dump.html: Added.

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

14 months agoSet the AVAssetResourceLoaderRequest's contentType to AVStreamingKeyDeliveryContentKe...
jer.noble@apple.com [Wed, 6 Jun 2018 16:10:47 +0000 (16:10 +0000)]
Set the AVAssetResourceLoaderRequest's contentType to AVStreamingKeyDeliveryContentKeyType in the case of a FPS key request.
https://bugs.webkit.org/show_bug.cgi?id=186328
<rdar://problem/40829228>

Reviewed by Eric Carlson.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):

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

14 months ago[LFC] Add margin computation for floating, replaced elements.
zalan@apple.com [Wed, 6 Jun 2018 15:52:16 +0000 (15:52 +0000)]
[LFC] Add margin computation for floating, replaced elements.
https://bugs.webkit.org/show_bug.cgi?id=186337

Reviewed by Antti Koivisto.

If 'margin-left' or 'margin-right' are computed as 'auto', their used value is '0'.

* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):

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

14 months ago[LFC] Add margin computation for floating, no-replaced elements.
zalan@apple.com [Wed, 6 Jun 2018 15:25:38 +0000 (15:25 +0000)]
[LFC] Add margin computation for floating, no-replaced elements.
https://bugs.webkit.org/show_bug.cgi?id=186334

Reviewed by Antti Koivisto.

If 'margin-left', or 'margin-right' are computed as 'auto', their used value is '0'.

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):

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

14 months agoUse minimal coverage rect for tiled layers when under memory pressure
antti@apple.com [Wed, 6 Jun 2018 14:50:02 +0000 (14:50 +0000)]
Use minimal coverage rect for tiled layers when under memory pressure
https://bugs.webkit.org/show_bug.cgi?id=186185
<rdar://problem/40713608>

Reviewed by Darin Adler.

We do this for the main content layer already.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::adjustTiledLayerVisibleRect):

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

14 months ago[GTK] Unreviewed test gardening
aboya@igalia.com [Wed, 6 Jun 2018 11:18:46 +0000 (11:18 +0000)]
[GTK] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=186342

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:

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

14 months ago[Web Animations] Only expose CSSAnimation and CSSTransition if the WebAnimationsCSSIn...
graouts@webkit.org [Wed, 6 Jun 2018 08:20:10 +0000 (08:20 +0000)]
[Web Animations] Only expose CSSAnimation and CSSTransition if the WebAnimationsCSSIntegration runtime flag is enabled
https://bugs.webkit.org/show_bug.cgi?id=186305

Reviewed by Dean Jackson.

Source/WebCore:

* animation/CSSAnimation.idl:
* animation/CSSTransition.idl:

Websites/webkit.org:

Add a test for the WebAnimationsCSSIntegration runtime flag.

* experimental-features.html:

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

14 months agoRegression(r232082): Websites get loaded inside of Messages App chat transcript
cdumez@apple.com [Wed, 6 Jun 2018 04:53:35 +0000 (04:53 +0000)]
Regression(r232082): Websites get loaded inside of Messages App chat transcript
https://bugs.webkit.org/show_bug.cgi?id=186331
<rdar://problem/40735446>

Reviewed by Darin Adler.

Source/WebKitLegacy/mac:

r232082 made it so that if the client implements decidePolicyForMIMEType / decidePolicyForNavigationAction
but does not call use / ignore on the listener, then we would do "use" by default.
The intention was to restore pre-AsyncPolicyDelegates behavior and unbreak Box.app. However,
the pre-AsyncPolicyDelegates behavior was only to "use" by default for decidePolicyForMIMEType,
not decidePolicyForNavigationAction. Doing "use" by default for decidePolicyForNavigationAction
is new behavior and it breaks Messages.app. This patch updates r232082 so that we now do call
"use" by default on the listener for decidePolicyForMIMEType and "ignore" by default for other
policy decisions. This should restore pre-AsyncPolicyDelegates behavior. This fixes Messages.app
and Box.app is still working properly.

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
(WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
(WebFrameLoaderClient::dispatchWillSubmitForm):
(WebFrameLoaderClient::setUpPolicyListener):
(-[WebFramePolicyListener initWithFrame:policyFunction:defaultPolicy:]):
(-[WebFramePolicyListener initWithFrame:policyFunction:defaultPolicy:appLinkURL:]):
(-[WebFramePolicyListener dealloc]):
(-[WebFramePolicyListener initWithFrame:policyFunction:]): Deleted.
(-[WebFramePolicyListener initWithFrame:policyFunction:appLinkURL:]): Deleted.

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/mac/NoPolicyDelegateResponse.mm:
(-[NoDecidePolicyForNavigationActionDecisionDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:]):
(-[NoDecidePolicyForNavigationActionDecisionDelegate webView:didStartProvisionalLoadForFrame:]):
(TestWebKitAPI::TEST):
(-[NoPolicyDelegateDecisionDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:]): Deleted.
(-[NoPolicyDelegateDecisionDelegate webView:decidePolicyForMIMEType:request:frame:decisionListener:]): Deleted.
(-[NoPolicyDelegateDecisionDelegate webView:didFinishLoadForFrame:]): Deleted.

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

14 months agoMove OpenGL display mask to screen data struct.
pvollan@apple.com [Wed, 6 Jun 2018 04:35:12 +0000 (04:35 +0000)]
Move OpenGL display mask to screen data struct.
https://bugs.webkit.org/show_bug.cgi?id=186198
<rdar://problem/40724854>

Reviewed by Brent Fulgham.

Currently, the OpenGL display mask is a global in the WebContent process. This is not correct in all cases, since
it is possible to have two Web views in the same WebContent process, displayed on different displays. This can be
resolved by moving the OpenGL display mask to a new ScreenData struct, containing information specific to each
display. The display ID of the host window is used to find the OpenGL display mask when needed. This patch makes
the host window available when creating an IOSurface, in order to find the right OpenGL display mask. If no host
window is available, the OpenGL display mask of the main display is used.

Source/WebCore:

No new tests, since testing this requires two Web views in the same WebContent process, displayed on
two different monitors.

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createImageBuffer const):
* platform/PlatformScreen.h:
* platform/ScreenProperties.h:
(WebCore::ScreenProperties::encode const):
(WebCore::ScreenProperties::decode):
(WebCore::ScreenData::encode const):
(WebCore::ScreenData::decode):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::create):
* platform/graphics/ImageBuffer.h:
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer):
(WebCore::ImageBuffer::ImageBuffer):
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::allowOfflineRenderers const):
(WebCore::GraphicsContext3D::setOpenGLDisplayMask): Deleted.
(WebCore::GraphicsContext3D::getOpenGLDisplayMask): Deleted.
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::ensurePlatformContext):
* platform/mac/PlatformScreenMac.mm:
(WebCore::screenProperties):
(WebCore::collectScreenProperties):
(WebCore::setScreenProperties):
(WebCore::screenData):
(WebCore::primaryOpenGLDisplayMask):
(WebCore::displayMaskForDisplay):
(WebCore::getScreenProperties):
(WebCore::screenIsMonochrome):
(WebCore::screenHasInvertedColors):
(WebCore::screenDepth):
(WebCore::screenDepthPerComponent):
(WebCore::screenRectForDisplay):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
(WebCore::screenColorSpace):
(WebCore::screenSupportsExtendedColor):

Source/WebKit:

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::windowScreenDidChange):
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::screenPropertiesStateChanged):
(WebKit::displayReconfigurationCallBack):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_credentialsMessenger):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::openGLDisplayMaskChanged): Deleted.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setScreenProperties):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

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

14 months agoREGRESSION (231817): Videos permanently blank out after switching out of a tab and...
jer.noble@apple.com [Wed, 6 Jun 2018 04:25:48 +0000 (04:25 +0000)]
REGRESSION (231817): Videos permanently blank out after switching out of a tab and back in
https://bugs.webkit.org/show_bug.cgi?id=186326
<rdar://problem/40778157>

Reviewed by Eric Carlson.

Source/WebCore:

Check whether the element is visible in the viewport when the web view itself becomes visible, and if so, clear the m_elementIsHiddenUntilVisibleInViewport flag.

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::visibilityChanged):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:

LayoutTests:

* media/video-buffering-allowed-expected.txt:
* media/video-buffering-allowed.html:

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

14 months ago[LFC] Move inflow, replaced width and margin computation to a dedicated function.
zalan@apple.com [Wed, 6 Jun 2018 04:23:26 +0000 (04:23 +0000)]
[LFC] Move inflow, replaced width and margin computation to a dedicated function.
https://bugs.webkit.org/show_bug.cgi?id=186327

Reviewed by Sam Weinig.

I was searching for the function inFlowReplacedWidthAndMargin() and there was none.

* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):

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

14 months ago[LFC] Add missing margins for inflow, non replaced block and replaced inline elements
zalan@apple.com [Wed, 6 Jun 2018 03:10:45 +0000 (03:10 +0000)]
[LFC] Add missing margins for inflow, non replaced block and replaced inline elements
https://bugs.webkit.org/show_bug.cgi?id=186332

Reviewed by Darin Adler.

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):

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

14 months agoRemove tracksResourceLoadMilestones support
krollin@apple.com [Wed, 6 Jun 2018 01:46:17 +0000 (01:46 +0000)]
Remove tracksResourceLoadMilestones support
https://bugs.webkit.org/show_bug.cgi?id=186329
<rdar://problem/40829898>

Reviewed by Darin Adler.

Remove the mechanism for enabling/disabling the tracking of
resource-load milestones. This was initially added in order to enable
the tracking only for Safari. However, the decision has been made to
enable the tracking for all WebKit clients, so it's now enabled
unconditionally.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
(WebKit::NetworkConnectionToWebProcess::stopTrackingResourceLoad):
(WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTracking):
(WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTrackingForPage):
(WebKit::networkActivityTrackingEnabled): Deleted.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::tracksResourceLoadMilestones const): Deleted.
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContextConfigurationRef.cpp:
(WKContextConfigurationTracksResourceLoadMilestones): Deleted.
(WKContextConfigurationSetTracksResourceLoadMilestones): Deleted.
* UIProcess/API/C/WKContextConfigurationRef.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration tracksResourceLoadMilestones]): Deleted.
(-[_WKProcessPoolConfiguration setTracksResourceLoadMilestones:]): Deleted.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):

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

14 months ago[macOS] Spelling errors in the middle of an inserted paragraph are not displayed
wenson_hsieh@apple.com [Wed, 6 Jun 2018 01:44:03 +0000 (01:44 +0000)]
[macOS] Spelling errors in the middle of an inserted paragraph are not displayed
https://bugs.webkit.org/show_bug.cgi?id=185584
<rdar://problem/38676081>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Currently when typing, we only consider the range of adjacent words when determining where to place spelling
correction markers, even though we provide NSSpellChecker with the full context of the sentence (and get back
results encompassing the full range). In macOS Mojave, NSSpellChecker may now return spell checking results that
include correctly spelled words that are misused in the context of the sentence. This means that while typing a
sentence, a different part of the sentence may gain or lose spelling markers as a result.

To support this, WebKit needs to mark or unmark spelling corrections in the full range of the sentence whenever
a full word is typed (since the context of other words within the sentence may have changed, resulting in
different platform spellchecking results). In markMisspellingsAfterTypingToWord, we expand the spell checking
range past the adjacent words so that it encompasses the largest subrange of the full sentence that includes the
start of the typed word, and does not include any position that is under an element with `spellcheck=false`.

This guarantees that we don't erroneously place spelling document markers under elements where spellchecking is
disabled, while allowing for sentence retro corrections when spellchecking is enabled. However, this doesn't
handle the case where an element with spellchecking disabled lies between a sentence retro correction range and
the currently typed word. In the future, we could fix this by refactoring SpellCheckRequest to track a list of
non-contiguous spelling correction ranges — see the FIXME in markMisspellingsAfterTypingToWord for more detail.

Covered by 2 new layout tests, as well as an existing spell-checking test that should now be passing.

Tests: editing/spelling/retro-correction-spelling-markers.html
       editing/spelling/spelling-markers-after-pasting-sentence.html

* editing/Editor.cpp:
(WebCore::Editor::markMisspellingsAfterTypingToWord):
* testing/Internals.h:
* testing/Internals.idl:

Add an internal testing helper to determine whether retro sentence corrections are enabled.

LayoutTests:

Adds 2 new spellchecking tests, and refactors some existing tests.

* editing/spelling/grammar-expected.txt:
* editing/spelling/grammar.html:
* editing/spelling/markers-expected.txt:
* editing/spelling/markers.html:

Tweaked so that these tests pass regardless of whether sentence retro correction is enabled or disabled.

* editing/spelling/retro-correction-spelling-markers-expected.txt: Added.
* editing/spelling/retro-correction-spelling-markers.html: Added.

Tests that typing at the end of a sentence will mark other parts of the sentence as misspellings, if retro
sentence correction is enabled.

* editing/spelling/spelling-changed-text-expected.txt:
* editing/spelling/spelling-changed-text.html:

Tweaked to correctly wait for the marker range to become the expected value.

* editing/spelling/spelling-markers-after-pasting-sentence-expected.txt: Added.
* editing/spelling/spelling-markers-after-pasting-sentence.html: Added.

Tests that after pasting a sentence with misspelled words, those misspelled words will be marked as misspellings.

* platform/ios/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/mac-wk2/TestExpectations:

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

14 months agoDataInteractionTests ContentEditableToTextarea and ContentEditableToContentEditable...
wenson_hsieh@apple.com [Wed, 6 Jun 2018 00:50:54 +0000 (00:50 +0000)]
DataInteractionTests ContentEditableToTextarea and ContentEditableToContentEditable are failing on recent iOS 12
https://bugs.webkit.org/show_bug.cgi?id=186325
<rdar://problem/40527850>

Reviewed by Tim Horton.

Tweak these API tests so that they're robust against changes to how NSAttributedStrings are serialized in item
providers ("public.rtf" vs. "com.apple.flat-rtfd"). Across all versions of iOS, just verify that either rich
text type is present in the list of dragged type identifiers, and that the rich text type is placed at a higher
fidelity than plain text.

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(checkRichTextTypePrecedesPlainTextType):
(TestWebKitAPI::TEST):
(checkTypeIdentifierPrecedesOtherTypeIdentifier): Deleted.

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

14 months ago[Cocoa] Retire DispatchPtr, and add more move semantics and simpler #ifs to other...
darin@apple.com [Wed, 6 Jun 2018 00:18:27 +0000 (00:18 +0000)]
[Cocoa] Retire DispatchPtr, and add more move semantics and simpler #ifs to other smart pointers
https://bugs.webkit.org/show_bug.cgi?id=186324

Reviewed by Anders Carlsson.

Source/WebCore:

* platform/FileMonitor.h: Use OSObjectPtr instead of DispatchPtr.
* platform/cocoa/FileMonitorCocoa.mm:
(WebCore::FileMonitor::FileMonitor): Ditto.

Source/WebKit:

* NetworkProcess/cache/NetworkCacheData.h: Use OSObjectPtr instead of
DispatchPtr and also use an rvalue reference in the constructor.
* NetworkProcess/cache/NetworkCacheDataCocoa.mm:
(WebKit::NetworkCache::Data::Data): Use adoptOSObject, rvalue reference
and WTFMove.
(WebKit::NetworkCache::Data::empty): Use OSObjectPtr.
(WebKit::NetworkCache::Data::data const): Use adoptOSObject.
(WebKit::NetworkCache::Data::subrange const): Ditto.
(WebKit::NetworkCache::concatenate): Ditto.
(WebKit::NetworkCache::Data::adoptMap): Ditto. Also use WTFMove.

* NetworkProcess/cache/NetworkCacheIOChannel.h: Use OSObjectPtr.
* NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
(WebKit::NetworkCache::IOChannel::IOChannel): Use adoptOSObject.
(WebKit::NetworkCache::IOChannel::read): Use OSObjectPtr.

Source/WTF:

* WTF.xcodeproj/project.pbxproj: Removed DispatchPtr.h.
* wtf/BlockPtr.h: Remove unneeded checks for __OBJC__. Added some use
of WTFMove.
* wtf/CMakeLists.txt: Removed DispatchPtr.h.
* wtf/DispatchPtr.h: Removed. We no longer need to support Mavericks.
* wtf/OSObjectPtr.h: Remove unneeded checks for __OBJC__. Added some use
of WTFMove.

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

14 months agoUnreviewed, fix the macOS build with recent SDKs.
ryanhaddad@apple.com [Wed, 6 Jun 2018 00:15:08 +0000 (00:15 +0000)]
Unreviewed, fix the macOS build with recent SDKs.

* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::paintContents):

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

14 months agoAdjust compile and runtime flags to match shippable state of features
bfulgham@apple.com [Tue, 5 Jun 2018 23:31:25 +0000 (23:31 +0000)]
Adjust compile and runtime flags to match shippable state of features
https://bugs.webkit.org/show_bug.cgi?id=186319
<rdar://problem/40352045>

Reviewed by Maciej Stachowiak, Jon Lee, and others.

Source/JavaScriptCore:

This patch revises the compile time and runtime state for various features to match their
suitability for end-user releases.

* Configurations/DebugRelease.xcconfig: Update to match WebKit definition of
WK_RELOCATABLE_FRAMEWORKS so that ENABLE(EXPERIMENTAL_FEATURES) is defined properly for
Cocoa builds.
* Configurations/FeatureDefines.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
or ENABLE_INPUT_TYPE_COLOR_POPOVER.
* runtime/Options.h: Only enable INTL_NUMBER_FORMAT_TO_PARTS and INTL_PLURAL_RULES
at runtime for non-production builds.

Source/WebCore:

* Configurations/FeatureDefines.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
or ENABLE_INPUT_TYPE_COLOR_POPOVER.

Source/WebCore/PAL:

* Configurations/DebugRelease.xcconfig: Update to match WebKit definition of
WK_RELOCATABLE_FRAMEWORKS so that ENABLE(EXPERIMENTAL_FEATURES) is defined properly for
Cocoa builds.
* Configurations/FeatureDefines.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
or ENABLE_INPUT_TYPE_COLOR_POPOVER.

Source/WebKit:

Change the default state of various experimental features so that they are off by default in production
builds, since they are still under development.

Turn 'CacheAPIEnabled' and 'SubresourceIntegrityEnabled' on by default, since both features have been
shipping for a full cycle and have proven to be stable in production.

* Configurations/FeatureDefines.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
or ENABLE_INPUT_TYPE_COLOR_POPOVER.
* Shared/WebPreferences.yaml:

Source/WebKitLegacy/mac:

* Configurations/DebugRelease.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
or ENABLE_INPUT_TYPE_COLOR_POPOVER.
* Configurations/FeatureDefines.xcconfig: Update to match WebKit definition of
WK_RELOCATABLE_FRAMEWORKS so that ENABLE(EXPERIMENTAL_FEATURES) is defined properly for
Cocoa builds.

Tools:

This patch revises the compile time and runtime state for various features to match their
suitability for end-user releases.

* TestWebKitAPI/Configurations/DebugRelease.xcconfig: Update to match WebKit definition of
WK_RELOCATABLE_FRAMEWORKS so that ENABLE(EXPERIMENTAL_FEATURES) is defined properly for
Cocoa builds.
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
or ENABLE_INPUT_TYPE_COLOR_POPOVER.

LayoutTests:

* platform/mac/TestExpectations:
* platform/mac/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-badInput-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-willValidate-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/selection-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/readwrite-readonly-expected.txt: Added.

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

14 months agoTemporarily Skip JSC stress test failures that are consistently occurring.
commit-queue@webkit.org [Tue, 5 Jun 2018 22:57:06 +0000 (22:57 +0000)]
Temporarily Skip JSC stress test failures that are consistently occurring.
https://bugs.webkit.org/show_bug.cgi?id=186283

Unreviewed test gardening.

Patch by David Fenton <david_fenton@apple.com> on 2018-06-05

* executableAllocationFuzz.yaml:
* slowMicrobenchmarks/default-derived-constructor.js:
* stress/put-direct-index-broken-2.js:
* stress/splay-flash-access.js:
* stress/spread-forward-call-varargs-stack-overflow.js:

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

14 months agoWeb Inspector: Tab picker is briefly visible when TabBar initially shown
mattbaker@apple.com [Tue, 5 Jun 2018 22:41:00 +0000 (22:41 +0000)]
Web Inspector: Tab picker is briefly visible when TabBar initially shown
https://bugs.webkit.org/show_bug.cgi?id=186317

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TabBar.js:
(WI.TabBar): Picker should be initially hidden.

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

14 months agoClean up LocalDefaultSystemAppearance and prefers-dark-interface media query
timothy@apple.com [Tue, 5 Jun 2018 22:26:58 +0000 (22:26 +0000)]
Clean up LocalDefaultSystemAppearance and prefers-dark-interface media query

https://bugs.webkit.org/show_bug.cgi?id=186323
rdar://problem/38382252

Reviewed by Tim Horton.

Source/WebCore:

* css/MediaFeatureNames.h:
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersDarkInterfaceEvaluate):
(WebCore::defaultAppearanceEvaluate): Deleted.
* css/MediaQueryExpression.cpp:
(WebCore::featureWithValidIdent):
(WebCore::isFeatureValidWithoutValue):
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):

Source/WebKit:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _defaultAppearance]):
* UIProcess/API/mac/WKView.mm:
(-[WKView _defaultAppearance]):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::useDefaultAppearance):

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView _defaultAppearance]):

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

14 months ago[iOS] TestWebKitAPI.WebKit.WKHTTPCookieStoreWithoutProcessPool fails because cookies...
sihui_liu@apple.com [Tue, 5 Jun 2018 22:09:48 +0000 (22:09 +0000)]
[iOS] TestWebKitAPI.WebKit.WKHTTPCookieStoreWithoutProcessPool fails because cookies aren't flushed to file
https://bugs.webkit.org/show_bug.cgi?id=186303
<rdar://problem/40468716>

Reviewed by Geoffrey Garen.

No matter there is an observer or not, cookies in UI process should always be flushed to
file when new process pool is created, such that cookies created via API can be synced to
network process.

* UIProcess/API/APIHTTPCookieStore.cpp:
(API::HTTPCookieStore::HTTPCookieStore):
(API::HTTPCookieStore::registerObserver):
(API::HTTPCookieStore::cookieManagerDestroyed):
(API::HTTPCookieStore::registerForNewProcessPoolNotifications):

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

14 months agosecheuristic should only use touch began and ended, not changed.
commit-queue@webkit.org [Tue, 5 Jun 2018 21:29:05 +0000 (21:29 +0000)]
secheuristic should only use touch began and ended, not changed.
https://bugs.webkit.org/show_bug.cgi?id=186318
rdar://problem/39781486

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-06-05
Reviewed by Jer Noble.

Filter out change events so swiping gestures don't trigger the heuristic.

* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController _touchDetected:]):

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

14 months ago[Cocoa] More preparation for ARC, focusing on WebKit and smart pointers
darin@apple.com [Tue, 5 Jun 2018 20:58:14 +0000 (20:58 +0000)]
[Cocoa] More preparation for ARC, focusing on WebKit and smart pointers
https://bugs.webkit.org/show_bug.cgi?id=186314

Reviewed by Anders Carlsson.

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Use __bridge for cast.
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::overrideSystemProxies): Ditto.
(WebKit::NetworkProcess::allowSpecificHTTPSCertificateForHost): Ditto.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendMessage): Ditto.
(IPC::readFromMachPort): Ditto.

* Platform/mac/StringUtilities.mm:
(WebKit::formattedPhoneNumberString): Use __bridge for cast and
CFBridgingRelease instead of an explicit autorelease.

* Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
(initializeMethods): Use auto instead of an explicit type so that we get
the correct type for the result of protocol_copyProtocolList.

* Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
(-[_WKRemoteObjectRegistry _sendInvocation:interface:]): Added a
bridging cast to void* because that's needed to call _Block_signature
under ARC and harmless outside ARC.

* Shared/API/c/cf/WKStringCF.mm:
(WKStringCreateWithCFString): Use __bridge for cast.
* Shared/API/c/cf/WKURLCF.mm:
(WKURLCreateWithCFURL): Ditto.
* Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
(WebKit::AuthenticationManager::initializeConnection): Ditto.
* Shared/Cocoa/DataDetectionResult.mm:
(WebKit::DataDetectionResult::encode const): Ditto.
(WebKit::DataDetectionResult::decode): Ditto.
* Shared/Cocoa/WKNSError.mm:
(-[WKNSError _web_createTarget]): Ditto.
* Shared/Cocoa/WKNSURLExtras.mm:
(-[NSURL _web_originalDataAsWTFString]): Ditto.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
(WebKit::XPCServiceInitializer): Removed balanced calls to both
adoptOSObject and xpc_retain and instead rely on the assignment
operator just added to OSObjectPtr.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
(WebKit::XPCServiceEventHandler): Use __bridge for cast.
* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer): Ditto.
* Shared/cf/ArgumentCodersCF.cpp:
(IPC::decode): Ditto.
* Shared/mac/ArgumentCodersMac.mm:
(IPC::isSerializableValue): Ditto.
(IPC::encode): Ditto.
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::encodeNSError): Ditto. Also use CFSTR("")" instead of @""
when we need a CFString.
(IPC::decodeNSError): Ditto.
(IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
(IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
(IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
(IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
(IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
* Shared/mac/WebHitTestResultData.mm:
(WebKit::WebHitTestResultData::platformEncode const): Ditto.
(WebKit::WebHitTestResultData::platformDecode): Ditto.
* UIProcess/API/C/mac/WKContextPrivateMac.mm:
(WKContextIsPlugInUpdateAvailable): Ditto.
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(-[WKBrowsingContextController certificateChain]): Ditto.
(didStartProvisionalLoadForFrame): Ditto.
(didReceiveServerRedirectForProvisionalLoadForFrame): Ditto.
(didFailProvisionalLoadWithErrorForFrame): Ditto.
(didCommitLoadForFrame): Ditto.
(didFinishLoadForFrame): Ditto.
(didFailLoadWithErrorForFrame): Ditto.
(canAuthenticateAgainstProtectionSpaceInFrame): Ditto.
(didReceiveAuthenticationChallengeInFrame): Ditto.
(didStartProgress): Ditto.
(didChangeProgress): Ditto.
(didFinishProgress): Ditto.
(didChangeBackForwardList): Ditto.
(processDidCrash): Ditto.
(setUpPageLoaderClient): Ditto.
(setUpPagePolicyClient): Ditto.
* UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
(createWKArray): Ditto.
(-[WKBrowsingContextGroup addUserStyleSheet:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:mainFrameOnly:]): Ditto.
(-[WKBrowsingContextGroup addUserScript:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:injectionTime:mainFrameOnly:]): Ditto.
* UIProcess/API/Cocoa/WKConnection.mm:
(didReceiveMessage): Ditto.
(didClose): Ditto.
(setUpClient): Ditto.
* UIProcess/API/Cocoa/WKProcessGroup.mm:
(didCreateConnection): Ditto.
(getInjectedBundleInitializationUserData): Ditto.
(setUpInjectedBundleClient): Ditto.
(-[WKProcessGroup _setAllowsSpecificHTTPSCertificate:forHost:]): Ditto.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _setAllowsSpecificHTTPSCertificate:forHost:]): Ditto.
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _setProxyConfiguration:]): Ditto.
(-[WKWebsiteDataStore _proxyConfiguration]): Ditto.
* UIProcess/API/Cocoa/_WKThumbnailView.mm:
(-[_WKThumbnailView _didTakeSnapshot:]): Ditto.

* UIProcess/API/Cocoa/_WKUserContentFilter.mm: Added a missing include.

* UIProcess/Authentication/mac/WebCredentialMac.mm:
(WebKit::chain): Use __bridge for cast.

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
Use CFBridgingRelease instead of adoptNS.
(WebKit::privateBrowsingSession): Use __bridge for cast.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::provideDataForPasteboard): Use __bridge for cast.
* UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
(WebKit::PluginInfoStore::pluginPathsInDirectory): Ditto.
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::recursivelyMapIOSurfaceBackingStore): Ditto.
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::beginSwipeGesture): Ditto.
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController enterFullScreen:]): Ditto.
* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::showPopupMenu): Ditto.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
(didCreatePage): Ditto.
(willDestroyPage): Ditto.
(setUpBundleClient): Ditto.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(didStartProvisionalLoadForFrame): Ditto.
(didReceiveServerRedirectForProvisionalLoadForFrame): Ditto.
(didFinishLoadForFrame): Ditto.
(globalObjectIsAvailableForFrame): Ditto.
(didRemoveFrameFromHierarchy): Ditto.
(didCommitLoadForFrame): Ditto.
(didFinishDocumentLoadForFrame): Ditto.
(didFailProvisionalLoadWithErrorForFrame): Ditto.
(didFailLoadWithErrorForFrame): Ditto.
(didSameDocumentNavigationForFrame): Ditto.
(didLayoutForFrame): Ditto.
(didReachLayoutMilestone): Ditto.
(didFirstVisuallyNonEmptyLayoutForFrame): Ditto.
(didHandleOnloadEventsForFrame): Ditto.
(userAgentForURL): Ditto.
(setUpPageLoaderClient): Ditto.
(willSendRequestForFrame): Ditto.
(didInitiateLoadForResource): Ditto.
(didFinishLoadForResource): Ditto.
(didFailLoadForResource): Ditto.
(setUpResourceLoadClient): Ditto.
* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::initialize): Ditto.
* WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
(WebKit::NetscapePlugin::popUpContextMenu): Ditto.

* WebProcess/Plugins/PDF/PDFPlugin.h: Put functions that return NSData inside
an #ifdef __OBJC__ and use __bridge for cast.

* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::declareAndWriteDragImage): Use __bridge for cast.

* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
(WebKit::PlatformCALayerRemoteCustom::contents const): Added a bridging cast.
(WebKit::PlatformCALayerRemoteCustom::setContents): Use __bridge for cast.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom): Ditto.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::setTopOverhangImage): Ditto.
(WebKit::WebPage::setBottomOverhangImage): Ditto.

Source/WTF:

* wtf/BlockPtr.h: Put Block_copy/release calls into #if since they are
not needed under ARC.

* wtf/OSObjectPtr.h: Added constructor and assignment operator so we can
work with OS objects without adopting them.

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

14 months ago[Cocoa] Improve some soft linking compatibility with ARC
darin@apple.com [Tue, 5 Jun 2018 19:13:43 +0000 (19:13 +0000)]
[Cocoa] Improve some soft linking compatibility with ARC
https://bugs.webkit.org/show_bug.cgi?id=186309

Reviewed by Anders Carlsson.

Source/WebCore:

* platform/audio/ios/AudioSessionIOS.mm: Use SOFT_LINK_CONSTANT instead of SOFT_LINK_POINTER
for NSString constants.
* platform/audio/ios/MediaSessionManagerIOS.mm: Ditto.
* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: Ditto.
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm: Ditto.
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm: Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState): Use __bridge for
some bridging casts.
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: Use
SOFT_LINK_CONSTANT instead of SOFT_LINK_POINTER for NSString constants.
* platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: Ditto.
* platform/mediastream/mac/AVCaptureDeviceManager.mm: Ditto.
* platform/mediastream/mac/AVMediaCaptureSource.mm: Ditto.
* platform/mediastream/mac/AVVideoCaptureSource.mm: Ditto.

Source/WTF:

* wtf/cocoa/SoftLinking.h: Updated the SOFT_LINK_CONSTANT family of
macros to use a const type. This increases the chance that they will
work without triggering ARC compilation errors since it's easier to
get the type right for read-only access than for read/write.

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

14 months agoWeb Inspector: Text in "Add New Class" in auto-capitalizes
nvasilyev@apple.com [Tue, 5 Jun 2018 19:07:12 +0000 (19:07 +0000)]
Web Inspector: Text in "Add New Class" in auto-capitalizes
https://bugs.webkit.org/show_bug.cgi?id=186311

Reviewed by Matt Baker.

Disable spellcheck to prevent auto-capitalization.

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

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

14 months agorun-testmem should have a dry run option and an option to parse the stdout of executi...
sbarati@apple.com [Tue, 5 Jun 2018 18:54:10 +0000 (18:54 +0000)]
run-testmem should have a dry run option and an option to parse the stdout of executing the dry run
https://bugs.webkit.org/show_bug.cgi?id=186293

Reviewed by Mark Lam.

This makes it easier to execute run-testmem on a device that doesn't have ruby
on it. run-testmem now has a --dry option that will output commands to execute
in bash. To run on a device that doesn't have ruby, just put its output into
a bash script, and copy the PerformanceTests/testmem directory onto that device,
and execute the bash script. Running that bash script will give you raw output.
Make a file with that output and pass it into run-testmem using the --parse option.
run-testmem will parse the raw output and compute the benchmark score.

* Scripts/run-testmem:

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

14 months agoServiceWorker registration should store any script fetched through importScripts
youenn@apple.com [Tue, 5 Jun 2018 18:50:41 +0000 (18:50 +0000)]
ServiceWorker registration should store any script fetched through importScripts
https://bugs.webkit.org/show_bug.cgi?id=182444
<rdar://problem/37164835>

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/registration-mime-types.https-expected.txt:

Source/WebCore:

Covered by added test http/wpt/service-workers/persistent-importScripts.html.

Update importScripts implementation to look for/update the resource map in case of service worker scope.
This resource map is stored persistently and sent when running the service worker.

Add support to persistent storage of this resource map.
This requires updating the schema database.
The schema version is bumped to 2 and we delete any data related to old registrations.

When updating the service worker, the resource map is currently flushed so that all scripts will be retrieved from the network.

Did some limited refactoring to put more loading handling in WorkerScriptLoader.

* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::importScripts):
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):
(WebCore::WorkerScriptLoader::script):
* workers/WorkerScriptLoader.h:
* workers/service/ServiceWorkerContextData.cpp:
(WebCore::ServiceWorkerContextData::isolatedCopy const):
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::ImportedScript::isolatedCopy const):
(WebCore::ServiceWorkerContextData::ImportedScript::encode const):
(WebCore::ServiceWorkerContextData::ImportedScript::decode):
(WebCore::ServiceWorkerContextData::encode const):
(WebCore::ServiceWorkerContextData::decode):
* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::scriptResource const):
(WebCore::ServiceWorkerGlobalScope::setScriptResource):
* workers/service/ServiceWorkerGlobalScope.h:
* workers/service/context/SWContextManager.h:
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::v1RecordsTableSchema):
(WebCore::RegistrationDatabase::doPushChanges):
(WebCore::RegistrationDatabase::importRecords):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistrationFromStore):
(WebCore::SWServer::updateWorker):
(WebCore::SWServer::installContextData):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):
* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::SWServerToContextConnection::setScriptResource):
* workers/service/server/SWServerToContextConnection.h:
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::SWServerWorker):
(WebCore::m_scriptResourceMap):
(WebCore::SWServerWorker::contextData const):
(WebCore::SWServerWorker::setScriptResource):
* workers/service/server/SWServerWorker.h:

Source/WebKit:

Add C API to kill storage process.
In case a Storage Process is closed or crashed, ensure that all its related service worker processes also exit.

* StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
* UIProcess/API/C/WKContext.cpp:
(WKContextTerminateStorageProcess):
* UIProcess/API/C/WKContextPrivate.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::webToStorageProcessConnectionClosed):
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::setScriptResource):
* WebProcess/Storage/WebSWContextManagerConnection.h:

Source/WTF:

* wtf/persistence/PersistentCoders.h:

Tools:

Add support to crash the storage process from Internals.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::terminateStorageProcess):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::terminateStorageProcess):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):

LayoutTests:

* http/wpt/service-workers/persistent-importScripts-expected.txt: Added.
* http/wpt/service-workers/persistent-importScripts.html: Added.
* http/wpt/service-workers/resources/persistent-importScripts-script.py: Added.
* http/wpt/service-workers/resources/persistent-importScripts-worker.js: Added.
* http/wpt/service-workers/resources/routines.js: Added.

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

14 months agoRevise DEFAULT_EXPERIMENTAL_FEATURES_ENABLED to work properly on Apple builds
bfulgham@apple.com [Tue, 5 Jun 2018 18:14:00 +0000 (18:14 +0000)]
Revise DEFAULT_EXPERIMENTAL_FEATURES_ENABLED to work properly on Apple builds
https://bugs.webkit.org/show_bug.cgi?id=186286
<rdar://problem/40782992>

Reviewed by Dan Bernstein.

Use the WK_RELOCATABLE_FRAMEWORKS flag (which is always defined for non-production builds)
to define ENABLE(EXPERIMENTAL_FEATURES) so that we do not need to manually
change this flag when preparing for a production release.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to determine
whether experimental features should be enabled, and use it to properly define the
feature flag.

Source/WebCore:

* Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to determine
whether experimental features should be enabled, and use it to properly define the
feature flag.

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to determine
whether experimental features should be enabled, and use it to properly define the
feature flag.

Source/WebKit:

* Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to determine whether
experimental features should be enabled, and use it to properly define the feature flag.
* Shared/WebPreferencesDefaultValues.h:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to determine
whether experimental features should be enabled, and use it to properly define the
feature flag.

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to
determine whether experimental features should be enabled, and use it to properly define
the feature flag.

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