2017-08-18 Said Abou-Hallawa Followup (r220289): RenderImageResourceStyleImage code clean up https://bugs.webkit.org/show_bug.cgi?id=175444 Reviewed by Darin Adler. RenderImageResourceStyleImage may be created with a StyleImage of type StyleGeneratedImage. It may also be associated with a CachedImage which is loaded through a source URL. In this case, adding and removing m_renderer as a client of the CachedImage will be done through RenderImageResource::setCachedImage(). RenderImageResource::setCachedImage() is already called from ImageLoader::updateRenderer() when the CachedImage finishes loading. This call adds m_renderer to the clients of the CachedImage. RenderImageResource::setCachedImage() will also be called from RenderImageResourceStyleImage::shutdown() via RenderImageResource::shutdown() to remove m_renderer from the clients of CachedImage by passing a null pointer. * rendering/RenderImage.cpp: (WebCore::RenderImage::styleWillChange): * rendering/RenderImageResource.cpp: (WebCore::RenderImageResource::initialize): (WebCore::RenderImageResource::shutdown): (WebCore::RenderImageResource::setCachedImage): (WebCore::RenderImageResource::resetAnimation): (WebCore::RenderImageResource::image const): (WebCore::RenderImageResource::setContainerSizeForRenderer): (WebCore::RenderImageResource::imageSize const): (WebCore::RenderImageResource::~RenderImageResource): Deleted. (WebCore::RenderImageResource::errorOccurred const): Deleted. (WebCore::RenderImageResource::imageHasRelativeWidth const): Deleted. (WebCore::RenderImageResource::imageHasRelativeHeight const): Deleted. (WebCore::RenderImageResource::intrinsicSize const): Deleted. (WebCore::RenderImageResource::getImageSize const): Deleted. * rendering/RenderImageResource.h: (WebCore::RenderImageResource::initialize): (WebCore::RenderImageResource::renderer const): (WebCore::RenderImageResource::errorOccurred const): (WebCore::RenderImageResource::imageHasRelativeWidth const): (WebCore::RenderImageResource::imageHasRelativeHeight const): (WebCore::RenderImageResource::imageSize const): (WebCore::RenderImageResource::intrinsicSize const): (WebCore::RenderImageResource::imagePtr const): * rendering/RenderImageResourceStyleImage.cpp: (WebCore::RenderImageResourceStyleImage::initialize): (WebCore::RenderImageResourceStyleImage::shutdown): (WebCore::RenderImageResourceStyleImage::image const): (WebCore::RenderImageResourceStyleImage::setContainerSizeForRenderer): (WebCore::RenderImageResourceStyleImage::~RenderImageResourceStyleImage): Deleted. * rendering/RenderImageResourceStyleImage.h: * rendering/RenderSnapshottedPlugIn.cpp: (WebCore::RenderSnapshottedPlugIn::RenderSnapshottedPlugIn): * rendering/svg/RenderSVGImage.cpp: (WebCore::RenderSVGImage::RenderSVGImage): 2017-08-18 Jiewen Tan [WebCrypto][Mac] Replace CCECCryptorGetKeyComponents with CCECCryptorExportKey for exporting ECC JWKs https://bugs.webkit.org/show_bug.cgi?id=175657 Reviewed by Brent Fulgham. CCECCryptorGetKeyComponents returns components in unpadded formats. In some minor cases, the ECC components do need padding. Therefore, we occasionally see some corrupted outputs in JWKs. To overcome that, this patch replaces CCECCryptorGetKeyComponents with CCECCryptorExportKey which does padding all the time. In the meantime, this patch also makes export* methods return OperationError if any error occur in the underlying operations though very unlikely. Test: crypto/subtle/ecdsa-generate-export-import-jwk-sign-verify.html * crypto/algorithms/CryptoAlgorithmECDH.cpp: (WebCore::CryptoAlgorithmECDH::exportKey): * crypto/algorithms/CryptoAlgorithmECDSA.cpp: (WebCore::CryptoAlgorithmECDSA::exportKey): * crypto/gcrypt/CryptoKeyECGCrypt.cpp: (WebCore::CryptoKeyEC::platformAddFieldElements const): * crypto/keys/CryptoKeyEC.cpp: (WebCore::CryptoKeyEC::exportRaw const): (WebCore::CryptoKeyEC::exportJwk const): (WebCore::CryptoKeyEC::exportSpki const): (WebCore::CryptoKeyEC::exportPkcs8 const): * crypto/keys/CryptoKeyEC.h: * crypto/mac/CryptoKeyECMac.cpp: (WebCore::CryptoKeyEC::platformExportRaw const): (WebCore::CryptoKeyEC::platformAddFieldElements const): (WebCore::CryptoKeyEC::platformExportSpki const): (WebCore::CryptoKeyEC::platformExportPkcs8 const): 2017-08-18 Per Arne Vollan [Win] accessibility/heading-crash-after-hidden.html is a flaky crash. https://bugs.webkit.org/show_bug.cgi?id=173536 Reviewed by Brent Fulgham. If the tree state is dirty, accessible objects are deleted while iterating over children under AccessibilityNodeObject::textUnderElement when the style is updated. Make sure the style is updated before this method is called. No new tests, covered by existing tests. * accessibility/win/AccessibilityObjectWrapperWin.cpp: (WebCore::AccessibilityObjectWrapper::accessibilityAttributeValue): 2017-08-18 Youenn Fablet [Cache API] Add response body storage https://bugs.webkit.org/show_bug.cgi?id=175658 Reviewed by Alex Christensen. Covered by rebased tests. Tests are still flaky until waiting for end of fetch load is implemented. Adding a response body within CacheStorageConnection::Record. Adding ability to pass this body from/to the main thread. Adding response body consumption into a CacheStorageConnection::Record. Adding response body setting from a CacheStorageConnection::Record. * Modules/beacon/NavigatorBeacon.cpp: (WebCore::NavigatorBeacon::sendBeacon): * Modules/cache/Cache.cpp: (WebCore::Cache::put): (WebCore::toConnectionRecord): (WebCore::Cache::updateRecords): * Modules/cache/CacheStorageConnection.cpp: (WebCore::CacheStorageConnection::copyResponseBody): (WebCore::CacheStorageConnection::isolatedResponseBody): (WebCore::CacheStorageConnection::Record::copy const): * Modules/cache/CacheStorageConnection.h: * Modules/cache/WorkerCacheStorageConnection.cpp: (WebCore::toCrossThreadRecordData): (WebCore::fromCrossThreadRecordData): * Modules/fetch/FetchBody.cpp: (WebCore::FetchBody::bodyAsFormData const): (WebCore::FetchBody::take): (WebCore::FetchBody::bodyForInternalRequest const): Deleted. * Modules/fetch/FetchBody.h: (WebCore::FetchBody::setAsFormData): * Modules/fetch/FetchBodyConsumer.h: (WebCore::FetchBodyConsumer::setData): * Modules/fetch/FetchRequest.cpp: (WebCore::FetchRequest::resourceRequest const): * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::consumeBody): (WebCore::FetchResponse::setBodyData): * Modules/fetch/FetchResponse.h: 2017-08-18 Youenn Fablet [Fetch API] Add support for a callback-based fetch https://bugs.webkit.org/show_bug.cgi?id=175710 Reviewed by Alex Christensen. No change of behavior. Moving from a DOMPromise to a Callback taking an ExceptionOr. Updating window and worker call sites. * Modules/fetch/DOMWindowFetch.cpp: (WebCore::DOMWindowFetch::fetch): * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::fetch): (WebCore::FetchResponse::BodyLoader::didFail): (WebCore::FetchResponse::BodyLoader::BodyLoader): (WebCore::FetchResponse::BodyLoader::didReceiveResponse): (WebCore::FetchResponse::BodyLoader::stop): * Modules/fetch/FetchResponse.h: * Modules/fetch/WorkerGlobalScopeFetch.cpp: (WebCore::WorkerGlobalScopeFetch::fetch): 2017-08-18 Brady Eidson Bounce ServiceWorker jobs to the Storage Process. https://bugs.webkit.org/show_bug.cgi?id=175650 Reviewed by Andy Estes. No new tests (Covered by both changes and consistencies in existing tests) This lays the groundwork for the SW job queue being in the StorageProcess by actually setting up some objects for IPC communication and actually sending things over the wire. The main point of IPC is the WebCore abstract base class "SWServer::Connection" A collection of them will soon be managed by the SWServer itself in the StorageProcess. That object will be the stand-in for IPC on both the WebProcess and StorageProcess side. Currently, any job that we try to schedule still immediately rejects (though now it does so asynchronously instead of synchronously). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/ExceptionData.h: Copied from Source/WebCore/workers/service/ServiceWorkerProvider.h. (WebCore::ExceptionData::toException const): (WebCore::ExceptionData::encode const): (WebCore::ExceptionData::decode): * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::addRegistration): (WebCore::ServiceWorkerContainer::scheduleJob): * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerJob.cpp: (WebCore::ServiceWorkerJob::failedWithException): (WebCore::ServiceWorkerJob::data const): * workers/service/ServiceWorkerJob.h: * workers/service/ServiceWorkerJobData.h: Copied from Source/WebCore/workers/service/ServiceWorkerProvider.h. (WebCore::ServiceWorkerJobData::encode const): (WebCore::ServiceWorkerJobData::decode): * workers/service/ServiceWorkerJobType.h: Copied from Source/WebCore/workers/service/ServiceWorkerProvider.h. * workers/service/ServiceWorkerProvider.h: * workers/service/ServiceWorkerRegistrationParameters.h: * workers/service/server/SWServer.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp. (WebCore::SWServer::Connection::scheduleJob): (WebCore::SWServer::Connection::jobRejected): * workers/service/server/SWServer.h: Copied from Source/WebCore/workers/service/ServiceWorkerProvider.h. (WebCore::SWServer::Connection::~Connection): 2017-08-18 Chris Dumez [Beacon] Add support for quota limitation https://bugs.webkit.org/show_bug.cgi?id=175443 Reviewed by Youenn Fablet. LoaderStrategy::startPingLoad() now takes a completion handler parameter, allowing CachedResource::load() to know when a Beacon load is complete. This was needed in order for the fetch in-flight keepalive request quota limit to work properly for beacon loads as well. We need to know when the beacon load completes in order to know if the beacon is in-flight or not and only free up its allocated quota once it is no longer in-flight. No new tests, updated existing test. * loader/LoaderStrategy.h: * loader/PingLoader.cpp: (WebCore::PingLoader::startPingLoad): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::load): * platform/network/PingHandle.h: 2017-08-18 Youenn Fablet [Cache API] Add a WK2 implementation of CacheStorageConnection https://bugs.webkit.org/show_bug.cgi?id=175640 Reviewed by Alex Christensen & Chris Dumez. * Modules/cache/CacheStorageConnection.cpp: Adding Internal error. * Modules/cache/CacheStorageConnection.h: Ditto. * WebCore.xcodeproj/project.pbxproj: Exporting CacheQueryOptions.h header. 2017-08-18 Antti Koivisto Factor render tree mutation code from RenderListItem to RenderTreeUpdater https://bugs.webkit.org/show_bug.cgi?id=175718 Reviewed by Andreas Kling. We already stopped doing layout time mutations. We can now move the code out too. * WebCore.xcodeproj/project.pbxproj: * rendering/RenderListItem.cpp: (WebCore::isHTMLListElement): (WebCore::getParentOfFirstLineBox): Deleted. (WebCore::firstNonMarkerChild): Deleted. (WebCore::RenderListItem::updateMarkerRenderer): Deleted. Moved to RenderTreeUpdater::ListItem. * rendering/RenderListItem.h: * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::willBeDestroyed): * rendering/TextAutoSizing.cpp: (WebCore::TextAutoSizingValue::adjustTextNodeSizes): * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::pushParent): (WebCore::RenderTreeUpdater::popParent): (WebCore::RenderTreeUpdater::updateBeforeDescendants): (WebCore::RenderTreeUpdater::updateAfterDescendants): Factor pre/post update into functions. (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement): * style/RenderTreeUpdater.h: * style/RenderTreeUpdaterListItem.cpp: Added. Mutation functions move here. (WebCore::getParentOfFirstLineBox): (WebCore::firstNonMarkerChild): (WebCore::RenderTreeUpdater::ListItem::updateMarker): * style/RenderTreeUpdaterListItem.h: Added. 2017-08-18 Ms2ger [GTK] Show controls if a video element isn't allowed to play inline. https://bugs.webkit.org/show_bug.cgi?id=141705 Reviewed by Xabier Rodriguez-Calvar. Test: covered by media/video-fullscreeen-only-controls.html [sic]. * Modules/mediacontrols/mediaControlsGtk.js: (ControllerGtk.prototype.shouldHaveControls): 2017-08-18 Zan Dobersek [EME] MediaKeySession has to initiate playback resume on HTMLMediaElement https://bugs.webkit.org/show_bug.cgi?id=175671 Reviewed by Xabier Rodriguez-Calvar. In MediaKeySession::updateKeyStatuses(), HTMLMediaElement objects that are associated with the MediaKeys instance that created this session have to be notified in order to run the 'Attempt to Resume Playback If Necessary' algorithm. MediaKeys object now tracks the sessions that were created through it. MediaKeySession object is passed a MediaKeys reference, and has that reference invalidated if/when the MediaKeys object is destroyed. In MediaKeySession::updateKeyStatuses(), a task is now queued, notifying the MediaKeys object, if any, that the associated HTMLMediaElement instances have to run the mentioned algorithm. The associated media elements are stored through CDMClient pointers, with HTMLMediaElement class inheriting from the newly-introduced CDMClient interface. HTMLMediaElement::cdmClientAttemptToResumePlaybackIfNecessary() is left unimplemented for now. The object will attach itself to and detach from the associated MediaKeys object in setMediaKeys() and the destructor, enabling the MediaKeys object to properly dispatch the playback resume requests for the attached clients. * Modules/encryptedmedia/CDMClient.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeys.h. (WebCore::CDMClient::~CDMClient): * Modules/encryptedmedia/MediaKeySession.cpp: (WebCore::MediaKeySession::create): (WebCore::MediaKeySession::MediaKeySession): (WebCore::MediaKeySession::detachKeys): (WebCore::MediaKeySession::updateKeyStatuses): * Modules/encryptedmedia/MediaKeySession.h: * Modules/encryptedmedia/MediaKeys.cpp: (WebCore::MediaKeys::~MediaKeys): (WebCore::MediaKeys::createSession): (WebCore::MediaKeys::attachCDMClient): (WebCore::MediaKeys::detachCDMClient): (WebCore::MediaKeys::attemptToResumePlaybackOnClients): * Modules/encryptedmedia/MediaKeys.h: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::cdmClientAttemptToResumePlaybackIfNecessary): * html/HTMLMediaElement.h: 2017-08-18 Commit Queue Unreviewed, rolling out r220854. https://bugs.webkit.org/show_bug.cgi?id=175716 I'm not sure we really need this (Requested by KaL on #webkit). Reverted changeset: "[GTK][WPE] Add NTLM authentication enabled API" https://bugs.webkit.org/show_bug.cgi?id=122952 http://trac.webkit.org/changeset/220854 2017-08-17 Wenson Hsieh [Input Events] Rename inputType "formatForeColor" to "formatFontColor" https://bugs.webkit.org/show_bug.cgi?id=175703 Reviewed by Ryosuke Niwa. Renames an inputType value to match the spec. There is no other change in behavior. Rebaselines fast/events/input-events-selection-forecolor-data.html and fast/events/input-events-forecolor-data.html. * editing/EditCommand.cpp: (WebCore::inputTypeNameForEditingAction): 2017-08-17 Daewoong Jang [Curl] Improve multi-threaded networking https://bugs.webkit.org/show_bug.cgi?id=175253 Reviewed by Alex Christensen. * platform/network/curl/CurlContext.cpp: (WebCore::CurlMultiHandle::CurlMultiHandle): (WebCore::CurlHandle::CurlHandle): (WebCore::CurlHandle::initialize): (WebCore::CurlHandle::setSslKeyPassword): (WebCore::CurlHandle::setSslErrors): (WebCore::CurlHandle::getSslErrors): * platform/network/curl/CurlContext.h: * platform/network/curl/CurlDownload.cpp: (WebCore::CurlDownload::init): (WebCore::CurlDownload::getResponse const): (WebCore::CurlDownload::setupRequest): (WebCore::CurlDownload::didReceiveHeader): (WebCore::CurlDownload::didReceiveData): (WebCore::CurlDownload::headerCallback): (WebCore::CurlDownload::getTempPath const): Deleted. (WebCore::CurlDownload::getUrl const): Deleted. (WebCore::CurlDownload::downloadFinishedCallback): Deleted. (WebCore::CurlDownload::downloadFailedCallback): Deleted. (WebCore::CurlDownload::receivedDataCallback): Deleted. (WebCore::CurlDownload::receivedResponseCallback): Deleted. * platform/network/curl/CurlDownload.h: * platform/network/curl/ResourceError.h: (WebCore::ResourceError::ResourceError): (WebCore::ResourceError::sslErrors const): (WebCore::ResourceError::setSSLErrors): Deleted. * platform/network/curl/ResourceHandleCurl.cpp: (WebCore::ResourceHandleInternal::initialize): (WebCore::ResourceHandleInternal::didFail): (WebCore::ResourceHandleInternal::dispatchSynchronousJob): * platform/network/curl/SSLHandle.cpp: (WebCore::allowedClientHosts): (WebCore::addAllowedClientCertificate): (WebCore::getSSLClientCertificate): (WebCore::certVerifyCallback): (WebCore::setSSLVerifyOptions): (WebCore::setSSLClientCertificate): Deleted. * platform/network/curl/SSLHandle.h: 2017-08-17 Chris Dumez Regression(r220817): We should only copy the original request headers for Ping loads https://bugs.webkit.org/show_bug.cgi?id=175679 Reviewed by Youenn Fablet. For performance reason, we should only copy the original request headers for Ping loads (Beacon at the moment), not for all CachedResourceRequests. * loader/LoaderStrategy.h: * loader/cache/CachedResource.cpp: (WebCore::CachedResource::CachedResource): (WebCore::CachedResource::load): * loader/cache/CachedResource.h: (WebCore::CachedResource::shouldUsePingLoad): (WebCore::CachedResource::setOriginalRequestHeaders): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestResource): * loader/cache/CachedResourceRequest.cpp: (WebCore::CachedResourceRequest::CachedResourceRequest): * loader/cache/CachedResourceRequest.h: (WebCore::CachedResourceRequest::releaseResourceRequest): (WebCore::CachedResourceRequest::releaseOriginalRequestHeaders): Deleted. 2017-08-17 Don Olmstead [PAL] Relocate SessionID to root https://bugs.webkit.org/show_bug.cgi?id=175684 Reviewed by Alex Christensen. No new tests. No change in functionality. * dom/Document.h: * html/HTMLMediaElement.cpp: * loader/cache/CachedResource.h: * loader/cache/CachedResourceLoader.cpp: * loader/cache/MemoryCache.h: * loader/cocoa/DiskCacheMonitorCocoa.h: * page/CacheStorageProvider.h: * page/Page.h: * page/PlugInClient.h: * page/SocketProvider.h: * platform/CookiesStrategy.h: * platform/WebCoreCrossThreadCopier.cpp: * platform/network/CacheValidation.h: * platform/network/NetworkStorageSession.cpp: * platform/network/NetworkStorageSession.h: * platform/network/cf/SocketStreamHandleImpl.h: * platform/network/curl/SocketStreamHandleImpl.h: * platform/network/soup/SocketStreamHandleImpl.h: * workers/WorkerGlobalScope.h: * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerRegistrationParameters.h: 2017-08-17 Wenson Hsieh Fix the build on other platforms after r220865 https://bugs.webkit.org/show_bug.cgi?id=175683 Reviewed by Tim Horton. Instead of special casing iOS 10 behavior with __IPHONE_OS_VERSION_MAX_ALLOWED < 110000, revert to special casing iOS 11 behavior with __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000. This is because other targets that are neither iOS 10 nor 11 will fail the "before iOS 11" compile-time check, and subsequently assume that item providers exist. To fix this, flip the compiler-time checks and the order of codeblocks in the PlatformPasteboard::write methods. There is no change in behavior. * platform/ios/PlatformPasteboardIOS.mm: (WebCore::registerItemToPasteboard): (WebCore::PlatformPasteboard::write): 2017-08-17 Michael Catanzaro -Wreturn-type warnings in CryptoKey.cpp and SubtleCrypto.cpp https://bugs.webkit.org/show_bug.cgi?id=175675 Reviewed by Jiewen Tan. * crypto/CryptoKey.cpp: (WebCore::CryptoKey::algorithm const): * crypto/SubtleCrypto.cpp: (WebCore::toCryptoKeyUsageBitmap): (WebCore::toKeyData): 2017-08-17 Andreas Kling Disable CSS regions at compile time https://bugs.webkit.org/show_bug.cgi?id=175630 Reviewed by Antti Koivisto. * Configurations/FeatureDefines.xcconfig: 2017-08-17 Wenson Hsieh [iOS] Respect type fidelities when copying image elements to the pasteboard https://bugs.webkit.org/show_bug.cgi?id=175638 Reviewed by Ryosuke Niwa. Ensures that we respect type fidelities when copying on iOS, by unifying pasteboard writing codepaths across dragging and copying. When dragging and copying, we now generate and set UIItemProviders on the UIPasteboard. Tests: ActionSheetTests.CopyImageElementWithHREF ActionSheetTests.CopyImageElementWithoutHREF * platform/PlatformPasteboard.h: Remove all variants of the writeObjectRepresentations helper method. Now that both paths for writing to the pasteboard are unified, it's no longer useful to separate out item-provider-based pasteboard logic. * platform/ios/AbstractPasteboard.h: * platform/ios/PlatformPasteboardIOS.mm: Replaces -setItemsUsingRegistrationInfoLists: with -setRegistrationInfoLists:. Rather than have a helper that both sets up item providers and item registration lists, split this functionality out into two setters. This is because UIPasteboard does not need to know about the registration info lists used to set up the item providers in the first place, but internal drag-and-drop clients require this information immediately when starting a drag in order to construct custom drag previews. (WebCore::richTextRepresentationsForPasteboardWebContent): (WebCore::registerItemToPasteboard): Add a new helper to register item providers to the pasteboard, given an WebItemProviderRegistrationInfoList. (WebCore::PlatformPasteboard::write): (WebCore::PlatformPasteboard::writeObjectRepresentations): Deleted. Refactors PlatformPasteboard::write to always generate and set item providers, unless we're building for an SDK prior to iOS 11. For images, strings and URLs, we can simply transition to using the new item-provider-based codepaths used for drag and drop. For web content, we add two additional UTIs that were present when copying, but not when dragging: flat RTFD and a string constant used to indicate to UIKit that the pasteboard contains rich text. * platform/ios/WebItemProviderPasteboard.h: * platform/ios/WebItemProviderPasteboard.mm: (-[WebItemProviderRegistrationInfoList init]): (-[WebItemProviderRegistrationInfoList addData:forType:]): (-[WebItemProviderRegistrationInfoList addRepresentingObject:]): (-[WebItemProviderRegistrationInfoList numberOfItems]): (-[WebItemProviderRegistrationInfoList itemAtIndex:]): (-[WebItemProviderRegistrationInfoList itemProvider]): (-[WebItemProviderRegistrationInfoList description]): Make some small tweaks in WebItemProviderPasteboard (and related classes): 1. Transition to preferredPresentationSize from estimatedDisplayedSize, which is now deprecated. 2. Remove calls to -initWithItemProviderData:typeIdentifier:error:, which is deprecated. 3. Rename _items to _representations to better reflect the role of WebItemProviderRegistrationInfo. 4. Implement -description for WebItemProviderRegistrationInfoList for debugging purposes. (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]): (-[WebItemProviderPasteboard setRegistrationInfoLists:]): (-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]): Deleted. 2017-08-17 Youenn Fablet Add a DOMPromiseDeferred method to handle ExceptionOr<> results https://bugs.webkit.org/show_bug.cgi?id=175603 Reviewed by Darin Adler. No change of behavior. Introduce DOMPromiseDeferred::settle to reject/resolve a promise with an ExceptionOr<>. Making batchPutOperation/batchDeleteOperation take a Function with an ExceptionOr<>. Using DOMPromiseDeferred::settle in Cache put/remove. Updated CacheStorageConnection to create ExceptionOr<> from CacheStorageConnection::Error. * Modules/cache/Cache.cpp: (WebCore::Cache::put): (WebCore::Cache::remove): (WebCore::Cache::batchDeleteOperation): (WebCore::Cache::batchPutOperation): * Modules/cache/Cache.h: * Modules/cache/CacheStorage.cpp: (WebCore::CacheStorage::open): (WebCore::CacheStorage::remove): * Modules/cache/CacheStorageConnection.cpp: (WebCore::CacheStorageConnection::errorToException): * Modules/cache/CacheStorageConnection.h: (WebCore::CacheStorageConnection::errorToException): (WebCore::CacheStorageConnection::exceptionOrResult): * bindings/js/JSDOMPromiseDeferred.h: (WebCore::DOMPromiseDeferred::settle): (WebCore::DOMPromiseDeferred::settle): 2017-08-17 Zan Dobersek [GStreamer] AppendPipeline: support dispatch of decryption-specific GstStructure into the pipeline https://bugs.webkit.org/show_bug.cgi?id=175668 Reviewed by Xabier Rodriguez-Calvar. Add the AppendPipeline::dispatchDecryptionStructure() method. Callers can pass in a GstStructure object that contains all the information the decryption elements in the pipeline will require to properly decrypt the content. In case the decryptor element isn't available yet, the GstStructure is stored and dispatched when that element becomes available. The dispatch itself simply creates a new custom GstEvent that adopts the given GstStructure object, sends that into the pipeline element, and shifts the state to 'ongoing'. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread): (WebCore::AppendPipeline::dispatchPendingDecryptionStructure): (WebCore::AppendPipeline::dispatchDecryptionStructure): * platform/graphics/gstreamer/mse/AppendPipeline.h: Remove a redundant private: label. 2017-08-17 Zan Dobersek [GStreamer] GstStructure shouldn't be handled through GRefPtr https://bugs.webkit.org/show_bug.cgi?id=175673 Reviewed by Xabier Rodriguez-Calvar. * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (webkitMediaCommonEncryptionDecryptTransformCaps): GstStructure isn't ref-counted, so it should be handled through the GUniquePtr smart pointer. 2017-08-17 Youenn Fablet [Mac/iOS] Increase the audio buffer size when audio capture is on but web audio is not used https://bugs.webkit.org/show_bug.cgi?id=175631 Reviewed by Eric Carlson. * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: (PlatformMediaSessionManager::updateSessionState): Change value from 128 to the equivalent of 20ms when audio capture happens but not web audio. 2017-08-17 Antti Koivisto RenderListItem - Avoid render tree mutation during layout https://bugs.webkit.org/show_bug.cgi?id=175666 Reviewed by Andreas Kling. Mutations should be done by RenderTreeUpdater only. * rendering/RenderListItem.cpp: (WebCore::RenderListItem::updateMarkerRenderer): This is now called by RenderTreeUpdater only. Remove code dealing with this being called at layout time. Merged marker construction code from styleDidChange here and renamed for clarity. (WebCore::RenderListItem::layout): (WebCore::RenderListItem::computePreferredLogicalWidths): Remove mutating calls. (WebCore::RenderListItem::styleDidChange): Deleted. (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded): Deleted. * rendering/RenderListItem.h: * rendering/TextAutoSizing.cpp: (WebCore::TextAutoSizingValue::adjustTextNodeSizes): Call updateMarkerRenderer. * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::popParent): (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement): Call updateMarkerRenderer. 2017-08-17 Don Olmstead [PAL] Move SessionID into PAL https://bugs.webkit.org/show_bug.cgi?id=174192 Reviewed by Antti Koivisto. No new tests. No change in behavior. * CMakeLists.txt: * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::connect): * WebCore.xcodeproj/project.pbxproj: * dom/Document.cpp: (WebCore::Document::sessionID const): * dom/Document.h: * dom/ScriptExecutionContext.h: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::elementWithID): (WebCore::HTMLMediaElement::finishParsingChildren): (WebCore::HTMLMediaElement::scheduleEvent): (WebCore::HTMLMediaElement::canPlayType const): (WebCore::HTMLMediaElement::load): (WebCore::HTMLMediaElement::loadResource): (WebCore::HTMLMediaElement::textTracksAreReady const): (WebCore::HTMLMediaElement::textTrackModeChanged): (WebCore::HTMLMediaElement::noneSupported): (WebCore::HTMLMediaElement::mediaLoadingFailedFatally): (WebCore::HTMLMediaElement::mediaLoadingFailed): (WebCore::HTMLMediaElement::setReadyState): (WebCore::HTMLMediaElement::addPlayedRange): (WebCore::HTMLMediaElement::seekTask): (WebCore::HTMLMediaElement::refreshCachedTime const): (WebCore::HTMLMediaElement::currentMediaTime const): (WebCore::HTMLMediaElement::setWebkitPreservesPitch): (WebCore::HTMLMediaElement::ended const): (WebCore::HTMLMediaElement::playInternal): (WebCore::HTMLMediaElement::pause): (WebCore::HTMLMediaElement::togglePlayState): (WebCore::HTMLMediaElement::beginScrubbing): (WebCore::HTMLMediaElement::playbackProgressTimerFired): (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack): (WebCore::HTMLMediaElement::didAddTextTrack): (WebCore::HTMLMediaElement::didRemoveTextTrack): (WebCore::controllerJSValue): (WebCore::HTMLMediaElement::configureTextTracks): (WebCore::HTMLMediaElement::selectNextSourceChild): (WebCore::HTMLMediaElement::sourceWasAdded): (WebCore::HTMLMediaElement::sourceWasRemoved): (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): (WebCore::HTMLMediaElement::potentiallyPlaying const): (WebCore::HTMLMediaElement::endedPlayback const): (WebCore::HTMLMediaElement::stoppedDueToErrors const): (WebCore::HTMLMediaElement::updatePlayState): (WebCore::HTMLMediaElement::userCancelledLoad): (WebCore::HTMLMediaElement::canSuspendForDocumentSuspension const): (WebCore::HTMLMediaElement::addEventListener): (WebCore::HTMLMediaElement::isFullscreen const): (WebCore::HTMLMediaElement::toggleStandardFullscreenState): (WebCore::HTMLMediaElement::waitForPreparedForInlineThen): (WebCore::HTMLMediaElement::setVideoFullscreenLayer): (WebCore::HTMLMediaElement::updateTextTrackDisplay): (WebCore::HTMLMediaElement::mediaControls const): (WebCore::HTMLMediaElement::configureTextTrackDisplay): (WebCore::HTMLMediaElement::setMediaGroup): (WebCore::HTMLMediaElement::setControllerForBindings): (WebCore::HTMLMediaElement::isBlockedOnMediaController const): (WebCore::HTMLMediaElement::prepareMediaFragmentURI): (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot): (WebCore::HTMLMediaElement::fileSize const): (WebCore::HTMLMediaElement::mediaSessionTitle const): (WebCore::needsSeekingSupportQuirk): (WebCore::HTMLMediaElement::supportsSeeking const): (WebCore::HTMLMediaElement::doesHaveAttribute const): (WebCore::HTMLMediaElement::isVideoTooSmallForInlinePlayback): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::continueAfterContentPolicy): * loader/EmptyClients.cpp: * loader/FrameLoaderClient.h: * loader/cache/CachedCSSStyleSheet.cpp: (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet): * loader/cache/CachedCSSStyleSheet.h: * loader/cache/CachedFont.cpp: (WebCore::CachedFont::CachedFont): * loader/cache/CachedFont.h: * loader/cache/CachedImage.cpp: (WebCore::CachedImage::CachedImage): * loader/cache/CachedImage.h: * loader/cache/CachedRawResource.cpp: (WebCore::CachedRawResource::CachedRawResource): * loader/cache/CachedRawResource.h: * loader/cache/CachedResource.cpp: (WebCore::CachedResource::CachedResource): * loader/cache/CachedResource.h: (WebCore::CachedResource::sessionID const): * loader/cache/CachedResourceLoader.cpp: (WebCore::createResource): (WebCore::CachedResourceLoader::sessionID const): * loader/cache/CachedResourceLoader.h: * loader/cache/CachedSVGDocument.cpp: (WebCore::CachedSVGDocument::CachedSVGDocument): * loader/cache/CachedSVGDocument.h: * loader/cache/CachedSVGFont.cpp: (WebCore::CachedSVGFont::CachedSVGFont): * loader/cache/CachedSVGFont.h: * loader/cache/CachedScript.cpp: (WebCore::CachedScript::CachedScript): * loader/cache/CachedScript.h: * loader/cache/CachedTextTrack.cpp: (WebCore::CachedTextTrack::CachedTextTrack): * loader/cache/CachedTextTrack.h: * loader/cache/CachedXSLStyleSheet.cpp: (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet): * loader/cache/CachedXSLStyleSheet.h: * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::sessionResourceMap const): (WebCore::MemoryCache::ensureSessionResourceMap): (WebCore::MemoryCache::resourceForRequest): (WebCore::MemoryCache::addImageToCache): (WebCore::MemoryCache::removeImageFromCache): (WebCore::MemoryCache::forEachSessionResource): (WebCore::MemoryCache::removeResourcesWithOrigins): (WebCore::MemoryCache::originsWithCache const): (WebCore::MemoryCache::evictResources): * loader/cache/MemoryCache.h: * loader/cocoa/DiskCacheMonitorCocoa.h: (WebCore::DiskCacheMonitor::sessionID const): * loader/cocoa/DiskCacheMonitorCocoa.mm: (WebCore::DiskCacheMonitor::monitorFileBackingStoreCreation): (WebCore::DiskCacheMonitor::DiskCacheMonitor): * page/CacheStorageProvider.h: * page/DatabaseProvider.h: * page/Page.cpp: (WebCore::Page::Page): (WebCore::Page::enableLegacyPrivateBrowsing): (WebCore::Page::sessionID const): (WebCore::Page::setSessionID): * page/Page.h: * page/PlugInClient.h: * page/SocketProvider.cpp: (WebCore::SocketProvider::createSocketStreamHandle): * page/SocketProvider.h: * platform/CookiesStrategy.h: * platform/WebCoreCrossThreadCopier.cpp: (WTF::PAL::SessionID>::copy): (WTF::WebCore::SessionID>::copy): Deleted. * platform/WebCoreCrossThreadCopier.h: * platform/network/CacheValidation.cpp: (WebCore::headerValueForVary): (WebCore::collectVaryingRequestHeaders): (WebCore::verifyVaryingRequestHeaders): * platform/network/CacheValidation.h: * platform/network/NetworkStorageSession.cpp: (WebCore::NetworkStorageSession::globalSessionMap): (WebCore::NetworkStorageSession::storageSession): (WebCore::NetworkStorageSession::destroySession): * platform/network/NetworkStorageSession.h: (WebCore::NetworkStorageSession::sessionID const): * platform/network/NetworkStorageSessionStub.cpp: (WebCore::NetworkStorageSession::NetworkStorageSession): (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): (WebCore::NetworkStorageSession::ensureSession): (WebCore::NetworkStorageSession::defaultStorageSession): * platform/network/cf/NetworkStorageSessionCFNet.cpp: (WebCore::NetworkStorageSession::NetworkStorageSession): (WebCore::NetworkStorageSession::switchToNewTestingSession): (WebCore::NetworkStorageSession::defaultStorageSession): (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): (WebCore::NetworkStorageSession::ensureSession): * platform/network/cf/SocketStreamHandleImpl.h: (WebCore::SocketStreamHandleImpl::create): * platform/network/cf/SocketStreamHandleImplCFNet.cpp: (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl): * platform/network/curl/SocketStreamHandleImpl.h: (WebCore::SocketStreamHandleImpl::create): * platform/network/soup/NetworkStorageSessionSoup.cpp: (WebCore::NetworkStorageSession::NetworkStorageSession): (WebCore::NetworkStorageSession::defaultStorageSession): (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): (WebCore::NetworkStorageSession::ensureSession): (WebCore::NetworkStorageSession::switchToNewTestingSession): * platform/network/soup/SocketStreamHandleImpl.h: * platform/network/soup/SocketStreamHandleImplSoup.cpp: (WebCore::SocketStreamHandleImpl::create): * workers/DedicatedWorkerGlobalScope.cpp: (WebCore::DedicatedWorkerGlobalScope::create): (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope): * workers/DedicatedWorkerGlobalScope.h: * workers/DedicatedWorkerThread.cpp: (WebCore::DedicatedWorkerThread::DedicatedWorkerThread): (WebCore::DedicatedWorkerThread::createWorkerGlobalScope): * workers/DedicatedWorkerThread.h: * workers/Worker.cpp: (WebCore::Worker::notifyFinished): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): * workers/WorkerGlobalScope.h: * workers/WorkerGlobalScopeProxy.h: * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): * workers/WorkerMessagingProxy.h: * workers/WorkerThread.cpp: (WebCore::WorkerThreadStartupData::WorkerThreadStartupData): (WebCore::WorkerThread::WorkerThread): * workers/WorkerThread.h: * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerRegistrationParameters.h: 2017-08-17 Carlos Garcia Campos [GTK][WPE] Add NTLM authentication enabled API https://bugs.webkit.org/show_bug.cgi?id=122952 Reviewed by Michael Catanzaro. Add/remove NTLM feature to/from soup session depending on whether the feature is enabled or disabled. * platform/network/soup/SoupNetworkSession.cpp: (WebCore::SoupNetworkSession::SoupNetworkSession): (WebCore::SoupNetworkSession::setInitialNTLMAuthenticationEnabled): (WebCore::SoupNetworkSession::setNTLMAuthenticationEnabled): * platform/network/soup/SoupNetworkSession.h: 2017-08-16 Ryosuke Niwa Add the support for mutating clipboard data via DataTransferItemList https://bugs.webkit.org/show_bug.cgi?id=175639 Reviewed by Wenson Hsieh. Added the support for adding plaintext data via dataTransfer.items.add, clearing data via clear, and removing an entry via remove. When DataTransferItem is removed from DataTransferItemList, we must put into the disabled mode. To support the removal of DataTransferItem, this patch replaces a reference to DataTransfer by a WeakPtr to DataTransferItemList, and stops forwarding ref from DataTransferItem to DataTransfer. This means that DataTransfer can now be GC'ed before DataTransferItem is GC'ed. Because the identify and the order of DataTransferItems need to be preserved, we can't simply re-popluate m_itemList in DataTransferItemList. Instead, whenever the clipboard content is mutated, we make the parallel modifications to m_itemList. This includes changes made via DataTransfer methods such as setData and clearData. Test: editing/pasteboard/datatransfer-items-copy-plaintext.html * dom/DataTransfer.cpp: (WebCore::DataTransfer::clearData): Invoke didClearStringData when m_itemList exists. (WebCore::DataTransfer::setData): Ditto. (WebCore::DataTransfer::createForInputEvent): (WebCore::DataTransfer::createForDrag): (WebCore::DataTransfer::createForDrop): * dom/DataTransferItem.cpp: (WebCore::DataTransferItem::create): (WebCore::DataTransferItem::DataTransferItem): (WebCore::DataTransferItem::clearListAndPutIntoDisabledMode): Added. (WebCore::DataTransferItem::type const): Moved from the header. (WebCore::DataTransferItem::getAsString const): (WebCore::DataTransferItem::getAsFile const): * dom/DataTransferItem.h: (WebCore::DataTransferItem::ref): Deleted. (WebCore::DataTransferItem::deref): Deleted. (WebCore::DataTransferItem::isFile const): Added. (WebCore::DataTransferItem::type const): Move to the cpp file. * dom/DataTransferItemList.cpp: (WebCore::isSupportedType): Moved. (WebCore::DataTransferItemList::DataTransferItemList): Moved from the header. (WebCore::DataTransferItemList::~DataTransferItemList): Added. (WebCore::DataTransferItemList::item): (WebCore::DataTransferItemList::add): Implemented the variant to add string data. (WebCore::DataTransferItemList::remove): Implemented. For now, we don't have to deal with removing a file since a writable dataTransfer never contains a File object. (WebCore::DataTransferItemList::clear): Implemented. (WebCore::DataTransferItemList::ensureItems const): (WebCore::removeStringItemOfLowercasedType): Added. (WebCore::DataTransferItemList::didClearStringData): Called when dataTransfer.clear is called. (WebCore::DataTransferItemList::didSetStringData): Ditto for * dom/DataTransferItemList.h: (WebCore::DataTransferItemList): Added a WeakPtrFactory. Also use a vector of Ref instead of unique_ptr since DataTransferItem can outlive DataTransferItemList. (WebCore::DataTransferItemList::dataTransfer): Added. * dom/DataTransferItemList.idl: 2017-08-16 Andy Estes [Apple Pay] Rename PaymentRequest to ApplePaySessionPaymentRequest https://bugs.webkit.org/show_bug.cgi?id=175648 Reviewed by Tim Horton. The W3C Payment Request API defines an interface called PaymentRequest, which conflicts with an existing Apple Pay class. This patch renames PaymentRequest to ApplePaySessionPaymentRequest so that a follow-on patch can introduce PaymentRequest for the W3C API. * Modules/applepay/ApplePayError.h: * Modules/applepay/ApplePayLineItem.h: * Modules/applepay/ApplePayPaymentRequest.h: * Modules/applepay/ApplePaySession.cpp: (WebCore::convertAndValidateTotal): (WebCore::convertAndValidate): (WebCore::ApplePaySession::ApplePaySession): (WebCore::ApplePaySession::didSelectShippingMethod): * Modules/applepay/ApplePaySession.h: * Modules/applepay/ApplePaySessionPaymentRequest.cpp: Renamed from Source/WebCore/Modules/applepay/PaymentRequest.cpp. (WebCore::ApplePaySessionPaymentRequest::ApplePaySessionPaymentRequest): (WebCore::ApplePaySessionPaymentRequest::~ApplePaySessionPaymentRequest): (WebCore::ApplePaySessionPaymentRequest::isValidSupportedNetwork): * Modules/applepay/ApplePaySessionPaymentRequest.h: Renamed from Source/WebCore/Modules/applepay/PaymentRequest.h. * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp: (WebCore::convert): (WebCore::ApplePayShippingMethodSelectedEvent::ApplePayShippingMethodSelectedEvent): * Modules/applepay/ApplePayShippingMethodSelectedEvent.h: * Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::beginPaymentSession): (WebCore::PaymentCoordinator::didSelectShippingMethod): * Modules/applepay/PaymentCoordinator.h: * Modules/applepay/PaymentCoordinatorClient.h: * Modules/applepay/PaymentHeaders.h: * Modules/applepay/PaymentRequestValidator.cpp: (WebCore::PaymentRequestValidator::validate): (WebCore::PaymentRequestValidator::validateTotal): (WebCore::validateMerchantCapabilities): (WebCore::validateShippingMethod): (WebCore::validateShippingMethods): * Modules/applepay/PaymentRequestValidator.h: * WebCore.xcodeproj/project.pbxproj: * loader/EmptyClients.cpp: 2017-08-16 Chris Dumez Cross origin Beacon requests with a ArrayBuffer / ArrayBufferView payload should not do a CORS preflight https://bugs.webkit.org/show_bug.cgi?id=175628 Reviewed by Geoffrey Garen. Cross origin Beacon requests with a ArrayBuffer / ArrayBufferView payload should not do a CORS preflight. To achieve this, the following changes were made: 1. Revert r220779 which caused us to use a non CORS-safelisted Content-Type header for such payload 2. Teach PingLoad how to deal with "simple" cross origin requests (i.e. Don't assume we need a CORS preflight merely because the fetch mode is set to "cors"). Test: http/wpt/beacon/cors/crossorigin-arraybufferview-no-preflight.html * Modules/fetch/FetchBody.cpp: (WebCore::FetchBody::extract): * loader/CrossOriginAccessControl.h: * loader/LoaderStrategy.h: * loader/PingLoader.cpp: (WebCore::PingLoader::loadImage): (WebCore::PingLoader::sendPing): (WebCore::PingLoader::sendViolationReport): (WebCore::PingLoader::startPingLoad): * loader/PingLoader.h: * loader/cache/CachedResource.cpp: (WebCore::CachedResource::CachedResource): (WebCore::CachedResource::load): * loader/cache/CachedResource.h: * loader/cache/CachedResourceRequest.cpp: (WebCore::CachedResourceRequest::CachedResourceRequest): * loader/cache/CachedResourceRequest.h: (WebCore::CachedResourceRequest::releaseOriginalRequestHeaders): * platform/network/HTTPHeaderValues.cpp: * platform/network/HTTPHeaderValues.h: 2017-08-16 Matt Baker Web Inspector: capture async stack trace when workers/main context posts a message https://bugs.webkit.org/show_bug.cgi?id=167084 Reviewed by Brian Burg. Add instrumentation to DOMWindow to support showing asynchronous stack traces when the debugger pauses in a MessageEvent handler. Test: inspector/debugger/async-stack-trace.html * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didPostMessageImpl): (WebCore::InspectorInstrumentation::didFailPostMessageImpl): (WebCore::InspectorInstrumentation::willDispatchPostMessageImpl): (WebCore::InspectorInstrumentation::didDispatchPostMessageImpl): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::didPostMessage): (WebCore::InspectorInstrumentation::didFailPostMessage): (WebCore::InspectorInstrumentation::willDispatchPostMessage): (WebCore::InspectorInstrumentation::didDispatchPostMessage): * inspector/PageDebuggerAgent.cpp: (WebCore::PageDebuggerAgent::didClearAsyncStackTraceData): (WebCore::PageDebuggerAgent::didPostMessage): (WebCore::PageDebuggerAgent::didFailPostMessage): (WebCore::PageDebuggerAgent::willDispatchPostMessage): (WebCore::PageDebuggerAgent::didDispatchPostMessage): * inspector/PageDebuggerAgent.h: * page/DOMWindow.cpp: (WebCore::DOMWindow::postMessage): (WebCore::DOMWindow::postMessageTimerFired): 2017-08-16 Timothy Horton Try to fix the build * platform/ios/PlatformPasteboardIOS.mm: 2017-08-16 Simon Fraser Build fix after r220812 Fix builds where LOG_DISABLED is defined. * css/MediaQueryEvaluator.cpp: 2017-08-16 Simon Fraser Add a log channel for media queries https://bugs.webkit.org/show_bug.cgi?id=175591 Reviewed by Zalan Bujtas. Add a "MediaQueries" log channel which logs data about media query evaluation. * css/MediaList.cpp: (WebCore::MediaQuerySet::MediaQuerySet): (WebCore::operator<<): * css/MediaList.h: * css/MediaQuery.cpp: (WebCore::operator<<): * css/MediaQuery.h: * css/MediaQueryEvaluator.cpp: (WebCore::operator<<): (WebCore::MediaQueryEvaluator::evaluate const): (WebCore::aspectRatioValueAsString): (WebCore::orientationEvaluate): (WebCore::aspectRatioEvaluate): (WebCore::deviceAspectRatioEvaluate): (WebCore::evaluateResolution): (WebCore::deviceHeightEvaluate): (WebCore::deviceWidthEvaluate): (WebCore::heightEvaluate): (WebCore::widthEvaluate): * css/MediaQueryExpression.cpp: (WebCore::operator<<): * css/MediaQueryExpression.h: * css/MediaQueryMatcher.cpp: (WebCore::MediaQueryMatcher::styleResolverChanged): * css/StyleResolver.cpp: (WebCore::StyleResolver::hasMediaQueriesAffectedByViewportChange const): (WebCore::StyleResolver::hasMediaQueriesAffectedByAccessibilitySettingsChange const): * dom/InlineStyleSheetOwner.cpp: (WebCore::InlineStyleSheetOwner::createSheet): * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::bestFitSourceFromPictureElement): * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::process): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::selectNextSourceChild): * html/HTMLPictureElement.cpp: (WebCore::HTMLPictureElement::viewportChangeAffectedPicture const): * html/parser/HTMLPreloadScanner.cpp: (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): * page/FrameView.cpp: (WebCore::FrameView::layout): * platform/Logging.cpp: (WebCore::initializeLogChannelsIfNecessary): * platform/Logging.h: * platform/URL.cpp: (WebCore::isSchemeFirstChar): (WebCore::operator<<): * platform/URL.h: 2017-08-16 Sam Weinig [WebIDL] Remove the need for JSSubtleCryptoCustom.cpp https://bugs.webkit.org/show_bug.cgi?id=175526 Reviewed by Chris Dumez. - Generates bindings for all of SubtleCrypto except AlgorithmIdentifier normalization, which is defined in the WebCrypto spec to happen after normal IDL operations. - Adds initial support for IDL object types in unions (some, unneeded at the moment, edge cases remain). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSSubtleCryptoCustom.cpp: Removed. Remove JSSubtleCryptoCustom.cpp, added CryptoKeyFormat.h * bindings/js/JSDOMConvertObject.h: Add needed, when included in generated code, #include of StrongInlines.h * bindings/js/JSDOMConvertUnion.h: Add initial support for object (needed for AlgorithmIdentifier which is (object or DOMString)). Remaining support will be handled by https://webkit.org/b/175616 Also add remaining spec comments while in the area. * bindings/js/JSDOMPromiseDeferred.cpp: (WebCore::DeferredPromise::reject): Add support for the special ExistingExceptionError error code. Capturing the current exception and using it as the rejection value. * crypto/SubtleCrypto.cpp: (WebCore::SubtleCrypto::~SubtleCrypto): (WebCore::toHashIdentifier): (WebCore::normalizeCryptoAlgorithmParameters): (WebCore::toCryptoKeyUsageBitmap): (WebCore::rejectWithException): (WebCore::normalizeJsonWebKey): (WebCore::toKeyData): (WebCore::copyToVector): (WebCore::isSupportedExportKey): (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: * crypto/SubtleCrypto.idl: Moves implementation from JSSubtleCryptoCustom.cpp -> here. Important changes that come with that are: - All parameters are now converted / type checked for us. - Rather than throwing exceptions and expecting the bindings layer to convert them to promise rejections, all rejections are now explicitly made. - Algorithms are no longer checked for being supported twice, once in normalizeCryptoAlgorithmParameters and then again in the operation. We instead rely on normalizeCryptoAlgorithmParameters to return an Exception if its not supported. - Shaves 251 lines off the file. * crypto/CryptoKeyFormat.h: Added. Add new header for unified key format enum. (For bindings purposes, SubtleCrypto re aliases it to SubtleCrypto::KeyFormat). * bindings/js/JSWebKitSubtleCryptoCustom.cpp: * crypto/CryptoAlgorithm.cpp: * crypto/CryptoAlgorithm.h: * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp: * crypto/algorithms/CryptoAlgorithmAES_CBC.h: * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp: * crypto/algorithms/CryptoAlgorithmAES_CFB.h: * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp: * crypto/algorithms/CryptoAlgorithmAES_CTR.h: * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp: * crypto/algorithms/CryptoAlgorithmAES_GCM.h: * crypto/algorithms/CryptoAlgorithmAES_KW.cpp: * crypto/algorithms/CryptoAlgorithmAES_KW.h: * crypto/algorithms/CryptoAlgorithmECDH.cpp: * crypto/algorithms/CryptoAlgorithmECDH.h: * crypto/algorithms/CryptoAlgorithmECDSA.cpp: * crypto/algorithms/CryptoAlgorithmECDSA.h: * crypto/algorithms/CryptoAlgorithmHKDF.cpp: * crypto/algorithms/CryptoAlgorithmHKDF.h: * crypto/algorithms/CryptoAlgorithmHMAC.cpp: * crypto/algorithms/CryptoAlgorithmHMAC.h: * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp: * crypto/algorithms/CryptoAlgorithmPBKDF2.h: * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp: * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h: * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp: * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h: * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp: * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h: * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp: * crypto/algorithms/CryptoAlgorithmRSA_PSS.h: Use CryptoKeyFormat enum directly, rather than SubtleCrypto::KeyFormat, to allow not including SubtleCrypto.h. * crypto/parameters/CryptoAlgorithmEcdsaParams.h: * crypto/parameters/CryptoAlgorithmHkdfParams.h: * crypto/parameters/CryptoAlgorithmHmacKeyParams.h: * crypto/parameters/CryptoAlgorithmPbkdf2Params.h: * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h: * crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h: * crypto/parameters/EcdsaParams.idl: * crypto/parameters/HkdfParams.idl: * crypto/parameters/HmacKeyParams.idl: * crypto/parameters/Pbkdf2Params.idl: * crypto/parameters/RsaHashedImportParams.idl: * crypto/parameters/RsaHashedKeyGenParams.idl: Update IDLs and implementations to use the correct definition of HashAlgorithmIdentifier, which is (object or DOMString), now that it is supported. 2017-08-16 Youenn Fablet [Cache API] Implement Worker connection to the Cache storage engine https://bugs.webkit.org/show_bug.cgi?id=175599 Reviewed by Chris Dumez. Covered by existing tests. Adding a WorkerCacheStorageConnection to connect workers Cache/CacheStorage to the cache storage engine. WorkerCacheStorageConnection does this by hopping to the main thread to call the document cache storage connection to do the actual job. Doing some CacheStorageConnection refactoring to share code with WK2 implementation of the cache storage connection. * Modules/cache/CacheQueryOptions.h: (WebCore::CacheQueryOptions::isolatedCopy const): * Modules/cache/CacheStorageConnection.cpp: (WebCore::CacheStorageConnection::open): (WebCore::CacheStorageConnection::remove): (WebCore::CacheStorageConnection::retrieveCaches): (WebCore::CacheStorageConnection::retrieveRecords): (WebCore::CacheStorageConnection::batchDeleteOperation): (WebCore::CacheStorageConnection::batchPutOperation): (WebCore::CacheStorageConnection::openOrRemoveCompleted): (WebCore::CacheStorageConnection::updateCaches): (WebCore::CacheStorageConnection::updateRecords): (WebCore::CacheStorageConnection::removeRecordsCompleted): (WebCore::CacheStorageConnection::putRecordsCompleted): * Modules/cache/CacheStorageConnection.h: (WebCore::CacheStorageConnection::openCompleted): (WebCore::CacheStorageConnection::removeCompleted): (WebCore::CacheStorageConnection::doOpen): (WebCore::CacheStorageConnection::doRemove): (WebCore::CacheStorageConnection::doRetrieveCaches): (WebCore::CacheStorageConnection::doRetrieveRecords): (WebCore::CacheStorageConnection::doBatchDeleteOperation): (WebCore::CacheStorageConnection::doBatchPutOperation): * Modules/cache/WorkerCacheStorageConnection.cpp: Added. (WebCore::toCrossThreadRecordData): (WebCore::fromCrossThreadRecordData): (WebCore::WorkerCacheStorageConnection::create): (WebCore::WorkerCacheStorageConnection::WorkerCacheStorageConnection): (WebCore::WorkerCacheStorageConnection::doOpen): (WebCore::WorkerCacheStorageConnection::doRemove): (WebCore::WorkerCacheStorageConnection::doRetrieveCaches): (WebCore::WorkerCacheStorageConnection::doRetrieveRecords): (WebCore::WorkerCacheStorageConnection::doBatchDeleteOperation): (WebCore::WorkerCacheStorageConnection::doBatchPutOperation): * Modules/cache/WorkerCacheStorageConnection.h: Added. * Modules/cache/WorkerGlobalScopeCaches.cpp: (WebCore::WorkerGlobalScopeCaches::caches const): * WebCore.xcodeproj/project.pbxproj: * loader/FetchOptions.h: (WebCore::FetchOptions::isolatedCopy const): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::cacheStorageConnection): * workers/WorkerGlobalScope.h: 2017-08-16 Yoshiaki Jitsukawa [PAL] Move spi/ios and spi/win directories into PAL https://bugs.webkit.org/show_bug.cgi?id=175171 Reviewed by Antti Koivisto. * PlatformWin.cmake: * WebCore.xcodeproj/project.pbxproj: * editing/cocoa/DataDetection.mm: * loader/ios/PreviewLoader.mm: * page/CaptionUserPreferencesMediaAF.cpp: * page/cocoa/MemoryReleaseCocoa.mm: * page/cocoa/SettingsCocoa.mm: * page/ios/UserAgentIOS.mm: * platform/audio/ios/MediaSessionManagerIOS.mm: * platform/graphics/ca/PlatformCALayer.cpp: * platform/graphics/cocoa/FontCascadeCocoa.mm: * platform/graphics/cocoa/GraphicsContext3DCocoa.mm: * platform/graphics/opentype/OpenTypeCG.h: * platform/graphics/win/SimpleFontDataCGWin.cpp: * platform/graphics/win/SimpleFontDataDirect2D.cpp: * platform/ios/Device.h: * platform/ios/PlatformPasteboardIOS.mm: * platform/ios/PlatformScreenIOS.mm: * platform/ios/QuickLookSoftLink.h: * platform/ios/QuickLookSoftLink.mm: * platform/ios/ValidationBubbleIOS.mm: * platform/ios/WebItemProviderPasteboard.mm: * platform/network/ios/PreviewConverter.mm: * platform/sql/SQLiteFileSystem.cpp: * rendering/RenderThemeIOS.mm: 2017-08-16 Tim Horton 2-3% of main thread time under UTTypeCreatePreferredIdentifierForTag on wunderground map https://bugs.webkit.org/show_bug.cgi?id=175618 Reviewed by Simon Fraser. No new tests, just a perf win. UTTypeCreatePreferredIdentifierForTag is fairly expensive, and is called under every toDataURL, which the Wunderground wundermap does a /lot/. Keep a 16-item LRU cache of MIMEType->UTI mappings. Also, make other callers of UTTypeCreatePreferredIdentifierForTag use the UTIUtilities version so they can share in the caching. Also, as a drive-by, add and make other callers use mimeTypeFromUTI too, and make the UTIUtilities operate on Strings for a slightly more WebCore-y feel. * editing/ios/EditorIOS.mm: (WebCore::Editor::WebContentReader::readImage): * platform/MIMETypeRegistry.cpp: (WebCore::initializeSupportedImageMIMETypes): (WebCore::initializeSupportedImageMIMETypesForEncoding): * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: (WebCore::createFileTypesSet): * platform/graphics/cg/ImageSourceCGMac.mm: (WebCore::MIMETypeForImageSourceType): Adopt newly-added MIMETypeFromUTI(). * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::utiFromImageBufferMIMEType): (WebCore::ImageBuffer::toCFData const): (WebCore::cfData): (WebCore::utiFromMIMEType): Deleted. Adopt UTIFromMIMEType, and rename the local helper that does something different (a small static map) on iOS and Windows to not have an overlapping name. * platform/ios/PasteboardIOS.mm: (WebCore::Pasteboard::resourceMIMEType): (WebCore::utiTypeFromCocoaType): Adopt UTIFromMIMEType(). * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::writeObjectRepresentations): * platform/mac/PasteboardMac.mm: (WebCore::cocoaTypeFromHTMLClipboardType): Adopt isDeclaredUTI and UTIFromMIMEType(). * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm: (WebCore::WebCoreAVFResourceLoader::responseReceived): * platform/network/ios/WebCoreURLResponseIOS.mm: (WebCore::adjustMIMETypeIfNecessary): * platform/network/mac/WebCoreURLResponse.mm: (WebCore::adjustMIMETypeIfNecessary): * rendering/RenderThemeIOS.mm: (WebCore::iconForAttachment): * rendering/RenderThemeMac.mm: (WebCore::iconForAttachment): Deal with the fact that UTI utilities deal in Strings now. * platform/network/mac/UTIUtilities.h: * platform/network/mac/UTIUtilities.mm: (WebCore::MIMETypeFromUTI): Added. This doesn't crawl up the UTI tree if the first conversion fails, which is what most of the existing code does. It's possible we want to use MIMETypeFromUTITree's logic everywhere, but I didn't want to change that in this patch. (WebCore::MIMETypeFromUTITree): (WebCore::isDeclaredUTI): Take and return strings. (WebCore::UTIFromMIMETypeCachePolicy::createValueForKey): (WebCore::UTIFromMIMEType): Add the aforementioned cache. 2017-08-16 Simon Fraser Make RenderLayer and RenderLayerBacking TextStream-loggable, and clean up compositing logging https://bugs.webkit.org/show_bug.cgi?id=175634 Reviewed by Zalan Bujtas. Add operator<<(TextStream&) for RenderLayer and RenderLayer backing, and use them for compositing logging. Convert CompositingUpdateType to an enum class. * page/FrameView.cpp: (WebCore::FrameView::updateCompositingLayersAfterLayout): (WebCore::FrameView::updateCompositingLayersAfterScrolling): * page/ios/FrameIOS.mm: (WebCore::Frame::viewportOffsetChanged): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPositionsAfterLayout): (WebCore::RenderLayer::updateCompositingLayersAfterScroll): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateAfterLayout): (WebCore::RenderLayerBacking::updateGeometry): (WebCore::operator<<): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout): (WebCore::RenderLayerCompositor::flushPendingLayerChanges): (WebCore::RenderLayerCompositor::updateCompositingLayersTimerFired): (WebCore::RenderLayerCompositor::updateCompositingLayers): (WebCore::RenderLayerCompositor::layerTreeAsText): (WebCore::operator<<): * rendering/RenderLayerCompositor.h: 2017-08-16 Eric Carlson Consider allow gUM to be called from localhost without https https://bugs.webkit.org/show_bug.cgi?id=173457 Reviewed by Youenn Fablet. Tests: http/tests/media/media-stream/get-user-media-localhost.html http/tests/media/media-stream/get-user-media-loopback-ip.html * Modules/mediastream/UserMediaRequest.cpp: (WebCore::isSecure): Call SchemeRegistry::shouldTreatURLSchemeAsSecure instead of looking for the string 'https'. (WebCore::canCallGetUserMedia): Allow localhost or loopback address. * page/SecurityOrigin.cpp: (WebCore::isLoopbackIPAddress): Add a comment. (WebCore::shouldTreatAsPotentionallyTrustworthy): Move tests for localhost and loopback address to isLocalHostOrLoopbackIPAddress, call it. (WebCore::SecurityOrigin::isLocalHostOrLoopbackIPAddress): * page/SecurityOrigin.h: 2017-08-16 Chris Dumez EventSource: ignore IDs with U+0000 https://bugs.webkit.org/show_bug.cgi?id=175178 Reviewed by Darin Adler. EventSource: ignore IDs with U+0000 as per: https://github.com/whatwg/html/pull/2849 Test: imported/w3c/web-platform-tests/eventsource/format-field-id-null.htm * page/EventSource.cpp: (WebCore::EventSource::parseEventStreamLine): 2017-08-16 Fujii Hironori [HarfBuzz] Decomposed Vietnamese characters are rendered incorrectly https://bugs.webkit.org/show_bug.cgi?id=174418 Reviewed by Michael Catanzaro. HarfBuzzShaper should normalize the input text before collecting HarfBuzzRuns. Actually, HarfBuzzShaper::setNormalizedBuffer does the task. But, this function hasn't been called from anywhere since Bug 90951. Test: fast/text/international/vietnamese-nfd.html imported/blink/fast/text/international/text-shaping-arabic-diffs.html * platform/graphics/harfbuzz/HarfBuzzShaper.cpp: (WebCore::HarfBuzzShaper::HarfBuzzShaper): Call setNormalizedBuffer instead of normalizeCharacters. (WebCore::normalizeCharacters): Deleted. (WebCore::normalizeSpacesAndMirrorChars) Use FontCascade::treatAsZeroWidthSpaceInComplexScript instead of FontCascade::treatAsZeroWidthSpace to preserve ZWJ and ZWNJ. 2017-08-16 Antti Koivisto Move first-letter renderer mutation code out of RenderBlock and into RenderTreeUpdater https://bugs.webkit.org/show_bug.cgi?id=175627 Reviewed by Andreas Kling. Render tree should not mutate itself. We already fixed this for first-letter, supporting code can now move to RenderTreeUpdater too. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * rendering/RenderBlock.cpp: (WebCore::styleForFirstLetter): Deleted. (WebCore::isPunctuationForFirstLetter): Deleted. (WebCore::shouldSkipForFirstLetter): Deleted. (WebCore::RenderBlock::updateFirstLetterStyle): Deleted. (WebCore::RenderBlock::createFirstLetterRenderer): Deleted. (WebCore::RenderBlock::updateFirstLetter): Deleted. * rendering/RenderBlock.h: * rendering/RenderRubyRun.cpp: (WebCore::RenderRubyRun::updateFirstLetter): Deleted. * rendering/RenderRubyRun.h: * rendering/RenderTable.cpp: (WebCore::RenderTable::updateFirstLetter): Deleted. * rendering/RenderTable.h: Virtual overrides just disabled first letter for some RenderBlock subclasses. This is now achieved via supportsFirstLetter test in the first letter updater. * rendering/TextAutoSizing.cpp: (WebCore::TextAutoSizingValue::adjustTextNodeSizes): * rendering/svg/RenderSVGText.cpp: (WebCore::RenderSVGText::updateFirstLetter): Deleted. * rendering/svg/RenderSVGText.h: * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::popParent): * style/RenderTreeUpdater.h: * style/RenderTreeUpdaterFirstLetter.cpp: Added. (WebCore::styleForFirstLetter): (WebCore::isPunctuationForFirstLetter): (WebCore::shouldSkipForFirstLetter): (WebCore::updateFirstLetterStyle): (WebCore::createFirstLetterRenderer): (WebCore::supportsFirstLetter): (WebCore::RenderTreeUpdater::FirstLetter::update): * style/RenderTreeUpdaterFirstLetter.h: Added. 2017-08-16 Xabier Rodriguez Calvar [GStreamer][EME] Rework handling key systems and UUIDs https://bugs.webkit.org/show_bug.cgi?id=175567 Reviewed by Žan Doberšek. The UUIDs and key system strings were moved to the GStreamerEMEUtilities class because so far they were managed by the decryptors and that was ugly. * platform/GStreamer.cmake: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem): * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp: Added. * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h: Added. (WebCore::GStreamerEMEUtilities::isClearKeyKeySystem): (WebCore::GStreamerEMEUtilities::keySystemToUuid): * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: (webkit_media_clear_key_decrypt_class_init): * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.h: 2017-08-16 Andy Estes [Payment Request] Add an ENABLE flag and an experimental feature preference https://bugs.webkit.org/show_bug.cgi?id=175622 Reviewed by Tim Horton. * Configurations/FeatureDefines.xcconfig: * page/Settings.in: 2017-08-15 Ryosuke Niwa Make DataTransferItemList work with plain text entries https://bugs.webkit.org/show_bug.cgi?id=175596 Reviewed by Wenson Hsieh. Added the basic machinery to get the list of plain text items to DataTransferItemList and DataTransferItem. Each DataTransferItem now depends on DataTransfer so it does ref-forwarding like DataTransferItemList to make DataTransfer alive as long as any DataTransferItem is alive. Specifications: https://html.spec.whatwg.org/multipage/dnd.html#the-datatransferitem-interface https://html.spec.whatwg.org/multipage/dnd.html#the-datatransferitemlist-interface Tests: editing/pasteboard/datatransfer-items-drop-plaintext-file.html editing/pasteboard/datatransfer-items-paste-plaintext.html * dom/DataTransferItem.cpp: (WebCore::DataTransferItem::DataTransferItem): Added two variants one for plain text and another one for a file. (WebCore::DataTransferItem::kind const): Rewritten. (WebCore::DataTransferItem::getAsString const): Implemented. (WebCore::DataTransferItem::getAsFile const): Implemented. * dom/DataTransferItem.h: (WebCore::DataTransferItem::ref): Added. (WebCore::DataTransferItem::deref): Added. (WebCore::DataTransferItem::type const): Returns String instead of AtomicString. (WebCore::DataTransferItem::kind const): Moved to cpp. * dom/DataTransferItem.idl: Removed NoInterfaceObject since the interface object should exist on DOMWindow. * dom/DataTransferItemList.cpp: (WebCore::DataTransferItemList::length): Implemented. (WebCore::DataTransferItemList::item): Ditto. (WebCore::isSupportedType): Added. For now, we only support text/plain. (WebCore::DataTransferItemList::ensureItems): Added. Constructs the list of DataTransferItems. * dom/DataTransferItemList.h: (DataTransferItemList): Added m_items. The list is filled lazily by ensureItems. * dom/DataTransferItemList.idl: Removed NoInterfaceObject since the interface object should exist on DOMWindow. 2017-08-15 Simon Fraser Remove ScrollView::clipsRepaints() which was only used by Chromium https://bugs.webkit.org/show_bug.cgi?id=175594 Reviewed by Tim Horton. clipsRepaints() was added in r74568 but was only used by Chromium. It's always true for other platforms, so remove conditionals that test for it and assume true. * page/FrameView.cpp: (WebCore::FrameView::scrollContentsFastPath): * platform/ScrollView.cpp: (WebCore::ScrollView::repaintContentRectangle): (WebCore::ScrollView::setClipsRepaints): Deleted. * platform/ScrollView.h: (WebCore::ScrollView::clipsRepaints const): Deleted. 2017-08-15 Simon Fraser Allow WebCore logging channels to be set from the UI process https://bugs.webkit.org/show_bug.cgi?id=175608 Reviewed by Tim Horton. Change initializeLogChannelsIfNecessary() to take an optional String, which can be a list of log channels passed from the UI process. * platform/LogInitialization.h: * platform/Logging.cpp: (WebCore::initializeLogChannelsIfNecessary): 2017-08-15 Chris Dumez Fetch / Beacon: Use "application/octet-stream" Content-Type for payloads of type ArrayBuffer / ArrayBufferView https://bugs.webkit.org/show_bug.cgi?id=175600 Reviewed by Youenn Fablet. Use "application/octet-stream" Content-Type for payloads of type ArrayBuffer / ArrayBufferView in Fetch & Beacon. If we don't set a Content-Type header, our underlying network stack is going to add a "application/x-www-form-urlencoded" Content-Type header, which is worse. Chrome is already using "application/octet-stream" Content-Type in Beacon, but use no Content-Type in Fetch. The Fetch/Beacon specification says we should have no Content-Type header in this case but this is unfortunately not something we can support at the moment. Using "application/octet-stream" Content-Type for now seems like the lesser evil. Test: http/wpt/fetch/fetch-request-arraybuffer-content-type.html * Modules/fetch/FetchBody.cpp: (WebCore::FetchBody::extract): * platform/network/HTTPHeaderValues.cpp: (WebCore::HTTPHeaderValues::octetStreamContentType): * platform/network/HTTPHeaderValues.h: 2017-08-15 Robin Morisset Change the order of arguments of JSWithScope::create() for consistency https://bugs.webkit.org/show_bug.cgi?id=175585 Reviewed by Saam Barati. No change of behavior. * bindings/js/JSHTMLElementCustom.cpp: (WebCore::JSHTMLElement::pushEventHandlerScope const): 2017-08-15 Youenn Fablet [Cache API] Ensure ResourceResponse is not null when redirected/tainting/type fields are set https://bugs.webkit.org/show_bug.cgi?id=175538 Reviewed by Chris Dumez. No change of behavior. This change ensures that response type is preserved when encoding/decoding ResourceResponse, in particular the error type. This will allow Cache API to preserve responses when reading them from a different process. * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::setType): * platform/network/ResourceResponseBase.h: (WebCore::ResourceResponseBase::setType): 2017-08-15 Chris Dumez Update CachedResourceLoader::requestResource() to return a WTF::Expected https://bugs.webkit.org/show_bug.cgi?id=175505 Reviewed by Youenn Fablet. Update CachedResourceLoader::requestResource() to return a WTF::Expected type instead of using an out parameter for the ResourceError in case of synchronous failure. * Modules/beacon/NavigatorBeacon.cpp: (WebCore::NavigatorBeacon::sendBeacon): * bindings/js/CachedScriptFetcher.cpp: (WebCore::CachedScriptFetcher::requestScriptWithCache const): * css/CSSFontFaceSrcValue.cpp: (WebCore::CSSFontFaceSrcValue::cachedFont): * css/CSSImageSetValue.cpp: (WebCore::CSSImageSetValue::loadBestFitImage): * css/CSSImageValue.cpp: (WebCore::CSSImageValue::loadImage): * css/StyleRuleImport.cpp: (WebCore::StyleRuleImport::requestStyleSheet): * dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::checkStyleSheet): * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::process): * loader/CrossOriginPreflightChecker.cpp: (WebCore::CrossOriginPreflightChecker::startPreflight): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::startLoadingMainResource): * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::loadRequest): * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadedResourceFromMemoryCache): * loader/FrameLoader.h: * loader/ImageLoader.cpp: (WebCore::ImageLoader::updateFromElement): * loader/LinkLoader.cpp: (WebCore::LinkLoader::preloadIfNeeded): * loader/MediaResourceLoader.cpp: (WebCore::MediaResourceLoader::requestResource): * loader/TextTrackLoader.cpp: (WebCore::TextTrackLoader::load): * loader/cache/CachedResourceLoader.cpp: (WebCore::castCachedResourceTo): (WebCore::CachedResourceLoader::requestImage): (WebCore::CachedResourceLoader::requestFont): (WebCore::CachedResourceLoader::requestTextTrack): (WebCore::CachedResourceLoader::requestCSSStyleSheet): (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): (WebCore::CachedResourceLoader::requestScript): (WebCore::CachedResourceLoader::requestXSLStyleSheet): (WebCore::CachedResourceLoader::requestSVGDocument): (WebCore::CachedResourceLoader::requestLinkResource): (WebCore::CachedResourceLoader::requestMedia): (WebCore::CachedResourceLoader::requestIcon): (WebCore::CachedResourceLoader::requestRawResource): (WebCore::CachedResourceLoader::requestBeaconResource): (WebCore::CachedResourceLoader::requestMainResource): (WebCore::CachedResourceLoader::shouldContinueAfterNotifyingLoadedFromMemoryCache): (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::preload): * loader/cache/CachedResourceLoader.h: * loader/cache/CachedSVGDocumentReference.cpp: (WebCore::CachedSVGDocumentReference::load): * loader/icon/IconLoader.cpp: (WebCore::IconLoader::startLoading): * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm: (WebCore::WebCoreAVFResourceLoader::startLoading): * svg/SVGFEImageElement.cpp: (WebCore::SVGFEImageElement::requestImageResource): * svg/SVGFontFaceUriElement.cpp: (WebCore::SVGFontFaceUriElement::loadFont): * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::updateExternalDocument): * xml/XSLImportRule.cpp: (WebCore::XSLImportRule::loadSheet): 2017-08-15 Don Olmstead [PAL] Move Sleep classes into PAL https://bugs.webkit.org/show_bug.cgi?id=175456 Reviewed by Ryosuke Niwa. No new tests. No change in behavior. * CMakeLists.txt: * PlatformMac.cmake: * WebCore.xcodeproj/project.pbxproj: * html/HTMLMediaElement.cpp: * html/HTMLMediaElement.h: * platform/audio/PlatformMediaSessionManager.cpp: * platform/audio/PlatformMediaSessionManager.h: * platform/mac/WebVideoFullscreenController.h: * platform/mac/WebVideoFullscreenController.mm: 2017-08-15 Youenn Fablet [Cache API] Adding generic support for CacheStorage and Cache methods https://bugs.webkit.org/show_bug.cgi?id=175455 Reviewed by Chris Dumez. Covered by existing tests. Adding a CacheStorageProvider abstraction that creates a CacheStorageConnection. The CacheStorageProvider is accessed from the page for Document calls. The CacheStorageConnection is responsible to implement the read/write operations on the cache database. At the moment, it does nothing but return not implemented errors. Implementing CacheStorage APIs and Cache APIs based on the CacheStorageConnection except for Cache add and addAll which will be implemented later on. CacheStoragConnection is responsible to read/write CacheStorage list of caches and each individual cache. The CacheStorageConnection is a generic connection and not tied to any document/context. CacheStorage objects are manipulated by providing to the connection the origin of the context. CacheStorage are global to all contexts with the same origin. Cache objects are manipulated by an ID that is given initially by the CacheStorageEngine when opening the Cache object. Adding various accessors and constructors for Fetch constructs as needed by the Cache API implementation. * Modules/cache/Cache.cpp: (WebCore::Cache::Cache): (WebCore::Cache::~Cache): The CacheStorageConnection is a generic connection and not tied to any document/context. (WebCore::Cache::match): Implementation of https://www.w3.org/TR/service-workers-1/#cache-match. Redirect to matchAll as per spec. (WebCore::Cache::matchAll): Implementation of https://www.w3.org/TR/service-workers-1/#cache-matchAll. Checks for request as per spec. Then either refresh the request to response map and return all responses. Or call the query cache algorithm and return copies of the responses (using clone). (WebCore::Cache::put): Check the request and response as per spec. Add temporary rejection cases (being loaded responses, responses with ReadableStream) as there is no support for them right now. Call the batch put operation. (WebCore::Cache::remove): Check the request and response as per spec. Call the batch delete operation. (WebCore::Cache::keys): Refresh the request to response map and return corresponding requests. Making sure to reuse the same request objects as per spec. As per spec, the request to response map is ordered. We implement it as a Vector. (WebCore::Cache::refreshRequestToResponseMap): Use the cache storage connection to get an up-to-date list of cached records. (WebCore::Cache::queryCacheMatch): Implements the match algorithm defined in https://www.w3.org/TR/service-workers-1/#query-cache-algorithm. This is split for queryCache as cache storage engine will need to use it when implementing the delete operation. (WebCore::Cache::queryCache): Full implementation of https://www.w3.org/TR/service-workers-1/#query-cache-algorithm with no targetStorage argument. (WebCore::Cache::queryCacheWithTargetStorage): Full implementation of https://www.w3.org/TR/service-workers-1/#query-cache-algorithm with a provided targetStorage argument. (WebCore::Cache::batchDeleteOperation): Implementation of https://www.w3.org/TR/service-workers-1/#batch-cache-operations-algorithm but dedicated to a delete operation. Delete operation are always done one at a time. (WebCore::Cache::batchPutOperation): Implementation of https://www.w3.org/TR/service-workers-1/#batch-cache-operations-algorithm dedicated to a put operation. Put operation takes one record for put but can take several records in the case of addAll, hence the current design. (WebCore::Cache::updateRequestToResponseMap): Update the cache request to response map based on the records retrieved from the cache storage connection. * Modules/cache/Cache.h: (WebCore::Cache::create): (WebCore::Cache::name const): * Modules/cache/Cache.idl: * Modules/cache/CacheStorage.cpp: (WebCore::CacheStorage::origin const): Computing the cache origin that is passed to the CacheStorageConnection. (WebCore::CacheStorage::has): Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-has. Call the cache storage connection to refresh its cache map. Then use it to check whether a cache exists. (WebCore::CacheStorage::refreshCacheMap): Use the cache storage connection to get the list of existing caches. (WebCore::CacheStorage::open): Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-open. Refreshing the cache map so as to return a pre-existing cache if any. (WebCore::CacheStorage::remove): Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-delete-method. Refreshing the cache map so as to do nothing if there is no cache to remove. (WebCore::CacheStorage::keys): Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-keys-method. Refreshing the cache map and returnin its keys. As per spec, the cache map is ordered. We implement it as a Vector. (WebCore::CacheStorage::cacheMap): Get the list of cache objects, used as a private accessor for JS built-ins. * Modules/cache/CacheStorage.h: (WebCore::CacheStorage::create): (WebCore::CacheStorage::CacheStorage): * Modules/cache/CacheStorageConnection.cpp: Added. (WebCore::CacheStorageConnection::exceptionFromError): * Modules/cache/CacheStorageConnection.h: Added. Makes the link between Web facing Cache API and the cache storage engine. Envisioned implementation are: - One main thread connection used by all documents in the given process. - One connection per worker that forwards the calls to the main thread and use the main thread connection afterwards. (WebCore::CacheStorageConnection::create): (WebCore::CacheStorageConnection::open): (WebCore::CacheStorageConnection::remove): (WebCore::CacheStorageConnection::refreshCacheMap): (WebCore::CacheStorageConnection::refreshRequestToResponseMap): (WebCore::CacheStorageConnection::batchDeleteOperation): (WebCore::CacheStorageConnection::batchPutOperation): * Modules/cache/CacheStorageRecord.h: Added. A fetch record from the Web facing cache API perspective. * Modules/cache/DOMWindowCaches.cpp: (WebCore::DOMWindowCaches::caches const): * Modules/cache/WorkerGlobalScopeCaches.cpp: (WebCore::WorkerGlobalScopeCaches::from): (WebCore::WorkerGlobalScopeCaches::caches const): * Modules/cache/WorkerGlobalScopeCaches.h: (WebCore::WorkerGlobalScopeCaches::WorkerGlobalScopeCaches): * Modules/fetch/FetchBodyOwner.h: (WebCore::FetchBodyOwner::isReadableStreamBody const): Added getter as it is used by cache API. * Modules/fetch/FetchHeaders.h: (WebCore::FetchHeaders::create): Add another create as used by the cache API. (WebCore::FetchHeaders::guard const): Added getter and IPC serializer as this is something that will be stored by the cache engine. * Modules/fetch/FetchLoader.cpp: (WebCore::FetchLoader::start): * Modules/fetch/FetchRequest.cpp: (WebCore::buildOptions): In case FetchRequest::create is called from C++, there is no need to set init.window to a null value. Add a check so that no value at all is the same as a null/undefined value. (WebCore::FetchRequest::resourceRequest const): * Modules/fetch/FetchRequest.h: * Modules/fetch/FetchResponse.h: * WebCore.xcodeproj/project.pbxproj: * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::overlayPage): * page/CacheStorageProvider.h: Added. Interface to create main thread cache storage connection for the given page. There will be one provider for each process. Passing a sessionID so that we will create a connection per session. * page/Page.cpp: (WebCore::Page::Page): * page/Page.h: (WebCore::Page::cacheStorageProvider): * page/PageConfiguration.cpp: (WebCore::PageConfiguration::PageConfiguration): * page/PageConfiguration.h: * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::dataChanged): 2017-08-15 Chris Dumez Implement quota limitation for keepalive Fetch requests https://bugs.webkit.org/show_bug.cgi?id=175482 Reviewed by Sam Weinig and Youenn Fablet. Implement quota limitation for keepalive Fetch requests as per: - https://fetch.spec.whatwg.org/#http-network-or-cache-fetch (Step 9) This partly works for Beacon as well, meaning that no Beacon with a body over 64Kb can be sent. However, we don't keep track about wether or not beacon loads are inflight or not. Also update CachedResourceLoader::requestResource() so that the caller can get a ResourceError when it returns null. This is useful for both Fetch and Beacon to return better error messages. Test: http/wpt/beacon/beacon-quota.html * CMakeLists.txt: * Modules/beacon/NavigatorBeacon.cpp: (WebCore::NavigatorBeacon::sendBeacon): * Modules/fetch/FetchBodyOwner.cpp: (WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse): (WebCore::FetchBodyOwner::BlobLoader::didFail): * Modules/fetch/FetchBodyOwner.h: * Modules/fetch/FetchLoader.cpp: (WebCore::FetchLoader::start): (WebCore::FetchLoader::didFail): * Modules/fetch/FetchLoaderClient.h: * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::BodyLoader::didFail): * Modules/fetch/FetchResponse.h: * WebCore.xcodeproj/project.pbxproj: * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::loadRequest): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::load): * loader/cache/CachedResource.h: (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const): * loader/cache/CachedResourceLoader.cpp: (WebCore::createResource): (WebCore::CachedResourceLoader::requestImage): (WebCore::CachedResourceLoader::requestFont): (WebCore::CachedResourceLoader::requestTextTrack): (WebCore::CachedResourceLoader::requestCSSStyleSheet): (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): (WebCore::CachedResourceLoader::requestScript): (WebCore::CachedResourceLoader::requestXSLStyleSheet): (WebCore::CachedResourceLoader::requestSVGDocument): (WebCore::CachedResourceLoader::requestLinkResource): (WebCore::CachedResourceLoader::requestMedia): (WebCore::CachedResourceLoader::requestIcon): (WebCore::CachedResourceLoader::requestRawResource): (WebCore::CachedResourceLoader::requestBeaconResource): (WebCore::CachedResourceLoader::requestMainResource): (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::preload): * loader/cache/CachedResourceLoader.h: * loader/cache/KeepaliveRequestTracker.cpp: Added. (WebCore::KeepaliveRequestTracker::~KeepaliveRequestTracker): (WebCore::KeepaliveRequestTracker::canLoadRequest): (WebCore::KeepaliveRequestTracker::registerRequest): (WebCore::KeepaliveRequestTracker::responseReceived): (WebCore::KeepaliveRequestTracker::notifyFinished): (WebCore::KeepaliveRequestTracker::unregisterRequest): * loader/cache/KeepaliveRequestTracker.h: Added. * platform/network/FormData.cpp: (WebCore::FormDataElement::lengthInBytes const): (WebCore::FormData::lengthInBytes const): * platform/network/FormData.h: 2017-08-15 Darin Adler REGRESSION(r220052): http/tests/appcache/deferred-events-delete-while-raising-timer.html is crashing. https://bugs.webkit.org/show_bug.cgi?id=175107 Reviewed by Alexey Proskuryakov. * loader/FrameLoader.cpp: (WebCore::FrameLoader::checkLoadComplete): Moved the assertion to after the null page check. 2017-08-15 Commit Queue Unreviewed, rolling out r219504. https://bugs.webkit.org/show_bug.cgi?id=175580 Broke Arabic text shaping (Requested by mcatanzaro on #webkit). Reverted changeset: "[HarfBuzz] Decomposed Vietnamese characters are rendered incorrectly" https://bugs.webkit.org/show_bug.cgi?id=174418 http://trac.webkit.org/changeset/219504 2017-08-14 Carlos Garcia Campos WebDriver: handle click events on option elements https://bugs.webkit.org/show_bug.cgi?id=174710 Reviewed by Brian Burg. Export WebCore symbols required by WebKit layer. * html/HTMLOptGroupElement.h: * html/HTMLOptionElement.h: 2017-08-14 Simon Fraser Remove Proximity Events and related code https://bugs.webkit.org/show_bug.cgi?id=175545 Reviewed by Daniel Bates. No platform enables Proximity Events, so remove code inside ENABLE(PROXIMITY_EVENTS) and other related code. * CMakeLists.txt: * Configurations/FeatureDefines.xcconfig: * DerivedSources.cpp: * Modules/proximity/DeviceProximityClient.h: Removed. * Modules/proximity/DeviceProximityController.cpp: Removed. * Modules/proximity/DeviceProximityController.h: Removed. * Modules/proximity/DeviceProximityEvent.cpp: Removed. * Modules/proximity/DeviceProximityEvent.h: Removed. * Modules/proximity/DeviceProximityEvent.idl: Removed. * dom/EventNames.h: * dom/EventNames.in: * history/PageCache.cpp: (WebCore::canCachePage): * page/DOMWindow.cpp: (WebCore::DOMWindow::addEventListener): (WebCore::DOMWindow::removeEventListener): (WebCore::DOMWindow::removeAllEventListeners): * page/DOMWindow.idl: * page/DiagnosticLoggingKeys.cpp: (WebCore::DiagnosticLoggingKeys::deviceProximityKey): Deleted. * page/DiagnosticLoggingKeys.h: * testing/Internals.cpp: (WebCore::Internals::setDeviceProximity): Deleted. * testing/Internals.h: * testing/Internals.idl: 2017-08-14 Simon Fraser Remove ENABLE(REQUEST_AUTOCOMPLETE) code, which was disabled everywhere https://bugs.webkit.org/show_bug.cgi?id=175504 Reviewed by Sam Weinig. REQUEST_AUTOCOMPLETE was added in r133396 then removed in r148731, but brought back in r173596, however no further work was done, and it was left disabled. So remove the code. * Configurations/FeatureDefines.xcconfig: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * dom/AutocompleteErrorEvent.h: Removed. * dom/AutocompleteErrorEvent.idl: Removed. * dom/EventNames.in: * dom/GlobalEventHandlers.idl: * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::HTMLFormElement): (WebCore::HTMLFormElement::requestAutocomplete): Deleted. (WebCore::HTMLFormElement::finishRequestAutocomplete): Deleted. (WebCore::HTMLFormElement::requestAutocompleteTimerFired): Deleted. * html/HTMLFormElement.h: * html/HTMLFormElement.idl: * loader/EmptyClients.cpp: * loader/FrameLoaderClient.h: 2017-08-14 Chris Dumez XHR should only fire an abort event if the cancellation was requested by the client https://bugs.webkit.org/show_bug.cgi?id=175546 Reviewed by Youenn Fablet. XHR should only fire an abort event if the cancellation was requested by the client, otherwise it should fire an error event. Blink and Gecko already match the specification. Specification: - https://xhr.spec.whatwg.org/#handle-errors - https://xhr.spec.whatwg.org/#the-abort()-method Test: http/tests/navigation/page-cache-xhr-in-pagehide.html * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::open): (WebCore::XMLHttpRequest::abort): (WebCore::XMLHttpRequest::abortError): (WebCore::XMLHttpRequest::didFail): * xml/XMLHttpRequest.h: 2017-08-14 Simon Fraser Remove ENABLE_VIEW_MODE_CSS_MEDIA and related code https://bugs.webkit.org/show_bug.cgi?id=175557 Reviewed by Jon Lee. No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it. * Configurations/FeatureDefines.xcconfig: * css/CSSValueKeywords.in: * css/MediaFeatureNames.h: * css/MediaQueryEvaluator.cpp: (WebCore::viewModeEvaluate): Deleted. * css/MediaQueryExpression.cpp: (WebCore::featureWithValidIdent): (WebCore::isFeatureValidWithoutValue): * page/Page.cpp: (WebCore::Page::stringToViewMode): Deleted. (WebCore::Page::setViewMode): Deleted. * page/Page.h: (WebCore::Page::viewMode const): Deleted. 2017-08-14 Myles C. Maxfield Parse font-display https://bugs.webkit.org/show_bug.cgi?id=175382 Reviewed by Simon Fraser. The syntax is very simple: font-display: auto | block | swap | fallback | optional. So, parsing support is quite straightfoward. Test: fast/text/font-display/parse.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/CSSFontFace.cpp: (WebCore::CSSFontFace::setLoadingBehavior): * css/CSSFontFace.h: * css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::addFontFaceRule): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator FontLoadingBehavior const): * css/CSSProperties.json: * css/CSSProperty.cpp: (WebCore::CSSProperty::isDescriptorOnly): * css/CSSValueKeywords.in: * css/parser/CSSPropertyParser.cpp: (WebCore::consumeFontFaceFontDisplay): (WebCore::CSSPropertyParser::parseFontFaceDescriptor): * rendering/style/RenderStyleConstants.h: 2017-08-14 Jer Noble Obj-C exception crash in AVStreamSession when using EME in Private Browsing mode https://bugs.webkit.org/show_bug.cgi?id=175547 Reviewed by Eric Carlson. When the storagePath() is empty, do not use those AVStreamSession APIs which require a valid file path to stored proof-of-key-release data. Drive-by fix: return emptyString() from HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory() when in Private Browsing mode, to match the behavior of WebKitMediaKeySession. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const): * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::releaseKeys): (WebCore::CDMSessionAVStreamSession::update): (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage): 2017-08-14 Andy Estes REGRESSION (r220456): Crash in PreviewLoader::shouldCreateForMIMEType() when a ResourceResponse has a null MIME type https://bugs.webkit.org/show_bug.cgi?id=175548 Reviewed by Brady Eidson. New API test: QuickLook.ShouldCreateForMIMEType * WebCore.xcodeproj/project.pbxproj: * loader/ios/PreviewLoader.h: * loader/ios/PreviewLoader.mm: (WebCore::PreviewLoader::shouldCreateForMIMEType): Check if mimeType is a null String before calling HashSet::contains(). 2017-08-14 Andy Estes [Apple Pay] Add support for phonetic contact names https://bugs.webkit.org/show_bug.cgi?id=175537 Reviewed by Tim Horton. * Modules/applepay/ApplePayError.idl: Defined "phoneticName" in ApplePayErrorContactField. * Modules/applepay/ApplePayPaymentContact.h: Defined phoneticGivenName and phoneticFamilyName in ApplePayPaymentContact. * Modules/applepay/ApplePayPaymentContact.idl: Ditto. * Modules/applepay/ApplePayPaymentRequest.h: Defined PhoneticName in ApplePayPaymentRequest::ContactField. * Modules/applepay/ApplePayPaymentRequest.idl: Defined "phoneticName" in ApplePayContactField. * Modules/applepay/ApplePaySession.cpp: (WebCore::convertAndValidate): Added a version parameter. Added code to convert ContactField::PhoneticName, throwing an exception if version is less than 3. * Modules/applepay/PaymentContact.h: Added a version parameter to fromApplePayPaymentContact(). * Modules/applepay/PaymentRequest.h: Defined phoneticName in PaymentRequest::ContactFields and defined PhoneticName in PaymentError::ContactField. * Modules/applepay/cocoa/PaymentContactCocoa.mm: (WebCore::convert): Added a version parameter. Set a phoneticRepresentation on the PKContact's name if there are non-empty phonetic names and version is 3 or greater. (WebCore::PaymentContact::fromApplePayPaymentContact): Passed version to convert(). 2017-08-14 Said Abou-Hallawa The none smooth stroke applied to an SVG shape breaks its hit testing https://bugs.webkit.org/show_bug.cgi?id=175506 Reviewed by Simon Fraser. Clear RenderSVGShape::m_path when calling RenderSVGRect::updateShapeFromElement(). The m_path will be recalculated when RenderSVGShape::updateShapeFromElement() is called from RenderSVGRect::shapeDependentStrokeContains(). Test: svg/stroke/stroke-linejoin-click.html * rendering/svg/RenderSVGRect.cpp: (WebCore::RenderSVGRect::updateShapeFromElement): * rendering/svg/RenderSVGShape.h: (WebCore::RenderSVGShape::clearPath): 2017-08-14 Adrian Perez de Castro [WPE] Implement WebCore::standardUserAgent() https://bugs.webkit.org/show_bug.cgi?id=175507 Reviewed by Michael Catanzaro. Remove "_GLIB" from user-agent version macros. * platform/glib/UserAgentGLib.cpp: (WebCore::versionForUAString): 2017-08-14 Chris Dumez Unreviewed, rollout r220622 & r220696 https://bugs.webkit.org/show_bug.cgi?id=175482 Seems to have caused failures on iOS. * CMakeLists.txt: * Modules/beacon/NavigatorBeacon.cpp: (WebCore::NavigatorBeacon::sendBeacon): * Modules/fetch/FetchBodyOwner.cpp: (WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse): (WebCore::FetchBodyOwner::BlobLoader::didFail): * Modules/fetch/FetchBodyOwner.h: * Modules/fetch/FetchLoader.cpp: (WebCore::FetchLoader::start): (WebCore::FetchLoader::didFail): * Modules/fetch/FetchLoaderClient.h: * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::BodyLoader::didFail): * Modules/fetch/FetchResponse.h: * WebCore.xcodeproj/project.pbxproj: * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::loadRequest): * loader/cache/CachedRawResource.cpp: (WebCore::CachedRawResource::finishLoading): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::load): * loader/cache/CachedResource.h: (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const): * loader/cache/CachedResourceLoader.cpp: (WebCore::createResource): (WebCore::CachedResourceLoader::requestImage): (WebCore::CachedResourceLoader::requestFont): (WebCore::CachedResourceLoader::requestTextTrack): (WebCore::CachedResourceLoader::requestCSSStyleSheet): (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): (WebCore::CachedResourceLoader::requestScript): (WebCore::CachedResourceLoader::requestXSLStyleSheet): (WebCore::CachedResourceLoader::requestSVGDocument): (WebCore::CachedResourceLoader::requestLinkResource): (WebCore::CachedResourceLoader::requestMedia): (WebCore::CachedResourceLoader::requestIcon): (WebCore::CachedResourceLoader::requestRawResource): (WebCore::CachedResourceLoader::requestBeaconResource): (WebCore::CachedResourceLoader::requestMainResource): (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::preload): * loader/cache/CachedResourceLoader.h: * loader/cache/KeepaliveRequestTracker.cpp: Removed. * loader/cache/KeepaliveRequestTracker.h: Removed. * platform/network/FormData.cpp: (WebCore::FormData::appendFile): (WebCore::FormData::appendFileRange): (WebCore::FormData::appendBlob): (WebCore::FormData::expandDataStore): * platform/network/FormData.h: 2017-08-14 Daniel Bates [css-ui] Implement caret-color support https://bugs.webkit.org/show_bug.cgi?id=166572 Reviewed by David Hyatt. Add support for the CSS property caret-color as per (02 March 2017). The property caret-color specifies the color of the text insertion caret in an editable element, say an HTML textarea element. Unlike other CSS color properties caret-color can have value "auto" and this is its initial value. Internally we treat value "auto" as an invalid caret color to simplify the code. Tests: editing/pasteboard/preserve-caret-color.html fast/css/caret-color-auto.html fast/css/caret-color-fallback-to-color.html fast/css/caret-color-inherit.html fast/css/caret-color-span-inside-editable-parent.html fast/css/caret-color.html fast/history/visited-link-caret-color.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/CSSProperties.json: Add property caret-color. We represent the initial "auto" Also, fix up wording in a comment while I am here. * css/StyleResolver.cpp: (WebCore::isValidVisitedLinkProperty): Add caret-color to the list of properties that can be applied to visited hyperlinks. * css/parser/CSSParserFastPaths.cpp: (WebCore::parseCaretColor): Added. (WebCore::CSSParserFastPaths::maybeParseValue): Unlike other CSS color properties caret-color can be defined to be "auto". We explicitly check if the property is caret-color and use parseCaretColor() to parse its value. * css/parser/CSSPropertyParser.cpp: (WebCore::consumeCaretColor): Added. (WebCore::CSSPropertyParser::parseSingleValue): Similar to the change to CSSParserFastPaths::maybeParseValue() use a dedicated code path to parse caret-color. * editing/EditingStyle.cpp: Preserve caret-color during editing operations. * editing/FrameSelection.cpp: (WebCore::CaretBase::paintCaret const): Modified code to query property caret-color instead of color for the color of the text insertion caret. Always honor the caret-color of the editable element if it is valid color. Note that "caret-color: auto" is treated as an invalid color internally. A caret-color can have an invalid color if its inherits from the CSS color property with an invalid color. If caret-color is a valid color then we take it to be the color of the text insertion caret. Otherwise, we do what we do today and use a heuristic to determine the color of the text-insertion caret. (WebCore::disappearsIntoBackground): Deleted; moved logic into CaretBase::paintCaret(). * page/animation/CSSPropertyAnimation.cpp: (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Add property wrapper to support animating caret-color. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline const): Modified to consider changes to caret color. (WebCore::RenderStyle::colorIncludingFallback const): Modified to compute the appropriate color for property caret-color with respect to an unvisited or visited link. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setCaretColor): Added. (WebCore::RenderStyle::setVisitedLinkCaretColor): Added. (WebCore::RenderStyle::caretColor const): Added. (WebCore::RenderStyle::visitedLinkCaretColor const): Added. * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): Modified to consider caret color. (WebCore::StyleRareInheritedData::operator== const): Ditto. * rendering/style/StyleRareInheritedData.h: 2017-08-14 Zan Dobersek REGRESSION(r220517-r220521) [GTK] Various compositing tests fail https://bugs.webkit.org/show_bug.cgi?id=175478 Reviewed by Sergio Villar Senin. Fix a regression introduced in r220519. Move a framebuffer binding in TextureMapperGL away from GraphicsContext3D and onto the OpenGL API to work around the framebuffer binding state that's kept in the GraphicsContext3D class. This mismatch in how the framebuffer was bound was causing a couple of test failures in compositing tests. No new tests -- regressed tests have their failure expectations removed. * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGL::bindDefaultSurface): Don't use GraphicsContext3D for the glBindFramebuffer() call. This would be done in subsequent patches that would move TextureMapperGL off the GraphicsContext3D usage, but this specific use case clashes with the framebuffer binding that's done in BitmapTextureGL and was causing test failures. 2017-08-14 Chris Dumez Unreviewed fix after r220622 to address crashes on iOS. * loader/cache/CachedRawResource.cpp: (WebCore::CachedRawResource::finishLoading): 2017-08-14 Antti Koivisto Factor text autosizing into a class https://bugs.webkit.org/show_bug.cgi?id=175530 Reviewed by Andreas Kling. Move the remaining parts out of Document. * css/StyleBuilderCustom.h: (WebCore::computeLineHeightMultiplierDueToFontSize): * dom/Document.cpp: (WebCore::Document::destroyRenderTree): (WebCore::Document::textAutoSizing): (WebCore::TextAutoSizingTraits::constructDeletedValue): Deleted. (WebCore::TextAutoSizingTraits::isDeletedValue): Deleted. (WebCore::Document::addAutoSizedNode): Deleted. (WebCore::Document::updateAutoSizedNodes): Deleted. (WebCore::Document::clearAutoSizedNodes): Deleted. * dom/Document.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::adjustComputedFontSizes): * rendering/RenderElement.cpp: (WebCore::RenderElement::adjustComputedFontSizesOnBlocks): (WebCore::RenderElement::resetTextAutosizing): * rendering/TextAutoSizing.cpp: (WebCore::TextAutoSizingTraits::constructDeletedValue): (WebCore::TextAutoSizingTraits::isDeletedValue): (WebCore::TextAutoSizing::addTextNode): (WebCore::TextAutoSizing::updateRenderTree): (WebCore::TextAutoSizing::reset): * rendering/TextAutoSizing.h: 2017-08-14 Antti Koivisto [Render Tree Mutation] First letter should not mutate the render tree while in layout. https://bugs.webkit.org/show_bug.cgi?id=163848 Reviewed by Zalan Bujtas. RenderBlock::updateFirstLetter shouldn't be called during layout. Instead it should be invoked by the RenderTreeUpdater. With this future patches can move updateFirstLetter() and the related functions completely out of the render tree. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::layout): No more updateFirstLetter calls during layout... (WebCore::RenderBlock::computePreferredLogicalWidths): ...or preferred width computation. (WebCore::RenderBlock::updateFirstLetter): * rendering/RenderBlock.h: * rendering/RenderRubyRun.cpp: (WebCore::RenderRubyRun::updateFirstLetter): * rendering/RenderRubyRun.h: * rendering/RenderTable.cpp: (WebCore::RenderTable::updateFirstLetter): * rendering/RenderTable.h: * rendering/svg/RenderSVGText.cpp: (WebCore::RenderSVGText::updateFirstLetter): * rendering/svg/RenderSVGText.h: * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::popParent): Call updateFirstLetter when closing the element. All of of descedant renderers are known here so this can be resolved correctly. 2017-08-13 Manuel Rego Casasnovas Composition underline color is always black https://bugs.webkit.org/show_bug.cgi?id=174675 Reviewed by Ryosuke Niwa. This patch uses the current color of the text instead of black for the composition underline marker. This makes it visible in the case we have a black/dark background. Test: editing/composition-underline-color.html * editing/CompositionUnderline.h: (WebCore::CompositionUnderline::CompositionUnderline): Added new attribute compositionUnderlineColor. * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintCompositionUnderline): Use the text color if compositionUnderlineColor is TextColor. 2017-08-13 Carlos Garcia Campos [GTK] stop kinetic scrolling when a zero movement is reached https://bugs.webkit.org/show_bug.cgi?id=175468 Reviewed by Michael Catanzaro. This is GTK+ change by Christian Hergert. https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=4f63d839550f7a9038b391e7d3e1e6fc8bdfafa6 When the kinetic scrolling reduces its speed, there can be multiple frames where the movement is zero pixels, followed by a 1 pixel movement later on. This causes a "jitter" right at the end of the scroll which makes it feel less quality than other platforms. Instead, we should just clamp it as soon as we get a zero movement. * platform/ScrollAnimationKinetic.cpp: (WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll): 2017-08-13 Chris Dumez Drop non-const getter for CachedResource::resourceRequest() https://bugs.webkit.org/show_bug.cgi?id=175524 Reviewed by Youenn Fablet. Drop non-const getter for CachedResource::resourceRequest(). It would be unsafe to modify the request of a CachedResource after it has been cached. Exposing such a getter is therefore a footgun. * loader/LinkLoader.cpp: (WebCore::LinkLoader::preloadIfNeeded): * loader/cache/CachedImage.cpp: (WebCore::CachedImage::CachedImage): * loader/cache/CachedImage.h: * loader/cache/CachedResource.cpp: (WebCore::CachedResource::CachedResource): * loader/cache/CachedResource.h: (WebCore::CachedResource::resourceRequest const): (WebCore::CachedResource::ignoreForRequestCount const): (WebCore::CachedResource::setIgnoreForRequestCount): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestResource): * loader/cache/CachedResourceRequest.h: (WebCore::CachedResourceRequest::ignoreForRequestCount const): (WebCore::CachedResourceRequest::setIgnoreForRequestCount): * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::addImageToCache): * platform/network/ResourceRequestBase.h: 2017-08-13 Adrian Perez de Castro [WPE] Implement WebCore::standardUserAgent() https://bugs.webkit.org/show_bug.cgi?id=175507 Reviewed by Carlos Alberto Lopez Perez. Implement missing User-Agent handling for the WPE port by sharing the code with the GTK+ port. * PlatformGTK.cmake: Handlde renaming of UserAgentGtk.cpp to UserAgentGLib.cpp. * PlatformWPE.cmake: Add UserAgentGLib.cpp and UserAgentQuirks.cpp to the list of built WebCore sources. * platform/glib/UserAgentGLib.cpp: Renamed from Source/WebCore/platform/gtk/UserAgentGtk.cpp. (WebCore::versionForUAString): Change "GTK" in UA version macros to "GLIB". 2017-08-11 Ryosuke Niwa Replace DATA_TRANSFER_ITEMS by a runtime flag and add a stub implementation https://bugs.webkit.org/show_bug.cgi?id=175474 Reviewed by Wenson Hsieh. Replaced the build flag by a runtime flag and added a stub implementation for DataTransferItemList and DataTransferItem to make it compile. DataTransferItemList is created lazily by DataTransfer.items, and its lifetime is tied to DataTransfer by forwarding ref and deref. See https://html.spec.whatwg.org/multipage/dnd.html#the-datatransferitemlist-interface Tests: editing/pasteboard/datatransfer-idl.html * CMakeLists.txt: * Configurations/FeatureDefines.xcconfig: * WebCore.xcodeproj/project.pbxproj: * dom/DataTransfer.cpp: (WebCore::DataTransfer::items): Added. Create DataTransferItemList lazily * dom/DataTransfer.h: * dom/DataTransfer.idl: * dom/DataTransferItem.cpp: (WebCore::DataTransferItem::DataTransferItem): Added a stub implementation. (WebCore::DataTransferItem::~DataTransferItem): Ditto. (WebCore::DataTransferItem::getAsString const): Ditto. (WebCore::DataTransferItem::getAsFile const): Ditto. * dom/DataTransferItem.h: (WebCore::DataTransferItemList): Devirtualized functions. (WebCore::DataTransferItemList::kind const): (WebCore::DataTransferItemList::type const): * dom/DataTransferItem.idl: * dom/DataTransferItemList.cpp: Added. (WebCore::DataTransferItemList::length const): Added a stub implementation. (WebCore::DataTransferItemList::item): Ditto. (WebCore::DataTransferItemList::add): Ditto. (WebCore::DataTransferItemList::remove): Ditto. (WebCore::DataTransferItemList::clear): Ditto. * dom/DataTransferItemList.h: (WebCore::DataTransferItemList::DataTransferItemList): (WebCore::DataTransferItemList::~DataTransferItemList): Deleted. (WebCore::DataTransferItemList::ref): Forwards to DataTransfer's ref. (WebCore::DataTransferItemList::deref): Ditto. * dom/DataTransferItemList.idl: Updated to match the latest specification. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setDataTransferItemsEnabled): Added. (WebCore::RuntimeEnabledFeatures::dataTransferItemsEnabled const): Added. 2017-08-11 Brady Eidson Move files inside WebCore/workers to WebCore/workers/service. https://bugs.webkit.org/show_bug.cgi?id=175495 Rubberstamped by Tim Horton. * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * workers/service/ServiceWorker.cpp: Renamed from Source/WebCore/workers/ServiceWorker.cpp. * workers/service/ServiceWorker.h: Renamed from Source/WebCore/workers/ServiceWorker.h. * workers/service/ServiceWorker.idl: Renamed from Source/WebCore/workers/ServiceWorker.idl. * workers/service/ServiceWorkerContainer.cpp: Renamed from Source/WebCore/workers/ServiceWorkerContainer.cpp. * workers/service/ServiceWorkerContainer.h: Renamed from Source/WebCore/workers/ServiceWorkerContainer.h. * workers/service/ServiceWorkerContainer.idl: Renamed from Source/WebCore/workers/ServiceWorkerContainer.idl. * workers/service/ServiceWorkerGlobalScope.cpp: Renamed from Source/WebCore/workers/ServiceWorkerGlobalScope.cpp. * workers/service/ServiceWorkerGlobalScope.h: Renamed from Source/WebCore/workers/ServiceWorkerGlobalScope.h. * workers/service/ServiceWorkerGlobalScope.idl: Renamed from Source/WebCore/workers/ServiceWorkerGlobalScope.idl. * workers/service/ServiceWorkerJob.cpp: Renamed from Source/WebCore/workers/ServiceWorkerJob.cpp. * workers/service/ServiceWorkerJob.h: Renamed from Source/WebCore/workers/ServiceWorkerJob.h. * workers/service/ServiceWorkerJobClient.h: Renamed from Source/WebCore/workers/ServiceWorkerJobClient.h. * workers/service/ServiceWorkerProvider.cpp: Renamed from Source/WebCore/workers/ServiceWorkerProvider.cpp. * workers/service/ServiceWorkerProvider.h: Renamed from Source/WebCore/workers/ServiceWorkerProvider.h. * workers/service/ServiceWorkerRegistration.cpp: Renamed from Source/WebCore/workers/ServiceWorkerRegistration.cpp. * workers/service/ServiceWorkerRegistration.h: Renamed from Source/WebCore/workers/ServiceWorkerRegistration.h. * workers/service/ServiceWorkerRegistration.idl: Renamed from Source/WebCore/workers/ServiceWorkerRegistration.idl. * workers/service/ServiceWorkerRegistrationOptions.h: Renamed from Source/WebCore/workers/ServiceWorkerRegistrationOptions.h. * workers/service/ServiceWorkerRegistrationParameters.cpp: Renamed from Source/WebCore/workers/ServiceWorkerRegistrationParameters.cpp. * workers/service/ServiceWorkerRegistrationParameters.h: Renamed from Source/WebCore/workers/ServiceWorkerRegistrationParameters.h. * workers/service/ServiceWorkerUpdateViaCache.h: Renamed from Source/WebCore/workers/ServiceWorkerUpdateViaCache.h. * workers/service/ServiceWorkerUpdateViaCache.idl: Renamed from Source/WebCore/workers/ServiceWorkerUpdateViaCache.idl. 2017-08-11 Chris Dumez Implement quota limitation for keepalive Fetch requests https://bugs.webkit.org/show_bug.cgi?id=175482 Reviewed by Sam Weinig and Youenn Fablet. Implement quota limitation for keepalive Fetch requests as per: - https://fetch.spec.whatwg.org/#http-network-or-cache-fetch (Step 9) This partly works for Beacon as well, meaning that no Beacon with a body over 64Kb can be sent. However, we don't keep track about wether or not beacon loads are inflight or not. Also update CachedResourceLoader::requestResource() so that the caller can get a ResourceError when it returns null. This is useful for both Fetch and Beacon to return better error messages. Test: http/wpt/beacon/beacon-quota.html * CMakeLists.txt: * Modules/beacon/NavigatorBeacon.cpp: (WebCore::NavigatorBeacon::sendBeacon): * Modules/fetch/FetchBodyOwner.cpp: (WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse): (WebCore::FetchBodyOwner::BlobLoader::didFail): * Modules/fetch/FetchBodyOwner.h: * Modules/fetch/FetchLoader.cpp: (WebCore::FetchLoader::start): (WebCore::FetchLoader::didFail): * Modules/fetch/FetchLoaderClient.h: * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::BodyLoader::didFail): * Modules/fetch/FetchResponse.h: * WebCore.xcodeproj/project.pbxproj: * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::loadRequest): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::load): * loader/cache/CachedResource.h: (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const): * loader/cache/CachedResourceLoader.cpp: (WebCore::createResource): (WebCore::CachedResourceLoader::requestImage): (WebCore::CachedResourceLoader::requestFont): (WebCore::CachedResourceLoader::requestTextTrack): (WebCore::CachedResourceLoader::requestCSSStyleSheet): (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): (WebCore::CachedResourceLoader::requestScript): (WebCore::CachedResourceLoader::requestXSLStyleSheet): (WebCore::CachedResourceLoader::requestSVGDocument): (WebCore::CachedResourceLoader::requestLinkResource): (WebCore::CachedResourceLoader::requestMedia): (WebCore::CachedResourceLoader::requestIcon): (WebCore::CachedResourceLoader::requestRawResource): (WebCore::CachedResourceLoader::requestBeaconResource): (WebCore::CachedResourceLoader::requestMainResource): (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::preload): * loader/cache/CachedResourceLoader.h: * loader/cache/KeepaliveRequestTracker.cpp: Added. (WebCore::KeepaliveRequestTracker::~KeepaliveRequestTracker): (WebCore::KeepaliveRequestTracker::canLoadRequest): (WebCore::KeepaliveRequestTracker::registerRequest): (WebCore::KeepaliveRequestTracker::responseReceived): (WebCore::KeepaliveRequestTracker::notifyFinished): (WebCore::KeepaliveRequestTracker::unregisterRequest): * loader/cache/KeepaliveRequestTracker.h: Added. * platform/network/FormData.cpp: (WebCore::FormDataElement::lengthInBytes const): (WebCore::FormData::lengthInBytes const): * platform/network/FormData.h: 2017-08-11 Don Olmstead [WTF] Move ValueToString into WTF https://bugs.webkit.org/show_bug.cgi?id=175469 Reviewed by Sam Weinig. No new tests. No change in behavior. * WebCore.xcodeproj/project.pbxproj: * html/HTMLMediaElement.h: (WTF::ValueToString::string): Deleted. * platform/LayoutUnit.h: (WTF::ValueToString::string): (WebCore::ValueToString::string): Deleted. * platform/PODInterval.h: * platform/PODIntervalTree.h: * platform/PODRedBlackTree.h: * platform/graphics/FloatPolygon.h: (WTF::ValueToString [Bindings] Simplify DOMPromiseProxy now that WTF::Function can return references https://bugs.webkit.org/show_bug.cgi?id=175394 Reviewed by Chris Dumez. * bindings/IDLTypes.h: (WebCore::IDLWrapper::convertToParameterType): Deleted. Remove no longer used convertToParameterType. * bindings/js/DOMPromiseProxy.h: - Replace Variant with ExceptionOr / ExceptionOr. - Update ResolveCallback to have a return type of IDLType::ParameterType, rather than IDLType::ImplementationType, now that WTF::Function supports references as the return type. This is needed, since the IDLType::ParameterType for an interface T is T&. * css/FontFace.cpp: * css/FontFace.h: * css/FontFaceSet.cpp: * css/FontFaceSet.h: Update resolve callbacks to return a reference rather than a RefPtr, matching the new signature requirement. 2017-08-11 Sam Weinig [WebIDL] Replace JSCryptoKeyCustom and JSCryptoAlgorithmBuilder with generated code https://bugs.webkit.org/show_bug.cgi?id=175457 Reviewed by Chris Dumez. * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCryptoAlgorithmBuilder.cpp: Removed. * bindings/js/JSCryptoAlgorithmBuilder.h: Removed. * bindings/js/JSCryptoKeyCustom.cpp: Removed. Remove JSCryptoAlgorithmBuilder and JSCryptoKeyCustom, add KeyAlgorithm IDLs and headers. * crypto/CryptoKey.cpp: * crypto/CryptoKey.h: * crypto/CryptoKey.idl: Replace custom algorithm attribute with a union of the supported key algorithms. * crypto/keys/CryptoAesKeyAlgorithm.h: Added. * crypto/keys/CryptoAesKeyAlgorithm.idl: Added. * crypto/keys/CryptoEcKeyAlgorithm.h: Added. * crypto/keys/CryptoEcKeyAlgorithm.idl: Added. * crypto/keys/CryptoHmacKeyAlgorithm.h: Added. * crypto/keys/CryptoHmacKeyAlgorithm.idl: Added. * crypto/keys/CryptoKeyAlgorithm.h: Added. * crypto/keys/CryptoKeyAlgorithm.idl: Added. * crypto/keys/CryptoRsaHashedKeyAlgorithm.h: Added. * crypto/keys/CryptoRsaHashedKeyAlgorithm.idl: Added. * crypto/keys/CryptoRsaKeyAlgorithm.h: Added. * crypto/keys/CryptoRsaKeyAlgorithm.idl: Added. Add IDLs and headers fo the supported key algorithms. * crypto/keys/CryptoKeyAES.h: * crypto/keys/CryptoKeyEC.h: * crypto/keys/CryptoKeyHMAC.h: * crypto/keys/CryptoKeyRSA.h: * crypto/keys/CryptoKeyRaw.h: Give each of the existing KeyAlgorithm subclasses a dictionary() function that returns the populated corresponding spec'd dictionary. 2017-08-11 Simon Fraser Some RenderSVGResource cleanup https://bugs.webkit.org/show_bug.cgi?id=175494 Reviewed by Zalan Bujtas. Use more initializers. Remove spurious use of bitfields that didn't save any space at all. 0 -> nullptr. No behavior change. * rendering/svg/RenderSVGResourceContainer.cpp: (WebCore::RenderSVGResourceContainer::RenderSVGResourceContainer): * rendering/svg/RenderSVGResourceContainer.h: * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::RenderSVGResourceGradient::RenderSVGResourceGradient): (WebCore::RenderSVGResourceGradient::applyResource): * rendering/svg/RenderSVGResourceGradient.h: * rendering/svg/RenderSVGResourcePattern.cpp: (WebCore::RenderSVGResourcePattern::RenderSVGResourcePattern): * rendering/svg/RenderSVGResourcePattern.h: * rendering/svg/RenderSVGShape.cpp: (WebCore::RenderSVGShape::fillShape): (WebCore::RenderSVGShape::strokeShape): * rendering/svg/SVGRenderingContext.cpp: (WebCore::SVGRenderingContext::~SVGRenderingContext): (WebCore::SVGRenderingContext::prepareToRenderSVGContent): * rendering/svg/SVGRenderingContext.h: (WebCore::SVGRenderingContext::SVGRenderingContext): 2017-08-11 Tim Horton Fix the build with modern Clang's -Wexpansion-to-defined https://bugs.webkit.org/show_bug.cgi?id=175467 Reviewed by Simon Fraser. * crypto/mac/SerializedCryptoKeyWrapMac.mm: 2017-08-11 Brady Eidson Crash under ServiceWorkerJob::failedWithException. https://bugs.webkit.org/show_bug.cgi?id=175488 Reviewed by Tim Horton. Covered by existing tests. * workers/ServiceWorkerJob.cpp: (WebCore::ServiceWorkerJob::failedWithException): jobDidFinish might cause the Job to be deleted, so make it last. 2017-08-10 Sam Weinig WTF::Function does not allow for reference / non-default constructible return types https://bugs.webkit.org/show_bug.cgi?id=175244 Reviewed by Chris Dumez. * bindings/js/JSCustomElementInterface.h: (WebCore::JSCustomElementInterface::invokeCallback): Update the default value for the addArguments parameter to be an empty lambda, rather than default initialization, which leads to a null WTF::Function. This allows us to remove support for calling null WTF::Function. No change in behavior. 2017-08-11 Antti Koivisto Remove RenderQuote collection from RenderView https://bugs.webkit.org/show_bug.cgi?id=175479 Reviewed by Andreas Kling. We can do it well enough without maintaining this pointer structure. Global updating doesn't work well with future direction for first-letter and similar anyway. We need to update quote immediately when updating its style. * rendering/RenderQuote.cpp: (WebCore::RenderQuote::insertedIntoTree): (WebCore::RenderQuote::willBeRemovedFromTree): Just tell the view that there are renderers to update. (WebCore::RenderQuote::styleDidChange): (WebCore::RenderQuote::isOpen const): (WebCore::RenderQuote::updateRenderer): (WebCore::RenderQuote::updateRenderers): Deleted. Update single renderer only. RenderTreeUpdater provides the previous renderer to compute the depth. * rendering/RenderQuote.h: * rendering/RenderView.cpp: (WebCore::RenderView::registerQuote): Deleted. (WebCore::RenderView::unregisterQuote): Deleted. (WebCore::RenderView::updateSpecialRenderers): Deleted. Remove the quote list. * rendering/RenderView.h: * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::commit): Ensure that all quotes are updated. (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement): (WebCore::RenderTreeUpdater::updateQuotesUpTo): Traverse render tree to find quotes to update starting from the previous updated quote. * style/RenderTreeUpdater.h: 2017-08-11 Adrian Perez de Castro [CMake] Many warning about missing “override” keywords in ANGLE with Clang https://bugs.webkit.org/show_bug.cgi?id=175475 Reviewed by Michael Catanzaro. * CMakeLists.txt: Add "-Wno-inconsistent-missing-override" to the compiler flags using for building the ANGLE sources. 2017-08-11 Adrian Perez de Castro [GTK][WPE] Overriden virtual function not marked “override” in ImageBufferDataCairo.h https://bugs.webkit.org/show_bug.cgi?id=175476 Reviewed by Carlos Garcia Campos. * platform/graphics/cairo/ImageBufferDataCairo.h: Add missing "override" qualifier. 2017-08-11 Carlos Garcia Campos [Soup] Cannot access HTTPS sites using a HTTP proxy that requires authentication https://bugs.webkit.org/show_bug.cgi?id=175378 Reviewed by Sergio Villar Senin. Bring back part of the code removed in r206732, to keep a reference to the SoupMessage in the AuthenticationChallenge since it can be different to the resource message. * platform/network/soup/AuthenticationChallenge.h: (WebCore::AuthenticationChallenge::AuthenticationChallenge): Deleted. (WebCore::AuthenticationChallenge::authenticationClient const): Deleted. (WebCore::AuthenticationChallenge::soupAuth const): Deleted. (WebCore::AuthenticationChallenge::setProposedCredential): Deleted. * platform/network/soup/AuthenticationChallengeSoup.cpp: (WebCore::AuthenticationChallenge::AuthenticationChallenge): (WebCore::AuthenticationChallenge::platformCompare): 2017-08-10 Dan Bernstein Fixed building for macOS 10.12 with the macOS 10.13 SDK. Suppressed the unguarded-availability-new warning around uses of AVSampleBufferAudioRenderer and AVSampleBufferRenderSynchronizer. Even though the 10.13 SDK declares them as available starting in that release, they have been available as SPI earlier. * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (-[WebAVSampleBufferErrorListener beginObservingRenderer:]): (-[WebAVSampleBufferErrorListener stopObservingRenderer:]): (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError): (WebCore::SourceBufferPrivateAVFObjC::flush): 2017-08-10 Brady Eidson Rename the source files for the WTF persistent coders. https://bugs.webkit.org/show_bug.cgi?id=175441 Reviewed by Tim Horton. * platform/network/NetworkLoadMetrics.h: 2017-08-10 Yusuke Suzuki Make ThreadGlobalData RefCounted for web thread https://bugs.webkit.org/show_bug.cgi?id=175439 Reviewed by Mark Lam. When the web thread is enabled, we share ThreadGlobalData between the web thread and the main thread. The problem happens when the main thread is dying. It could start deallocating TLS and the web thread may see the destructed ThreadGlobalData. Even though, the current implementation is safe because the main thread do not perform TLS deallocation in the Darwin environment. But this is not true in Windows. And we should not rely on this condition that depends on the platforms. In this patch, we make ThreadGlobalData ThreadSafeRefCounted. This type verbosely describes that ThreadGlobalData could be shared between threads when the web thread enabled. And make the life time management simple instead of relying on the platform dependent TLS implementation. * platform/ThreadGlobalData.cpp: (WebCore::ThreadGlobalData::setWebCoreThreadData): (WebCore::threadGlobalData): * platform/ThreadGlobalData.h: (WebCore::ThreadGlobalData::cachedResourceRequestInitiators): Deleted. (WebCore::ThreadGlobalData::eventNames): Deleted. (WebCore::ThreadGlobalData::threadTimers): Deleted. (WebCore::ThreadGlobalData::qualifiedNameCache): Deleted. (WebCore::ThreadGlobalData::cachedConverterICU): Deleted. (WebCore::ThreadGlobalData::cachedConverterTEC): Deleted. 2017-08-10 Yusuke Suzuki [JSC] Use @toNumber in builtins https://bugs.webkit.org/show_bug.cgi?id=172692 Reviewed by Sam Weinig. Use @toNumber bytecode intrinsic. It emits op_to_number, which efficiently converts a given argument to a number. * Modules/streams/ReadableByteStreamInternals.js: (privateInitializeReadableByteStreamController): (readableByteStreamControllerRespond): * Modules/streams/StreamInternals.js: (validateAndNormalizeQueuingStrategy): (enqueueValueWithSize): 2017-08-10 Nan Wang AX: crash at WebCore::AccessibilityObject::supportsARIALiveRegion() const + 24 https://bugs.webkit.org/show_bug.cgi?id=175340 Reviewed by Chris Fleizach. The issue here is that we manualy set the parent object of the AccessibilitySVGRoot object and there are chances that the parent doesn't detach it properly during the parent's destroying process. Accessing the stale parent object will lead to a crash. Fixed this by making the parent object a weak pointer so we don't access an invalid memory. Test: accessibility/add-children-pseudo-element.html * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::AccessibilityRenderObject): * accessibility/AccessibilityRenderObject.h: (WebCore::AccessibilityRenderObject::createWeakPtr): * accessibility/AccessibilitySVGRoot.cpp: (WebCore::AccessibilitySVGRoot::AccessibilitySVGRoot): (WebCore::AccessibilitySVGRoot::setParent): (WebCore::AccessibilitySVGRoot::parentObject const): * accessibility/AccessibilitySVGRoot.h: 2017-08-10 Chris Dumez [Beacon] Do connect-src CSP check on redirects as well https://bugs.webkit.org/show_bug.cgi?id=175410 Reviewed by Youenn Fablet. Pass ContentSecurityPolicy object to createPingHandle so that we can send enough data to the NetworkProcess so do CSP checks for Ping loads such as Beacon. For the IPC, we serialize the ContentSecurityPolicy's response headers. Those headers are now cached in ContentSecurityPolicy for performance reasons. CSP headers are rarely updated in practice but sendBeacon() may get called repeatedly for a given document. Tests: http/wpt/beacon/connect-src-beacon-redirect-allowed.sub.html http/wpt/beacon/connect-src-beacon-redirect-blocked.sub.html * loader/LoaderStrategy.h: * loader/PingLoader.cpp: (WebCore::PingLoader::loadImage): (WebCore::PingLoader::sendPing): (WebCore::PingLoader::sendViolationReport): (WebCore::PingLoader::startPingLoad): * loader/PingLoader.h: * loader/cache/CachedResource.cpp: (WebCore::CachedResource::load): * page/csp/ContentSecurityPolicy.cpp: (WebCore::ContentSecurityPolicy::responseHeaders const): (WebCore::ContentSecurityPolicy::didReceiveHeader): * page/csp/ContentSecurityPolicy.h: * page/csp/ContentSecurityPolicyResponseHeaders.h: (WebCore::ContentSecurityPolicyResponseHeaders::encode const): (WebCore::ContentSecurityPolicyResponseHeaders::decode): 2017-08-09 Yusuke Suzuki [WTF] ThreadSpecific should not introduce additional indirection https://bugs.webkit.org/show_bug.cgi?id=175187 Reviewed by Mark Lam. We drop ThreadSpecific::replace feature which is only used by Web thread. Instead, we use ThreadSpecific> here. While this std::unique_ptr shares one instance between main thread and web thread, this is the same to the current implementation. It is safe because the web thread never finishes. And for non-web thread implementation, we just use ThreadSpecific, since it is the most efficient. * platform/ThreadGlobalData.cpp: (WebCore::ThreadGlobalData::ThreadGlobalData): (WebCore::ThreadGlobalData::setWebCoreThreadData): (WebCore::threadGlobalData): We also drop StringImpl::empty() call since it is not necessary now: StringImpl::empty data is statically initialized by using constexpr. * platform/ThreadGlobalData.h: We make it FAST_ALLOCATED since it is previously allocated by fast malloc in ThreadSpecific. 2017-08-10 Michael Catanzaro REGRESSION(r220515) [GTK][CMake] Build with ENABLE_GEOLOCATION fails on Debian Jessie https://bugs.webkit.org/show_bug.cgi?id=175426 Reviewed by Carlos Alberto Lopez Perez. Also stop using GEOCLUE_LIBRARIES and GEOCLUE_INCLUDE_DIRS, since they are empty. Apparently we have not actually been using the client library at all this whole time, only the D-Bus interface. * PlatformGTK.cmake: 2017-08-10 Brady Eidson Add ServiceWorkerJob. https://bugs.webkit.org/show_bug.cgi?id=175241 Reviewed by Tim Horton. Test: http/tests/workers/service/basic-register.html This patch does a few things: - Adds the spec concept of a ServiceWorkerJob (in the WebProcess, at least) - Adds a ServiceWorkerProvider interface for WebKit to implement - Actually creates a job for service worker registration and "schedules" it, though it always immediately errors out the promise. Actually queuing jobs and executing asynchronously is coming up soon. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/Document.cpp: (WebCore::Document::sessionID const): * dom/Document.h: * workers/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer): (WebCore::ServiceWorkerContainer::addRegistration): (WebCore::ServiceWorkerContainer::scheduleJob): (WebCore::ServiceWorkerContainer::jobDidFinish): * workers/ServiceWorkerContainer.h: * workers/ServiceWorkerJob.cpp: Added. (WebCore::ServiceWorkerJob::ServiceWorkerJob): (WebCore::ServiceWorkerJob::~ServiceWorkerJob): (WebCore::ServiceWorkerJob::failedWithException): * workers/ServiceWorkerJob.h: Copied from Source/WebCore/workers/ServiceWorkerContainer.h. (WebCore::ServiceWorkerJob::createRegisterJob): (WebCore::ServiceWorkerJob::identifier const): * workers/ServiceWorkerJobClient.h: Added. (WebCore::ServiceWorkerJobClient::~ServiceWorkerJobClient): * workers/ServiceWorkerProvider.cpp: Added. (WebCore::ServiceWorkerProvider::singleton): (WebCore::ServiceWorkerProvider::setSharedProvider): * workers/ServiceWorkerProvider.h: Added. * workers/ServiceWorkerRegistrationOptions.h: Copied from Source/WebCore/workers/ServiceWorkerContainer.h. * workers/ServiceWorkerRegistrationParameters.cpp: Added. * workers/ServiceWorkerRegistrationParameters.h: Added. 2017-08-10 Tim Horton Remove some unused lambda captures so that WebKit builds with -Wunused-lambda-capture https://bugs.webkit.org/show_bug.cgi?id=175436 Reviewed by Simon Fraser. * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: (PlatformMediaSessionManager::updateSessionState): * platform/graphics/cocoa/WebCoreDecompressionSession.mm: (WebCore::WebCoreDecompressionSession::handleDecompressionOutput): 2017-08-10 Commit Queue Unreviewed, rolling out r220463. https://bugs.webkit.org/show_bug.cgi?id=175435 unaccepted fix (Requested by n_wang on #webkit). Reverted changeset: "AX: crash at WebCore::AccessibilityObject::supportsARIALiveRegion() const + 24" https://bugs.webkit.org/show_bug.cgi?id=175340 http://trac.webkit.org/changeset/220463 2017-08-10 Michael Catanzaro Remove ENABLE_GAMEPAD_DEPRECATED https://bugs.webkit.org/show_bug.cgi?id=175361 Reviewed by Carlos Garcia Campos. * CMakeLists.txt: * Configurations/FeatureDefines.xcconfig: * PlatformGTK.cmake: * PlatformWPE.cmake: * platform/Linux.cmake: Removed. * platform/gamepad/deprecated/Gamepads.h: Removed. * platform/gamepad/glib/GamepadsGlib.cpp: Removed. * platform/gamepad/linux/GamepadDeviceLinux.cpp: Removed. * platform/gamepad/linux/GamepadDeviceLinux.h: Removed. 2017-08-10 Myles C. Maxfield Addressing post-review comments after r219173. https://bugs.webkit.org/show_bug.cgi?id=174149 Unreviewed. * css/CSSFontStyleValue.h: * editing/EditingStyle.cpp: (WebCore::identifierForStyleProperty): 2017-08-10 Antti Koivisto Try to fix windows build. * style/StyleUpdate.h: (WebCore::Style::TextUpdate::TextUpdate): 2017-08-10 Carlos Garcia Campos [GTK] Crashes in WebCore::PasteboardHelper::fillSelectionData when source file of drag is unavailable https://bugs.webkit.org/show_bug.cgi?id=174161 Reviewed by Xabier Rodriguez-Calvar. In r219385 we changed the early return in fillSelectionData() to check the selection data length instead of the data pointer. However, the gtk_selection_data_get_length() can return -1, so we need to check also if the value less than 0. The case of setting an empty string could be valid depending on the target type, so it's better to return early only when data lenght is less than 0 and handle the 0 length case in each target. * platform/gtk/PasteboardHelper.cpp: (WebCore::PasteboardHelper::fillSelectionData): 2017-08-10 Antti Koivisto Text renderer updates should be done by RenderTreeUpdater https://bugs.webkit.org/show_bug.cgi?id=175417 Reviewed by Andreas Kling. All render tree mutations should be done by RenderTreeUpdater. Currently Text::updateRendererAfterContentChange calls RenderText::setTextWithOffset directly. * dom/Document.cpp: (WebCore::Document::updateTextRenderer): Add range argument. * dom/Document.h: * dom/Text.cpp: (WebCore::Text::updateRendererAfterContentChange): Remove call to setTextWithOffset and pass the range to updateTextRenderer * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::updateRenderTree): (WebCore::RenderTreeUpdater::updateTextRenderer): Call setTextWithOffset here. * style/RenderTreeUpdater.h: * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolveComposedTree): * style/StyleUpdate.cpp: (WebCore::Style::Update::textUpdate const): (WebCore::Style::Update::addText): Add TextUpdate struct similar to ElementUpdate to pass the range to the RenderTreeUpdater. * style/StyleUpdate.h: 2017-08-10 Zan Dobersek Unreviewed GTK+ build fix for ENABLE_GLES2=ON. * platform/graphics/texmap/TextureMapperGLHeaders.h: Define various GL constants that are not provided in GLES2 headers but are only leveraged in OpenGL calls if at runtime the underlying OpenGL is GLES2-capable. 2017-08-10 Zan Dobersek [TexMap] Remove GraphicsContext3D usage from BitmapTexturePool https://bugs.webkit.org/show_bug.cgi?id=175319 Reviewed by Carlos Garcia Campos. Drop the GraphicsContext3D reference in BitmapTexturePool now that the BitmapTextureGL doesn't require it anymore. No new tests -- no change in behavior. * platform/graphics/texmap/BitmapTexturePool.cpp: (WebCore::BitmapTexturePool::BitmapTexturePool): * platform/graphics/texmap/BitmapTexturePool.h: * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGL::TextureMapperGL): 2017-08-10 Zan Dobersek [TexMap] Drop GraphicsContext3D usage from BitmapTextureGL https://bugs.webkit.org/show_bug.cgi?id=175317 Reviewed by Carlos Garcia Campos. Have BitmapTextureGL use direct OpenGL API entrypoints and constants instead of leveraging the GraphicsContext3D class. Any GraphicsContext3D object passed to BitmapTextureGL would assume rendering to the GL context that's current on that thread, translating method invocations to the OpenGL API. We can do this by ourselves and benefit by avoiding allocating GraphicsContext3D resources like the ANGLE compiler that are by most useful for WebGL. BitmapTextureGL::create() call sites are adjusted to stop passing a GraphicsContext3D reference. BitmapTextureGL::bindAsSurface() doesn't need a replacement for the passed-in GraphicsContext3D object since that object originated from the TextureMapperGL instance, whose GraphicsContext3D is by default of the render-to-current-context nature. Other changes are direct translations of GraphicsContext3D methods to OpenGL API calls, or of GraphicsContext3D values to OpenGL API constants. No new tests -- no change in behavior. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor): * platform/graphics/texmap/BitmapTextureGL.cpp: Also remove an unnecessary GraphicsContext.h header inclusion. (WebCore::BitmapTextureGL::BitmapTextureGL): (WebCore::BitmapTextureGL::didReset): (WebCore::BitmapTextureGL::updateContentsNoSwizzle): (WebCore::BitmapTextureGL::updateContents): (WebCore::BitmapTextureGL::initializeStencil): (WebCore::BitmapTextureGL::initializeDepthBuffer): (WebCore::BitmapTextureGL::clearIfNeeded): (WebCore::BitmapTextureGL::createFboIfNeeded): (WebCore::BitmapTextureGL::bindAsSurface): (WebCore::BitmapTextureGL::~BitmapTextureGL): (WebCore::BitmapTextureGL::copyFromExternalTexture): * platform/graphics/texmap/BitmapTextureGL.h: (WebCore::BitmapTextureGL::create): (WebCore::BitmapTextureGL::textureTarget const): (WebCore::BitmapTextureGL::internalFormat const): * platform/graphics/texmap/BitmapTexturePool.cpp: (WebCore::BitmapTexturePool::createTexture): * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGL::bindSurface): (WebCore::TextureMapperGL::createTexture): 2017-08-09 Michael Catanzaro [GTK] Remove support for geoclue1 https://bugs.webkit.org/show_bug.cgi?id=164205 Reviewed by Carlos Garcia Campos. * PlatformGTK.cmake: * platform/geoclue/GeolocationProviderGeoclue.h: * platform/geoclue/GeolocationProviderGeoclue1.cpp: Removed. * platform/geoclue/GeolocationProviderGeoclue2.cpp: Removed. 2017-08-09 Yoshiaki Jitsukawa [PAL] Move spi/cocoa and spi/cg directories into PAL https://bugs.webkit.org/show_bug.cgi?id=175175 Reviewed by Myles C. Maxfield. * Modules/applepay/cocoa/PaymentCocoa.mm: * Modules/applepay/cocoa/PaymentContactCocoa.mm: * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm: * Modules/applepay/cocoa/PaymentMethodCocoa.mm: * PlatformAppleWin.cmake: * WebCore.xcodeproj/project.pbxproj: * editing/cocoa/EditorCocoa.mm: * editing/cocoa/HTMLConverter.mm: * editing/ios/EditorIOS.mm: * page/cocoa/ResourceUsageThreadCocoa.mm: * page/mac/TextIndicatorWindow.mm: * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm: * platform/cocoa/DataDetectorsCoreSoftLink.h: * platform/cocoa/MIMETypeRegistryCocoa.mm: * platform/cocoa/NetworkExtensionContentFilter.mm: * platform/cocoa/ParentalControlsContentFilter.mm: * platform/cocoa/SleepDisablerCocoa.cpp: * platform/graphics/Font.cpp: * platform/graphics/Font.h: * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm: * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm: * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm: * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: * platform/graphics/cg/ColorCG.cpp: * platform/graphics/cg/GraphicsContextCG.cpp: * platform/graphics/cg/ImageBufferCG.cpp: * platform/graphics/cg/ImageBufferDataCG.cpp: * platform/graphics/cg/ImageDecoderCG.cpp: * platform/graphics/cg/NativeImageCG.cpp: * platform/graphics/cocoa/FontCacheCoreText.cpp: * platform/graphics/cocoa/FontCascadeCocoa.mm: * platform/graphics/cocoa/FontCocoa.mm: * platform/graphics/cocoa/FontDescriptionCocoa.cpp: * platform/graphics/cocoa/FontPlatformDataCocoa.mm: * platform/graphics/cocoa/IOSurface.mm: * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm: * platform/graphics/cocoa/WebActionDisablingCALayerDelegate.h: * platform/graphics/ios/FontAntialiasingStateSaver.h: * platform/graphics/ios/FontCacheIOS.mm: * platform/graphics/mac/ComplexTextControllerCoreText.mm: * platform/graphics/mac/FontCacheMac.mm: * platform/graphics/mac/GlyphPageMac.cpp: * platform/graphics/win/FontCacheWin.cpp: * platform/ios/LegacyTileCache.mm: * platform/ios/LegacyTileGrid.mm: * platform/ios/LegacyTileGridTile.mm: * platform/ios/PlaybackSessionInterfaceAVKit.mm: * platform/ios/QuickLook.mm: * platform/ios/VideoFullscreenInterfaceAVKit.mm: * platform/ios/WebAVPlayerController.h: * platform/ios/WebAVPlayerController.mm: * platform/ios/WebVideoFullscreenControllerAVKit.mm: * platform/ios/wak/WKGraphics.mm: * platform/mac/DragImageMac.mm: * platform/mac/PlatformScreenMac.mm: * platform/mac/PlaybackSessionInterfaceMac.mm: * platform/mac/ThemeMac.mm: * platform/mac/VideoFullscreenInterfaceMac.mm: * platform/mac/WebPlaybackControlsManager.h: * platform/mac/WebVideoFullscreenHUDWindowController.mm: * platform/network/cocoa/CookieStorageObserver.mm: * platform/network/cocoa/NetworkLoadMetrics.mm: * platform/network/mac/AuthenticationMac.mm: * platform/network/mac/ResourceHandleMac.mm: * platform/spi/ios/DataDetectorsUISPI.h: * platform/spi/mac/DataDetectorsSPI.h: * platform/spi/mac/NSViewSPI.h: * rendering/RenderThemeCocoa.mm: * rendering/RenderThemeIOS.mm: * rendering/RenderThemeMac.mm: 2017-08-09 Don Olmstead [WTF] Move TextStream into WTF https://bugs.webkit.org/show_bug.cgi?id=175211 Reviewed by Myles C. Maxfield. No new tests. No change in behavior. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/ComposedTreeIterator.cpp: * dom/Position.cpp: * dom/Position.h: * dom/Range.cpp: (WebCore::operator<<): * dom/Range.h: * dom/ViewportArguments.cpp: * dom/ViewportArguments.h: * editing/VisiblePosition.cpp: * editing/VisiblePosition.h: * editing/VisibleSelection.cpp: * editing/VisibleSelection.h: * html/HTMLVideoElement.cpp: * html/canvas/CanvasRenderingContext2D.cpp: * page/FrameView.cpp: * page/ViewportConfiguration.cpp: * page/ViewportConfiguration.h: * page/WheelEventDeltaFilter.cpp: * page/animation/CSSPropertyAnimation.cpp: * page/scrolling/AsyncScrollingCoordinator.cpp: * page/scrolling/ScrollingConstraints.cpp: * page/scrolling/ScrollingConstraints.h: * page/scrolling/ScrollingCoordinator.cpp: * page/scrolling/ScrollingCoordinator.h: * page/scrolling/ScrollingStateFixedNode.cpp: * page/scrolling/ScrollingStateFixedNode.h: * page/scrolling/ScrollingStateFrameScrollingNode.cpp: * page/scrolling/ScrollingStateFrameScrollingNode.h: * page/scrolling/ScrollingStateNode.cpp: * page/scrolling/ScrollingStateNode.h: * page/scrolling/ScrollingStateOverflowScrollingNode.cpp: * page/scrolling/ScrollingStateOverflowScrollingNode.h: * page/scrolling/ScrollingStateScrollingNode.cpp: * page/scrolling/ScrollingStateScrollingNode.h: * page/scrolling/ScrollingStateStickyNode.cpp: * page/scrolling/ScrollingStateStickyNode.h: * page/scrolling/ScrollingTree.cpp: * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: * page/scrolling/ScrollingTreeFrameScrollingNode.h: * page/scrolling/ScrollingTreeNode.cpp: * page/scrolling/ScrollingTreeNode.h: * page/scrolling/ScrollingTreeScrollingNode.cpp: * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/mac/ScrollingTreeFixedNode.h: * page/scrolling/mac/ScrollingTreeFixedNode.mm: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: * page/scrolling/mac/ScrollingTreeStickyNode.h: * page/scrolling/mac/ScrollingTreeStickyNode.mm: * platform/CalculationValue.cpp: * platform/CalculationValue.h: * platform/LayoutUnit.cpp: * platform/LayoutUnit.h: * platform/Length.cpp: * platform/Length.h: * platform/LengthBox.cpp: * platform/LengthBox.h: * platform/LengthPoint.cpp: * platform/LengthPoint.h: * platform/LengthSize.cpp: * platform/LengthSize.h: * platform/LogMacros.h: * platform/ScrollView.cpp: * platform/ScrollableArea.cpp: * platform/animation/TimingFunction.cpp: * platform/animation/TimingFunction.h: * platform/graphics/BitmapImage.cpp: * platform/graphics/BitmapImage.h: * platform/graphics/Color.cpp: * platform/graphics/Color.h: * platform/graphics/CrossfadeGeneratedImage.cpp: * platform/graphics/CrossfadeGeneratedImage.h: * platform/graphics/FloatPoint.cpp: * platform/graphics/FloatPoint.h: * platform/graphics/FloatPoint3D.cpp: * platform/graphics/FloatPoint3D.h: * platform/graphics/FloatRect.cpp: * platform/graphics/FloatRect.h: * platform/graphics/FloatRoundedRect.cpp: * platform/graphics/FloatRoundedRect.h: * platform/graphics/FloatSize.cpp: * platform/graphics/FloatSize.h: * platform/graphics/FontTaggedSettings.cpp: * platform/graphics/FontTaggedSettings.h: * platform/graphics/GradientImage.cpp: (WebCore::GradientImage::dump const): * platform/graphics/GradientImage.h: * platform/graphics/GraphicsContext.cpp: * platform/graphics/GraphicsContext.h: * platform/graphics/GraphicsLayer.cpp: * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::dumpAdditionalProperties const): * platform/graphics/GraphicsTypes.cpp: * platform/graphics/GraphicsTypes.h: * platform/graphics/Image.cpp: * platform/graphics/Image.h: * platform/graphics/ImageSource.h: * platform/graphics/IntPoint.cpp: * platform/graphics/IntPoint.h: * platform/graphics/IntRect.cpp: * platform/graphics/IntRect.h: * platform/graphics/IntSize.cpp: * platform/graphics/IntSize.h: * platform/graphics/LayoutPoint.cpp: * platform/graphics/LayoutPoint.h: * platform/graphics/LayoutRect.cpp: * platform/graphics/LayoutRect.h: * platform/graphics/LayoutSize.cpp: * platform/graphics/LayoutSize.h: * platform/graphics/NamedImageGeneratedImage.cpp: * platform/graphics/NamedImageGeneratedImage.h: * platform/graphics/Path.cpp: * platform/graphics/Path.h: * platform/graphics/ca/GraphicsLayerCA.cpp: * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/ca/PlatformCAAnimation.cpp: * platform/graphics/ca/PlatformCAAnimation.h: * platform/graphics/ca/PlatformCALayer.cpp: * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/TileController.cpp: * platform/graphics/ca/TileGrid.cpp: * platform/graphics/cg/GraphicsContextCG.cpp: * platform/graphics/cg/PDFDocumentImage.cpp: * platform/graphics/cg/PDFDocumentImage.h: * platform/graphics/cocoa/IOSurface.h: * platform/graphics/cocoa/IOSurface.mm: * platform/graphics/displaylists/DisplayList.cpp: (WebCore::DisplayList::DisplayList::description const): * platform/graphics/displaylists/DisplayList.h: * platform/graphics/displaylists/DisplayListItems.cpp: * platform/graphics/displaylists/DisplayListItems.h: * platform/graphics/displaylists/DisplayListRecorder.cpp: * platform/graphics/displaylists/DisplayListReplayer.cpp: * platform/graphics/filters/DistantLightSource.cpp: * platform/graphics/filters/DistantLightSource.h: * platform/graphics/filters/FEBlend.cpp: * platform/graphics/filters/FEBlend.h: * platform/graphics/filters/FEColorMatrix.cpp: * platform/graphics/filters/FEColorMatrix.h: * platform/graphics/filters/FEComponentTransfer.cpp: * platform/graphics/filters/FEComponentTransfer.h: * platform/graphics/filters/FEComposite.cpp: * platform/graphics/filters/FEComposite.h: * platform/graphics/filters/FEConvolveMatrix.cpp: * platform/graphics/filters/FEConvolveMatrix.h: * platform/graphics/filters/FEDiffuseLighting.cpp: * platform/graphics/filters/FEDiffuseLighting.h: * platform/graphics/filters/FEDisplacementMap.cpp: * platform/graphics/filters/FEDisplacementMap.h: * platform/graphics/filters/FEDropShadow.cpp: * platform/graphics/filters/FEDropShadow.h: * platform/graphics/filters/FEFlood.cpp: * platform/graphics/filters/FEFlood.h: * platform/graphics/filters/FEGaussianBlur.cpp: * platform/graphics/filters/FEGaussianBlur.h: * platform/graphics/filters/FEMerge.cpp: * platform/graphics/filters/FEMerge.h: * platform/graphics/filters/FEMorphology.cpp: * platform/graphics/filters/FEMorphology.h: * platform/graphics/filters/FEOffset.cpp: * platform/graphics/filters/FEOffset.h: * platform/graphics/filters/FESpecularLighting.cpp: * platform/graphics/filters/FESpecularLighting.h: * platform/graphics/filters/FETile.cpp: * platform/graphics/filters/FETile.h: * platform/graphics/filters/FETurbulence.cpp: * platform/graphics/filters/FETurbulence.h: * platform/graphics/filters/FilterEffect.cpp: * platform/graphics/filters/FilterEffect.h: * platform/graphics/filters/FilterOperation.cpp: * platform/graphics/filters/FilterOperation.h: * platform/graphics/filters/FilterOperations.cpp: * platform/graphics/filters/FilterOperations.h: * platform/graphics/filters/LightSource.h: * platform/graphics/filters/PointLightSource.cpp: * platform/graphics/filters/PointLightSource.h: * platform/graphics/filters/SourceAlpha.cpp: * platform/graphics/filters/SourceAlpha.h: * platform/graphics/filters/SourceGraphic.cpp: * platform/graphics/filters/SourceGraphic.h: * platform/graphics/filters/SpotLightSource.cpp: * platform/graphics/filters/SpotLightSource.h: * platform/graphics/transforms/AffineTransform.cpp: * platform/graphics/transforms/AffineTransform.h: * platform/graphics/transforms/IdentityTransformOperation.h: * platform/graphics/transforms/Matrix3DTransformOperation.cpp: * platform/graphics/transforms/Matrix3DTransformOperation.h: * platform/graphics/transforms/MatrixTransformOperation.cpp: * platform/graphics/transforms/MatrixTransformOperation.h: * platform/graphics/transforms/PerspectiveTransformOperation.cpp: * platform/graphics/transforms/PerspectiveTransformOperation.h: * platform/graphics/transforms/RotateTransformOperation.cpp: * platform/graphics/transforms/RotateTransformOperation.h: * platform/graphics/transforms/ScaleTransformOperation.cpp: * platform/graphics/transforms/ScaleTransformOperation.h: * platform/graphics/transforms/SkewTransformOperation.cpp: * platform/graphics/transforms/SkewTransformOperation.h: * platform/graphics/transforms/TransformOperation.cpp: * platform/graphics/transforms/TransformOperation.h: * platform/graphics/transforms/TransformOperations.cpp: * platform/graphics/transforms/TransformOperations.h: * platform/graphics/transforms/TransformationMatrix.cpp: * platform/graphics/transforms/TransformationMatrix.h: * platform/graphics/transforms/TranslateTransformOperation.cpp: * platform/graphics/transforms/TranslateTransformOperation.h: * platform/ios/SelectionRect.cpp: (WebCore::operator<<): * platform/ios/SelectionRect.h: * platform/mac/ScrollAnimatorMac.mm: * platform/text/TextAllInOne.cpp: * rendering/InlineBox.cpp: * rendering/InlineBox.h: * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::outputLineTreeAndMark const): * rendering/InlineFlowBox.h: * rendering/InlineTextBox.cpp: * rendering/InlineTextBox.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::outputLineTreeAndMark const): * rendering/RenderBlockFlow.h: * rendering/RenderLayer.cpp: * rendering/RenderLayerCompositor.cpp: * rendering/RenderObject.cpp: * rendering/RenderObject.h: * rendering/RenderTreeAsText.cpp: * rendering/RenderTreeAsText.h: * rendering/ScrollAlignment.cpp: * rendering/ScrollAlignment.h: * rendering/SimpleLineLayoutCoverage.cpp: * rendering/SimpleLineLayoutFunctions.cpp: * rendering/SimpleLineLayoutFunctions.h: * rendering/style/FillLayer.cpp: * rendering/style/FillLayer.h: * rendering/style/NinePieceImage.cpp: * rendering/style/NinePieceImage.h: * rendering/style/RenderStyleConstants.cpp: * rendering/style/RenderStyleConstants.h: * rendering/svg/SVGRenderTreeAsText.cpp: (WebCore::operator<<): * rendering/svg/SVGRenderTreeAsText.h: (WebCore::operator<<): * svg/SVGLengthValue.cpp: * svg/SVGLengthValue.h: * svg/graphics/SVGImage.cpp: * svg/graphics/SVGImage.h: * svg/graphics/filters/SVGFEImage.cpp: * svg/graphics/filters/SVGFEImage.h: 2017-08-09 Commit Queue Unreviewed, rolling out r220466, r220477, and r220487. https://bugs.webkit.org/show_bug.cgi?id=175411 This change broke existing API tests and follow up fixes did not resolve all the issues. (Requested by ryanhaddad on #webkit). Reverted changesets: https://bugs.webkit.org/show_bug.cgi?id=175244 http://trac.webkit.org/changeset/220466 "WTF::Function does not allow for reference / non-default constructible return types" https://bugs.webkit.org/show_bug.cgi?id=175244 http://trac.webkit.org/changeset/220477 https://bugs.webkit.org/show_bug.cgi?id=175244 http://trac.webkit.org/changeset/220487 2017-08-09 Chris Dumez [Beacon][NetworkSession] Support CORS-preflighting on redirects https://bugs.webkit.org/show_bug.cgi?id=175386 Reviewed by Youenn Fablet. Export a couple of WebCore symbols so I can use them in WebKit2. Tests: http/wpt/beacon/cors/cors-preflight-redirect-failure.html http/wpt/beacon/cors/cors-preflight-redirect-from-crossorigin-to-sameorigin.html http/wpt/beacon/cors/cors-preflight-redirect-success.html * loader/CrossOriginAccessControl.h: * page/SecurityOrigin.h: 2017-08-09 Jeremy Jones Use MPAVRoutingController instead of deprecated versions. https://bugs.webkit.org/show_bug.cgi?id=175063 Reviewed by Tim Horton. No new tests because no behavior change. This uses a different platform class to present an interface. Remove deprecated MPAudioVideoRoutingPopoverController and MPAVRoutingSheet Add MPMediaControlsViewController. * platform/spi/ios/MediaPlayerSPI.h: 2017-08-09 Myles C. Maxfield Mark font-display as in development https://bugs.webkit.org/show_bug.cgi?id=175387 Unreviewed. * features.json: 2017-08-09 Commit Queue Unreviewed, rolling out r219334. https://bugs.webkit.org/show_bug.cgi?id=175398 Caused bug 175023 (Requested by ap on #webkit). Reverted changeset: "[SVG] Leak in SVGAnimatedListPropertyTearOff" https://bugs.webkit.org/show_bug.cgi?id=172545 http://trac.webkit.org/changeset/219334 2017-08-09 Dave Hyatt [Repaint from Layout Removal] Move layer repaint rects into a map https://bugs.webkit.org/show_bug.cgi?id=175393 Reviewed by Zalan Bujtas. Move the two repaint rects held by RenderLayer into a RenderLayerModelObject -> RepaintLayoutRects hash map. RepaintLayoutRects is a new struct that holds both rects. Eventually more objects than just self painting layers will be caching repaint rects, so this takes a first step towards having a common cache for these repaint rects. In addition this change saves memory, since layers that aren't self-painting no longer have empty repaint rects taking up space in RenderLayer. * rendering/RenderBlockLineLayout.cpp: (WebCore::RenderBlockFlow::layoutRunsAndFloats): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::RenderLayer): (WebCore::RenderLayer::updateLayerPositions): (WebCore::RenderLayer::repaintRectIncludingNonCompositingDescendants): (WebCore::RenderLayer::computeRepaintRects): (WebCore::RenderLayer::clearRepaintRects): (WebCore::RenderLayer::updateLayerPositionsAfterScroll): (WebCore::RenderLayer::scrollTo): * rendering/RenderLayer.h: * rendering/RenderLayerModelObject.cpp: (WebCore::RepaintLayoutRects::RepaintLayoutRects): (WebCore::RenderLayerModelObject::willBeDestroyed): (WebCore::RenderLayerModelObject::destroyLayer): (WebCore::RenderLayerModelObject::styleDidChange): (WebCore::RenderLayerModelObject::hasRepaintLayoutRects): (WebCore::RenderLayerModelObject::setRepaintLayoutRects): (WebCore::RenderLayerModelObject::clearRepaintLayoutRects): (WebCore::RenderLayerModelObject::repaintLayoutRects): (WebCore::RenderLayerModelObject::computeRepaintLayoutRects): * rendering/RenderLayerModelObject.h: (WebCore::RepaintLayoutRects::RepaintLayoutRects): 2017-08-09 Sam Weinig WTF::Function does not allow for reference / non-default constructible return types https://bugs.webkit.org/show_bug.cgi?id=175244 Reviewed by Chris Dumez. * bindings/js/JSCustomElementInterface.h: (WebCore::JSCustomElementInterface::invokeCallback): Update the default value for the addArguments parameter to be an empty lambda, rather than default initialization, which leads to a null WTF::Function. This allows us to remove support for calling null WTF::Function. No change in behavior. 2017-08-09 Brady Eidson Teach ScriptExecutionContexts about their SessionID. https://bugs.webkit.org/show_bug.cgi?id=175391 Reviewed by Andy Estes. No new tests (No current change in behavior). Turns out that Workers need to know their SessionID for future feature development. So let's teach it to them. * dom/ScriptExecutionContext.h: Expose a pure virtual SessionID accessor. * dom/Document.cpp: (WebCore::Document::sessionID const): * dom/Document.h: * page/SessionID.cpp: (WebCore::SessionID::isolatedCopy const): * page/SessionID.h: * workers/DedicatedWorkerGlobalScope.cpp: (WebCore::DedicatedWorkerGlobalScope::create): (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope): * workers/DedicatedWorkerGlobalScope.h: * workers/DedicatedWorkerThread.cpp: (WebCore::DedicatedWorkerThread::DedicatedWorkerThread): (WebCore::DedicatedWorkerThread::createWorkerGlobalScope): * workers/DedicatedWorkerThread.h: * workers/Worker.cpp: (WebCore::Worker::notifyFinished): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): * workers/WorkerGlobalScope.h: * workers/WorkerGlobalScopeProxy.h: * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): * workers/WorkerMessagingProxy.h: * workers/WorkerThread.cpp: (WebCore::WorkerThreadStartupData::WorkerThreadStartupData): (WebCore::WorkerThread::WorkerThread): (WebCore::WorkerThread::workerThread): * workers/WorkerThread.h: 2017-08-09 Wenson Hsieh [iOS DnD] ENABLE_DRAG_SUPPORT should be turned off for iOS 10 and enabled by default https://bugs.webkit.org/show_bug.cgi?id=175392 Reviewed by Tim Horton and Megan Gardner. Tweak FeatureDefines to enable drag and drop by default, and disable only on unsupported platforms (i.e. iOS 10). No change in behavior. * Configurations/FeatureDefines.xcconfig: 2017-08-09 Kirill Ovchinnikov Old subtitle track is not deleted on 'src' attribute change event https://bugs.webkit.org/show_bug.cgi?id=175031 Reviewed by Eric Carlson. Test: media/track/text-track-src-change.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::textTrackReadyStateChanged): * html/HTMLTrackElement.cpp: (WebCore::HTMLTrackElement::loadTimerFired): * html/shadow/MediaControls.cpp: (WebCore::MediaControls::clearTextDisplayContainer): * html/shadow/MediaControls.h: 2017-08-09 Ryan Haddad Unreviewed, rolling out r220457. This change introduced API test failures. Reverted changeset: "WTF::Function does not allow for reference / non-default constructible return types" https://bugs.webkit.org/show_bug.cgi?id=175244 http://trac.webkit.org/changeset/220457 2017-08-09 Don Olmstead [WinCairo] Fix build after rev 220399 https://bugs.webkit.org/show_bug.cgi?id=175360 Reviewed by Žan Doberšek. No new tests. No change in behavior. * platform/graphics/texmap/TextureMapperGLHeaders.h: 2017-08-09 Nan Wang AX: crash at WebCore::AccessibilityObject::supportsARIALiveRegion() const + 24 https://bugs.webkit.org/show_bug.cgi?id=175340 Reviewed by Chris Fleizach. When adding a psuedo element child to a RenderBlockFlow element, there might be a chance where the element has already been layed out but we are still holding onto its stale children. Fixed it by notifying AX correctly when inserting/removing children during layout. Test: accessibility/add-children-pseudo-element.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::insertFloatingObject): (WebCore::RenderBlockFlow::removeFloatingObject): 2017-08-09 Charlie Turner [GStreamer][MSE] Add missing lock around getStreamByTrackId https://bugs.webkit.org/show_bug.cgi?id=175323 Reviewed by Xabier Rodriguez-Calvar. Covered by existing tests. * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: (WebCore::PlaybackPipeline::enqueueSample): Ensure the media source lock is taken before modifiying the track queues indirectly via the iterator use in getTrackId. 2017-08-09 Daniel Bates REGRESSION (r219013): OAuth flows are broken when redirecting back to application after authentication https://bugs.webkit.org/show_bug.cgi?id=175247 Reviewed by Brady Eidson. Add SPI so that Safari can differentiate between a form submission and a redirected form submission and have PolicyCheck notify the frame loader client if the navigation was in response to receiving a redirect response. This is the WebKit portion to fix an issue when a native app makes use of an OAuth OAuth flow that bounces to Safari for user login and then bounce back to the app. Microsoft Graph's OAuth flow is one example. Safari was differentiating between a form submission and a redirected form submission based on the nullity of WKNavigationAction.sourceFrame because in both cases the navigation type was WKNavigationTypeFormSubmitted. The navigation type is the same for both navigations because WebKit always used the navigation action from the original request for the redirect request when the original request redirected. Prior to r219013, WKNavigationAction.sourceFrame would be nil for a form submission that redirects. Following r219013, WKNavigationAction.sourceFrame is non-nil unless the navigation was initiated by API. In particular, WKNavigationAction.sourceFrame is non-nil for the redirect navigation corresponding to a form submission that redirects. * loader/EmptyClients.cpp: (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * loader/FrameLoaderClient.h: Have dispatchDecidePolicyForNavigationAction() take a boolean as to whether the navigation was in response to receiving a redirect response. * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): Notify the frame loader client whether the navigation is in response to receiving a redirect response. 2017-08-09 Sam Weinig WTF::Function does not allow for reference / non-default constructible return types https://bugs.webkit.org/show_bug.cgi?id=175244 Reviewed by Chris Dumez. * bindings/js/JSCustomElementInterface.h: (WebCore::JSCustomElementInterface::invokeCallback): Update the default value for the addArguments parameter to be an empty lambda, rather than default initialization, which leads to a null WTF::Function. This allows us to remove support for calling null WTF::Function. No change in behavior. 2017-08-09 Andy Estes [QuickLook] Use case-insensitive comparison of preview MIME types https://bugs.webkit.org/show_bug.cgi?id=175350 Reviewed by Brady Eidson. MIME types are case-insensitive, but PreviewLoader was using a case-sensitive comparison to determine if a MIME type was supported by QLPreviewConverter. As a result we would fail to preview Excel macro-enabled workbooks, since CFNetwork would sniff a MIME type of "application/vnd.ms-excel.sheet.macroEnabled.12" but QuickLook contained "application/vnd.ms-excel.sheet.macroenabled.12" in its set of supported MIME type strings. Fix this by copying the QuickLook supported MIME type set into a HashSet using ASCIICaseInsensitiveHash and using that HashSet for MIME type checks. Test: quicklook/excel-macro-enabled.html * loader/ios/PreviewLoader.mm: (WebCore::PreviewLoader::shouldCreateForMIMEType): 2017-08-09 Ms2ger Remove unnecessary copies of PlatformMediaSessionManager::m_sessions https://bugs.webkit.org/show_bug.cgi?id=175375 Reviewed by Sam Weinig. Remove unnecessary copies of PlatformMediaSessionManager::m_sessions. These should have been removed in r207688. No new tests: no behavior change. * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive const): (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const): (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground const): (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground const): 2017-08-09 Chris Dumez Reinstate active flag for iterators https://bugs.webkit.org/show_bug.cgi?id=175312 Reviewed by Sam Weinig. NodeIterator / TreeWalker should no longer allow recursive filters after the following change to the DOM specification: - https://github.com/whatwg/dom/pull/359 This patch aligns our behavior with the latest specification. No new tests, updated existing tests. * dom/NodeIterator.cpp: (WebCore::NodeIterator::nextNode): (WebCore::NodeIterator::previousNode): Note that we now also call m_candidateNode.clear() before returning an exception. This was a pre-existing bug that we failed to do so in the exception case but it became more obvious after this change now that we throw. This was causing traversal/moz-bug559526.html to fail otherwise (the filter was called one too many times). The test case is passing in Firefox (The filter is called 4 times and they throw each time). * dom/Traversal.cpp: (WebCore::NodeIteratorBase::NodeIteratorBase): (WebCore::NodeIteratorBase::acceptNode): * dom/Traversal.h: * dom/TreeWalker.cpp: 2017-08-09 Antti Koivisto RenderQuote should not mutate render tree https://bugs.webkit.org/show_bug.cgi?id=175328 Reviewed by Zalan Bujtas. RenderQuote text renderers are currently created and deleted in a quirky fashion using a linked list. This patch moves to a simpler model that guarantees the mutations are always done in controlled fashion during render tree update. * dom/Document.cpp: (WebCore::Document::updateTextRenderer): Move text renderer updating to Document so we can set the inRenderTreeUpdate bit for it too. * dom/Document.h: * dom/Text.cpp: (WebCore::Text::updateRendererAfterContentChange): * rendering/RenderDescendantIterator.h: (WebCore::RenderDescendantIteratorAdapter::at): (WebCore::RenderDescendantConstIteratorAdapter::at const): Add at() function for starting iteration from a specified renderer. * rendering/RenderQuote.cpp: (WebCore::RenderQuote::insertedIntoTree): (WebCore::RenderQuote::willBeRemovedFromTree): Register and unregister quotes to RenderView. Don't do any mutations. (WebCore::RenderQuote::styleDidChange): Invalidate the text renderer but don't mutate it. (WebCore::RenderQuote::updateTextRenderer): (WebCore::RenderQuote::computeText const): (WebCore::RenderQuote::updateRenderers): Compute depth of all render quotes and update the text renderer as needed. (WebCore::RenderQuote::willBeDestroyed): Deleted. (WebCore::RenderQuote::attachQuote): Deleted. (WebCore::RenderQuote::detachQuote): Deleted. (WebCore::RenderQuote::updateDepth): Deleted. Get rid of the linked list. * rendering/RenderQuote.h: * rendering/RenderView.cpp: (WebCore::RenderView::registerQuote): (WebCore::RenderView::unregisterQuote): Maintain a render tree order ListHashSet of RenderQuotes. (WebCore::RenderView::updateSpecialRenderers): Add a function for making additional render tree mutations at the end of a render tree update. Currently this just invokes RenderQuote::updateRenderers. * rendering/RenderView.h: * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::commit): Call RenderView::updateSpecialRenderers after committing all other changes. 2017-08-09 Zan Dobersek [Soup] Incorrect conversion in msToSoupDate() https://bugs.webkit.org/show_bug.cgi?id=175320 Reviewed by Carlos Garcia Campos. Original patch by VaL Doroshchuk. * platform/network/soup/NetworkStorageSessionSoup.cpp: (WebCore::msToSoupDate): monthFromDayInYear() returns a value in the [0,11] range, while soup_date_new() expects a month value in the [1,12] range. The return value must be thus incremented by one to match that expectation. 2017-08-08 Wenson Hsieh Unreviewed, rolling out r220393. This patch regresses the performance of WebPage::editorState. Reverted changeset: "[iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div" https://bugs.webkit.org/show_bug.cgi?id=175116 http://trac.webkit.org/changeset/220393 2017-08-08 Chris Dumez [Beacon] Add support for CORS-preflighting for WK2 / NETWORK_SESSION https://bugs.webkit.org/show_bug.cgi?id=175264 Reviewed by Youenn Fablet. Pass additional information when creating a PingHandle so that the PingLoad can deal with CORS-preflighting on Network process side. Tests: http/wpt/beacon/cors/cors-preflight-arraybufferview-failure.html http/wpt/beacon/cors/cors-preflight-arraybufferview-success.html http/wpt/beacon/cors/cors-preflight-blob-failure.html http/wpt/beacon/cors/cors-preflight-blob-success.html http/wpt/beacon/cors/cors-preflight-cookie.html * WebCore.xcodeproj/project.pbxproj: * loader/CrossOriginAccessControl.cpp: (WebCore::validatePreflightResponse): * loader/CrossOriginAccessControl.h: * loader/CrossOriginPreflightChecker.cpp: (WebCore::CrossOriginPreflightChecker::validatePreflightResponse): * loader/CrossOriginPreflightResultCache.h: * loader/LoaderStrategy.h: * loader/PingLoader.cpp: (WebCore::PingLoader::loadImage): (WebCore::PingLoader::sendPing): (WebCore::PingLoader::sendViolationReport): (WebCore::PingLoader::startPingLoad): * loader/PingLoader.h: * loader/cache/CachedResource.cpp: (WebCore::CachedResource::load): * page/SecurityOrigin.h: 2017-08-08 Sam Weinig Address review feedback from https://bugs.webkit.org/show_bug.cgi?id=175246. * bindings/js/DOMPromiseProxy.h: * css/FontFaceSet.cpp: * css/FontFaceSet.h: 2017-08-08 Devin Rousso Web Inspector: Canvas: support editing WebGL shaders https://bugs.webkit.org/show_bug.cgi?id=124211 Reviewed by Matt Baker. Test: inspector/canvas/updateShader.html * inspector/InspectorCanvasAgent.h: * inspector/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::updateShader): * html/canvas/WebGLRenderingContextBase.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::linkProgram): (WebCore::WebGLRenderingContextBase::linkProgramWithoutInvalidatingAttribLocations): Normally, when a program is linked, it invalidates any WebGLUniformLocation associated with the program by incrementing its `linkCount`. In order to allow live editing of shaders, we need to be able to compile and link a shader without invalidating these locations. This patch moves the shader linking logic to its own function that is called by `linkProgram` so that InspectorCanvasAgent can compile and link without invalidation. 2017-08-08 Sam Weinig [WebIDL] Add support for Promise<> attributes https://bugs.webkit.org/show_bug.cgi?id=175246 Reviewed by Yusuke Suzuki. Introduces and adopts DOMPromiseProxy, a new class for binding promises in a more straightforward and safe (from a wrapper world perspective) way. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSFontFaceCustom.cpp: Removed. * bindings/js/JSFontFaceSetCustom.cpp: Removed. * bindings/js/JSMediaKeySessionCustom.cpp: Removed. * bindings/js/JSServiceWorkerContainerCustom.cpp: Removed. * bindings/js/JSWebGPUCommandBufferCustom.cpp: Removed. Remove custom bindings only needed for promise attributes. Add DOMPromiseProxy.h * Modules/encryptedmedia/MediaKeySession.cpp: (WebCore::MediaKeySession::sessionClosed): (WebCore::MediaKeySession::registerClosedPromise): Deleted. * Modules/encryptedmedia/MediaKeySession.h: * Modules/encryptedmedia/MediaKeySession.idl: Replace custom promise code using the registerPromise idiom with DOMPromiseProxy. * bindings/IDLTypes.h: Add StorageType type alias to allow specifying a specific form for storage. This allows use to use Ref<> for interfaces in DOMPromiseProxy. (WebCore::IDLWrapper::convertToParameterType): Also add convertToParameterType, an annoying hack to workaround the fact WTF::Function can't return references / no * bindings/js/DOMPromiseProxy.h: Added. (WebCore::DOMPromiseProxy): DOMPromiseProxy is a new class (set of classes) to represent promises that works with the standard toJS<> / JSDOMConvert infrastructure used by the bindings generator. From the implementation perspective, it is similar to DOMPromiseDeferred, but instead of receiving one as a parameter, you can initialize it directly in your constructor and start using it. From the bindings perspective, a DOMPromiseProxy can be converted into a JS Promise by calling its promise function, which will either create a new promise, or return a cached one. To make this work, DOMPromiseProxy maintains a Vector of DeferredPromises that hold onto those actualized promises. The reason it has a Vector, is that we need one DeferredPromises per DOMWrapperWorld, just like we need one wrapper for an interface per DOMWrapperWorld in the wrapper cache. In most cases, only the normal world will be in play, so the Vector has an inline capacity of one. In addition, DOMPromiseProxy maintains a Variant of either an Exception or the result value type. This allows the DOMPromiseProxy to be resolved or rejected at anytime. Then, when the bindings request the promise, the stored result / exception can be resolved / rejected into the promise. (WebCore::DOMPromiseProxy): For void promises, we need slightly different semantics (resolve takes no parameters, Value is a bit indicating resolved state), so it is specialized. (WebCore::DOMPromiseProxyWithResolveCallback): In addition to the void specialization, we have DOMPromiseProxyWithResolveCallback. Instead of storing the value of the resolution directly, this specialization allows the owner to specify callback to be called when the resolved value is needed. This is needed to avoid reference cycles when the resolved value is the owner such as is the case with FontFace and FontFaceSet. * bindings/js/JSDOMConvertPromise.h: (WebCore::JSConverter>::convert): Add converter that calls through to the DOMPromiseProxy function promise. * bindings/js/JSDOMPromiseDeferred.cpp: (WebCore::DeferredPromise::callFunction): (WebCore::DeferredPromise::reject): * bindings/js/JSDOMPromiseDeferred.h: (WebCore::DeferredPromise::create): (WebCore::DeferredPromise::DeferredPromise): Add a new create function for DeferredPromise that creates the JSPromiseDeferred for you. Also adds a mode to DeferredPromise to allow keeping the promise after resolution. Maintain the old behavior as the default. Change reject to take an Exception as sink rather than an r-value, to allow DOMPromiseProxy to copy a Exception into multiple DeferredPromises. For callers already moving into reject, this should be no change. * bindings/scripts/CodeGeneratorJS.pm: (AddToIncludesForIDLType): (GenerateParametersCheck): (GenerateImplementationFunctionCall): (NativeToJSValueDOMConvertNeedsState): (NativeToJSValueDOMConvertNeedsGlobalObject): Add support DOMPromiseProxy. For now, this means a new extended attribute, [PromiseProxy], but once I convert all the existing promises over to using DOMPromiseProxy, it will be removed. Also specify the right #includes for promises and necessary parameters for conversion. * bindings/scripts/IDLAttributes.json: Add [PromiseProxy], a temporary extended attribute for using DOMPromiseProxy. * css/FontFace.cpp: * css/FontFace.h: * css/FontFace.idl: * css/FontFaceSet.cpp: * css/FontFaceSet.h: * css/FontFaceSet.idl: Replace custom promise code using the registerPromise idiom with DOMPromiseProxyWithResolveCallback. The callback is necessary for these two classes since the value the resolve is themselves, and using a normal resolve would create a cycle. * html/canvas/WebGPUCommandBuffer.cpp: * html/canvas/WebGPUCommandBuffer.h: * html/canvas/WebGPUCommandBuffer.idl: * platform/graphics/cocoa/GPUCommandBufferMetal.mm: * platform/graphics/gpu/GPUCommandBuffer.cpp: * platform/graphics/gpu/GPUCommandBuffer.h: Replace custom promise code using the registerPromise idiom with DOMPromiseProxy. * page/NavigatorBase.cpp: (WebCore::NavigatorBase::NavigatorBase): * page/NavigatorBase.h: Forward declare ServiceWorkerContainer and add an explicit constructor to allow removing #include of ServiceWorkerContainer.h in the header, avoiding an #include cycle. * workers/ServiceWorkerContainer.cpp: * workers/ServiceWorkerContainer.h: * workers/ServiceWorkerContainer.idl: Replace custom promise code using the registerPromise idiom with DOMPromiseProxy. * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: * bindings/scripts/test/TestObj.idl: Add / update tests. 2017-08-08 John Wilander Resource Load Statistics: Merge of dataRecordsRemoved should use std::max() https://bugs.webkit.org/show_bug.cgi?id=175348 Reviewed by Chris Dumez. No new tests. Online change of a statistic that doesn't affect logic flow. * loader/ResourceLoadStatistics.cpp: (WebCore::ResourceLoadStatistics::merge): Now uses std::max() instead of addition. 2017-08-08 Brent Fulgham Sandbox flags do not support document.domain control https://bugs.webkit.org/show_bug.cgi?id=175281 Reviewed by Chris Dumez. Update the 'setDomain' logic to honor the sandbox properties as defined in the current HTML5 specification. This brings us in line with how Chrome and other browsers have worked for some time. Test: fast/frames/sandboxed-iframe-domain.html * dom/Document.cpp: (WebCore::Document::setDomain): Add check for sandbox flag (with appropriate error message) * dom/SecurityContext.h: 2017-08-08 Jeremy Jones Change fast seek logic to prevent ping-ponging. https://bugs.webkit.org/show_bug.cgi?id=175167 rdar://problem/32936116 Reviewed by Jer Noble. Updated test: media/video-fast-seek.html Changed fast seek behavior to always seek early than seek time; and after current time when seeking forward. This prevents ping-ponging, where a fast seek overshoots the target looking for a keyframe. A subsequent seek will suddenly be on the other side of current time and will search in the opposite direction for a key frame; repeat. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::fastSeek): 2017-08-08 Ms2ger Unreviewed. Correct the function name in a debug message. https://bugs.webkit.org/show_bug.cgi?id=175262 No new tests: debug logs are not tested. * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const): 2017-08-08 Brent Fulgham Unreviewed build fix after r220376. Don't attempt to use isPublicSuffix when building without that feature enabled. * dom/Document.cpp: (WebCore::Document::domainIsRegisterable const): 2017-08-08 Michael Catanzaro [CMake] Properly test if compiler supports compiler flags https://bugs.webkit.org/show_bug.cgi?id=174490 Reviewed by Konstantin Tokarev. * CMakeLists.txt: * PlatformGTK.cmake: * PlatformWPE.cmake: 2017-08-08 Zan Dobersek [GStreamer] Don't use GraphicsContext3D in VideoTextureCoperGStreamer https://bugs.webkit.org/show_bug.cgi?id=174774 Reviewed by Carlos Garcia Campos. VideoTextureCoperGStreamer class creates a new GraphicsContext3D internally that's used to render to whichever OpenGL context is current. Such usage doesn't add anything to the user since there's no underlying offscreen-based OpenGL context created, and instead all GraphicsContext3D calls are directly translated to usual OpenGL API calls. We should avoid using GraphicsContext3D in such cases and instead use direct OpenGL API calls. This patch achieves that for the VideoTextureCoperGStreamer class. A GraphicsContext3D object is still created because it's needed to construct an instance of the TextureMapperShaderProgram class, but this will be removed as soon as TextureMapperShaderProgram drops the GraphicsContext3D dependence. No new tests -- no change in behavior. * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp: (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer): (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer): (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture): * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h: (WebCore::VideoTextureCopierGStreamer::resultTexture): 2017-08-08 Zan Dobersek [TexMap] Drop GC3D* type usage from TextureMapperPlatformLayer{Buffer,Proxy} https://bugs.webkit.org/show_bug.cgi?id=175314 Reviewed by Carlos Garcia Campos. Switch to using OpenGL types in the TextureMapperPlatformLayerBuffer and TextureMapperPlatformLayerProxy classes, instead of the equivalent GC3D* types provided in the GraphicsTypes3D.h header. No new tests -- no change in behavior. * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp: (WebCore::TextureMapperPlatformLayerBuffer::TextureMapperPlatformLayerBuffer): (WebCore::TextureMapperPlatformLayerBuffer::canReuseWithoutReset): * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h: * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp: (WebCore::TextureMapperPlatformLayerProxy::getAvailableBuffer): * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h: 2017-08-08 Zan Dobersek [TexMap] Don't use GraphicsContext3D in ClipStack https://bugs.webkit.org/show_bug.cgi?id=174776 Reviewed by Carlos Garcia Campos. Any GraphicsContext3D object that's passed to ClipStack methods is of the render-to-current-context nature, meaning there's no internally owned GL context that has to be properly handled and all calls are simply passed to OpenGL APIs. We should drop such (non-)usage of GraphicsContext3D in favor of direct OpenGL API invocations. This patch covers TextureMapper's ClipStack. Call sites to the apply() and applyIfNeeded() are modified to not pass a reference to any GraphicsContext3D object. Internally, OpenGL API entrypoints and constants are used instead of GraphicsContext3D invocations. No new tests -- no change in behavior. * platform/graphics/texmap/BitmapTextureGL.cpp: (WebCore::BitmapTextureGL::clearIfNeeded): (WebCore::BitmapTextureGL::bindAsSurface): * platform/graphics/texmap/ClipStack.cpp: (WebCore::ClipStack::apply): (WebCore::ClipStack::applyIfNeeded): * platform/graphics/texmap/ClipStack.h: * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGL::bindDefaultSurface): (WebCore::TextureMapperGL::beginScissorClip): (WebCore::TextureMapperGL::beginClip): (WebCore::TextureMapperGL::endClip): 2017-08-08 Javier Fernandez Not possible to remove the 'li' element inside the table cell https://bugs.webkit.org/show_bug.cgi?id=173148 Reviewed by Ryosuke Niwa. We need to add a new case for breaking out empty list items when they are at the start of an editable area. Since list items can be also inside table cells, we need to consider this kind of elements as well. Tests: editing/deleting/delete-list-items-in-table-cell-1.html editing/deleting/delete-list-items-in-table-cell-2.html editing/deleting/delete-list-items-in-table-cell-3.html editing/deleting/delete-list-items-in-table-cell-4.html editing/deleting/delete-list-items-in-table-cell-5.html editing/deleting/delete-list-items-in-table-cell-6.html editing/deleting/delete-list-items-in-table-cell-7.html editing/deleting/delete-list-items-in-table-cell-8.html * editing/TypingCommand.cpp: (WebCore::TypingCommand::deleteKeyPressed): 2017-08-08 Zan Dobersek [TexMap] Isolate the TextureMapperPlatformLayerProxyProvider class https://bugs.webkit.org/show_bug.cgi?id=175316 Reviewed by Carlos Garcia Campos. Move the TextureMapperPlatformLayerProxyProvider class (which is the type aliased to PlatformLayer for threaded CoordGraphics) into its own header file. This prevents including the TextureMapperPlatformLayerProxy.h header file in MediaPlayerPrivateGStreamerBase.h, avoiding spilling OpenGL types and function declarations before the GStreamer GL headers include them later in the MediaPlayerPrivateGStreamerBase implementation file. In the MediaPlayerPrivateGStreamerBase.h header file, only the new header is included, and a forward declaration of the TextureMapperPlatformLayerProxy class is used. proxy() and swapBuffersIfNeeded() methods are moved into the implementation file to avoid requiring the full definition of the TextureMapperPlatformLayerProxy class. Similar is done for the TextureMapperGC3DPlatformLayer class and the Cairo-specific implementation of the ImageBufferData class. The CoordinatedGraphicsLayer implementation file also gains an include of the TextureMapperPlatformLayerProxyProvider.h header since it requires the full definition of that class. No new tests -- no change in behavior. * platform/graphics/cairo/ImageBufferCairo.cpp: (WebCore::ImageBufferData::proxy const): * platform/graphics/cairo/ImageBufferDataCairo.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): (WebCore::MediaPlayerPrivateGStreamerBase::proxy const): (WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp: * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h: * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h: * platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h: Added. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: 2017-08-08 Zan Dobersek Unreviewed. Follow-up to r220392 that fixes build on configurations that disable USE(GSTREAMER_GL). * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor): When creating the BitmapTextureGL object, also provide an initialized TextureMapperContextAttributes object. 2017-08-08 Zan Dobersek [TexMap] Group GL header file inclusions in a single header file https://bugs.webkit.org/show_bug.cgi?id=175313 Reviewed by Carlos Garcia Campos. Add a helper header file to the TextureMapper subsystem that includes the OpenGL headers, properly addressing the build configuration to include headers as provided by either libepoxy, the OpenGL ES library, or the OpenGL library. TextureMapperContextAttributes implementation file is the only one that can leverage the header at the moment, but more will follow. * platform/graphics/texmap/TextureMapperContextAttributes.cpp: * platform/graphics/texmap/TextureMapperGLHeaders.h: Copied from Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.cpp. 2017-08-08 Wenson Hsieh [iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div https://bugs.webkit.org/show_bug.cgi?id=175116 Reviewed by Darin Adler and Ryosuke Niwa. WebCore support for WebPage::editorState refactoring. See WebKit ChangeLogs for more detail. Tests: EditorStateTests.TypingAttributesBold EditorStateTests.TypingAttributesItalic EditorStateTests.TypingAttributesUnderline EditorStateTests.TypingAttributesTextAlignmentAbsoluteAlignmentOptions EditorStateTests.TypingAttributesTextAlignmentStartEnd EditorStateTests.TypingAttributesTextAlignmentDirectionalText EditorStateTests.TypingAttributesTextColor EditorStateTests.TypingAttributesMixedStyles EditorStateTests.TypingAttributesLinkColor * css/StyleProperties.cpp: (WebCore::StyleProperties::propertyAsColor const): (WebCore::StyleProperties::propertyAsValueID const): Introduces some helper functions in StyleProperties to convert CSS property values to Color or a CSSValueID. * css/StyleProperties.h: * editing/EditingStyle.cpp: (WebCore::EditingStyle::hasStyle): Pull out logic in selectionStartHasStyle that asks for a style TriState into EditingStyle::hasStyle. This is because WebPage::editorState will now query for multiple styles at the selection start, but selectionStartHasStyle currently recomputes styleAtSelectionStart every time it is called. To prevent extra work from being done, we can just call selectionStartHasStyle once and use ask for EditingStyle::hasStyle on the computed EditingStyle at selection start. * editing/EditingStyle.h: * editing/Editor.cpp: (WebCore::Editor::selectionStartHasStyle const): 2017-08-08 Zan Dobersek [TexMap] Add TextureMapperContextAttributes https://bugs.webkit.org/show_bug.cgi?id=175311 Reviewed by Carlos Garcia Campos. Add and use TextureMapperContextAttributes, a slim struct that holds information about the type and extensions supported by the OpenGL context that's being used for one specific TextureMapperGL instance. This struct is initialized in the TextureMapperGL constructor for the OpenGL context that's been made current on that thread, and that will be used for that TextureMapperGL instance through its lifetime. The struct is then also copied into any BitmapTextureGL objects that have been created through this TextureMapperGL (or its texture pool). The struct is initialized with information about GLES2 support (which is at this point done through the USE_OPENGL_ES_2 macro) and about specific OpenGL extensions that are supported. These are then used in TextureMapperGL (NPOT textures) and BitmapTextureGL (BGRA support, sub-image unpacking) to deploy specific optimizations or workarounds. This ultimately serves as a replacement for clunky static functions that need to operate on GraphicsContext3D objects to retrieve this information. No new tests -- no change in behavior. * platform/TextureMapper.cmake: * platform/graphics/texmap/BitmapTextureGL.cpp: (WebCore::BitmapTextureGL::BitmapTextureGL): (WebCore::BitmapTextureGL::updateContentsNoSwizzle): (WebCore::BitmapTextureGL::updateContents): (WebCore::driverSupportsSubImage): Deleted. * platform/graphics/texmap/BitmapTextureGL.h: (WebCore::BitmapTextureGL::create): * platform/graphics/texmap/BitmapTexturePool.cpp: (WebCore::BitmapTexturePool::BitmapTexturePool): (WebCore::BitmapTexturePool::createTexture): * platform/graphics/texmap/BitmapTexturePool.h: * platform/graphics/texmap/TextureMapperContextAttributes.cpp: Added. (WebCore::TextureMapperContextAttributes::initialize): * platform/graphics/texmap/TextureMapperContextAttributes.h: Added. * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGL::TextureMapperGL): (WebCore::TextureMapperGL::drawTexture): (WebCore::TextureMapperGL::drawTexturedQuadWithProgram): (WebCore::TextureMapperGL::createTexture): (WebCore::driverSupportsNPOTTextures): Deleted. * platform/graphics/texmap/TextureMapperGL.h: 2017-08-08 Zan Dobersek [TexMap] Don't expose GraphicsContext3D object https://bugs.webkit.org/show_bug.cgi?id=175310 Reviewed by Carlos Garcia Campos. Remove the GraphicsContext3D getter from the TextureMapperGL class. Instead, the clearColor() method is added that's to be used by the CoordinatedGraphicsScene class which was accessing the GraphicsContext3D object for this purpose. * platform/graphics/texmap/TextureMapper.h: * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGL::clearColor): * platform/graphics/texmap/TextureMapperGL.h: (WebCore::TextureMapperGL::graphicsContext3D const): Deleted. 2017-08-07 Simon Fraser RenderStyle:diff() was inadvertently doing deep compares of StyleRareNonInheritedData etc https://bugs.webkit.org/show_bug.cgi?id=175304 Reviewed by Tim Horton. r210758 changed DataRef::get() from returning a pointer to a reference. This caused all the places in RenderStyle::diff() and related functions, where we intended to do a quick pointer comparison, to doing deep compares via operator!=. This made the code slightly slower. Fix by exposing ptr() on DataRef and using it wherever we wish to do pointer comparison. * rendering/style/DataRef.h: (WebCore::DataRef::ptr const): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::inheritedDataShared const): (WebCore::RenderStyle::changeAffectsVisualOverflow const): (WebCore::RenderStyle::changeRequiresLayout const): (WebCore::RenderStyle::changeRequiresRecompositeLayer const): (WebCore::RenderStyle::listStyleImage const): Expand the function onto multiple lines. 2017-08-07 Simon Fraser Add a fast path for rotate() and rotateZ() transform parsing https://bugs.webkit.org/show_bug.cgi?id=175308 Reviewed by Zalan Bujtas. Fast paths only existed for translate-related functions, matrix3d() and scale3d(). Add rotate() and rotateX(), which gives a small boost to one of the MotionMark tests. * css/parser/CSSParserFastPaths.cpp: (WebCore::parseSimpleAngle): (WebCore::parseTransformAngleArgument): (WebCore::parseSimpleTransformValue): (WebCore::transformCanLikelyUseFastPath): 2017-08-07 Simon Fraser Re-order the tests in RenderLayerCompositor::requiresCompositingLayer() for performance https://bugs.webkit.org/show_bug.cgi?id=175306 Reviewed by Tim Horton. Re-order the tests for compositing reasons so that reasons more likely to happen are higher in the list. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::requiresCompositingLayer const): (WebCore::RenderLayerCompositor::requiresOwnBackingStore const): 2017-08-07 Simon Fraser Avoid a hash lookup in FilterInfo::remove() https://bugs.webkit.org/show_bug.cgi?id=175301 Reviewed by Sam Weinig. FilterInfo::remove() always called map().remove(&layer)), even when layer.m_hasFilterInfo was false (and even asserted that layer.m_hasFilterInfo == map().contains(&layer)). So we can early return if layer.m_hasFilterInfo is false. * rendering/RenderLayerFilterInfo.cpp: (WebCore::RenderLayer::FilterInfo::getIfExists): (WebCore::RenderLayer::FilterInfo::remove): 2017-08-07 Simon Fraser Make TransformOperation::type() non-virtual https://bugs.webkit.org/show_bug.cgi?id=175297 Reviewed by Sam Weinig. Store the OperationType in the base class so that type() and isSameType() can be non-virtual. Small perf win on some benchmarks. * platform/graphics/transforms/IdentityTransformOperation.h: * platform/graphics/transforms/Matrix3DTransformOperation.h: * platform/graphics/transforms/MatrixTransformOperation.h: * platform/graphics/transforms/PerspectiveTransformOperation.h: * platform/graphics/transforms/RotateTransformOperation.cpp: (WebCore::RotateTransformOperation::blend): * platform/graphics/transforms/RotateTransformOperation.h: * platform/graphics/transforms/ScaleTransformOperation.cpp: (WebCore::ScaleTransformOperation::blend): * platform/graphics/transforms/ScaleTransformOperation.h: * platform/graphics/transforms/SkewTransformOperation.cpp: (WebCore::SkewTransformOperation::blend): * platform/graphics/transforms/SkewTransformOperation.h: * platform/graphics/transforms/TransformOperation.h: (WebCore::TransformOperation::TransformOperation): (WebCore::TransformOperation::type const): (WebCore::TransformOperation::isSameType const): * platform/graphics/transforms/TranslateTransformOperation.cpp: (WebCore::TranslateTransformOperation::blend): * platform/graphics/transforms/TranslateTransformOperation.h: 2017-08-07 Simon Fraser Inline ~Color and Color::isExtended() https://bugs.webkit.org/show_bug.cgi?id=175293 Reviewed by Zalan Bujtas. The Color destructor and Color::isExtended() show up on profiles, so inline them. Before r207265 the destructor was inlined. Also make sure that LengthSize::operator== is inlined, which it was not (according to profiles). * platform/LengthSize.h: (WebCore::operator==): * platform/graphics/Color.cpp: (WebCore::Color::~Color): Deleted. (WebCore::Color::isExtended const): Deleted. * platform/graphics/Color.h: (WebCore::Color::~Color): (WebCore::Color::isExtended const): 2017-08-04 Brent Fulgham Implement the HTML5 same-origin restriction specification https://bugs.webkit.org/show_bug.cgi?id=175226 Reviewed by Chris Dumez. Follow the algorithms defined in the HTML5 specification for relaxing the same-origin restriction. We were missing a few steps related to checking for public suffix and presence of a browsing context. Tested by new TestWebKitAPI tests. * dom/Document.cpp: (WebCore::Document::domainIsRegisterable): Added helper function. (WebCore::Document::setDomain): 2017-08-07 Devin Rousso Web Inspector: Preview Canvas path when viewing a recording https://bugs.webkit.org/show_bug.cgi?id=174967 Reviewed by Brian Burg. Tests: fast/canvas/2d.currentPoint.html fast/canvas/2d.getPath.modification.html fast/canvas/2d.getPath.newobject.html fast/canvas/2d.setPath.html * html/canvas/CanvasPath.idl: * html/canvas/CanvasPath.h: * html/canvas/CanvasPath.cpp: (WebCore::CanvasPath::currentX const): (WebCore::CanvasPath::currentY const): * html/canvas/CanvasRenderingContext2D.idl: * html/canvas/CanvasRenderingContext2D.h: * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::setPath): (WebCore::CanvasRenderingContext2D::getPath const): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setInspectorAdditionsEnabled): (WebCore::RuntimeEnabledFeatures::inspectorAdditionsEnabled const): Add runtime flag for added IDL items above so that they are only usable within the inspector process. The runtime flag is not enabled from anywhere else as of now. * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildInitialState): Send current path as part of the InitialState. Drive-by: deduplicate more string values. 2017-08-07 Chris Dumez Update sendBeacon() to rely on FetchBody instead of the whole FetchRequest https://bugs.webkit.org/show_bug.cgi?id=175280 Reviewed by Youenn Fablet. Update sendBeacon() to rely on FetchBody instead of the whole FetchRequest. FetchBody for data extraction is really the only thing we need at the moment. The new code also properly sets the CORS mode, which will be needed for Bug 175264. * Modules/beacon/NavigatorBeacon.cpp: (WebCore::NavigatorBeacon::sendBeacon): 2017-08-07 Michael Catanzaro -Wimplicit-fallthrough warning in ComputedStyleExtractor::propertyValue https://bugs.webkit.org/show_bug.cgi?id=174469 Reviewed by Simon Fraser. Add a RELEASE_ASSERT_NOT_REACHED to silence this warning. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): 2017-08-06 Filip Pizlo Primitive auxiliaries and JSValue auxiliaries should have separate gigacages https://bugs.webkit.org/show_bug.cgi?id=174919 Reviewed by Keith Miller. No new tests because no change in behavior. Adapting to API changes - we now specify the AlignedMemoryAllocator differently and we need to be specific about which Gigacage we're using. * bindings/js/WebCoreJSClientData.cpp: (WebCore::JSVMClientData::JSVMClientData): * platform/graphics/cocoa/GPUBufferMetal.mm: (WebCore::GPUBuffer::GPUBuffer): 2017-08-07 Basuke Suzuki [Curl] Add abstraction layer of cookie jar implementation for Curl port https://bugs.webkit.org/show_bug.cgi?id=174943 Reviewed by Brent Fulgham. * platform/network/curl/CookieJarCurl.cpp: (WebCore::CookieJarCurlFileSystem::setCookiesFromDOM): (WebCore::CookieJarCurlFileSystem::cookiesForDOM): (WebCore::CookieJarCurlFileSystem::cookieRequestHeaderFieldValue): (WebCore::CookieJarCurlFileSystem::cookiesEnabled): (WebCore::CookieJarCurlFileSystem::getRawCookies): (WebCore::CookieJarCurlFileSystem::deleteCookie): (WebCore::CookieJarCurlFileSystem::getHostnamesWithCookies): (WebCore::CookieJarCurlFileSystem::deleteCookiesForHostnames): (WebCore::CookieJarCurlFileSystem::deleteAllCookies): (WebCore::CookieJarCurlFileSystem::deleteAllCookiesModifiedSince): (WebCore::cookiesForDOM): (WebCore::setCookiesFromDOM): (WebCore::cookieRequestHeaderFieldValue): (WebCore::cookiesEnabled): (WebCore::getRawCookies): (WebCore::deleteCookie): (WebCore::getHostnamesWithCookies): (WebCore::deleteCookiesForHostnames): (WebCore::deleteAllCookies): (WebCore::deleteAllCookiesModifiedSince): * platform/network/curl/CookieJarCurl.h: Added. * platform/network/curl/CurlContext.cpp: * platform/network/curl/CurlContext.h: (WebCore::CurlContext::cookieJar): 2017-08-07 Brady Eidson Implement most of ServiceWorkerContainer::addRegistration. https://bugs.webkit.org/show_bug.cgi?id=175237 Reviewed by Andy Estes. No new tests (Covered by changes to existing tests). There's still so much supporting infrastructure to add with these early patches that I'm still moving them in baby steps for now, hence not implementing register() all in one shot. Things will start moving very quickly once we no longer need to add lots of new primitives in each change. * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * page/DOMWindow.cpp: (WebCore::DOMWindow::navigator const): * page/Navigator.cpp: (WebCore::Navigator::Navigator): Make the constructor take a ScriptExecutionContext for creation of objects where its import (e.g. ServiceWorkerContainer). * page/Navigator.h: * page/WorkerNavigator.cpp: (WebCore::WorkerNavigator::WorkerNavigator): Ditto. * page/WorkerNavigator.h: * page/NavigatorBase.cpp: (WebCore::NavigatorBase::NavigatorBase): Create the ServiceWorkerContainer upfront with the passed-in ScriptExecutionContext. (WebCore::NavigatorBase::serviceWorker): * page/NavigatorBase.h: Make ServiceWorkerContainer into an ActiveDOMObject. This will eventually be necessary for Document suspension reasons, but is also necessary because it also needs to be a ContextDestructionObserver (which ActiveDOMObject is): * workers/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::ServiceWorkerContainer): (WebCore::ServiceWorkerContainer::ready): (WebCore::ServiceWorkerContainer::addRegistration): (WebCore::ServiceWorkerContainer::getRegistration): (WebCore::ServiceWorkerContainer::getRegistrations): (WebCore::ServiceWorkerContainer::activeDOMObjectName const): (WebCore::ServiceWorkerContainer::canSuspendForDocumentSuspension const): (WebCore::rejectLater): Deleted. (WebCore::ServiceWorkerContainer::eventTargetInterface const): Deleted. (WebCore::ServiceWorkerContainer::scriptExecutionContext const): Deleted. * workers/ServiceWorkerContainer.h: * workers/ServiceWorkerContainer.idl: Add updateViaCache, etc: * workers/ServiceWorkerRegistration.cpp: (WebCore::ServiceWorkerRegistration::updateViaCache const): (WebCore::ServiceWorkerRegistration::update): (WebCore::ServiceWorkerRegistration::unregister): * workers/ServiceWorkerRegistration.h: * workers/ServiceWorkerRegistration.idl: * workers/ServiceWorkerUpdateViaCache.h: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl. * workers/ServiceWorkerUpdateViaCache.idl: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl. * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::navigator): (WebCore::WorkerGlobalScope::navigator const): Deleted. * workers/WorkerGlobalScope.h: * workers/WorkerType.h: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl. * workers/WorkerType.idl: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl. 2017-08-07 Ryan Haddad Unreviewed, rolling out r220299. This change caused LayoutTest inspector/dom-debugger/dom- breakpoints.html to fail. Reverted changeset: "Web Inspector: capture async stack trace when workers/main context posts a message" https://bugs.webkit.org/show_bug.cgi?id=167084 http://trac.webkit.org/changeset/220299 2017-08-07 Brian Burg Cleanup: simplify WebSockets code for RuntimeEnabledFeatures https://bugs.webkit.org/show_bug.cgi?id=175190 Reviewed by Sam Weinig. This runtime enabled flag is not used by anything. It was added for V8 in . * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::setIsAvailable): Deleted. (WebCore::WebSocket::isAvailable): Deleted. * Modules/websockets/WebSocket.h: * Modules/websockets/WebSocket.idl: * page/RuntimeEnabledFeatures.cpp: (WebCore::RuntimeEnabledFeatures::webSocketEnabled const): Deleted. * page/RuntimeEnabledFeatures.h: 2017-08-07 Brian Burg Remove CANVAS_PATH compilation guard https://bugs.webkit.org/show_bug.cgi?id=175207 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: * html/canvas/DOMPath.h: * html/canvas/DOMPath.idl: 2017-08-07 Carlos Alberto Lopez Perez [WPE][CMake] Only pass pkg-config CFLAGS from (E)GL when not using libepoxy. https://bugs.webkit.org/show_bug.cgi?id=175125 Reviewed by Michael Catanzaro. No change of behavior, covered by existing tests. * CMakeLists.txt: Instead of negating 3 times the use of libepoxy move the logic for (E)GL detection inside an else() block. 2017-08-07 Antti Koivisto REGRESSION (r219121): Airmail 3 prints header part only. https://bugs.webkit.org/show_bug.cgi?id=175258 Reviewed by Andreas Kling. When a WK1 WebViw is printed via AppKit view hierarchy it won't explictly set the page width but uses the existing width. r219121 assumes that all printing code paths set the page width. No test, there appears to be no good way to test AppKit printing behaviors without adding complicated new testing infrastructure. * rendering/RenderView.cpp: (WebCore::RenderView::layout): If we are in printing layout and don't have page width set yet then use the current view width. This matches the behavior prior r219121. 2017-08-05 Youenn Fablet [Fetch API] Response should keep all ResourceResponse information https://bugs.webkit.org/show_bug.cgi?id=175099 Reviewed by Sam Weinig. No change of behavior, covered by existing tests. Disabling filtering of resource response at DocumentThreadableLoader for fetch API and doing the filtering at FetchResponse level. This requires passing the tainting parameter to FetchResponse. For that purpose, we store the tainting on the ResourceResponse itself. This allows mimicking the concept of internal response from the fetch spec. This might be useful for future developments related to caching the responses. The body is now also stored in FetchResponse so a flag is added to ensure we only expose the body if allowed. Changing storage of opaque redirect information to keep the redirection information in the response. * Modules/fetch/FetchBodyOwner.cpp: (WebCore::FetchBodyOwner::blob): (WebCore::FetchBodyOwner::consumeNullBody): * Modules/fetch/FetchBodyOwner.h: * Modules/fetch/FetchLoader.cpp: (WebCore::FetchLoader::start): * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::BodyLoader::didReceiveResponse): (WebCore::FetchResponse::consume): (WebCore::FetchResponse::consumeBodyAsStream): (WebCore::FetchResponse::createReadableStreamSource): * Modules/fetch/FetchResponse.h: * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::responseReceived): (WebCore::DocumentThreadableLoader::didReceiveResponse): (WebCore::DocumentThreadableLoader::didFinishLoading): (WebCore::DocumentThreadableLoader::loadRequest): * loader/DocumentThreadableLoader.h: * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::willSendRequestInternal): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::setBodyDataFrom): (WebCore::CachedResource::setResponse): * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::crossThreadData const): (WebCore::ResourceResponseBase::fromCrossThreadData): (WebCore::ResourceResponseBase::filter): * platform/network/ResourceResponseBase.h: (WebCore::ResourceResponseBase::setTainting): (WebCore::ResourceResponseBase::tainting const): (WebCore::ResourceResponseBase::encode const): (WebCore::ResourceResponseBase::decode): 2017-08-05 Carlos Garcia Campos WebDriver: use in-view center point for clicks instead of bounding box center point https://bugs.webkit.org/show_bug.cgi?id=174863 Reviewed by Simon Fraser. Make DOMRect, and FloatPoint::narrowPrecision() available to WebKit layer. Also add FrameView::clientToDocumentPoint(). * WebCore.xcodeproj/project.pbxproj: * dom/Element.h: * page/FrameView.h: * platform/graphics/FloatPoint.h: 2017-08-05 Carlos Garcia Campos getClientRects doesn't work with list box option elements https://bugs.webkit.org/show_bug.cgi?id=175016 Reviewed by Darin Adler. Since HTMLOptionElement and HTMLOptGroupElement don't have a renderer, we are always returning an empty list from getClientRects. This is working fine in both chromium and firefox, option elements return its own bounding box and group elements return the bounding box of the group label and all its children items. Test: fast/dom/HTMLSelectElement/listbox-items-client-rects.html * dom/Element.cpp: (WebCore::listBoxElementBoundingBox): Helper function to return the bounding box of a HTMLOptionElement or HTMLOptGroupElement element. (WebCore::Element::getClientRects): Use listBoxElementBoundingBox() in case of HTMLOptionElement or HTMLOptGroupElement. (WebCore::Element::boundingClientRect): Ditto. 2017-08-04 Youenn Fablet [Cache API] Add Cache and CacheStorage IDL definitions https://bugs.webkit.org/show_bug.cgi?id=175201 Reviewed by Brady Eidson. Covered by activated tests. Adding IDLs as per https://www.w3.org/TR/service-workers-1/#idl-index. Implementation is guarded by a runtime flag which is off by default. It is off for DRT but on for WTR. * CMakeLists.txt: * DerivedSources.make: * Modules/cache/Cache.cpp: Added. (WebCore::Cache::match): (WebCore::Cache::matchAll): (WebCore::Cache::add): (WebCore::Cache::addAll): (WebCore::Cache::put): (WebCore::Cache::remove): (WebCore::Cache::keys): * Modules/cache/Cache.h: Added. (WebCore::Cache::create): (WebCore::Cache::Cache): * Modules/cache/Cache.idl: Added. * Modules/cache/CacheQueryOptions.h: Added. * Modules/cache/CacheQueryOptions.idl: Added. * Modules/cache/CacheStorage.cpp: Added. (WebCore::CacheStorage::match): (WebCore::CacheStorage::has): (WebCore::CacheStorage::open): (WebCore::CacheStorage::remove): (WebCore::CacheStorage::keys): * Modules/cache/CacheStorage.h: Added. (WebCore::CacheStorage::create): * Modules/cache/CacheStorage.idl: Added. * Modules/cache/DOMWindowCaches.cpp: Added. (WebCore::DOMWindowCaches::DOMWindowCaches): (WebCore::DOMWindowCaches::supplementName): (WebCore::DOMWindowCaches::from): (WebCore::DOMWindowCaches::caches): (WebCore::DOMWindowCaches::caches const): * Modules/cache/DOMWindowCaches.h: Added. * Modules/cache/DOMWindowCaches.idl: Added. * Modules/cache/WorkerGlobalScopeCaches.cpp: Added. (WebCore::WorkerGlobalScopeCaches::supplementName): (WebCore::WorkerGlobalScopeCaches::from): (WebCore::WorkerGlobalScopeCaches::caches): (WebCore::WorkerGlobalScopeCaches::caches const): * Modules/cache/WorkerGlobalScopeCaches.h: Added. * Modules/cache/WorkerGlobalScopeCaches.idl: Added. * WebCore.xcodeproj/project.pbxproj: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setCacheAPIEnabled): (WebCore::RuntimeEnabledFeatures::cacheAPIEnabled const): 2017-08-04 Brady Eidson Have navigator.serviceWorker() actually return a ServiceWorkerContainer object. https://bugs.webkit.org/show_bug.cgi?id=175215 Reviewed by Youenn Fablet. * page/NavigatorBase.cpp: (WebCore::NavigatorBase::serviceWorker): Actually create and remember an object. * page/NavigatorBase.h: * workers/ServiceWorkerContainer.cpp: (WebCore::rejectLater): Asynchronously reject the given promise with an error message. (WebCore::ServiceWorkerContainer::ServiceWorkerContainer): (WebCore::ServiceWorkerContainer::refEventTarget): Ref the underlying Navigator. (WebCore::ServiceWorkerContainer::derefEventTarget): Deref the underlying Navigator. (WebCore::ServiceWorkerContainer::ready): rejectLater the promise. (WebCore::ServiceWorkerContainer::addRegistration): Ditto. (WebCore::ServiceWorkerContainer::getRegistration): Ditto. (WebCore::ServiceWorkerContainer::getRegistrations): Ditto. * workers/ServiceWorkerContainer.h: 2017-08-04 Chris Dumez [Beacon] Update sendBeacon to use the CachedResourceLoader https://bugs.webkit.org/show_bug.cgi?id=175192 Reviewed by Youenn Fablet. Update sendBeacon to use the FetchRequest / CachedResourceLoader instead of the PingLoader. This gets us closer to the specification which is based on Fetch and reduces code duplication. This also fixes an issue where our Origin header was not properly set on Beacon resquests. In a follow-up, we will implement in CachedResourceLoader Fetch's quota for inflight keepalive requests which is needed to fully support sendBeacon(). * Modules/beacon/NavigatorBeacon.cpp: (WebCore::NavigatorBeacon::sendBeacon): * Modules/beacon/NavigatorBeacon.h: * loader/LinkLoader.cpp: (WebCore::createLinkPreloadResourceClient): * loader/PingLoader.cpp: * loader/PingLoader.h: * loader/ResourceLoadInfo.cpp: (WebCore::toResourceType): * loader/SubresourceLoader.cpp: (WebCore::logResourceLoaded): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::defaultPriorityForResourceType): (WebCore::CachedResource::load): * loader/cache/CachedResource.h: * loader/cache/CachedResourceLoader.cpp: (WebCore::createResource): (WebCore::CachedResourceLoader::requestBeaconResource): (WebCore::contentTypeFromResourceType): (WebCore::CachedResourceLoader::checkInsecureContent const): (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const): (WebCore::isResourceSuitableForDirectReuse): * loader/cache/CachedResourceLoader.h: 2017-08-04 John Wilander Resource Load Statistics: Report user interaction immediately, but only when needed https://bugs.webkit.org/show_bug.cgi?id=175090 Reviewed by Chris Dumez. Test: http/tests/loading/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::ResourceLoadObserver): (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Now tells the UI process immediately but also records that it has done so to avoid doing it when not needed. (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded): Conditional throttling gone, now always throttles. (WebCore::ResourceLoadObserver::notifyObserver): Renamed from ResourceLoadObserver::notificationTimerFired(). (WebCore::ResourceLoadObserver::clearState): New function to allow the test runner to reset the web process' statistics state now that we keep track of whether or not we've reported user interaction to the UI process. (WebCore::ResourceLoadObserver::setShouldThrottleObserverNotifications): Deleted. (WebCore::ResourceLoadObserver::notificationTimerFired): Deleted. * loader/ResourceLoadObserver.h: (): Deleted. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::setResourceLoadStatisticsShouldThrottleObserverNotifications): Deleted. No longer needed since user interaction is always communicated immediately. * testing/Internals.h: * testing/Internals.idl: 2017-08-04 Matt Baker Web Inspector: capture async stack trace when workers/main context posts a message https://bugs.webkit.org/show_bug.cgi?id=167084 Reviewed by Brian Burg. Add instrumentation to DOMWindow to support showing asynchronous stack traces when the debugger pauses in a MessageEvent handler. Test: inspector/debugger/async-stack-trace.html * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didPostMessageImpl): (WebCore::InspectorInstrumentation::didFailPostMessageImpl): (WebCore::InspectorInstrumentation::willDispatchPostMessageImpl): (WebCore::InspectorInstrumentation::didDispatchPostMessageImpl): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::didPostMessage): (WebCore::InspectorInstrumentation::didFailPostMessage): (WebCore::InspectorInstrumentation::willDispatchPostMessage): (WebCore::InspectorInstrumentation::didDispatchPostMessage): * inspector/PageDebuggerAgent.cpp: (WebCore::PageDebuggerAgent::didClearAsyncStackTraceData): (WebCore::PageDebuggerAgent::didPostMessage): (WebCore::PageDebuggerAgent::didFailPostMessage): (WebCore::PageDebuggerAgent::willDispatchPostMessage): (WebCore::PageDebuggerAgent::didDispatchPostMessage): * inspector/PageDebuggerAgent.h: * page/DOMWindow.cpp: (WebCore::DOMWindow::postMessage): (WebCore::DOMWindow::postMessageTimerFired): 2017-08-04 Devin Rousso Web Inspector: add source view for WebGL shader programs https://bugs.webkit.org/show_bug.cgi?id=138593 Reviewed by Matt Baker. Test: inspector/canvas/requestShaderSource.html * inspector/InspectorCanvasAgent.h: * inspector/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::requestShaderSource): * inspector/InspectorShaderProgram.h: * inspector/InspectorShaderProgram.cpp: (WebCore::InspectorShaderProgram::shaderForType): 2017-08-04 Matt Lewis Unreviewed, rolling out r220288. This broke multiple builds. Reverted changeset: "Use MPAVRoutingController instead of deprecated versions." https://bugs.webkit.org/show_bug.cgi?id=175063 http://trac.webkit.org/changeset/220288 2017-08-03 Filip Pizlo The allocator used to allocate memory for MarkedBlocks and LargeAllocations should not be the Subspace itself https://bugs.webkit.org/show_bug.cgi?id=175141 Reviewed by Mark Lam. No new tests because no new behavior. Just adapting to an API change. * ForwardingHeaders/heap/FastMallocAlignedMemoryAllocator.h: Added. * bindings/js/WebCoreJSClientData.cpp: (WebCore::JSVMClientData::JSVMClientData): 2017-08-04 Chris Dumez Match newly-clarified spec on textarea defaultValue/value/child text content https://bugs.webkit.org/show_bug.cgi?id=173878 Reviewed by Darin Adler. Update HTMLTextArea.defaultValue to match align with other browsers and match the latest HTML specification: - https://html.spec.whatwg.org/#dom-textarea-defaultvalue The defaultValue getter should return the child text content: - https://dom.spec.whatwg.org/#concept-child-text-content Our code was traversing all Text descendants, not just the children. The defaultValue setter should act as the setter of the Element's textContent IDL attribute. Previously, we had a custom logic that was only removing the text children. Test: imported/w3c/web-platform-tests/html/semantics/forms/the-textarea-element/value-defaultValue-textContent.html * dom/ScriptElement.cpp: (WebCore::ScriptElement::scriptContent const): * dom/TextNodeTraversal.cpp: (WebCore::TextNodeTraversal::childTextContent): * dom/TextNodeTraversal.h: * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::defaultValue const): (WebCore::HTMLTextAreaElement::setDefaultValue): * html/HTMLTitleElement.cpp: (WebCore::HTMLTitleElement::text const): 2017-08-04 Said Abou-Hallawa RenderImageResourceStyleImage::image() should return the nullImage() if the image is not available https://bugs.webkit.org/show_bug.cgi?id=174874 Reviewed by Simon Fraser. If an element has a non-CachedImage content data, e.g. -webkit-named-image, RenderImageResourceStyleImage will be created and attached to the RenderImage. RenderImageResourceStyleImage::m_cachedImage will be set to null at the beginning because the m_styleImage->isCachedImage() is false in this case. When ImageLoader finishes loading the url of the src attribute, RenderImageResource::setCachedImage() will be called to set m_cachedImage. A crash will happen when the RenderImage is destroyed. Destroying the RenderImage calls RenderImageResourceStyleImage::shutdown() which checks m_cachedImage and finds it not null, so it calls RenderImageResourceStyleImage::image() which ends up calling CSSNamedImageValue::image() which returns a null pointer because the size is empty. RenderImageResourceStyleImage::shutdown() calls image()->stopAnimation() without checking the return value of image(). Another crash will happen later when deleting the CachedImage from the memory cache if CachedImage::canDestroyDecodedData() is called because the client it gets from m_clients is a freed pointer. This happens because RenderImageResourceStyleImage has m_styleImage of type StyleGeneratedImage but its m_cachedImage is set by RenderImageResource::setCachedImage(). When RenderImageResourceStyleImage::shutdown() is called, it calls StyleGeneratedImage::removeClient() which does not know anything about RenderImageResourceStyleImage::m_cachedImage. So we end up having a freed pointer in the m_clients of the CachedImage. Test: fast/images/image-element-image-content-data.html * rendering/RenderImageResourceStyleImage.cpp: (WebCore::RenderImageResourceStyleImage::shutdown): Revert back the changes of r208511 in this function. Add a call to image()->stopAnimation() without checking the return of image() since it will return the nullImage() if the image not available. There is no need to check m_cachedImage before calling image() because image() does not check or access m_cachedImage. If m_styleImage is not a CachedStyleImage but m_cachedImage is not null, we need to remove m_renderer from the set of the clients of this m_cachedImage. (WebCore::RenderImageResourceStyleImage::image const): The base class method RenderImageResource::image() returns the nullImage() if the image not available. This is because CachedImage::imageForRenderer() returns the nullImage() if the image is not available; see CachedImage.h. We should do the same for the derived class for consistency. 2017-08-04 Jeremy Jones Use MPAVRoutingController instead of deprecated versions. https://bugs.webkit.org/show_bug.cgi?id=175063 Reviewed by Tim Horton. No new tests because no behavior change. This uses a different platform class to present an interface. Remove deprecated MPAudioVideoRoutingPopoverController and MPAVRoutingSheet Add MPMediaControlsViewController. * platform/spi/ios/MediaPlayerSPI.h: 2017-08-04 Matt Baker Web Inspector: REGRESSION (r220233): Check for null pointer passed to WebGLRenderingContextBase::deleteProgram https://bugs.webkit.org/show_bug.cgi?id=175196 Reviewed by Devin Rousso. * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::deleteProgram): 2017-08-04 Matt Lewis Unreviewed, rolling out r220271. Rolling out due to Layout Test failing on iOS Simulator. Reverted changeset: "Remove STREAMS_API compilation guard" https://bugs.webkit.org/show_bug.cgi?id=175165 http://trac.webkit.org/changeset/220271 2017-08-03 Sam Weinig [Cleanup] Remove ScriptGlobalObject https://bugs.webkit.org/show_bug.cgi?id=175173 Reviewed by Darin Adler. ScriptGlobalObject's two functions were only being used in four places. Three of those uses (ScriptGlobalObject::set in InspectorFrontendClientLocal, WebInspectorUI, and RemoteWebInspectorUI) were merged into the new function addSelfToGlobalObjectInWorld on InspectorFrontendHost. The remaining function (ScriptGlobalObject::get in InspectorFrontendHost) was easily inlined. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/ScriptGlobalObject.cpp: Removed. * bindings/js/ScriptGlobalObject.h: Removed. Removed ScriptGlobalObject. * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorFrontendClientLocal::windowObjectCleared): Remove call to ScriptGlobalObject::set and use addSelfToGlobalObjectInWorld instead. * inspector/InspectorFrontendHost.h: * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::showContextMenu): Inline ScriptGlobalObject::get. (WebCore::InspectorFrontendHost::addSelfToGlobalObjectInWorld): Add helper which inlines ScriptGlobalObject::set and works as a helper for the three inspector frontends. 2017-08-04 Ryan Haddad Unreviewed, rolling out r220268. This change caused assertion failures on macOS and iOS Debug WK2. Reverted changeset: "Resource Load Statistics: Report user interaction immediately, but only when needed" https://bugs.webkit.org/show_bug.cgi?id=175090 http://trac.webkit.org/changeset/220268 2017-08-04 Youenn Fablet Remove STREAMS_API compilation guard https://bugs.webkit.org/show_bug.cgi?id=175165 Reviewed by Darin Adler. No change of behavior. * Configurations/FeatureDefines.xcconfig: * Modules/fetch/FetchBody.cpp: (WebCore::FetchBody::consumeAsStream): * Modules/fetch/FetchBody.h: * Modules/fetch/FetchBodyOwner.cpp: (WebCore::FetchBodyOwner::isDisturbedOrLocked const): (WebCore::FetchBodyOwner::blobLoadingSucceeded): (WebCore::FetchBodyOwner::blobLoadingFailed): (WebCore::FetchBodyOwner::blobChunk): * Modules/fetch/FetchBodyOwner.h: * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::BodyLoader::didSucceed): (WebCore::FetchResponse::BodyLoader::didFail): (WebCore::FetchResponse::BodyLoader::didReceiveData): * Modules/fetch/FetchResponse.h: * Modules/fetch/FetchResponse.idl: * Modules/fetch/FetchResponse.js: (initializeFetchResponse): * Modules/fetch/FetchResponseSource.cpp: * Modules/fetch/FetchResponseSource.h: * Modules/streams/ByteLengthQueuingStrategy.idl: * Modules/streams/ByteLengthQueuingStrategy.js: * Modules/streams/CountQueuingStrategy.idl: * Modules/streams/CountQueuingStrategy.js: * Modules/streams/ReadableByteStreamController.idl: * Modules/streams/ReadableByteStreamController.js: * Modules/streams/ReadableByteStreamInternals.js: * Modules/streams/ReadableStream.idl: * Modules/streams/ReadableStream.js: * Modules/streams/ReadableStreamBYOBReader.idl: * Modules/streams/ReadableStreamBYOBReader.js: * Modules/streams/ReadableStreamBYOBRequest.idl: * Modules/streams/ReadableStreamBYOBRequest.js: * Modules/streams/ReadableStreamDefaultController.idl: * Modules/streams/ReadableStreamDefaultController.js: * Modules/streams/ReadableStreamDefaultReader.idl: * Modules/streams/ReadableStreamDefaultReader.js: * Modules/streams/ReadableStreamInternals.js: * Modules/streams/ReadableStreamSource.h: * Modules/streams/ReadableStreamSource.idl: * Modules/streams/StreamInternals.js: * Modules/streams/WritableStream.idl: * Modules/streams/WritableStream.js: * Modules/streams/WritableStreamInternals.js: * bindings/js/JSDOMGlobalObject.cpp: (WebCore::isReadableByteStreamAPIEnabled): (WebCore::JSDOMGlobalObject::addBuiltinGlobals): * bindings/js/JSReadableStreamPrivateConstructors.cpp: * bindings/js/JSReadableStreamPrivateConstructors.h: * bindings/js/JSReadableStreamSourceCustom.cpp: * bindings/js/ReadableStreamDefaultController.cpp: * bindings/js/ReadableStreamDefaultController.h: * page/RuntimeEnabledFeatures.h: * testing/Internals.cpp: * testing/Internals.h: * testing/Internals.idl: 2017-08-04 Zan Dobersek [EME][GStreamer] Register ClearKey CDMFactory https://bugs.webkit.org/show_bug.cgi?id=175136 Reviewed by Xabier Rodriguez-Calvar. Register the ClearKey CDM factory in CDMFactoryGStreamer. A CDMFactoryClearKey singleton object is introduced and used for that registration. The basic CDMFactoryClearKey and CDMPrivateClearKey methods are implemented, marking `org.w3.clearkey` as the supported key system and `keyids` as the supported init data type. Additional logic around key system configurations, distinctive identifiers, persistent state and related restrictions and requirements is implemented. This improves the ClearKey EME tests a bit, now progressing to the point of failing with a NotAllowedError exception due to the CDMInstance object failing to properly initialize because of missing implementation. No new tests -- relevant tests have underlying baselines updated to reflect changes in behavior. * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::CDMFactoryClearKey::singleton): (WebCore::CDMFactoryClearKey::supportsKeySystem): (WebCore::CDMPrivateClearKey::supportsInitDataType const): (WebCore::CDMPrivateClearKey::supportsConfiguration const): (WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions const): (WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration const): (WebCore::CDMPrivateClearKey::supportsRobustness const): (WebCore::CDMPrivateClearKey::distinctiveIdentifiersRequirement const): (WebCore::CDMPrivateClearKey::persistentStateRequirement const): * platform/encryptedmedia/clearkey/CDMClearKey.h: * platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp: (WebCore::CDMFactory::platformRegisterFactories): 2017-08-04 John Wilander Resource Load Statistics: Report user interaction immediately, but only when needed https://bugs.webkit.org/show_bug.cgi?id=175090 Reviewed by Chris Dumez. Test: http/tests/loading/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::ResourceLoadObserver): (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Now tells the UI process immediately but also records that it has done so to avoid doing it when not needed. (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded): Conditional throttling gone, now always throttles. (WebCore::ResourceLoadObserver::notifyObserver): Renamed from ResourceLoadObserver::notificationTimerFired(). (WebCore::ResourceLoadObserver::clearState): New function to allow the test runner to reset the web process' statistics state now that we keep track of whether or not we've reported user interaction to the UI process. (WebCore::ResourceLoadObserver::setShouldThrottleObserverNotifications): Deleted. (WebCore::ResourceLoadObserver::notificationTimerFired): Deleted. * loader/ResourceLoadObserver.h: (): Deleted. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::setResourceLoadStatisticsShouldThrottleObserverNotifications): Deleted. No longer needed since user interaction is always communicated immediately. * testing/Internals.h: * testing/Internals.idl: 2017-08-04 Zan Dobersek [EME] Push CDMFactory into the platform layer https://bugs.webkit.org/show_bug.cgi?id=175129 Reviewed by Xabier Rodriguez-Calvar. This is a follow-up to r219678 that moved the majority of CDM abstraction classes into the platform layer, but missed the CDMFactory class. The CDMFactory abstraction is now also placed in the platform layer. Only change to the interface is that the createCDM() method can't accept a CDM object reference anymore since that class is cemented into the WebCore layer, and no current implementation used it anyway. Additionally, the static Vector object of registered factories is moved under the CDMFactory class, along with the register and unregister functions. The platformRegisterFactories() function is added to allow for platform-specific factory registrations to occur when the registered factories are queried for the first time. Empty implementation for this function is provided for non-GStreamer platforms, while for GStreamer the implementation is kept in CDMFactoryGStreamer.cpp. It's still empty for now, but it will register the ClearKey factory there in the near future. No new tests -- none affected, only refactoring. * CMakeLists.txt: * Modules/encryptedmedia/CDM.cpp: (WebCore::createCDMPrivateForKeySystem): (WebCore::CDM::supportsKeySystem): (WebCore::CDM::CDM): (): Deleted. (WebCore::CDM::registerCDMFactory): Deleted. (WebCore::CDM::unregisterCDMFactory): Deleted. * Modules/encryptedmedia/CDM.h: (WebCore::CDMFactory::~CDMFactory): Deleted. * PlatformWPE.cmake: * platform/GStreamer.cmake: * platform/encryptedmedia/CDMFactory.cpp: Added. (WebCore::CDMFactory::registerFactory): (WebCore::CDMFactory::unregisterFactory): (WebCore::CDMFactory::platformRegisterFactories): * platform/encryptedmedia/CDMFactory.h: Added. (WebCore::CDMFactory::~CDMFactory): * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::CDMFactoryClearKey::createCDM): * platform/encryptedmedia/clearkey/CDMClearKey.h: * platform/encryptedmedia/gstreamer/CDMFactoryGStreamer.cpp: Added. (WebCore::CDMFactory::platformRegisterFactories): * testing/MockCDMFactory.cpp: (WebCore::m_weakPtrFactory): (WebCore::MockCDMFactory::unregister): (WebCore::MockCDMFactory::createCDM): * testing/MockCDMFactory.h: 2017-08-04 Frederic Wang ScrollingTreeOverflowScrollingNodeIOS uses the wrong fixed position rectangle https://bugs.webkit.org/show_bug.cgi?id=175135 Reviewed by Simon Fraser. This patch modifies ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll so that it uses the fixed position rectangle relative of the first frame ancestor instead of the one of the main frame. This makes it consistent with ScrollingTreeFrameScrollingNodeIOS and RenderLayerCompositor. This fixes some flickering issues on iOS. Test: fast/scrolling/ios/fixed-inside-overflow-inside-iframe.html * page/scrolling/ScrollingTreeFrameScrollingNode.h: (WebCore::ScrollingTreeFrameScrollingNode::fixedPositionRect): Helper function to get the fixed position rect to use for that frame. * page/scrolling/ScrollingTreeNode.cpp: (WebCore::ScrollingTreeNode::enclosingFrameNode const): Helper function to get the enclosing frame for this scrolling node or null if there is none. * page/scrolling/ScrollingTreeNode.h: Declare enclosingFrameNode. 2017-08-04 Zan Dobersek Unreviewed. Removing redundant NotImplemented.h header inclusions and cleaning up whitespace issues in libgcrypt-specific CryptoKeyEC and CryptoKeyRSA implementation files. * crypto/gcrypt/CryptoKeyECGCrypt.cpp: * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: 2017-08-04 Jeremy Jones Remove unnecesary call to status bar SPI. https://bugs.webkit.org/show_bug.cgi?id=175176 rdar://problem/20887306 Reviewed by Darin Adler. No new tests because no behavior change. This removes an obsolete call to SPI. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::cleanupFullscreen): 2017-08-03 Zan Dobersek [GCrypt] Implement CryptoKeyEC PKCS#8 imports https://bugs.webkit.org/show_bug.cgi?id=173647 Reviewed by Jiewen Tan. No new tests -- affected tests are now passing and are unskipped. Implement libgcrypt-based support for PKCS#8 imports of EC keys. Existing libtasn1 utilities are used to achieve this. First, the provided key data is decoded against the PrivateKeyInfo ASN.1 definition. First, the version member of that structure is validated, followed by the algorithm member. The latter is also properly tested depending on this being an import of an ECDSA or ECDH key. Data of the parameters member is decoded against the ECParameters ASN.1 definition, and the namedCurve object identifier is validated, making sure it represents a valid EC curve and that this curve maches the one specified for the import operation. Data of the privateKey member is decoded against the ECPrivateKey ASN.1 definition. The version member of that structure is properly validated. The optional parameters member of that structure is already decoded against the ECParameters ASN.1 definition. If present, it is checked to contain a valid EC curve identifier that matches the specified curve. The optional publicKey member of the ECPrivateKey structure is validated, testing that its data matches in size an uncompressed EC point, and that the first byte of this data is 0x04, as expected for an uncompressed EC point. What's left is the private key data on the initial ECPrivateKey structure. That data is retrieved and validated, making sure its size matches the size of the specified curve. The `private-key` s-expression is then constructed, embedding the curve name and the validated private key data. This s-expression is then used to construct an EC context. If the optional publicKey data was provided, it's used to set the `q` parameter for this EC context. Otherwise, the value for `q` is computed on-the-fly for the specified EC and the provided private key. The `q` point is then tested through the gcry_mpi_ec_curve_point() function, making sure that the derived point is indeed located on the given EC. Finally, with the private key properly validated, a new CryptoKeyEC object is constructed, using the `private-key` s-expression and the parameters that were specified for this import operation. * crypto/gcrypt/CryptoKeyECGCrypt.cpp: (WebCore::CryptoKeyEC::platformImportPkcs8): * crypto/gcrypt/GCryptUtilities.h: 2017-08-03 Chris Dumez Fix parsing of to allow time starting with a '.' without a leading 0 https://bugs.webkit.org/show_bug.cgi?id=175132 Reviewed by Darin Adler. Fix parsing of to allow time starting with a '.', without a leading 0. This is as per https://github.com/whatwg/html/pull/2852. The latest spec is at: - https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-refresh Test: imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html * html/parser/HTMLParserIdioms.cpp: (WebCore::parseHTTPRefreshInternal): 2017-08-03 Brian Burg Remove ENABLE(WEB_SOCKET) guards https://bugs.webkit.org/show_bug.cgi?id=167044 Reviewed by Joseph Pecoraro. * Configurations/FeatureDefines.xcconfig: * Modules/websockets/ThreadableWebSocketChannel.cpp: * Modules/websockets/ThreadableWebSocketChannel.h: * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp: * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h: * Modules/websockets/WebSocket.cpp: * Modules/websockets/WebSocket.h: * Modules/websockets/WebSocket.idl: * Modules/websockets/WebSocketChannel.cpp: * Modules/websockets/WebSocketChannel.h: * Modules/websockets/WebSocketChannelClient.h: * Modules/websockets/WebSocketDeflateFramer.cpp: * Modules/websockets/WebSocketDeflateFramer.h: * Modules/websockets/WebSocketDeflater.cpp: * Modules/websockets/WebSocketDeflater.h: * Modules/websockets/WebSocketExtensionDispatcher.cpp: * Modules/websockets/WebSocketExtensionDispatcher.h: * Modules/websockets/WebSocketExtensionParser.cpp: * Modules/websockets/WebSocketExtensionParser.h: * Modules/websockets/WebSocketExtensionProcessor.h: * Modules/websockets/WebSocketFrame.cpp: * Modules/websockets/WebSocketFrame.h: * Modules/websockets/WebSocketHandshake.cpp: * Modules/websockets/WebSocketHandshake.h: * Modules/websockets/WorkerThreadableWebSocketChannel.cpp: * Modules/websockets/WorkerThreadableWebSocketChannel.h: * dom/Document.cpp: (WebCore::Document::Document): (WebCore::Document::idbConnectionProxy): (WebCore::Document::socketProvider): * dom/Document.h: * dom/ScriptExecutionContext.h: * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didSendWebSocketFrameImpl): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::didSendWebSocketFrame): * inspector/InspectorNetworkAgent.cpp: * inspector/InspectorNetworkAgent.h: * page/RuntimeEnabledFeatures.cpp: (WebCore::RuntimeEnabledFeatures::webSocketEnabled const): * page/RuntimeEnabledFeatures.h: * page/SocketProvider.cpp: * page/SocketProvider.h: * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): * workers/WorkerGlobalScope.h: * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): * workers/WorkerThread.cpp: (WebCore::WorkerThread::WorkerThread): (WebCore::WorkerThread::socketProvider): * workers/WorkerThread.h: 2017-08-03 Don Olmstead Remove LayoutUnit dependency in TextStream https://bugs.webkit.org/show_bug.cgi?id=175110 Reviewed by Zalan Bujtas. No new tests. No change in behavior. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * platform/LayoutUnit.cpp: Added. (WebCore::operator<<): * platform/LayoutUnit.h: * platform/text/TextStream.cpp: * platform/text/TextStream.h: 2017-08-03 Jeremy Jones Improve WebKitLegacy video fullscreen animation begin and end rects. https://bugs.webkit.org/show_bug.cgi?id=175152 rdar://problem/32840576 Reviewed by Eric Carlson. No new tests, becuase this change has no effect on the DOM. This change uses different rects for fullscreen animation to prevent the animation from failing, and to improve the aesthetics of the animation. * platform/mac/WebVideoFullscreenController.mm: (frameExpandedToRatioOfFrame): (-[WebVideoFullscreenController enterFullscreen:]): (-[WebVideoFullscreenController exitFullscreen]): (-[WebVideoFullscreenWindow animateFromRect:toRect:withSubAnimation:controllerAction:]): (constrainFrameToRatioOfFrame): Deleted. 2017-08-03 Jer Noble [EME][Mac] SecureStop left on disk in Private Browsing mode. https://bugs.webkit.org/show_bug.cgi?id=175162 Reviewed by Eric Carlson. Return an empty string from mediaKeysStorageDirectory() when the page indicates that storage should be ephemeral(). Previously, an empty string in this case would be treated as an error. Instead, treat an empty string as valid, and do not try to store or retrieve session information to disk in that case. * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp: (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const): * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: (WebCore::CDMSessionAVContentKeySession::releaseKeys): (WebCore::CDMSessionAVContentKeySession::update): (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage): (WebCore::CDMSessionAVContentKeySession::contentKeySession): * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm: (WebCore::CDMSessionMediaSourceAVFObjC::storagePath const): 2017-08-03 Youenn Fablet [Fetch API] Add support for Request keepalive getter https://bugs.webkit.org/show_bug.cgi?id=175151 Reviewed by Chris Dumez. Test: imported/w3c/web-platform-tests/fetch/api/request/request-keepalive.html Adding keepalive as a fetch option. Adding initialization and getter of keepalive into FetchRequest. * Modules/fetch/FetchRequest.cpp: (WebCore::buildOptions): * Modules/fetch/FetchRequest.h: * Modules/fetch/FetchRequest.idl: * loader/FetchOptions.h: 2017-08-03 Yoshiaki Jitsukawa [PAL] Move spi/cf directory into PAL https://bugs.webkit.org/show_bug.cgi?id=175057 Reviewed by Antti Koivisto. * WebCore.xcodeproj/project.pbxproj: * loader/cocoa/DiskCacheMonitorCocoa.mm: * loader/cocoa/SubresourceLoaderCocoa.mm: * loader/mac/ResourceLoaderMac.mm: * platform/cf/CoreMediaSoftLink.cpp: * platform/cf/CoreMediaSoftLink.h: * platform/mac/PluginBlacklist.mm: * platform/mac/WebCoreNSStringExtras.mm: * platform/mac/WebGLBlacklist.mm: * platform/mediastream/mac/CoreAudioCaptureSource.cpp: * platform/network/NetworkStorageSession.h: * platform/network/cf/CookieJarCFNet.cpp: * platform/network/cf/CredentialStorageCFNet.cpp: * platform/network/cf/ResourceHandleCFNet.cpp: * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp: * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp: * platform/network/cf/ResourceRequestCFNet.cpp: * platform/network/cf/ResourceRequestCFNet.h: * platform/network/cf/ResourceResponse.h: * platform/network/cf/ResourceResponseCFNet.cpp: * platform/network/cf/SocketStreamHandleImplCFNet.cpp: * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: * platform/network/cocoa/CookieStorageObserver.h: * platform/network/cocoa/CredentialCocoa.h: * platform/network/cocoa/NetworkStorageSessionCocoa.mm: * platform/network/cocoa/ResourceRequestCocoa.mm: * platform/network/cocoa/ResourceResponseCocoa.mm: * platform/network/ios/ResourceRequestIOS.mm: * platform/network/mac/CookieJarMac.mm: * platform/network/mac/FormDataStreamMac.mm: * platform/network/mac/ResourceHandleMac.mm: * platform/network/mac/ResourceRequestMac.mm: * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: * platform/network/mac/WebCoreURLResponse.h: * testing/cocoa/WebArchiveDumpSupport.mm: 2017-08-03 Youenn Fablet Remove FETCH_API compilation guard https://bugs.webkit.org/show_bug.cgi?id=175154 Reviewed by Chris Dumez. No change of behavior. * Configurations/FeatureDefines.xcconfig: * Modules/fetch/DOMWindowFetch.cpp: * Modules/fetch/DOMWindowFetch.h: * Modules/fetch/DOMWindowFetch.idl: * Modules/fetch/FetchBody.cpp: * Modules/fetch/FetchBody.h: * Modules/fetch/FetchBody.idl: * Modules/fetch/FetchBodyConsumer.cpp: * Modules/fetch/FetchBodyConsumer.h: * Modules/fetch/FetchBodyOwner.cpp: * Modules/fetch/FetchBodyOwner.h: * Modules/fetch/FetchHeaders.cpp: * Modules/fetch/FetchHeaders.h: * Modules/fetch/FetchHeaders.idl: * Modules/fetch/FetchInternals.js: * Modules/fetch/FetchLoader.cpp: * Modules/fetch/FetchLoader.h: * Modules/fetch/FetchLoaderClient.h: * Modules/fetch/FetchRequest.cpp: * Modules/fetch/FetchRequest.h: * Modules/fetch/FetchRequest.idl: * Modules/fetch/FetchResponse.cpp: * Modules/fetch/FetchResponse.h: * Modules/fetch/FetchResponse.idl: * Modules/fetch/FetchResponse.js: * Modules/fetch/FetchResponseSource.cpp: * Modules/fetch/FetchResponseSource.h: * Modules/fetch/WorkerGlobalScopeFetch.cpp: * Modules/fetch/WorkerGlobalScopeFetch.h: * Modules/fetch/WorkerGlobalScopeFetch.idl: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::fetchAPIEnabled const): 2017-08-03 Devin Rousso Web Inspector: add button to open Inspector^2 https://bugs.webkit.org/show_bug.cgi?id=175108 Reviewed by Brian Burg. This patch just exposes a function to the inspector page. No new functionality was added. * inspector/InspectorFrontendHost.idl: * inspector/InspectorFrontendHost.h: * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::inspectInspector): 2017-08-03 Matt Baker Web Inspector: Instrument WebGLProgram created/deleted https://bugs.webkit.org/show_bug.cgi?id=175059 Reviewed by Devin Rousso. Tests: inspector/canvas/shaderProgram-add-remove-webgl.html inspector/canvas/shaderProgram-add-remove-webgl2.html This patch adds instrumentation to WebGLRenderingContextBase for tracking WebGLPrograms. A new helper class, InspectorShaderProgram, is used by the CanvasAgent to hold related data. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::createProgram): (WebCore::WebGLRenderingContextBase::deleteProgram): * inspector/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::enable): (WebCore::InspectorCanvasAgent::frameNavigated): (WebCore::InspectorCanvasAgent::didCreateProgram): (WebCore::InspectorCanvasAgent::willDeleteProgram): (WebCore::InspectorCanvasAgent::clearCanvasData): (WebCore::InspectorCanvasAgent::unbindCanvas): (WebCore::InspectorCanvasAgent::unbindProgram): (WebCore::InspectorCanvasAgent::assertInspectorProgram): (WebCore::InspectorCanvasAgent::findInspectorProgram): * inspector/InspectorCanvasAgent.h: * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl): (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodesImpl): (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl): (WebCore::InspectorInstrumentation::didChangeCanvasMemoryImpl): (WebCore::InspectorInstrumentation::recordCanvasActionImpl): (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrameImpl): (WebCore::InspectorInstrumentation::didCreateProgramImpl): (WebCore::InspectorInstrumentation::willDeleteProgramImpl): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::recordCanvasActionImpl): (WebCore::InspectorInstrumentation::didCreateCSSCanvas): (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodes): (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext): (WebCore::InspectorInstrumentation::didChangeCanvasMemory): (WebCore::InspectorInstrumentation::recordCanvasAction): (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrame): (WebCore::InspectorInstrumentation::didCreateProgram): (WebCore::InspectorInstrumentation::willDeleteProgram): * inspector/InspectorShaderProgram.cpp: Added. (WebCore::InspectorShaderProgram::create): (WebCore::InspectorShaderProgram::InspectorShaderProgram): (WebCore::InspectorShaderProgram::context const): * inspector/InspectorShaderProgram.h: Added. 2017-08-03 Matt Lewis Unreviewed, rolling out r220209. This caused internal build failures. Reverted changeset: "Use MPAVRoutingController instead of deprecated versions." https://bugs.webkit.org/show_bug.cgi?id=175063 http://trac.webkit.org/changeset/220209 2017-08-03 Brady Eidson Add SW IDLs and stub out basic functionality. https://bugs.webkit.org/show_bug.cgi?id=175115 Reviewed by Chris Dumez. No new tests (Currently no behavior change). Overall note: This feature is EnabledAtRuntime as opposed to EnabledBySetting because the Settings-based code generation is completely broken for non-Document contexts, whereas the RuntimeEnabledFeatures-based generation is not. * CMakeLists.txt: * Configurations/FeatureDefines.xcconfig: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * bindings/scripts/preprocess-idls.pl: Handle the new global scope c'tor file. * bindings/js/JSServiceWorkerContainerCustom.cpp: Added. (WebCore::JSServiceWorkerContainer::ready const): * bindings/js/JSWorkerGlobalScopeBase.cpp: (WebCore::toJSWorkerGlobalScope): Refactor to handle both types of derived workers. (WebCore::toJSServiceWorkerGlobalScope): * bindings/js/JSWorkerGlobalScopeBase.h: * dom/EventNames.h: * dom/EventTargetFactory.in: * features.json: Change status of feature. * page/Navigator.idl: * page/NavigatorBase.cpp: (WebCore::NavigatorBase::serviceWorker): * page/NavigatorBase.h: * page/NavigatorServiceWorker.idl: Added. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::serviceWorkerEnabled const): (WebCore::RuntimeEnabledFeatures::setServiceWorkerEnabled): * workers/ServiceWorker.cpp: Added. (WebCore::ServiceWorker::postMessage): (WebCore::ServiceWorker::~ServiceWorker): (WebCore::ServiceWorker::scriptURL const): (WebCore::ServiceWorker::state const): (WebCore::ServiceWorker::eventTargetInterface const): (WebCore::ServiceWorker::scriptExecutionContext const): * workers/ServiceWorker.h: Added. * workers/ServiceWorker.idl: Added. * workers/ServiceWorkerContainer.cpp: Added. (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer): (WebCore::ServiceWorkerContainer::controller const): (WebCore::ServiceWorkerContainer::ready): (WebCore::ServiceWorkerContainer::addRegistration): (WebCore::ServiceWorkerContainer::getRegistration): (WebCore::ServiceWorkerContainer::getRegistrations): (WebCore::ServiceWorkerContainer::startMessages): (WebCore::ServiceWorkerContainer::eventTargetInterface const): (WebCore::ServiceWorkerContainer::scriptExecutionContext const): * workers/ServiceWorkerContainer.h: Added. * workers/ServiceWorkerContainer.idl: Added. * workers/ServiceWorkerGlobalScope.cpp: Added. (WebCore::ServiceWorkerGlobalScope::registration): (WebCore::ServiceWorkerGlobalScope::skipWaiting): * workers/ServiceWorkerGlobalScope.h: Added. * workers/ServiceWorkerGlobalScope.idl: Added. * workers/ServiceWorkerRegistration.cpp: Added. (WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration): (WebCore::ServiceWorkerRegistration::installing): (WebCore::ServiceWorkerRegistration::waiting): (WebCore::ServiceWorkerRegistration::active): (WebCore::ServiceWorkerRegistration::scope const): (WebCore::ServiceWorkerRegistration::update): (WebCore::ServiceWorkerRegistration::unregister): (WebCore::ServiceWorkerRegistration::eventTargetInterface const): (WebCore::ServiceWorkerRegistration::scriptExecutionContext const): * workers/ServiceWorkerRegistration.h: Added. * workers/ServiceWorkerRegistration.idl: Added. 2017-08-03 Yoshiaki Jitsukawa [WebCore] Sort Xcode project files https://bugs.webkit.org/show_bug.cgi?id=175121 Reviewed by Antti Koivisto. * WebCore.xcodeproj/project.pbxproj: 2017-08-02 Sam Weinig [WebIDL] Convert MutationCallback to be a normal generated callback https://bugs.webkit.org/show_bug.cgi?id=174140 Reviewed by Darin Adler. To make this work more nicely, I: - Added the ability to for non-nullable interfaces in sequences to be passed via a Ref<> rather than a RefPtr<> as a parameter to a callback function. (e.g. callback MyCallback = void (sequence foos) will now have the signature, CallbackResult handleEvent(const Vector>&) rather than CallbackResult handleEvent(const Vector>&). - Added a new extended attribute for callback functions called [CallbackThisObject=Type] which allows you to specify that the callback needs a this object in addition to its arguments. When specified, the first argument of the C++ implementation function will now correspond to the this object, with the remaining arguments shifted over one. - Converted callback objects to all inherit directly from ActiveDOMCallback rather than having the generated JS callback derived class inherit from it. This allows us to have access to a callback's canInvokeCallback() function anywhere (needed for MutationCallback) as well as giving a place to put an optional virtual visitJSFunction to allow marking weak callbacks (while not an ideal layering, this matches what we do in EventListener). This change requires each callback to have a bit more code to import the ActiveDOMCallback's constructor and requires non-JS derived callbacks to pass a ScriptExecutionContext (e.g. the Document). * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSMutationCallback.cpp: Removed. * bindings/js/JSMutationCallback.h: Removed. Remove custom JSMutationCallback.h/cpp * Modules/geolocation/PositionCallback.h: * Modules/geolocation/PositionErrorCallback.h: * Modules/notifications/NotificationPermissionCallback.h: * Modules/webaudio/AudioBufferCallback.h: * Modules/webdatabase/DatabaseCallback.h: * Modules/webdatabase/SQLStatementCallback.h: * Modules/webdatabase/SQLStatementErrorCallback.h: * Modules/webdatabase/SQLTransactionCallback.h: * Modules/webdatabase/SQLTransactionErrorCallback.h: * css/MediaQueryListListener.h: * dom/NodeFilter.h: * dom/RequestAnimationFrameCallback.h: * dom/StringCallback.h: * fileapi/BlobCallback.h: * html/VoidCallback.h: * page/IntersectionObserverCallback.h: * page/PerformanceObserverCallback.h: Add ActiveDOMCallback as a base class. Import the ActiveDOMCallback constructor. * Modules/mediastream/MediaDevicesRequest.cpp: (WebCore::MediaDevicesRequest::filterDeviceList): (WebCore::MediaDevicesRequest::start): * Modules/mediastream/MediaDevicesRequest.h: Change filterDeviceList to take a Vector of Refs. * bindings/IDLTypes.h: Add InnerParameterType and NullableInnerParameterType type hooks and specialize wrappers to use Ref for InnerParameterType, and RefPtr for NullableInnerParameterType. * bindings/js/JSCallbackData.cpp: * bindings/js/JSCallbackData.h: Add support for passing a this object and give JSCallbackDataWeak a visitJSFunction to allow marking the underlying function. * bindings/js/JSMutationObserverCustom.cpp: (WebCore::JSMutationObserver::visitAdditionalChildren): (WebCore::constructJSMutationObserver): Deleted. Remove the custom constructor and replace it with a custom visitAdditionalChildren that calls the new ActiveDOMObject's visitJSFunction. * bindings/scripts/CodeGenerator.pm: (ParseType): Add helper to parse a type and cache the result. * bindings/scripts/CodeGeneratorJS.pm: (GenerateCallbackHeaderContent): (GenerateCallbackImplementationContent): (GetJSCallbackDataType): Deleted. - Add support for [CallbackThisObject]. When [CallbackThisObject] is not specified, use jsUndefined() as the this object as specified by WebIDL. - Stop inheriting from ActiveDOMCallback now that callbacks need to do this themselves. - Add a visitJSFunction override for weak callback functions which calls into the callback data. * bindings/scripts/IDLAttributes.json: Add [CallbackThisObject]. * bindings/scripts/IDLParser.pm: (ParseType): Add entry point to parse a single type. * css/FontFaceSet.h: Use Ref rather than RefPtr for the faces sequence. * dom/ActiveDOMCallback.h: (WebCore::ActiveDOMCallback::visitJSFunction): Add an optional visitJSFunction virtual function so that derived classes have a way of marking underlying function objects. * dom/MutationCallback.h: Convert to support generation (return a CallbackResult, inherit from ActiveDOMObject). * dom/MutationCallback.idl: Added. Added to generate the callback. Uses the new [CallbackThisObject]. * dom/MutationObserver.cpp: (WebCore::MutationObserver::deliver): Switch to call idiomatic handleEvent, and pass *this as the first parameter which will be translated into the this object. * dom/MutationObserver.h: (WebCore::MutationObserver::callback): Expose the callback so it can marked during GC. * dom/MutationObserver.idl: Remove CustomConstructor and replace it with a custom mark function. * dom/NativeNodeFilter.cpp: * dom/NativeNodeFilter.h: * inspector/InspectorDatabaseAgent.cpp: Pass now needed ScriptExecutionContext to non-js based callbacks. * bindings/scripts/test/JS/JSTestCallbackFunction.cpp: * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp: * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp: Added. * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h: Added. * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp: * bindings/scripts/test/JS/JSTestCallbackInterface.cpp: * bindings/scripts/test/JS/JSTestCallbackInterface.h: * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp: * bindings/scripts/test/TestCallbackFunctionWithThisObject.idl: Added. * bindings/scripts/test/TestCallbackInterface.idl: Add/update tests. 2017-08-03 Jeremy Jones Use MPAVRoutingController instead of deprecated versions. https://bugs.webkit.org/show_bug.cgi?id=175063 Reviewed by Tim Horton. No new tests because no behavior change. This uses a different platform class to present an interface. Remove deprecated MPAudioVideoRoutingPopoverController and MPAVRoutingSheet Add MPMediaControlsViewController. * platform/spi/ios/MediaPlayerSPI.h: 2017-08-03 Chris Dumez Improve our support for referrer policies https://bugs.webkit.org/show_bug.cgi?id=175069 Reviewed by Darin Adler. Improve our support for referrer policies. In particular, we now support the additional following ones: "same-origin", "origin-when-cross-origin" and "strict-origin-when-cross-origin". This is as per the following specification: - https://www.w3.org/TR/referrer-policy/#referrer-policies Also refactor the code a bit for clarity: I merged the ReferrerPolicy enum and the FetchOptions::ReferrerPolicy one. Tests: http/tests/referrer-policy/origin-when-cross-origin/cross-origin-http-http.html http/tests/referrer-policy/origin-when-cross-origin/cross-origin-http.https.html http/tests/referrer-policy/origin-when-cross-origin/same-origin.html http/tests/referrer-policy/same-origin/cross-origin-http-http.html http/tests/referrer-policy/same-origin/cross-origin-http.https.html http/tests/referrer-policy/same-origin/same-origin.html http/tests/referrer-policy/strict-origin-when-cross-origin/cross-origin-http-http.html http/tests/referrer-policy/strict-origin-when-cross-origin/cross-origin-http.https.html http/tests/referrer-policy/strict-origin-when-cross-origin/same-origin.html http/tests/referrer-policy/strict-origin/cross-origin-http-http.html http/tests/referrer-policy/strict-origin/cross-origin-http.https.html http/tests/referrer-policy/strict-origin/same-origin.html * Modules/fetch/FetchLoader.cpp: (WebCore::FetchLoader::start): * Modules/fetch/FetchReferrerPolicy.h: * Modules/fetch/FetchReferrerPolicy.idl: * Modules/fetch/FetchRequest.h: * Modules/fetch/FetchRequestInit.h: * dom/Document.cpp: (WebCore::Document::processReferrerPolicy): (WebCore::Document::applyQuickLookSandbox): (WebCore::Document::applyContentDispositionAttachmentSandbox): * dom/Document.h: * loader/FetchOptions.h: * loader/FrameNetworkingContext.h: * loader/PingLoader.cpp: (WebCore::PingLoader::sendBeacon): Drop explicit call to SecurityPolicy::shouldHideReferrer(). This is already called inside SecurityPolicy::generateReferrerHeader() and used only when needed, depending on the actual referrer policy. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::updateHTTPRequestHeaders): * loader/cache/CachedResourceRequest.cpp: (WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders): * page/SecurityPolicy.cpp: (WebCore::referrerToOriginString): (WebCore::SecurityPolicy::generateReferrerHeader): * page/SecurityPolicy.h: * platform/ReferrerPolicy.h: 2017-08-03 Daniel Bates Support ::marker pseudo-element https://bugs.webkit.org/show_bug.cgi?id=141477 Reviewed by David Hyatt. Implements the ::marker pseudo element as per the CSS Pseudo-Element Module Level 4 spec., (Editor's Draft, 24 July 2017). The ::marker pseudo element is a convenience pseudo element that allows a person to style the appearance of a list item marker. For example, to render all list item markers in bolded, blue text you would define a stylesheet with the following content: li::marker { color: blue; font-weight: bold; } and this could be applied to a page that contains markup of the form:
  1. Item 1
  2. Item 2
  3. ...
  4. Item N-1
  5. Item N
Formerly to the achieve the same effect you would need to use a stylesheet of the form: li { color: blue; font-weight: bold; } .list-item-content { all: initial; } and then write your markup to have the form:
  1. Item 1
  2. Item 2
  3. ...
  4. Item N-1
  5. Item N
The ::marker pseudo element only supports stylizing all font properties and the color property of a list item marker. Tests: fast/lists/list-marker-with-display.html http/wpt/css/css-pseudo-4/marker-and-other-pseudo-elements.html http/wpt/css/css-pseudo-4/marker-color.html http/wpt/css/css-pseudo-4/marker-font-properties.html http/wpt/css/css-pseudo-4/marker-inherit-values.html * css/CSSSelector.cpp: (WebCore::CSSSelector::pseudoId): Return the pseudo id for the ::marker pseudo element. * css/CSSSelector.h: Add enumerator PseudoElementMarker to the pseudo element enum. * css/RuleSet.cpp: (WebCore::determinePropertyWhitelistType): Return whitelist type PropertyWhitelistMarker for ::marker so that we match rules against the acceptable rules for ::marker. * css/RuleSet.h: Add enumerator PropertyWhitelistMarker to the property whitelist type enum. * css/SelectorPseudoElementTypeMap.in: Add "marker" to the list of pseudo element types. * css/StyleResolver.cpp: (WebCore::isValidMarkerStyleProperty): Determines if the specified CSS property is valid inside ::marker. (WebCore::StyleResolver::CascadedProperties::addMatch): Only recognize CSS properties in the content block of ::marker that match the ::marker whitelist policy. * rendering/RenderListItem.cpp: (WebCore::RenderListItem::computeMarkerStyle): Computes the style object for the list item marker. We apply the user-agent style to the marker here as opposed to defining ::marker in the UA sheet as per the spec. as an optimization to avoid having the style resolver apply the pseudo element to all elements. For now, we always inherit style from the originating element (list item). Added FIXME to selectively inherit styles. (WebCore::RenderListItem::styleDidChange): Always apply the list marker style to the list marker renderer. * rendering/RenderListItem.h: * rendering/style/RenderStyleConstants.h: Add pseudo ID for the ::marker pseudo element. 2017-08-03 Antti Koivisto Factor common code in Style::*ChangeInvalidation into helper functions https://bugs.webkit.org/show_bug.cgi?id=174312 Reviewed by Andreas Kling. There is a lot of copy code here. * Style/StyleInvalidationFunctions.h: Added. (WebCore::Style::traverseRuleFeaturesInShadowTree): (WebCore::Style::traverseRuleFeaturesForSlotted): (WebCore::Style::traverseRuleFeatures): Add functions for traversing rule features that may affect style of an element. Use lambdas to implement client-specific behavior. * WebCore.xcodeproj/project.pbxproj: * style/AttributeChangeInvalidation.cpp: (WebCore::Style::mayBeAffectedByAttributeChange): (WebCore::Style::AttributeChangeInvalidation::invalidateStyle): (WebCore::Style::mayBeAffectedByHostRules): Deleted. (WebCore::Style::mayBeAffectedBySlottedRules): Deleted. * style/ClassChangeInvalidation.cpp: (WebCore::Style::ClassChangeInvalidation::invalidateStyle): (WebCore::Style::mayBeAffectedByHostRules): Deleted. (WebCore::Style::mayBeAffectedBySlottedRules): Deleted. * style/IdChangeInvalidation.cpp: (WebCore::Style::IdChangeInvalidation::invalidateStyle): (WebCore::Style::mayBeAffectedByHostRules): Deleted. (WebCore::Style::mayBeAffectedBySlottedRules): Deleted. 2017-08-03 Zan Dobersek [EME] CDM constructor assigns CDMPrivate member multiple times https://bugs.webkit.org/show_bug.cgi?id=175128 Reviewed by Xabier Rodriguez-Calvar. In the CDM class constructor, iterate over the registered CDM factories, finding one that supports the specified key system. A CDMPrivate object is created through that factory, and the iteration is now stopped at that point, while previously it contined to potentially create CDMPrivate objects through other factories. Helper createCDMPrivateForKeySystem() function is removed. * Modules/encryptedmedia/CDM.cpp: (WebCore::CDM::CDM): (WebCore::createCDMPrivateForKeySystem): Deleted. 2017-08-03 Emilio Cobos Álvarez Don't always recalc the style of display: contents elements. https://bugs.webkit.org/show_bug.cgi?id=172753 Reviewed by Antti Koivisto. No new tests (no functionality change). This only removes an inefficiency. * dom/Element.cpp: (WebCore::Element::existingComputedStyle): * dom/Element.h: * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::updateRenderTree): (WebCore::RenderTreeUpdater::updateElementRenderer): * style/StyleTreeResolver.cpp: (WebCore::Style::renderOrDisplayContentsStyle): (WebCore::Style::TreeResolver::resolveElement): (WebCore::Style::TreeResolver::createAnimatedElementUpdate): (WebCore::Style::shouldResolveElement): (WebCore::Style::TreeResolver::resolveComposedTree): 2017-08-02 Devin Rousso Web Inspector: add stack trace information for each RecordingAction https://bugs.webkit.org/show_bug.cgi?id=174663 Reviewed by Joseph Pecoraro. Tests: inspector/canvas/recording-2d.html inspector/model/recording.html * inspector/InspectorCanvas.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::indexForData): (WebCore::InspectorCanvas::buildAction): 2017-08-02 Yusuke Suzuki Merge WTFThreadData to Thread::current https://bugs.webkit.org/show_bug.cgi?id=174716 Reviewed by Mark Lam. Use Thread::current() instead. * fileapi/AsyncFileStream.cpp: * platform/ThreadGlobalData.cpp: (WebCore::ThreadGlobalData::ThreadGlobalData): * platform/graphics/cocoa/WebCoreDecompressionSession.h: * platform/ios/wak/WebCoreThread.mm: (StartWebThread): * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThread): 2017-08-02 Sam Weinig Fix crashes in GC creating a document fragment on a background thread https://bugs.webkit.org/show_bug.cgi?id=175111 Reviewed by Chris Dumez. r220095 (https://webkit.org/b/175006) change JSHTMLTemplateElement from using a private name + property to manager the lifetime of the reference DocumentFragment to using the idiomatic visitAdditionalChildren. Unfortunately, the function to access the DocumentFragment lazily creates it. If this lazy creation happens on a GC thread, badness ensues. This introduces an accessor that returns the DocumentFragment if it has been created or null if it has not. * bindings/js/JSHTMLTemplateElementCustom.cpp: (WebCore::JSHTMLTemplateElement::visitAdditionalChildren): * html/HTMLTemplateElement.cpp: (WebCore::HTMLTemplateElement::contentIfAvailable): * html/HTMLTemplateElement.h: 2017-08-02 Sam Weinig [WebIDL] Simplify [EnabledBySettings] extended attribute code to not require passing a global object to finishCreation https://bugs.webkit.org/show_bug.cgi?id=175087 Reviewed by Chris Dumez. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): (GeneratePrototypeDeclaration): Remove unnecessary passing of the global object to finishCreation for [EnabledBySettings]. * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: * bindings/scripts/test/JS/JSTestNode.cpp: * bindings/scripts/test/JS/JSTestObj.cpp: Update tests. 2017-08-02 Andy Estes REGRESSION (r207155): Unable to switch sheets when previewing Numbers '09 spreadsheets https://bugs.webkit.org/show_bug.cgi?id=175098 Reviewed by Daniel Bates. r207155 enabled sandboxing on the frame displaying a QuickLook preview. This restricted frames within the sandbox from navigating their sandboxed siblings or ancestors, which breaks the functionality of multi-sheet Numbers '09 spreadsheet previews. These previews contain a frameset with a table of contents frame and a content frame, and the table of contents frame needs to be able to navigate the content frame when the sheet selection changes. Fix this by disabling the SandboxNavigation flag in the QuickLook sandbox. Frames within the sandbox will be able to navigate each other, but will not be able to navigate the top frame (due to SandboxTopNavigation still being enabled), nor will they be able to navigate any other ancestor frame outside the sandbox (due to QuickLook previews being in a different origin than the hosting frame). These two cases are covered by existing tests. Test: quicklook/multi-sheet-numbers-09.html * dom/Document.cpp: (WebCore::Document::applyQuickLookSandbox): Added a call to disableSandboxFlags(SandboxNavigation) after applying the content security policy. * dom/SecurityContext.h: (WebCore::SecurityContext::disableSandboxFlags): Defined disableSandboxFlags(). 2017-08-02 Jer Noble [MSE] Removing samples when presentation order does not match decode order can cause bad behavior. https://bugs.webkit.org/show_bug.cgi?id=175091 Reviewed by Eric Carlson. Address follow-up comments to r219519. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::removeCodedFrames): 2017-08-02 Jeremy Jones Remove unused and obsolete setting mediaDocumentEntersFullscreenAutomatically https://bugs.webkit.org/show_bug.cgi?id=175080 Reviewed by Jon Lee. No new tests because this only removes unused code. This is obsolete because of the alternate solution in https://bugs.webkit.org/show_bug.cgi?id=174850 * page/Settings.in: 2017-08-02 Filip Pizlo GPUBuffer::length() should return the size of the array buffer backing the GPU buffer, not the rounded-up GPU buffer length https://bugs.webkit.org/show_bug.cgi?id=175079 Reviewed by Simon Fraser. This fixes a failure in the GPU.BufferCreate unit test. The problem is that in order to have a Metal buffer wrap memory we allocated, we have to tell Metal that the memory is page-aligned. This means that the Metal buffer reports back a page-aligned size, which is different than what the test expected. It seems that it's most convenient for our GPUBuffer class to return the unaligned length, rather than the aligned length. This is just a simple matter of returning the length from the ArrayBuffer rather than the Metal buffer. This fixes the unit test and is probably more sensible for actual users of this class, since the page alignment of the length is a goofy implementation detail. * platform/graphics/cocoa/GPUBufferMetal.mm: (WebCore::GPUBuffer::length const): 2017-08-01 Brian Burg HTML file input elements do not support file extensions in the "accept" attribute https://bugs.webkit.org/show_bug.cgi?id=95698 Reviewed by Darin Adler. Serialize the accepted file extensions so they can be accessed in the UI process. * platform/FileChooser.h: * platform/FileChooser.cpp: (WebCore::FileChooser::invalidate): Modernize. (WebCore::FileChooserSettings::acceptTypes const): Deleted. This is dead code, it was only used by Chromium. 2017-08-02 Fujii Hironori Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName https://bugs.webkit.org/show_bug.cgi?id=175010 Reviewed by Alex Christensen. No new tests because no behavior change. Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed. * contentextensions/ContentExtensionParser.cpp: (WebCore::ContentExtensions::isValidCSSSelector): Call QualifiedName::init(). * dom/DOMAllInOne.cpp: Remove the warning. Include QualifiedName.cpp. * dom/QualifiedName.cpp: (WebCore::QualifiedName::init): Call LazyNeverDestroyed::construct instead of placement new. * dom/QualifiedName.h: Use LazyNeverDestroyed. 2017-08-01 Joseph Pecoraro CFString leak dragging an image - allocation under PlatformPasteboard::writeObjectRepresentations https://bugs.webkit.org/show_bug.cgi?id=175064 Reviewed by Tim Horton. * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::writeObjectRepresentations): Adopt a created string into the RetainPtr. * platform/ios/WebItemProviderPasteboard.h: * platform/ios/WebItemProviderPasteboard.mm: (-[WebItemProviderRegistrationInfoList dealloc]): Release suggestedName and switch from -strong to -copy. 2017-08-01 Chris Dumez Unreviewed, update Beacon API status to "In Development". * features.json: 2017-08-01 Chris Dumez Add initial support for navigator.sendBeacon https://bugs.webkit.org/show_bug.cgi?id=175007 Reviewed by Sam Weinig. Add initial support for navigator.sendBeacon behind an experimental feature runtime flag. The specification is available at: - https://w3c.github.io/beacon/ The current implementation supports sending beacons with all types of payloads except for ReadableStream. Some functionality is incomplete and will be taken care of in follow-up patches: - Support for CORS preflight for the cases where it is required. We currently return false and do not send the beacon in such cases. - Better support for redirects. - Use a more power-friendly network priority for beacon requests. Tests: http/tests/blink/sendbeacon/* http/tests/security/mixedContent/beacon/insecure-beacon-in-iframe.html http/wpt/beacon/* imported/blink/fast/beacon/* imported/w3c/web-platform-tests/beacon/* * CMakeLists.txt: * DerivedSources.make: * Modules/beacon/NavigatorBeacon.cpp: Added. (WebCore::NavigatorBeacon::sendBeacon): * Modules/beacon/NavigatorBeacon.h: Added. * Modules/beacon/NavigatorBeacon.idl: Added. * WebCore.xcodeproj/project.pbxproj: * loader/PingLoader.cpp: (WebCore::PingLoader::sendBeacon): * loader/PingLoader.h: 2017-08-01 Filip Pizlo Bmalloc and GC should put auxiliaries (butterflies, typed array backing stores) in a gigacage (separate multi-GB VM region) https://bugs.webkit.org/show_bug.cgi?id=174727 Reviewed by Mark Lam. No new tests because no change in behavior. Needed to teach Metal how to allocate in the Gigacage. * platform/graphics/cocoa/GPUBufferMetal.mm: (WebCore::GPUBuffer::GPUBuffer): (WebCore::GPUBuffer::contents): 2017-08-01 Fujii Hironori [WinCairo] Implement Font::platformBoundsForGlyph https://bugs.webkit.org/show_bug.cgi?id=174813 Reviewed by Alex Christensen. Test: fast/text/emphasis.html * platform/graphics/win/SimpleFontDataCairoWin.cpp: (WebCore::Font::platformBoundsForGlyph): Implemented by copying the code from Font::boundsForGDIGlyph(). 2017-08-01 Zalan Bujtas REGRESSION (r217197): New Yorker website hangs for a long time on load, lots of blank tiles https://bugs.webkit.org/show_bug.cgi?id=175009 Reviewed by Simon Fraser. This patch ensures that we report the desktop, non-frame-flattened frame size for media queries in subframes. Some websites don't expect the iframes to be expanded to the size of the content and when the media query callback mutates the content (triggering frame resize), they might end up getting into a never ending layout. Test: fast/frames/flattening/media-query-growing-content.html * css/MediaQueryEvaluator.cpp: (WebCore::orientationEvaluate): (WebCore::aspectRatioEvaluate): (WebCore::heightEvaluate): (WebCore::widthEvaluate): * page/FrameView.cpp: (WebCore::FrameView::layout): (WebCore::FrameView::layoutSizeForMediaQuery const): (WebCore::FrameView::evaluateMediaQueryList): * page/FrameView.h: 2017-07-26 Jiewen Tan Add tests to detect mistakes in backward compatibility when the structured clone algorithm is changed in the future https://bugs.webkit.org/show_bug.cgi?id=173998 Reviewed by Darin Adler. * bindings/js/SerializedScriptValue.cpp: Add a comment. 2017-08-01 Matt Lewis Unreviewed, rolling out r220089. This caused multiple crashes on macOS Debug testers. Reverted changeset: "Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName" https://bugs.webkit.org/show_bug.cgi?id=175010 http://trac.webkit.org/changeset/220089 2017-08-01 Sam Weinig [WebIDL] Swap a custom attribute for a custom mark function for HTMLTemplateElement https://bugs.webkit.org/show_bug.cgi?id=175006 Reviewed by Chris Dumez. Use the standard way of augmenting GC, visitAdditionalChildren, rather than using a private name to create ownership. * bindings/js/JSHTMLTemplateElementCustom.cpp: (WebCore::JSHTMLTemplateElement::visitAdditionalChildren): (WebCore::JSHTMLTemplateElement::content const): Deleted. * html/HTMLTemplateElement.idl: 2017-08-01 Zan Dobersek [GCrypt] Gather crypto constants in a single location https://bugs.webkit.org/show_bug.cgi?id=174091 Reviewed by Jiewen Tan. Gather common constants used across the libgcrypt-specific Web Crypto implementations in a single place -- in the GCryptUtilities.h header, inside the CryptoConstants namespace. The various ASN.1 object identifiers and other helper values are placed inside, in the std::array container. Additionally, CryptoConstants::matches() helper function is provided. It compares the provided data-and-size pair with the given std::array container and returns true if the std::memcmp() call returns 0. Changes in CryptoKeyEC and CryptoKeyRSA consist mostly of switching to the use of CryptoConstants::matches() and the CryptoConstants data arrays, as well as some whitespace cleanup. Additionallity in CryptoKeyEC, the helper functions covering various curve attributes are reordered, renamed and reorganized for simplicity. No new tests -- no changes in behavior. * crypto/gcrypt/CryptoKeyECGCrypt.cpp: (WebCore::curveIdentifier): (WebCore::curveSize): (WebCore::curveUncompressedFieldElementSize): (WebCore::curveUncompressedPointSize): (WebCore::CryptoKeyEC::platformImportRaw): (WebCore::CryptoKeyEC::platformImportJWKPublic): (WebCore::CryptoKeyEC::platformImportJWKPrivate): (WebCore::supportedAlgorithmIdentifier): (WebCore::curveForIdentifier): (WebCore::CryptoKeyEC::platformImportSpki): (WebCore::CryptoKeyEC::platformExportRaw): (WebCore::CryptoKeyEC::platformAddFieldElements): (WebCore::CryptoKeyEC::platformExportSpki): (WebCore::CryptoKeyEC::platformExportPkcs8): (WebCore::uncompressedPointSizeForCurve): Deleted. (WebCore::uncompressedFieldElementSizeForCurve): Deleted. * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: (WebCore::supportedAlgorithmIdentifier): (WebCore::CryptoKeyRSA::importPkcs8): (WebCore::CryptoKeyRSA::exportSpki): (WebCore::CryptoKeyRSA::exportPkcs8): * crypto/gcrypt/GCryptUtilities.h: (WebCore::CryptoConstants::matches): 2017-07-31 Fujii Hironori Use LazyNeverDestroyed instead of DEFINE_GLOBAL for MediaFeatureNames https://bugs.webkit.org/show_bug.cgi?id=175008 Reviewed by Alex Christensen. No new tests because no behavior change. Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed. * css/MediaFeatureNames.cpp: (WebCore::MediaFeatureNames::init): Do not include . Use LazyNeverDestroyed instead of DEFINE_GLOBAL. Call LazyNeverDestroyed::construct instead of placement new. * css/MediaFeatureNames.h: Use LazyNeverDestroyed. * css/MediaQueryEvaluator.cpp: (WebCore::MediaQueryEvaluator::evaluate const): Dereference with ->. 2017-07-31 Fujii Hironori Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName https://bugs.webkit.org/show_bug.cgi?id=175010 Reviewed by Alex Christensen. No new tests because no behavior change. Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed. * dom/DOMAllInOne.cpp: Remove the warning. Include QualifiedName.cpp. * dom/QualifiedName.cpp: (WebCore::QualifiedName::init): Call LazyNeverDestroyed::construct instead of placement new. * dom/QualifiedName.h: Use LazyNeverDestroyed. 2017-07-31 Matt Rajca Support quirk for letting media autoplay if the user interacted with at least one media element. https://bugs.webkit.org/show_bug.cgi?id=175005 Reviewed by Eric Carlson. If the user has interacted with at least one media element, let other media elements auto-play as a quirk. * dom/Document.cpp: (WebCore::Document::updateIsPlayingMedia): * dom/Document.h: (WebCore::Document::noteUserInteractionWithMediaElement): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): * html/MediaElementSession.cpp: (WebCore::needsDocumentLevelMediaUserGestureQuirk): (WebCore::MediaElementSession::playbackPermitted const): * page/MediaProducer.h: 2017-07-31 Nan Wang AX: CFEqual is failing on text markers with exact same data https://bugs.webkit.org/show_bug.cgi?id=175002 Reviewed by Chris Fleizach. We should zero the memory of the TextMarkerData instance so that it can be tested for byte-equivalence. Made sure this change won't break any of the existing tests. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::textMarkerDataForVisiblePosition): (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl): 2017-07-28 Matt Rajca Propagate user gesture tokens when script elements are loaded. https://bugs.webkit.org/show_bug.cgi?id=174959 Reviewed by Eric Carlson. Propagate user gesture tokens when script elements are loaded (i.e. between the time an element is created and its onload handler is invoked). * dom/ScriptElement.cpp: (WebCore::ScriptElement::ScriptElement): (WebCore::ScriptElement::dispatchLoadEventRespectingUserGestureIndicator): (WebCore::ScriptElement::executeScriptAndDispatchEvent): (WebCore::ScriptElement::executePendingScript): * dom/ScriptElement.h: 2017-07-31 Matt Lewis Unreviewed, rolling out r220048. This revision caused multiple crashes in fast/images. See webkit.org/b/174990 Reverted changeset: "RenderImageResourceStyleImage::image() should return the nullImage() if the image is not available" https://bugs.webkit.org/show_bug.cgi?id=174874 http://trac.webkit.org/changeset/220048 2017-07-31 Sam Weinig Remove unnecessary exceptions from storage code https://bugs.webkit.org/show_bug.cgi?id=174572 Reviewed by Chris Dumez. Remove checks for canAccessStorage() and the exceptions they would cause. These were used for Storage in ephemeral sessions, but they are now supported. Add checks for a null frame to functions that can mutate the storage, as the frame is needed for that, and it retains our existing behavior for disconnected frames. By removing these checks / exceptions, we can fully generate Storage.idl. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/JSStorageCustom.cpp: Removed. Remove JSStorageCustom.cpp * loader/EmptyClients.cpp: * page/DOMWindow.cpp: (WebCore::DOMWindow::sessionStorage): (WebCore::DOMWindow::localStorage): * storage/StorageArea.h: Remove canAccessStorage. * storage/Storage.cpp: (WebCore::Storage::length): (WebCore::Storage::key): (WebCore::Storage::getItem): (WebCore::Storage::setItem): (WebCore::Storage::removeItem): (WebCore::Storage::clear): (WebCore::Storage::contains): (WebCore::Storage::isSupportedPropertyName): (WebCore::Storage::supportedPropertyNames): * storage/Storage.h: * storage/Storage.idl: Remove canAccessStorage checks and corresponding exceptions. Add supportedPropertyNames to allow the removal of the [CustomGetOwnPropertyNames]. 2017-07-31 Matt Lewis Unreviewed, rolling out r220060. This broke our internal builds. Contact reviewer of patch for more information. Reverted changeset: "Merge WTFThreadData to Thread::current" https://bugs.webkit.org/show_bug.cgi?id=174716 http://trac.webkit.org/changeset/220060 2017-07-31 Yusuke Suzuki Merge WTFThreadData to Thread::current https://bugs.webkit.org/show_bug.cgi?id=174716 Reviewed by Sam Weinig. Use Thread::current() instead. * fileapi/AsyncFileStream.cpp: * platform/ThreadGlobalData.cpp: (WebCore::ThreadGlobalData::ThreadGlobalData): * platform/graphics/cocoa/WebCoreDecompressionSession.h: * platform/ios/wak/WebCoreThread.mm: (StartWebThread): * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThread): 2017-07-31 Xabier Rodriguez Calvar Created a bool pretty printer at WTF for debugging purposes https://bugs.webkit.org/show_bug.cgi?id=174893 Reviewed by Darin Adler. Use WTF::boolPrettyPrinter in debugging messages. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem): * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::seek): 2017-07-30 Zan Dobersek Unreviewed. Suppress the -Wextra compiler warning when building with GCC 6.3.0, explicitly initializing the RefCounted<> base class in the FetchHeaders(const FetchHeaders&) constructor. Note that while that's the signature of the copy constructor for the FetchHeaders class, the base RefCounted<> class is not copyable, so the default RefCounted<> constructor is used, but the FetchHeaders resources are normally copied into the new object from the one that's passed in. * Modules/fetch/FetchHeaders.h: (WebCore::FetchHeaders::FetchHeaders): 2017-07-30 Darin Adler Remove code in HTMLObjectElement attribute parsing that forces style resolution and layout https://bugs.webkit.org/show_bug.cgi?id=130653 Reviewed by Antti Koivisto. Also fixes a bug where load events are delivered prematurely in some cases when an object, embed, frame, or iframe element is still loading. * dom/Document.cpp: (WebCore::Document::loadEventDelayTimerFired): Added a call to FrameLoader::checkLoadComplete. Goes along with the change to FrameLoader::checkLoadCompleteForThisFrame, which now respects the isDelayingLoadEvent flag. * html/HTMLAppletElement.cpp: (WebCore::HTMLAppletElement::HTMLAppletElement): Removed the createdByParser argument, no longer needed by the base class. (WebCore::HTMLAppletElement::create): Added call to finishCreating, which is now part of the process of creating any object in a class derived from HTMLPlugInImageElement. (WebCore::HTMLAppletElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate is only called when it's becoming false; avoids a false/true/false round trip that can cause trouble. * html/HTMLAppletElement.h: Updated for the above. * html/HTMLEmbedElement.cpp: (WebCore::HTMLEmbedElement::HTMLEmbedElement): Removed the createdByParser argument, no longer needed by the base class. (WebCore::HTMLEmbedElement::create): Added call to finishCreating, which is now part of the process of creating any object in a class derived from HTMLPlugInImageElement. (WebCore::HTMLEmbedElement::parseAttribute): Changed srcAttr to call updateImageLoaderWithNewURLSoon to do the image loading logic. (WebCore::HTMLEmbedElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate is only called when it's becoming false; avoids a false/true/false round trip that can cause trouble. * html/HTMLEmbedElement.h: Updated for the above. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::setReadyState): Call setShouldDelayLoadEvent(false) when transitioning to HAVE_CURRENT_DATA (or beyond), even if we have already fired a loadeddata event in the past. This matches what the HTML specification calls for, but only if you read it carefully. Without this change, and with the more complete implementation of load event delay below, one of the regression tests hangs because are permanently stuck dealying load events. Also added a FIXME about other code that likely has a similar problem; the symptom is likely to be subtle and minor, though. * html/HTMLObjectElement.cpp: (WebCore::HTMLObjectElement::HTMLObjectElement): Removed the createdByParser argument, no longer needed by the base class. (WebCore::HTMLObjectElement::create): Added call to finishCreating, which is now part of the process of creating any object in a class derived from HTMLPlugInImageElement. (WebCore::HTMLObjectElement::parseAttribute): Changed dataAttr to use updateImageLoaderWithNewURLSoon. Explicitly call scheduleUpdateForAfterStyleResolution since just calling invalidateStyleAndRenderersForSubtree alone is no longer sufficient. (WebCore::HTMLObjectElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate is only called when it's becoming false; avoids a false/true/false round trip that can cause trouble. (WebCore::HTMLObjectElement::childrenChanged): Added calls to the new scheduleUpdateForAfterStyleResolution since invalidating style is no longer sufficient. (WebCore::HTMLObjectElement::renderFallbackContent): Remove the call to updateStyleIfNeeded. This is the main change that the title of this bug refers to. * html/HTMLObjectElement.h: Updated for the above. Also removed the clearUseFallbackContent function because it's clearer to set the data member in line at the single call site in HTMLObjectElement::parseAttribute. * html/HTMLPlugInImageElement.cpp: (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): Removed the createdByParser argument; no need to set an m_needsWidgetUpdate flag differently for parser cases now. (WebCore::HTMLPlugInImageElement::finshCreating): Added. To be called after creating an element to do work that can't be done in a constructor. (WebCore::HTMLPlugInImageElement::didRecalcStyle): Added. Calls the new scheduleUpdateForAfterStyleResolution function. (WebCore::HTMLPlugInImageElement::didAttachRenderers): Moved all the logic from this function into scheduleUpdateForAfterStyleResolution. Also added a call through to the base class; cleans things up, even though it's just an assertion. (WebCore::HTMLPlugInImageElement::willDetachRenderers): Removed the call to setNeedsWidgetUpdate(true) here; no longer needed because the new logic already does the right thing in this case. (WebCore::HTMLPlugInImageElement::updateWidgetIfNecessary): Deleted. Now handled by updateAfterStyleResolution instead. (WebCore::HTMLPlugInImageElement::finishParsingChildren): Deleted. Handling updates after parsing all the children now comes naturally out of the new implementation. (WebCore::HTMLPlugInImageElement::scheduleUpdateForAfterStyleResolution): Added. Schedules a call to updateAfterStyleResolution when needed, and equally importantly, increments the load event delay count to make sure that loads that are part of that update can participate in decision about whether it's time for the load event. (WebCore::HTMLPlugInImageElement::updateAfterStyleResolution): Added. Combines updateWidgetIfNecessary and startLoadingImage, and also deals with the new m_needsImageReload boolean in cases where no actual loading is done. (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Update load event delay count when moving an element that is in the middle of loading. This lets the updateAfterStyleResolution function do the right thing even when the element is moved without leaving anything stuck in a strange state. (WebCore::HTMLPlugInImageElement::prepareForDocumentSuspension): Call the new scheduleUpdateForAfterStyleResolution since invalidating style is no longer sufficient. (WebCore::HTMLPlugInImageElement::startLoadingImage): Deleted. Now handled by updateAfterStyleResolution instead. (WebCore::HTMLPlugInImageElement::updateImageLoaderWithNewURLSoon): Added. Does all the right things for when an image URL is changed; for use by the concrete derived classes. * html/HTMLPlugInImageElement.h: Updated for above changes. Also made m_imageLoader private rather than protected, and added the two new boolean data members. * html/HTMLTagNames.in: Removed unneeded constructorNeedsCreatedByParser flags for applet, embed, and object. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::isLoadingInAPISense): Return true if the document is delaying a load event. * loader/FrameLoader.cpp: (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Don't do any work if isDelayingLoadEvent is true; otherwise this function can have a side effect of triggering the load event. (WebCore::FrameLoader::detachFromParent): Schedule a checkLoadComplete here, too, not just a checkCompleted. This is relevant if the frame we are detaching was delaying a load event because it no longer will be and so the load might be complete. 2017-07-30 Sam Weinig [WebIDL] Remove JS builtin bindings for FetchRequest, DOMWindowFetch and WorkerGlobalScopeFetch https://bugs.webkit.org/show_bug.cgi?id=174974 Reviewed by Darin Adler. * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * Modules/fetch/DOMWindowFetch.js: Removed. * Modules/fetch/FetchRequest.js: Removed. * Modules/fetch/WorkerGlobalScopeFetch.js: Removed. Remove builtin files. * Modules/fetch/DOMWindowFetch.cpp: (WebCore::DOMWindowFetch::fetch): * Modules/fetch/DOMWindowFetch.h: * Modules/fetch/DOMWindowFetch.idl: * Modules/fetch/WorkerGlobalScopeFetch.cpp: (WebCore::WorkerGlobalScopeFetch::fetch): * Modules/fetch/WorkerGlobalScopeFetch.h: * Modules/fetch/WorkerGlobalScopeFetch.idl: Remove builtin and instead create FetchRequest in the implementation. * Modules/fetch/FetchBody.cpp: (WebCore::FetchBody::extract): * Modules/fetch/FetchBody.h: * Modules/fetch/FetchBodyOwner.cpp: (WebCore::FetchBodyOwner::extractBody): * Modules/fetch/FetchBodyOwner.h: * Modules/fetch/FetchResponse.cpp: * Modules/fetch/FetchResponse.h: Rename FetchBody::BindingDataType to FetchBody::Init to match its IDL naming. * Modules/fetch/FetchHeaders.cpp: (WebCore::appendToHeaderMap): (WebCore::fillHeaderMap): (WebCore::FetchHeaders::create): (WebCore::FetchHeaders::fill): * Modules/fetch/FetchHeaders.h: Add helpers to implement the fill algorithm for various input types. Leave the existing fill for now, as it is still used by the FetchResponse builtin, but will eventually be removed. * Modules/fetch/FetchRequest.cpp: (WebCore::FetchRequest::initializeOptions): (WebCore::FetchRequest::initializeWith): (WebCore::FetchRequest::setBody): (WebCore::FetchRequest::create): (WebCore::FetchRequest::setBodyFromInputRequest): Deleted. * Modules/fetch/FetchRequest.h: Migrate builtin code to the implementation. This is 1-to-1 re-implementation, so I did not attempt to fix any conformance issues. That will come in follow up. * Modules/fetch/FetchRequest.idl: Replace builtins with an IDL constructor. * Modules/fetch/FetchRequestInit.h: * Modules/fetch/FetchRequestInit.idl: Add missing headers and body to FetchRequestInit. 2017-07-30 Said Abou-Hallawa RenderImageResourceStyleImage::image() should return the nullImage() if the image is not available https://bugs.webkit.org/show_bug.cgi?id=174874 Reviewed by Darin Adler. If an element has image content data for a none cached image, e.g. -webkit-named-image, RenderImageResourceStyleImage will be created and attached to the RenderImage. RenderImageResourceStyleImage::m_cachedImage will be set to null because the m_styleImage->isCachedImage() is false in this case. When ImageLoader finishes loading the url of the src attribute, RenderImageResource::setCachedImage() will be called to set m_cachedImage. A crash will happen when the RenderImage is destroyed. Destroying the RenderImage calls RenderImageResourceStyleImage::shutdown() which checks m_cachedImage and finds it not null, so it calls RenderImageResourceStyleImage::image() which ends up calling CSSNamedImageValue::image() which returns a null pointer because the size is empty. RenderImageResourceStyleImage::shutdown() calls image()->stopAnimation() without checking the return value of image(). Like the base class virtual method RenderImageResource::image(), RenderImageResourceStyleImage::image() should return the nullImage() if the image is not available. Test: fast/images/image-element-image-content-data.html * css/CSSCrossfadeValue.cpp: * css/CSSFilterImageValue.cpp: * page/EventHandler.cpp: * page/PageSerializer.cpp: * rendering/RenderElement.cpp: * rendering/RenderImageResource.cpp: * rendering/RenderImageResourceStyleImage.cpp: (WebCore::RenderImageResourceStyleImage::initialize): (WebCore::RenderImageResourceStyleImage::shutdown): Revert back the changes of r208511 in this function. Add a call to image()->stopAnimation() without checking the return of image() since it will return the nullImage() if the image not available. There is no need to check m_cachedImage before calling image() because image() does not check or access m_cachedImage. (WebCore::RenderImageResourceStyleImage::image): The base class method RenderImageResource::image() returns the nullImage() if the image not available. This is because CachedImage::imageForRenderer() returns the nullImage() if the image is not available; see CachedImage.h. We should do the same for the derived class for consistency. * rendering/style/ContentData.cpp: * rendering/style/StyleCachedImage.cpp: * style/StylePendingResources.cpp: 2017-07-29 Filip Pizlo Unreviewed, rollout r220044 because it set the bots on fire. It seems that the "-Wunguarded-availability-new" pragma is not widely supported. So, a bunch of the Mac bots are now unable to build and that includes EWS. Fixing by rolling it out. * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (-[WebAVSampleBufferErrorListener beginObservingRenderer:]): (-[WebAVSampleBufferErrorListener stopObservingRenderer:]): (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError): (WebCore::SourceBufferPrivateAVFObjC::flush): 2017-07-29 Dan Bernstein Fixed building for macOS 10.12 with the macOS 10.13 SDK. Suppressed the unguarded-availability-new warning around uses of AVSampleBufferAudioRenderer and AVSampleBufferRenderSynchronizer. Even though the 10.13 SDK declares them as available starting in that release, they have been available as SPI earlier. * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (-[WebAVSampleBufferErrorListener beginObservingRenderer:]): (-[WebAVSampleBufferErrorListener stopObservingRenderer:]): (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError): (WebCore::SourceBufferPrivateAVFObjC::flush): 2017-07-29 Nan Wang AX: findMatchingObjects doesn't work when the startObject is ignored https://bugs.webkit.org/show_bug.cgi?id=174965 Reviewed by Chris Fleizach. findMatchingObjects would return a wrong element if we pass in an ignored start object. To fix this, we should use the closest accessible sibling as the start object. Test: accessibility/mac/search-predicate-from-ignored-element.html * accessibility/AccessibilityObject.cpp: (WebCore::appendChildrenToArray): 2017-07-29 Aaron Chu AX: FKA: Buttons need a visible focus indicator https://bugs.webkit.org/show_bug.cgi?id=171040 Reviewed by Antoine Quint. Added a background color for the focus state of the icon buttons in modern media controls. Test: media/modern-media-controls/button/button-focus-state.html * Modules/modern-media-controls/controls/button.css: (button:focus): (button:focus > picture): * Modules/modern-media-controls/controls/slider.css: (.slider > input): 2017-07-28 Sam Weinig [WebIDL] Remove JS builtin bindings for FetchHeaders https://bugs.webkit.org/show_bug.cgi?id=174905 Reviewed by Alex Christensen. * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * Modules/fetch/FetchHeaders.js: Removed. Remove FetchHeaders.js * Modules/fetch/FetchHeaders.cpp: (WebCore::appendToHeaderMap): (WebCore::FetchHeaders::create): (WebCore::FetchHeaders::append): * Modules/fetch/FetchHeaders.h: (WebCore::FetchHeaders::FetchHeaders): Add create function for generated constructor. Add appendToHeaderMap static function which takes the functionality from the existing append function, and makes it useable in create. * Modules/fetch/FetchHeaders.idl: Replace [JSBuiltinConstructor] with real constructor. Keep other builtin attributes as they are still used by other Fetch code. * bindings/js/JSDOMConvertRecord.h: Fix record conversion to work with proxies by changing to use the method table for getOwnPropertyNames, and undefined values by not excluding undefined values. 2017-07-28 Matt Baker Web Inspector: capture an async stack trace when web content calls addEventListener https://bugs.webkit.org/show_bug.cgi?id=174739 Reviewed by Brian Burg. Test: inspector/debugger/async-stack-trace.html Add instrumentation to EventTarget to support showing asynchronous stack traces when the debugger breaks in a script event listener. * dom/EventTarget.cpp: (WebCore::EventTarget::addEventListener): (WebCore::EventTarget::removeEventListener): (WebCore::EventTarget::fireEventListeners): * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didAddEventListenerImpl): (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl): (WebCore::InspectorInstrumentation::willHandleEventImpl): (WebCore::InspectorInstrumentation::didHandleEventImpl): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::didAddEventListener): (WebCore::InspectorInstrumentation::willRemoveEventListener): (WebCore::InspectorInstrumentation::willHandleEvent): (WebCore::InspectorInstrumentation::didHandleEvent): * inspector/PageDebuggerAgent.cpp: (WebCore::PageDebuggerAgent::didClearAsyncStackTraceData): (WebCore::PageDebuggerAgent::didAddEventListener): (WebCore::PageDebuggerAgent::willRemoveEventListener): (WebCore::PageDebuggerAgent::willHandleEvent): * inspector/PageDebuggerAgent.h: 2017-07-28 Matt Rajca Don't add autoplay restrictions to media elements created in response to user gestures. https://bugs.webkit.org/show_bug.cgi?id=174947 Reviewed by Eric Carlson. Test: media/video-create-with-user-gesture.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): 2017-07-28 Jeremy Jones WebMediaSessionHelper calls -[UIApplication beginReceivingRemoteControlEvents] from WebThread https://bugs.webkit.org/show_bug.cgi?id=174934 rdar://problem/33586772 Reviewed by Eric Carlson. No new tests because no effect on DOM. This dispatches a UIKit call to the main thread since it might happen on WebThread in WK1. * platform/audio/ios/MediaSessionManagerIOS.mm: (-[WebMediaSessionHelper initWithCallback:]): 2017-07-28 Myles C. Maxfield [macOS] Reeder's defaults font is Times instead of San Francisco https://bugs.webkit.org/show_bug.cgi?id=174885 Reviewed by Simon Fraser. Reeder uses explicit dot-prefixed names in its source code. Within Core Text, dot-prefixed names cannot be matched case insensitively. The solution is to not case-fold these family names, and to make our caches case sensitive for these special names. Tests: fast/text/font-lookup-dot-prefix-case-sensitive-2.html fast/text/font-lookup-dot-prefix-case-sensitive.html * platform/graphics/FontCache.cpp: (WebCore::FontPlatformDataCacheKey::operator==): (WebCore::FontPlatformDataCacheKeyHash::hash): * platform/graphics/FontCascade.cpp: (WebCore::keysMatch): (WebCore::computeFontCascadeCacheHash): * platform/graphics/FontDescription.cpp: (WebCore::FontCascadeDescription::familyNamesAreEqual): (WebCore::FontCascadeDescription::familyNameHash): (WebCore::FontCascadeDescription::foldedFamilyName): * platform/graphics/FontDescription.h: * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::fontForPostScriptName): 2017-07-28 Devin Rousso Web Inspector: Record actions performed on CanvasRenderingContext2D https://bugs.webkit.org/show_bug.cgi?id=174482 Reviewed by Joseph Pecoraro. Tests: inspector/canvas/recording-2d.html inspector/canvas/recording.html * html/canvas/CanvasRenderingContext2D.idl: Add CallTracingCallback to interface to record all API calls. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::paint): If a recording is active, mark the current frame as completed. * bindings/scripts/CodeGeneratorJS.pm: (GenerateAttributeGetterBodyDefinition): (GenerateAttributeSetterBodyDefinition): (GenerateImplementationFunctionCall): (GenerateCallTracerParameter): (GenerateCallTracer): * bindings/scripts/test/TestCallTracer.idl: * bindings/scripts/test/JS/JSTestCallTracer.cpp: (WebCore::setJSTestCallTracerTestAttributeInterfaceSetter): (WebCore::setJSTestCallTracerTestAttributeSpecifiedSetter): (WebCore::jsTestCallTracerTestAttributeWithVariantGetter): (WebCore::jsTestCallTracerTestAttributeWithVariant): (WebCore::setJSTestCallTracerTestAttributeWithVariantSetter): (WebCore::setJSTestCallTracerTestAttributeWithVariant): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationInterfaceBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationSpecifiedBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithArgumentsBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgumentBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgumentBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgument): * inspector/InspectorCanvas.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::recordAction): (WebCore::InspectorCanvas::buildAction): Change CallTracer IDL generation to flatten any variants so that all types for the parameters of an action are able to be listed in a single variant. This prevents possible ambiguity when constructing the variant, as they require that exactly one type be constructible and a sub-variant might not satisfy that condition. This was only an issue for older mac SDKs. * bindings/js/CallTracer.h: * bindings/js/CallTracer.cpp: (WebCore::CallTracer::recordCanvasAction): * bindings/js/CallTracerTypes.h: * inspector/InspectorCanvasAgent.h: * inspector/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::recordCanvasAction): * inspector/InspectorInstrumentation.h: * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::recordCanvasAction): (WebCore::InspectorInstrumentation::recordCanvasActionImpl): Rename CanvasActionParameterVariant to RecordCanvasActionVariant to match what is expected by the IDL generator. Also remove unnecessary includes now that they are in CallTracerTypes.h. * CMakeLists.txt: * bindings/js/JSBindingsAllInOne.cpp: Add CallTracer for CMake builds. 2017-07-28 Sam Weinig [WebIDL] Split-up and cleanup Fetch IDL files in preparation for removing unnecessary js builtins https://bugs.webkit.org/show_bug.cgi?id=174915 Reviewed by Alex Christensen. - Split FetchRequest enums and Init dictionary out of FetchRequest so they can be used from other files like WorkerGlobalScopeFetch and DOMWindowFetch. - Add missing FetchResponseInit. Currently unused but will be in a subsequent patch. - Add and update comments about missing properties and functions. * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * Modules/fetch/DOMWindowFetch.idl: * Modules/fetch/FetchBody.idl: * Modules/fetch/FetchBodyOwner.h: * Modules/fetch/FetchHeaders.h: * Modules/fetch/FetchHeaders.idl: * Modules/fetch/FetchReferrerPolicy.h: Added. * Modules/fetch/FetchReferrerPolicy.idl: Added. * Modules/fetch/FetchRequest.h: * Modules/fetch/FetchRequest.idl: * Modules/fetch/FetchRequestCache.h: Added. * Modules/fetch/FetchRequestCache.idl: Added. * Modules/fetch/FetchRequestCredentials.h: Added. * Modules/fetch/FetchRequestCredentials.idl: Added. * Modules/fetch/FetchRequestInit.h: Added. * Modules/fetch/FetchRequestInit.idl: Added. * Modules/fetch/FetchRequestMode.h: Added. * Modules/fetch/FetchRequestMode.idl: Added. * Modules/fetch/FetchRequestRedirect.h: Added. * Modules/fetch/FetchRequestRedirect.idl: Added. * Modules/fetch/FetchResponse.h: * Modules/fetch/FetchResponse.idl: * Modules/fetch/WorkerGlobalScopeFetch.idl: 2017-07-28 Myles C. Maxfield REGRESSION(r216944): Fallback fonts erroneously visible when the primary font is loading https://bugs.webkit.org/show_bug.cgi?id=174772 Reviewed by Simon Fraser. During a font load, we try pretty hard to find a font to use that isn't the last resort font (which happens to be Times). We do this by iterating through all the fonts in the font-family list, as well as through all the relevant @font-face blocks which share the requested font family name. Unfortunately, if we find one of these fallback fonts, we were simply using it directly, which means that it was being drawn as visible (because the visibility setting lives inside the Font object). Instead, we should carry the invisibility setting from the interstitial font to this used fallback font. This patch is an extension of r219221, which fixed the problem only for system fallback fonts. This patch adopts the same methodology to all fallback fonts. Test: http/tests/webfont/font-loading-system-fallback-visibility-FontRanges.html * platform/graphics/FontCascadeFonts.cpp: (WebCore::FontCascadeFonts::glyphDataForVariant): (WebCore::glyphPageFromFontRanges): * platform/graphics/FontRanges.cpp: (WebCore::FontRanges::glyphDataForCharacter): 2017-07-28 Frederic Wang Fix typo in scrollPositionChangedViaDelegatedScrolling https://bugs.webkit.org/show_bug.cgi?id=174937 Reviewed by Wenson Hsieh. No new tests, fix typo in the inUserInteraction parameter. * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): * page/scrolling/ScrollingTree.h: 2017-07-28 Wenson Hsieh [iOS DnD] [WK1] Snapshots generated using -[DOMRange renderImageForcingBlackText:] are upside down https://bugs.webkit.org/show_bug.cgi?id=174928 Reviewed by Tim Horton. Pulls the implementation of createDragImageForRange out into DragImageIOS, and use TextIndicator to generate a snapshot instead of FrameSelection's snapshotting utilities. This makes snapshotting a DOMRange behave the same way as snapshotting a dragged selection. No way of testing TextIndicator-based snapshotting yet. * platform/DragImage.cpp: Guard createDragImageForRange for !PLATFORM(IOS). * platform/ios/DragImageIOS.mm: (WebCore::createDragImageForSelection): Add a FIXME to point out that having an additional context flip inside the UIGraphicsImageRenderer block results in an upside-down drag image being returned from createDragImageFromImage. This image is being flipped elsewhere in drag initiation code, which eventually results in the correct orientation; we'll need further investigation to remove this extraneous flip. (WebCore::createDragImageForRange): 2017-07-28 Jeremy Jones Remove Web prefix from WebVideoFullscreen and WebPlaybackSession classes. https://bugs.webkit.org/show_bug.cgi?id=174437 Reviewed by Darin Adler. No new tests because no behavior change. Remove redundant Web- prefix from classes in WebCore namespace. * WebCore.xcodeproj/project.pbxproj: * html/HTMLMediaElement.cpp: * html/HTMLVideoElement.cpp: * platform/cocoa/PlaybackSessionInterface.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionInterface.h. (WebCore::PlaybackSessionInterface::~PlaybackSessionInterface): * platform/cocoa/PlaybackSessionModel.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModel.h. (WebCore::PlaybackSessionModel::~PlaybackSessionModel): (WebCore::PlaybackSessionModelClient::~PlaybackSessionModelClient): (WebCore::PlaybackSessionModelClient::externalPlaybackChanged): * platform/cocoa/PlaybackSessionModelMediaElement.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.h. * platform/cocoa/PlaybackSessionModelMediaElement.mm: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm. * platform/cocoa/VideoFullscreenChangeObserver.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenChangeObserver.h. (WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver): * platform/cocoa/VideoFullscreenModel.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModel.h. (WebCore::VideoFullscreenModel::~VideoFullscreenModel): (WebCore::VideoFullscreenModelClient::~VideoFullscreenModelClient): * platform/cocoa/VideoFullscreenModelVideoElement.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.h. (WebCore::VideoFullscreenModelVideoElement::create): * platform/cocoa/VideoFullscreenModelVideoElement.mm: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm. * platform/ios/PlaybackSessionInterfaceAVKit.h: Renamed from Source/WebCore/platform/ios/WebPlaybackSessionInterfaceAVKit.h. * platform/ios/PlaybackSessionInterfaceAVKit.mm: Renamed from Source/WebCore/platform/ios/WebPlaybackSessionInterfaceAVKit.mm. * platform/ios/VideoFullscreenInterfaceAVKit.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h. * platform/ios/VideoFullscreenInterfaceAVKit.mm: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm. * platform/ios/WebAVPlayerController.h: * platform/ios/WebAVPlayerController.mm: * platform/ios/WebVideoFullscreenControllerAVKit.mm: * platform/mac/PlaybackSessionInterfaceMac.h: Renamed from Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.h. * platform/mac/PlaybackSessionInterfaceMac.mm: Renamed from Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm. * platform/mac/VideoFullscreenInterfaceMac.h: Renamed from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h. * platform/mac/VideoFullscreenInterfaceMac.mm: Renamed from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm. * platform/mac/WebPlaybackControlsManager.h: * platform/mac/WebPlaybackControlsManager.mm: 2017-07-27 Jeremy Jones Don't override _allowsMediaDocumentInlinePlayback in MediaDocument with playsinlineAttr. https://bugs.webkit.org/show_bug.cgi?id=174850 rdar://problem/33449903 Reviewed by Jon Lee. This change removes playsinlineAttr from MediaDocument so that it doesn't override the setting from _allowsMediaDocumentInlinePlayback. In its place is an update to requiresFullscreenForVideoPlayback that implements the details of exactly which media documents are still allowed to play inlne. Media documents always use a video element; but when there are no video tracks, it has behavior like an audio element. See media-controller.js isAudio(). This change preserves this behavior with respect to fullscreen requirements for media document by mirroring the isAudio() check in requiresFullscreenForVideoPlayback. * html/MediaDocument.cpp: (WebCore::MediaDocumentParser::createDocumentStructure): * html/MediaElementSession.cpp: (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback): 2017-07-27 Jeremy Jones MediaDocument fullscreen pinch gesture should trigger navigate back. https://bugs.webkit.org/show_bug.cgi?id=174914 Reviewed by Jon Lee. No new tests because only effect is from interaction with platform. For media documents, pressing the "done" button on fullscreen video navigates back to the previous page. The same should happen for other gestures that pause playback when returning to inline. This allows the gesture to have the same behavior as the button. * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): 2017-07-27 Aaron Chu AX: VoiceOver silent or skipping over time values on media player. https://bugs.webkit.org/show_bug.cgi?id=174324 Reviewed by Antoine Quint. Added role attribute to modern media controls time lable class so that VoiceOver can access the time label when the media is playing. Test Updated: media/modern-media-controls/time-label/time-label.html Test Added: media/modern-media-controls/time-label/ios-time-label.html * Modules/modern-media-controls/controls/time-label.js: 2017-07-27 Yusuke Suzuki Hoist DOM binding attribute getter prologue into JavaScriptCore taking advantage of DOMJIT / CheckSubClass https://bugs.webkit.org/show_bug.cgi?id=171637 Reviewed by Darin Adler. We use DOMAttribute. When DOMAttribute is specified, ClassInfo check is performed by JSC side. So, we can drop ClassInfo check from the actual function. We also simplify DOMJIT::GetterSetter to make it smaller size. WebCore size comparison Before: 48443292 After: 48087800 (0.7% reduction) Speedometer Scores show 0.8% improvement. Before: 158.9 +- 0.46 After: 160.2 +- 0.36 Dromaeo DOM core Scores show 5.8% improvement. Before After Total Score: 8424.12runs/s ±1.38% 8911.60runs/s ±1.47% DOM Attributes 12627.27runs/s ±1.87% 14023.17runs/s ±1.87% DOM Modification 1207.82runs/s ±2.48% 1204.21runs/s ±3.05% DOM Query 68068.82runs/s ±0.63% 74273.38runs/s ±0.69% DOM Traversal 1240.07runs/s ±1.96% 1256.64runs/s ±1.77% Performance improvement can be explained by the following optimizations. 1. Type checks are typically eliminated in all the JIT tiers. IC / DFG / FTL can drop type checks since get_by_id operation already performs a structure check which subsumes this type check. 2. Direct getter call by CallDOMGetter without creating IC in DFG and FTL. * bindings/js/JSDOMAttribute.h: (WebCore::IDLAttribute::get): Add CastedThisErrorBehavior::Assert case. When this is specified, we perform casting without using jsDynamicCast. * bindings/scripts/CodeGeneratorJS.pm: (IsAcceleratedDOMAttribute): (GetJSCAttributesForAttribute): (GenerateHeader): (GeneratePropertiesHashTable): (GenerateImplementation): (GenerateAttributeGetterTrampolineDefinition): (GenerateAttributeGetterDefinition): (GenerateCallbackImplementationContent): (GenerateHashTableValueArray): (GenerateHashTable): (GenerateConstructorHelperMethods): Update CodeGeneratorJS to emit DOMAttribute. And DOMJIT::GetterSetter becomes changed to be smaller size. * bindings/scripts/test/JS/JSInterfaceName.cpp: (WebCore::JSInterfaceNamePrototype::finishCreation): * bindings/scripts/test/JS/JSMapLike.cpp: (WebCore::JSMapLikePrototype::finishCreation): * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: (WebCore::JSReadOnlyMapLikePrototype::finishCreation): * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: (WebCore::JSTestActiveDOMObjectPrototype::finishCreation): (WebCore::jsTestActiveDOMObjectExcitingAttr): * bindings/scripts/test/JS/JSTestCEReactions.cpp: (WebCore::JSTestCEReactionsPrototype::finishCreation): (WebCore::jsTestCEReactionsAttributeWithCEReactions): (WebCore::jsTestCEReactionsReflectAttributeWithCEReactions): (WebCore::jsTestCEReactionsStringifierAttribute): * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: (WebCore::JSTestCEReactionsStringifierPrototype::finishCreation): (WebCore::jsTestCEReactionsStringifierValue): * bindings/scripts/test/JS/JSTestCallTracer.cpp: (WebCore::JSTestCallTracerPrototype::finishCreation): (WebCore::jsTestCallTracerTestAttributeInterface): (WebCore::jsTestCallTracerTestAttributeSpecified): * bindings/scripts/test/JS/JSTestCallbackInterface.cpp: (WebCore::JSTestCallbackInterfaceConstructor::initializeProperties): * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp: (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::finishCreation): * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation): * bindings/scripts/test/JS/JSTestDOMJIT.cpp: (WebCore::JSTestDOMJITPrototype::finishCreation): (WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITAnyAttr): Deleted. (WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITBooleanAttr): Deleted. (WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITByteAttr): Deleted. (WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITOctetAttr): Deleted. (WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITShortAttr): Deleted. (WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortAttr): Deleted. (WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITLongAttr): Deleted. (WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongAttr): Deleted. (WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITLongLongAttr): Deleted. (WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongAttr): Deleted. (WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITFloatAttr): Deleted. (WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatAttr): Deleted. (WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITDoubleAttr): Deleted. (WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleAttr): Deleted. (WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITDomStringAttr): Deleted. (WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITByteStringAttr): Deleted. (WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUsvStringAttr): Deleted. (WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITNodeAttr): Deleted. (WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITBooleanNullableAttr): Deleted. (WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITByteNullableAttr): Deleted. (WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITOctetNullableAttr): Deleted. (WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITShortNullableAttr): Deleted. (WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortNullableAttr): Deleted. (WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITLongNullableAttr): Deleted. (WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongNullableAttr): Deleted. (WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITLongLongNullableAttr): Deleted. (WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongNullableAttr): Deleted. (WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITFloatNullableAttr): Deleted. (WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatNullableAttr): Deleted. (WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITDoubleNullableAttr): Deleted. (WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleNullableAttr): Deleted. (WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITDomStringNullableAttr): Deleted. (WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITByteStringNullableAttr): Deleted. (WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUsvStringNullableAttr): Deleted. (WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITNodeNullableAttr): Deleted. * bindings/scripts/test/JS/JSTestDOMJIT.h: * bindings/scripts/test/JS/JSTestEventConstructor.cpp: (WebCore::JSTestEventConstructorPrototype::finishCreation): (WebCore::jsTestEventConstructorAttr1): (WebCore::jsTestEventConstructorAttr2): (WebCore::jsTestEventConstructorAttr3): * bindings/scripts/test/JS/JSTestEventTarget.cpp: (WebCore::JSTestEventTargetPrototype::finishCreation): * bindings/scripts/test/JS/JSTestException.cpp: (WebCore::JSTestExceptionPrototype::finishCreation): (WebCore::jsTestExceptionName): * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: (WebCore::JSTestGenerateIsReachablePrototype::finishCreation): (WebCore::jsTestGenerateIsReachableASecretAttribute): * bindings/scripts/test/JS/JSTestGlobalObject.cpp: (WebCore::jsTestGlobalObjectRegularAttribute): * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: (WebCore::JSTestIndexedSetterNoIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::finishCreation): * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: (WebCore::JSTestIndexedSetterWithIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSTestInterfaceConstructor::initializeProperties): (WebCore::JSTestInterfacePrototype::finishCreation): (WebCore::jsTestInterfaceImplementsStr1): (WebCore::jsTestInterfaceImplementsStr2): (WebCore::jsTestInterfaceImplementsStr3): (WebCore::jsTestInterfaceImplementsNode): (WebCore::jsTestInterfaceSupplementalStr1): (WebCore::jsTestInterfaceSupplementalStr2): (WebCore::jsTestInterfaceSupplementalStr3): (WebCore::jsTestInterfaceSupplementalNode): * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: (WebCore::JSTestInterfaceLeadingUnderscorePrototype::finishCreation): (WebCore::jsTestInterfaceLeadingUnderscoreReadonly): * bindings/scripts/test/JS/JSTestIterable.cpp: (WebCore::JSTestIterablePrototype::finishCreation): * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp: (WebCore::JSTestJSBuiltinConstructorPrototype::finishCreation): (WebCore::jsTestJSBuiltinConstructorTestAttributeCustom): (WebCore::jsTestJSBuiltinConstructorTestAttributeRWCustom): * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: (WebCore::JSTestMediaQueryListListenerPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: (WebCore::JSTestNamedConstructorPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: (WebCore::JSTestNamedDeleterNoIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: (WebCore::JSTestNamedDeleterWithIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: (WebCore::JSTestNamedGetterCallWithPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: (WebCore::JSTestNamedGetterNoIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: (WebCore::JSTestNamedGetterWithIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: (WebCore::JSTestNamedSetterNoIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: (WebCore::JSTestNamedSetterThrowingExceptionPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: (WebCore::JSTestNamedSetterWithIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::finishCreation): (WebCore::jsTestNamedSetterWithUnforgablePropertiesUnforgeableAttribute): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::finishCreation): (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsUnforgeableAttribute): * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::JSTestNodePrototype::finishCreation): (WebCore::jsTestNodeName): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjConstructor::initializeProperties): (WebCore::JSTestObjPrototype::finishCreation): (WebCore::jsTestObjReadOnlyLongAttr): (WebCore::jsTestObjReadOnlyStringAttr): (WebCore::jsTestObjReadOnlyTestObjAttr): (WebCore::jsTestObjEnumAttr): (WebCore::jsTestObjByteAttr): (WebCore::jsTestObjOctetAttr): (WebCore::jsTestObjShortAttr): (WebCore::jsTestObjClampedShortAttr): (WebCore::jsTestObjEnforceRangeShortAttr): (WebCore::jsTestObjUnsignedShortAttr): (WebCore::jsTestObjLongAttr): (WebCore::jsTestObjLongLongAttr): (WebCore::jsTestObjUnsignedLongLongAttr): (WebCore::jsTestObjStringAttr): (WebCore::jsTestObjUsvstringAttr): (WebCore::jsTestObjTestObjAttr): (WebCore::jsTestObjTestNullableObjAttr): (WebCore::jsTestObjUnforgeableAttr): (WebCore::jsTestObjStringAttrTreatingNullAsEmptyString): (WebCore::jsTestObjUsvstringAttrTreatingNullAsEmptyString): (WebCore::jsTestObjByteStringAttrTreatingNullAsEmptyString): (WebCore::jsTestObjStringLongRecordAttr): (WebCore::jsTestObjUsvstringLongRecordAttr): (WebCore::jsTestObjStringObjRecordAttr): (WebCore::jsTestObjStringNullableObjRecordAttr): (WebCore::jsTestObjDictionaryAttr): (WebCore::jsTestObjNullableDictionaryAttr): (WebCore::jsTestObjAnnotatedTypeInUnionAttr): (WebCore::jsTestObjAnnotatedTypeInSequenceAttr): (WebCore::jsTestObjImplementationEnumAttr): (WebCore::jsTestObjXMLObjAttr): (WebCore::jsTestObjCreate): (WebCore::jsTestObjReflectedStringAttr): (WebCore::jsTestObjReflectedUSVStringAttr): (WebCore::jsTestObjReflectedIntegralAttr): (WebCore::jsTestObjReflectedUnsignedIntegralAttr): (WebCore::jsTestObjReflectedBooleanAttr): (WebCore::jsTestObjReflectedURLAttr): (WebCore::jsTestObjReflectedUSVURLAttr): (WebCore::jsTestObjReflectedCustomIntegralAttr): (WebCore::jsTestObjReflectedCustomBooleanAttr): (WebCore::jsTestObjReflectedCustomURLAttr): (WebCore::jsTestObjEnabledAtRuntimeAttribute): (WebCore::jsTestObjEnabledBySettingAttribute): (WebCore::jsTestObjTypedArrayAttr): (WebCore::jsTestObjAttributeWithGetterException): (WebCore::jsTestObjAttributeWithSetterException): (WebCore::jsTestObjStringAttrWithGetterException): (WebCore::jsTestObjStringAttrWithSetterException): (WebCore::jsTestObjCustomAttr): (WebCore::jsTestObjOnfoo): (WebCore::jsTestObjOnwebkitfoo): (WebCore::jsTestObjWithScriptStateAttribute): (WebCore::jsTestObjWithCallWithAndSetterCallWithAttribute): (WebCore::jsTestObjWithScriptExecutionContextAttribute): (WebCore::jsTestObjWithScriptStateAttributeRaises): (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises): (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute): (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises): (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): (WebCore::jsTestObjConditionalAttr1): (WebCore::jsTestObjConditionalAttr2): (WebCore::jsTestObjConditionalAttr3): (WebCore::jsTestObjCachedAttribute1): (WebCore::jsTestObjCachedAttribute2): (WebCore::jsTestObjAnyAttribute): (WebCore::jsTestObjObjectAttribute): (WebCore::jsTestObjContentDocument): (WebCore::jsTestObjMutablePoint): (WebCore::jsTestObjStrawberry): (WebCore::jsTestObjDescription): (WebCore::jsTestObjId): (WebCore::jsTestObjHash): (WebCore::jsTestObjReplaceableAttribute): (WebCore::jsTestObjNullableDoubleAttribute): (WebCore::jsTestObjNullableLongAttribute): (WebCore::jsTestObjNullableBooleanAttribute): (WebCore::jsTestObjNullableStringAttribute): (WebCore::jsTestObjNullableLongSettableAttribute): (WebCore::jsTestObjNullableStringSettableAttribute): (WebCore::jsTestObjNullableUSVStringSettableAttribute): (WebCore::jsTestObjNullableByteStringSettableAttribute): (WebCore::jsTestObjNullableStringValue): (WebCore::jsTestObjAttribute): (WebCore::jsTestObjAttributeWithReservedEnumType): (WebCore::jsTestObjPutForwardsAttribute): (WebCore::jsTestObjPutForwardsNullableAttribute): (WebCore::jsTestObjStringifierAttribute): (WebCore::jsTestObjConditionallyReadWriteAttribute): (WebCore::jsTestObjConditionalAndConditionallyReadWriteAttribute): * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: (WebCore::JSTestOverloadedConstructorsPrototype::finishCreation): * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::finishCreation): * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: (WebCore::JSTestOverrideBuiltinsPrototype::finishCreation): * bindings/scripts/test/JS/JSTestPluginInterface.cpp: (WebCore::JSTestPluginInterfacePrototype::finishCreation): * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: (WebCore::JSTestPromiseRejectionEventPrototype::finishCreation): (WebCore::jsTestPromiseRejectionEventReason): * bindings/scripts/test/JS/JSTestSerialization.cpp: (WebCore::JSTestSerializationPrototype::finishCreation): (WebCore::jsTestSerializationFirstStringAttribute): (WebCore::jsTestSerializationSecondLongAttribute): (WebCore::jsTestSerializationThirdUnserializableAttribute): (WebCore::jsTestSerializationFourthUnrestrictedDoubleAttribute): (WebCore::jsTestSerializationFifthLongAttribute): (WebCore::jsTestSerializationSixthTypedefAttribute): (WebCore::jsTestSerializationSeventhDirectlySerializableAttribute): (WebCore::jsTestSerializationEighthIndirectlyAttribute): * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp: (WebCore::JSTestSerializationIndirectInheritancePrototype::finishCreation): * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: (WebCore::JSTestSerializationInheritPrototype::finishCreation): (WebCore::jsTestSerializationInheritInheritLongAttribute): * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: (WebCore::JSTestSerializationInheritFinalPrototype::finishCreation): (WebCore::jsTestSerializationInheritFinalFinalLongAttributeFoo): (WebCore::jsTestSerializationInheritFinalFinalLongAttributeBar): * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: (WebCore::JSTestSerializedScriptValueInterfacePrototype::finishCreation): (WebCore::jsTestSerializedScriptValueInterfaceValue): (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValue): (WebCore::jsTestSerializedScriptValueInterfaceCachedValue): (WebCore::jsTestSerializedScriptValueInterfacePorts): (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValue): * bindings/scripts/test/JS/JSTestStringifier.cpp: (WebCore::JSTestStringifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: (WebCore::JSTestStringifierAnonymousOperationPrototype::finishCreation): * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: (WebCore::JSTestStringifierNamedOperationPrototype::finishCreation): * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: (WebCore::JSTestStringifierOperationImplementedAsPrototype::finishCreation): * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: (WebCore::JSTestStringifierOperationNamedToStringPrototype::finishCreation): * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: (WebCore::JSTestStringifierReadOnlyAttributePrototype::finishCreation): (WebCore::jsTestStringifierReadOnlyAttributeIdentifier): * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: (WebCore::JSTestStringifierReadWriteAttributePrototype::finishCreation): (WebCore::jsTestStringifierReadWriteAttributeIdentifier): * bindings/scripts/test/JS/JSTestTypedefs.cpp: (WebCore::JSTestTypedefsConstructor::initializeProperties): (WebCore::JSTestTypedefsPrototype::finishCreation): (WebCore::jsTestTypedefsUnsignedLongLongAttr): (WebCore::jsTestTypedefsSerializedScriptValue): (WebCore::jsTestTypedefsAttributeWithClamp): (WebCore::jsTestTypedefsAttributeWithClampInTypedef): (WebCore::jsTestTypedefsAttrWithGetterException): (WebCore::jsTestTypedefsAttrWithSetterException): (WebCore::jsTestTypedefsStringAttrWithGetterException): (WebCore::jsTestTypedefsStringAttrWithSetterException): (WebCore::jsTestTypedefsBufferSourceAttr): (WebCore::jsTestTypedefsDomTimeStampAttr): They are binding test rebaselines. * domjit/DOMJITIDLTypeFilter.h: * domjit/JSDocumentDOMJIT.cpp: (WebCore::compileDocumentDocumentElementAttribute): (WebCore::compileDocumentBodyAttribute): (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter): Deleted. (WebCore::DocumentBodyDOMJIT::callDOMGetter): Deleted. * domjit/JSNodeDOMJIT.cpp: (WebCore::compileNodeFirstChildAttribute): (WebCore::compileNodeLastChildAttribute): (WebCore::compileNodeNextSiblingAttribute): (WebCore::compileNodePreviousSiblingAttribute): (WebCore::compileNodeParentNodeAttribute): (WebCore::compileNodeNodeTypeAttribute): (WebCore::compileNodeOwnerDocumentAttribute): (WebCore::NodeFirstChildDOMJIT::callDOMGetter): Deleted. (WebCore::NodeLastChildDOMJIT::callDOMGetter): Deleted. (WebCore::NodeNextSiblingDOMJIT::callDOMGetter): Deleted. (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter): Deleted. (WebCore::NodeParentNodeDOMJIT::callDOMGetter): Deleted. (WebCore::NodeNodeTypeDOMJIT::callDOMGetter): Deleted. (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): Deleted. DOMJIT::GetterSetter becomes smaller constexpr data. 2017-07-27 Xabier Rodriguez Calvar [GStreamer][EME] Not having a key id buffer should not always error https://bugs.webkit.org/show_bug.cgi?id=174889 Reviewed by Žan Doberšek. In r219946 we introduced a hard requirement for a key id buffer that does not happen for all CDMs. * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: (webKitMediaClearKeyDecryptorSetupCipher): Check for key id buffer and error if we didn't get it. * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (webkitMediaCommonEncryptionDecryptTransformInPlace): Soften the requirement for key id buffer. 2017-07-27 Xabier Rodriguez Calvar [GStreamer][EME] Fix phony debug output in player base for supported key system https://bugs.webkit.org/show_bug.cgi?id=174888 Reviewed by Žan Doberšek. The debug output was returning always false because that method was not checking anything before. Now it is and should reflect it. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem): 2017-07-27 Zan Dobersek [EME][GStreamer] Add barebones CDM interface implementations for ClearKey https://bugs.webkit.org/show_bug.cgi?id=174887 Reviewed by Xabier Rodriguez-Calvar. Add empty ClearKey derivations of CDMFactory, CDMPrivate and CDMInstance classes. These will be enhanced as the implementation progresses. ClearKey is added to CDMInstance::ImplementationType, and the CDMInstanceClearKey::implementationType() override returns that value. Type traits specialization for the CDMInstanceClearKey class is also added, utilizing the CDMInstance::ImplementationType::ClearKey value. The implementation file is added to the WPE build, along with the necessary inclusion directory. * PlatformWPE.cmake: * platform/encryptedmedia/CDMInstance.h: * platform/encryptedmedia/clearkey/CDMClearKey.cpp: Added. (WebCore::CDMFactoryClearKey::createCDM): (WebCore::CDMFactoryClearKey::supportsKeySystem): (WebCore::CDMPrivateClearKey::supportsInitDataType): (WebCore::CDMPrivateClearKey::supportsConfiguration): (WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions): (WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration): (WebCore::CDMPrivateClearKey::supportsRobustness): (WebCore::CDMPrivateClearKey::distinctiveIdentifiersRequirement): (WebCore::CDMPrivateClearKey::persistentStateRequirement): (WebCore::CDMPrivateClearKey::distinctiveIdentifiersAreUniquePerOriginAndClearable): (WebCore::CDMPrivateClearKey::createInstance): (WebCore::CDMPrivateClearKey::loadAndInitialize): (WebCore::CDMPrivateClearKey::supportsServerCertificates): (WebCore::CDMPrivateClearKey::supportsSessions): (WebCore::CDMPrivateClearKey::supportsInitData): (WebCore::CDMPrivateClearKey::sanitizeResponse): (WebCore::CDMPrivateClearKey::sanitizeSessionId): (WebCore::CDMInstanceClearKey::initializeWithConfiguration): (WebCore::CDMInstanceClearKey::setDistinctiveIdentifiersAllowed): (WebCore::CDMInstanceClearKey::setPersistentStateAllowed): (WebCore::CDMInstanceClearKey::setServerCertificate): (WebCore::CDMInstanceClearKey::requestLicense): (WebCore::CDMInstanceClearKey::updateLicense): (WebCore::CDMInstanceClearKey::loadSession): (WebCore::CDMInstanceClearKey::closeSession): (WebCore::CDMInstanceClearKey::removeSessionData): (WebCore::CDMInstanceClearKey::storeRecordOfKeyUsage): * platform/encryptedmedia/clearkey/CDMClearKey.h: Added. 2017-07-27 Zan Dobersek [EME] Allow CDMInstance type traits specialization https://bugs.webkit.org/show_bug.cgi?id=174886 Reviewed by Xabier Rodriguez-Calvar. Allow using the trait-based type casting for the CDMInstance class and its derivatives. ImplementationType enumeration values are to be used and returned from the new implementationType() virtual method. This method is leveraged in the type trait specialization that enables using is<>() and downcast<>() helpers for CDMInstance objects. This will allow differentiating between CDMInstance implementations once the media playback pipeline has to retrieve any key information that's necessary for playback of encrypted content. MockCDMInstance class overrides the implementationType() method, returning the ImplementationType::Mock value. Type trait specializations for this class aren't added since they're not needed anywhere at this point. * platform/encryptedmedia/CDMInstance.h: * testing/MockCDMFactory.h: 2017-07-27 Zan Dobersek [GCrypt] Key serialization support https://bugs.webkit.org/show_bug.cgi?id=173883 Reviewed by Jiewen Tan. Implement crypto key serialization for platforms that use libgcrypt. Despite the function names and the existing implementation for the Mac port, we don't perform the KEK wrapping and unwrapping due to the review feedback advising against it. Instead the passed-in key data is simply copied and returned as the result of the 'wrapping' operation, and similarly the passed-in serialized data is simply copied and returned as the result of the 'unwrapping' operation. No new tests -- related tests are now passing and are unskipped. * crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp: (WebCore::getDefaultWebCryptoMasterKey): (WebCore::wrapSerializedCryptoKey): (WebCore::unwrapSerializedCryptoKey): 2017-07-26 Arnaud Renevier and Fujii Hironori Implement new TextMetrics, returned by canvas measureText() https://bugs.webkit.org/show_bug.cgi?id=82798 Reviewed by Dean Jackson. The specification: https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-measuretext Add new attributes to TextMetrics. Add a new method textOffset() of CanvasRenderingContext2D by extracting from drawTextInternal() to use the same horizontal and vertical offsets of a text in both drawTextInternal() and measureText(). Test: fast/canvas/canvas-measureText-2.html * html/TextMetrics.h: (WebCore::TextMetrics::actualBoundingBoxLeft): (WebCore::TextMetrics::setActualBoundingBoxLeft): (WebCore::TextMetrics::actualBoundingBoxRight): (WebCore::TextMetrics::setActualBoundingBoxRight): (WebCore::TextMetrics::fontBoundingBoxAscent): (WebCore::TextMetrics::setFontBoundingBoxAscent): (WebCore::TextMetrics::fontBoundingBoxDescent): (WebCore::TextMetrics::setFontBoundingBoxDescent): (WebCore::TextMetrics::actualBoundingBoxAscent): (WebCore::TextMetrics::setActualBoundingBoxAscent): (WebCore::TextMetrics::actualBoundingBoxDescent): (WebCore::TextMetrics::setActualBoundingBoxDescent): (WebCore::TextMetrics::emHeightAscent): (WebCore::TextMetrics::setEmHeightAscent): (WebCore::TextMetrics::emHeightDescent): (WebCore::TextMetrics::setEmHeightDescent): (WebCore::TextMetrics::hangingBaseline): (WebCore::TextMetrics::setHangingBaseline): (WebCore::TextMetrics::alphabeticBaseline): (WebCore::TextMetrics::setAlphabeticBaseline): (WebCore::TextMetrics::ideographicBaseline): (WebCore::TextMetrics::setIdeographicBaseline): Added getters and setters. (WebCore::TextMetrics::TextMetrics): Deleted. * html/TextMetrics.idl: Added new attributes. * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::FontProxy::fontMetrics): Changed the return value type to a const reference of FontMetrics not to copy it. (WebCore::CanvasRenderingContext2D::FontProxy::width): Added the second arguemnt of GlyphOverflow type. (WebCore::CanvasRenderingContext2D::measureText): Calculate and set the new attributes of TextMetrics. (WebCore::CanvasRenderingContext2D::textOffset): Extracted from drawTextInternal. (WebCore::CanvasRenderingContext2D::drawTextInternal): Removed the offset calculation code and call textOffset. * html/canvas/CanvasRenderingContext2D.h: Added the method declaration of textOffset. Change types of fontMetrics and width methods. * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp: (WebCore::FontCascade::floatWidthForComplexText): Added a dummy implementation of calculating GlyphOverflow. 2017-07-26 Devin Rousso Web Inspector: create protocol for recording Canvas contexts https://bugs.webkit.org/show_bug.cgi?id=174481 Reviewed by Joseph Pecoraro. Currently, a recording doesn't actually "start" until an action is performed on the context. This change adds the recording logic, but it does not use it anywhere. Additonal tests will be added in the patches that add uses: - Web Inspector: Record actions performed on CanvasRenderingContext2D - Web Inspector: Record actions performed on WebGLRenderingContext Test: inspector/model/recording.html * bindings/scripts/IDLAttributes.json: * bindings/scripts/CodeGeneratorJS.pm: (GenerateAttributeGetterBodyDefinition): (GenerateAttributeSetterBodyDefinition): (GenerateImplementationFunctionCall): * WebCore.xcodeproj/project.pbxproj: * bindings/js/CallTracer.h: Added. * bindings/js/CallTracer.cpp: Added. (WebCore::CallTracer::recordCanvasAction): * bindings/js/CallTracerTypes.h: Added. * bindings/scripts/test/TestCallTracer.idl: Added. * bindings/scripts/test/JS/JSTestCallTracer.h: Added. * bindings/scripts/test/JS/JSTestCallTracer.cpp: Added. Create new IDL extended attribute called "CallTracingCallback" that will add code to call a static function on CallTracer with the given extended attribute value as the function name, the `impl` object as the first parameter, the name of the attribute/operation as the second, and an optional object that accepts an initializer list of all the parameters as the third. This function will not be called, however, unless a `callTracingActive` function on the `impl` object returns true, and this is marked as UNLIKELY. "CallTracingCallback" can be added to an Interface, in which case it will apply to all attributes/operations of the generated class, or an individual Attribute/Operation. * html/canvas/CanvasRenderingContext.h: (WebCore::CanvasRenderingContext::callTracingActive): (WebCore::CanvasRenderingContext::setCallTracingActive): * inspector/InspectorCanvas.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::~InspectorCanvas): (WebCore::InspectorCanvas::resetRecordingData): (WebCore::InspectorCanvas::hasRecordingData): (WebCore::InspectorCanvas::recordAction): (WebCore::InspectorCanvas::releaseInitialState): (WebCore::InspectorCanvas::releaseFrames): (WebCore::InspectorCanvas::releaseData): (WebCore::InspectorCanvas::markNewFrame): (WebCore::InspectorCanvas::markCurrentFrameIncomplete): (WebCore::InspectorCanvas::setBufferLimit): (WebCore::InspectorCanvas::hasBufferSpace): (WebCore::InspectorCanvas::singleFrame): (WebCore::InspectorCanvas::setSingleFrame): (WebCore::InspectorCanvas::indexForData): (WebCore::buildArrayForAffineTransform): (WebCore::buildArrayForVector): (WebCore::InspectorCanvas::buildInitialState): (WebCore::InspectorCanvas::buildAction): (WebCore::InspectorCanvas::buildArrayForCanvasGradient): (WebCore::InspectorCanvas::buildArrayForCanvasPattern): (WebCore::InspectorCanvas::buildArrayForImageData): Hold the recording data on the corresponding InspectorCanvas. Recording Frames are completed when the HTMLCanvasElement paints or a 0_s timer is fired. A recording is not considered valid until at least one action is performed on the canvas context. Once that condition is satisfied, canceling the recording will flush the data. * inspector/InspectorCanvasAgent.h: * inspector/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::InspectorCanvasAgent): (WebCore::InspectorCanvasAgent::disable): (WebCore::InspectorCanvasAgent::requestRecording): (WebCore::InspectorCanvasAgent::cancelRecording): (WebCore::InspectorCanvasAgent::recordCanvasAction): (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame): (WebCore::InspectorCanvasAgent::canvasDestroyed): (WebCore::InspectorCanvasAgent::canvasRecordingTimerFired): (WebCore::InspectorCanvasAgent::clearCanvasData): * inspector/InspectorInstrumentation.h: * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::recordCanvasAction): (WebCore::InspectorInstrumentation::recordCanvasActionImpl): (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrameImpl): * html/canvas/CanvasRenderingContext2D.h: * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::stringForWindingRule): (WebCore::CanvasRenderingContext2D::stringForImageSmoothingQuality): * platform/graphics/Gradient.h: (WebCore::Gradient::stops): * svg/SVGPathUtilities.h: * svg/SVGPathUtilities.cpp: (WebCore::buildStringFromPath): 2017-07-26 Ali Juma Implement document.elementsFromPoint https://bugs.webkit.org/show_bug.cgi?id=153137 Reviewed by Simon Fraser. This ports Blink's implementation of elementsFromPoint, from the following patches by Philip Rogers (pdr@chromium.org): -https://src.chromium.org/viewvc/blink?revision=190686&view=revision -https://src.chromium.org/viewvc/blink?revision=191240&view=revision -https://src.chromium.org/viewvc/blink?revision=199214&view=revision Tests: imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-iframes.html imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-invalid-cases.html imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-shadowroot.html imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-simple.html imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-svg.html imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-table.html * dom/DocumentOrShadowRoot.idl: * dom/TreeScope.cpp: (WebCore::absolutePointIfNotClipped): (WebCore::TreeScope::nodeFromPoint): (WebCore::TreeScope::elementFromPoint): (WebCore::TreeScope::elementsFromPoint): * dom/TreeScope.h: * page/EventHandler.cpp: (WebCore::EventHandler::hitTestResultAtPoint): * rendering/EllipsisBox.cpp: (WebCore::EllipsisBox::nodeAtPoint): * rendering/HitTestRequest.h: (WebCore::HitTestRequest::HitTestRequest): (WebCore::HitTestRequest::resultIsElementList): (WebCore::HitTestRequest::includesAllElementsUnderPoint): * rendering/HitTestResult.cpp: (WebCore::HitTestResult::HitTestResult): (WebCore::HitTestResult::operator=): (WebCore::HitTestResult::addNodeToListBasedTestResult): (WebCore::HitTestResult::append): (WebCore::HitTestResult::listBasedTestResult): (WebCore::HitTestResult::mutableListBasedTestResult): (WebCore::HitTestResult::addNodeToRectBasedTestResult): Deleted. (WebCore::HitTestResult::rectBasedTestResult): Deleted. (WebCore::HitTestResult::mutableRectBasedTestResult): Deleted. * rendering/HitTestResult.h: * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::nodeAtPoint): * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::nodeAtPoint): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::nodeAtPoint): * rendering/RenderBox.cpp: (WebCore::RenderBox::nodeAtPoint): * rendering/RenderImage.cpp: (WebCore::RenderImage::nodeAtPoint): * rendering/RenderInline.cpp: (WebCore::RenderInline::hitTestCulledInline): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows): (WebCore::RenderLayer::hitTestLayer): (WebCore::RenderLayer::hitTestContents): (WebCore::RenderLayer::hitTestList): (WebCore::RenderLayer::calculateClipRects): * rendering/RenderTable.cpp: (WebCore::RenderTable::nodeAtPoint): * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::nodeAtPoint): * rendering/RenderWidget.cpp: (WebCore::RenderWidget::nodeAtPoint): * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::hitTestFlow): * rendering/svg/RenderSVGContainer.cpp: (WebCore::RenderSVGContainer::nodeAtFloatPoint): * rendering/svg/RenderSVGImage.cpp: (WebCore::RenderSVGImage::nodeAtFloatPoint): * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::nodeAtPoint): * rendering/svg/RenderSVGShape.cpp: (WebCore::RenderSVGShape::nodeAtFloatPoint): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::nodeAtPoint): * testing/Internals.cpp: (WebCore::Internals::nodesFromRect): 2017-07-26 Charlie Turner [GStreamer] Review WebKitWebSource after r219252. https://bugs.webkit.org/show_bug.cgi?id=174415 Reviewed by Carlos Garcia Campos. Remove ResourceHandleStreamingClient, and flatten the StreamingClient into CachedResourceStreamingClient (the only implemetation left). They are no longer required after r219252. Also remove the locking code. It's not needed now, and what existed was heavy-handed and missed several cases it was supposed to protect Covered by existing tests. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webkit_web_src_init): (webKitWebSrcDispose): (webKitWebSrcStop): (webKitWebSrcStart): (webKitWebSrcNeedData): (webKitWebSrcEnoughData): (webKitWebSrcSeek): (webKitWebSrcSetMediaPlayer): (CachedResourceStreamingClient::CachedResourceStreamingClient): (CachedResourceStreamingClient::~CachedResourceStreamingClient): (CachedResourceStreamingClient::getOrCreateReadBuffer): (CachedResourceStreamingClient::responseReceived): (CachedResourceStreamingClient::dataReceived): (CachedResourceStreamingClient::loadFinished): (ResourceHandleStreamingClient::create): Deleted. (): Deleted. (StreamingClient::StreamingClient): Deleted. (StreamingClient::~StreamingClient): Deleted. (StreamingClient::createReadBuffer): Deleted. (StreamingClient::handleResponseReceived): Deleted. (StreamingClient::handleDataReceived): Deleted. (StreamingClient::handleNotifyFinished): Deleted. (ResourceHandleStreamingClient::ResourceHandleStreamingClient): Deleted. (ResourceHandleStreamingClient::~ResourceHandleStreamingClient): Deleted. (ResourceHandleStreamingClient::cleanupAndStopRunLoop): Deleted. (ResourceHandleStreamingClient::invalidate): Deleted. (ResourceHandleStreamingClient::loadFailed): Deleted. (ResourceHandleStreamingClient::setDefersLoading): Deleted. (ResourceHandleStreamingClient::getOrCreateReadBuffer): Deleted. (ResourceHandleStreamingClient::willSendRequest): Deleted. (ResourceHandleStreamingClient::didReceiveResponse): Deleted. (ResourceHandleStreamingClient::didReceiveData): Deleted. (ResourceHandleStreamingClient::didReceiveBuffer): Deleted. (ResourceHandleStreamingClient::didFinishLoading): Deleted. (ResourceHandleStreamingClient::didFail): Deleted. (ResourceHandleStreamingClient::wasBlocked): Deleted. (ResourceHandleStreamingClient::cannotShowURL): Deleted. 2017-07-26 Brian Burg Remove WEB_TIMING feature flag https://bugs.webkit.org/show_bug.cgi?id=174795 Reviewed by Alex Christensen. * Configurations/FeatureDefines.xcconfig: * bindings/js/JSPerformanceEntryCustom.cpp: * dom/Document.cpp: (WebCore::Document::setReadyState): (WebCore::Document::finishedParsing): * dom/Document.h: (WebCore::Document::timing): * dom/DocumentTiming.h: * dom/EventTargetFactory.in: * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::finishedTimingForWorkerLoad): (WebCore::DocumentThreadableLoader::loadRequest): * loader/DocumentThreadableLoader.h: * loader/ResourceTimingInformation.cpp: * loader/ResourceTimingInformation.h: * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::didFinishLoading): (WebCore::SubresourceLoader::reportResourceTiming): * loader/SubresourceLoader.h: * loader/ThreadableLoaderClient.h: (WebCore::ThreadableLoaderClient::didFail): (WebCore::ThreadableLoaderClient::didFinishTiming): * loader/WorkerThreadableLoader.cpp: (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishTiming): * loader/WorkerThreadableLoader.h: * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::revalidateResource): (WebCore::CachedResourceLoader::loadResource): * loader/cache/CachedResourceLoader.h: (WebCore::CachedResourceLoader::resourceTimingInformation): * page/DOMWindow.cpp: (WebCore::DOMWindow::~DOMWindow): (WebCore::DOMWindow::resetDOMWindowProperties): (WebCore::DOMWindow::nowTimestamp): (WebCore::DOMWindow::removeAllEventListeners): * page/DOMWindow.h: * page/GlobalPerformance.idl: * page/Performance.cpp: * page/Performance.h: * page/Performance.idl: * page/PerformanceEntry.cpp: * page/PerformanceEntry.h: * page/PerformanceEntry.idl: * page/PerformanceMark.h: * page/PerformanceMark.idl: * page/PerformanceMeasure.h: * page/PerformanceMeasure.idl: * page/PerformanceNavigation.cpp: * page/PerformanceNavigation.h: * page/PerformanceNavigation.idl: * page/PerformanceObserver.cpp: * page/PerformanceObserver.h: * page/PerformanceObserver.idl: * page/PerformanceObserverCallback.h: * page/PerformanceObserverCallback.idl: * page/PerformanceObserverEntryList.cpp: * page/PerformanceObserverEntryList.h: * page/PerformanceObserverEntryList.idl: * page/PerformanceResourceTiming.cpp: * page/PerformanceResourceTiming.h: * page/PerformanceResourceTiming.idl: * page/PerformanceTiming.cpp: * page/PerformanceTiming.h: * page/PerformanceTiming.idl: * page/PerformanceUserTiming.cpp: * page/PerformanceUserTiming.h: * platform/network/ResourceHandle.h: * platform/network/ResourceHandleInternal.h: * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::ResourceHandle::start): * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp: (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse): * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse): * platform/network/curl/ResourceHandleCurl.cpp: (WebCore::ResourceHandleInternal::didFinish): (WebCore::ResourceHandleInternal::calculateWebTimingInformations): (WebCore::ResourceHandleInternal::dispatchSynchronousJob): * platform/network/mac/ResourceHandleMac.mm: (WebCore::ResourceHandle::createNSURLConnection): * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]): * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]): * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::restartedCallback): (WebCore::sendRequestCallback): (WebCore::createSoupMessageForHandleAndRequest): (WebCore::ResourceHandle::sendPendingRequest): * platform/network/soup/SoupNetworkSession.cpp: (WebCore::SoupNetworkSession::SoupNetworkSession): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): (WebCore::WorkerGlobalScope::~WorkerGlobalScope): (WebCore::WorkerGlobalScope::removeAllEventListeners): * workers/WorkerGlobalScope.h: 2017-07-26 Chris Dumez Pressing the Escape key should not be a valid user gesture to enter fullscreen https://bugs.webkit.org/show_bug.cgi?id=174864 Reviewed by Geoffrey Garen. Pressing the Escape key should not be a valid user gesture to enter fullscreen since this is the gesture to exit fullscreen already. Test: fullscreen/requestFullscreen-escape-key.html * dom/Document.cpp: (WebCore::Document::requestFullScreenForElement): * dom/UserGestureIndicator.cpp: (WebCore::UserGestureIndicator::UserGestureIndicator): * dom/UserGestureIndicator.h: (WebCore::UserGestureToken::create): (WebCore::UserGestureToken::gestureType): (WebCore::UserGestureToken::UserGestureToken): * page/EventHandler.cpp: (WebCore::EventHandler::internalKeyEvent): 2017-07-26 Nan Wang AX: Incorrect range from index and length in contenteditable with

tags https://bugs.webkit.org/show_bug.cgi?id=174856 Reviewed by Chris Fleizach. When asking for the string inside a text control with a given range, we sometimes get a wrong string at the line boundary due to a bad plain range to text marker conversion. To fix this, we should use the exsisting method on text controls to avoid this issue. Updated the test to test the problematic case. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): 2017-07-26 Daewoong Jang [Curl] Bug fix after r219606 https://bugs.webkit.org/show_bug.cgi?id=174845 Reviewed by Alex Christensen. * platform/network/curl/CurlContext.h: (WebCore::CurlSList::isEmpty): * platform/network/curl/ResourceHandleCurl.cpp: (WebCore::ResourceHandleInternal::didReceiveHeaderLine): (WebCore::ResourceHandleInternal::headerCallback): 2017-07-26 Zan Dobersek [EME][GStreamer] Multi-key support in the GStreamer ClearKey decryptor https://bugs.webkit.org/show_bug.cgi?id=174779 Reviewed by Xabier Rodriguez-Calvar. In the CENC decryptor, the key ID value is retrieved from the info structure on the GstProtectionMeta object. GstBuffer for that value is retrieved and passed to the setupCipher() function. In the ClearKey decryptor (which extends the CENC decryptor), the single GstBuffer object on the private instance that holds the key value is replaced with a Vector object that holds pairs of key ID and value GstBuffers. In the handleKeyResponse() implementation that Vector is emptied and then refilled with key ID and value pairs that are passed in through the drm-cipher-clearkey structure that's attached to the GstEvent that signalled new key information. In the ClearKey decryptor's setupCipher() implementation the passed-in key ID buffer is used to find a matching key ID and value pair stored on the private instance. If not found, an error is thrown. If found, the matching key value is used for decryption. * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: (webKitMediaClearKeyDecryptorHandleKeyResponse): (webKitMediaClearKeyDecryptorSetupCipher): * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (webkitMediaCommonEncryptionDecryptTransformInPlace): (webKitMediaCommonEncryptionDecryptDefaultSetupCipher): * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h: 2017-07-26 Zan Dobersek [EME][GStreamer] Handle ClearKey as a supported key system https://bugs.webkit.org/show_bug.cgi?id=174778 Reviewed by Xabier Rodriguez-Calvar. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem): Return true for the 'org.w3.clearkey' key system when building with ENCRYPTED_MEDIA enabled. The underlying implementation will follow. 2017-07-26 Claudio Saavedra [WPE] Fix a potential crash in the platform pasteboard when reading a string https://bugs.webkit.org/show_bug.cgi?id=174859 Reviewed by Žan Doberšek. We shouldn't assume that the wpe_pasteboard_string struct will be filled in, so initialize it. * platform/wpe/PlatformPasteboardWPE.cpp: (WebCore::PlatformPasteboard::readString): Initialize the struct before passing it to wpe and early return if it's still empty. 2017-07-26 Javier Fernandez InsertOrderedList command applied to table cells inserts an extra BR before the table https://bugs.webkit.org/show_bug.cgi?id=174593 Reviewed by Darin Adler. Don't add BR when pruning empty blocks if it's the start of a paragraph. The function MoveParagraph is used for several operations and editing commands, like 'insertOrderedList'. When moving paragraphs we check out whether we should add a 'br' element to avoid undesired block collapse. However, we shouldn't do this when destination is the start of a paragraph. Tests: editing/inserting/insert-list-in-table-cell-01.html editing/inserting/insert-list-in-table-cell-02.html editing/inserting/insert-list-in-table-cell-03.html editing/inserting/insert-list-in-table-cell-04.html editing/inserting/insert-list-in-table-cell-05.html editing/inserting/insert-list-in-table-cell-06.html editing/inserting/insert-list-in-table-cell-07.html editing/inserting/insert-list-in-table-cell-08.html * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): 2017-07-26 Zan Dobersek [WPE] WebGL2 support https://bugs.webkit.org/show_bug.cgi?id=174249 Reviewed by Alex Christensen. Implement WebGL2 support in GraphicsContext3DCairo for the WPE port, but keep the implementation specific to libepoxy (which WPE leverages by default). In the GraphicsContext3D::create() method, we first construct the GraphicsContext3D object that also ensures a current GL context on this thread. Only then can we determine through libepoxy whether the underlying GL library is able to support WebGL2. For WebGL2, the GLES3 support is required. The initial libepoxy implementation ensures this only in case of 'non-desktop GL' library of minimum version 3.0. This effectively translates to the only supported configuration being the EGL and OpenGL ES 3.0 (or higher) combination. If this cannot be ensured, we discard the existing GraphicsContext3D object and return null. WebGL2 can also be supported via OpenGL (i.e. 'desktop GL'), but this hasn't been tested yet. Implementation will in the future be extended to support that as required. In the GraphicsContext3D constructor itself, the ANGLEWebKitBridge constructor has to now receive the second argument, the desired shader specification that's used when parsing the provided shaders. This should be SH_WEBGL_SPEC for WebGL1, and SH_WEBGL2_SPEC for WebGL2. No new tests -- a small set of existing WebGL2 tests is unskipped and passing. * platform/graphics/cairo/GraphicsContext3DCairo.cpp: (WebCore::GraphicsContext3D::create): (WebCore::GraphicsContext3D::GraphicsContext3D): * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: Add WebGL2-specific methods to the build. 2017-07-26 Nan Wang AX: should dispatch accessibilityPerformPressAction async on MacOS https://bugs.webkit.org/show_bug.cgi?id=174849 Reviewed by Chris Fleizach. If performing the accessibility press action results in a modal alert being displayed, it can cause VoiceOver to hang. To fix it, we should dispatch the action asynchronously. Updated tests to adapt to this change. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityPerformPressAction]): (-[WebAccessibilityObjectWrapper _accessibilityPerformPressAction]): 2017-07-25 Carlos Garcia Campos Icon loader error on startup https://bugs.webkit.org/show_bug.cgi?id=174787 Reviewed by Brady Eidson. This is a regression of the new icon loading, it happens with pages that shouldn't have a favicon, like about pages. IconController::startLoader() did several checks before starting the load that DocumentLoader::startIconLoading() is not doing. It checked that the frame is the main one, the document can have an icon (document url is not empty and not about:blank) and that favicon url is in HTTP family. We should do the same checks now before starting to load icons. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::startIconLoading): 2017-07-25 Sam Weinig [WebIDL] Remove custom bindings for HTMLCanvasElement https://bugs.webkit.org/show_bug.cgi?id=174847 Reviewed by Darin Adler. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/JSHTMLCanvasElementCustom.cpp: Removed. Remove JSHTMLCanvasElementCustom. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::getContext): (WebCore::HTMLCanvasElement::getContext2d): (WebCore::HTMLCanvasElement::getContextWebGL): (WebCore::HTMLCanvasElement::getContextWebGPU): * html/HTMLCanvasElement.h: * html/HTMLCanvasElement.idl: Move context picking code to HTMLCanvasElement. Give more exact types to remaining context getters. 2017-07-25 Chris Dumez Clean up ExceptionCode enumeration https://bugs.webkit.org/show_bug.cgi?id=174812 Reviewed by Darin Adler. Clean up ExceptionCode enumeration: - Updated comments to reflect the latest WebIDL specification - Drop special values given to some exception codes. Those legacy codes are already in the table inside DOMException.cpp. This also allows us to drop empty rows in the DOMException table - Drop NoException value in the enumeration and use std::optional when needed instead. * Modules/indexeddb/shared/IDBError.cpp: (WebCore::IDBError::IDBError): (WebCore::IDBError::name): (WebCore::IDBError::message): * Modules/indexeddb/shared/IDBError.h: (WebCore::IDBError::code): (WebCore::IDBError::encode): (WebCore::IDBError::decode): * dom/DOMException.cpp: * dom/ExceptionCode.h: * fileapi/FileReaderSync.cpp: (WebCore::errorCodeToException): (WebCore::FileReaderSync::startLoading): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::createRequest): * xml/XMLHttpRequest.h: 2017-07-25 Andy Estes [Apple Pay] Add "carteBancaire" as a supported payment network https://bugs.webkit.org/show_bug.cgi?id=174841 Reviewed by Alex Christensen. Tests: http/tests/ssl/applepay/ApplePaySession.html http/tests/ssl/applepay/ApplePaySessionV3.html * Modules/applepay/PaymentRequest.cpp: (WebCore::PaymentRequest::isValidSupportedNetwork): 2017-07-25 Daniel Bates Make StyleResolver::isValid{Cue, Region}StyleProperty() static, inline, non-member functions https://bugs.webkit.org/show_bug.cgi?id=174827 Reviewed by Simon Fraser. StyleResolver::isValid{Cue, Region}StyleProperty() access neither instance nor class data. Moreover, they are private member functions and hence cannot be used outside of StyleResolver's implementation. So, make these static, inline, non-member functions. * css/StyleResolver.cpp: (WebCore::isValidRegionStyleProperty): (WebCore::isValidCueStyleProperty): (WebCore::StyleResolver::CascadedProperties::addMatch): (WebCore::StyleResolver::isValidRegionStyleProperty): Deleted. (WebCore::StyleResolver::isValidCueStyleProperty): Deleted. * css/StyleResolver.h: 2017-07-25 Per Arne Vollan Dragged links are blurry on 1x displays. https://bugs.webkit.org/show_bug.cgi?id=174831 Reviewed by Simon Fraser. When the width and height of the drag image is a multiple of 2, the drag image is not blurry on a 1x display. This is a workaround which should be removed when is fixed. No new tests, since this is not straightforward to test with a layout test. * platform/mac/DragImageMac.mm: (WebCore::LinkImageLayout::LinkImageLayout): 2017-07-25 Matt Baker Web Inspector: Refactoring: extract async stack trace logic from InspectorInstrumentation https://bugs.webkit.org/show_bug.cgi?id=174738 Reviewed by Brian Burg. Relocate AsyncCallType from InspectorInstrumentation to the debugger agent. Plumbing for `requestAnimationFrame` notifications has been added to PageDebuggerAgent, which is responsible for managing async stack traces. * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::registerCallback): (WebCore::ScriptedAnimationController::cancelCallback): (WebCore::ScriptedAnimationController::serviceScriptedAnimations): * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didInstallTimerImpl): (WebCore::InspectorInstrumentation::didRemoveTimerImpl): (WebCore::InspectorInstrumentation::willFireTimerImpl): (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl): (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl): (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl): (): Deleted. (WebCore::didScheduleAsyncCall): Deleted. * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::didRequestAnimationFrame): (WebCore::InspectorInstrumentation::didCancelAnimationFrame): (WebCore::InspectorInstrumentation::willFireAnimationFrame): Replaced Frame and Document pointers with references and moved pointer validation upstream. * inspector/PageDebuggerAgent.cpp: (WebCore::PageDebuggerAgent::didRequestAnimationFrame): (WebCore::PageDebuggerAgent::willFireAnimationFrame): (WebCore::PageDebuggerAgent::didCancelAnimationFrame): * inspector/PageDebuggerAgent.h: 2017-07-25 Said Abou-Hallawa Async image decoding for large images should be disabled after the first time a tile is painted https://bugs.webkit.org/show_bug.cgi?id=174451 Reviewed by Simon Fraser. Flashing because of DOM mutation can be fixed by disabling the asynchronous image decoding after the first time a tile was painted. We can detect this by consulting the tile repaintCount. If it is zero, then it is safe to use asynchronous image decoded. If the tile repaintCount is greater than zero, we are not sure if the renderer rectangle has an image drawn in it already or not. In this case we have to use the synchronous image decoding to avoid causing a flash. Tests: fast/images/async-image-background-change.html fast/images/async-image-src-change.html http/tests/multipart/multipart-async-image.html * html/shadow/MediaControlElements.cpp: (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage): * page/FrameView.cpp: (WebCore::FrameView::willPaintContents): (WebCore::FrameView::paintContentsForSnapshot): * page/PageOverlayController.cpp: (WebCore::PageOverlayController::paintContents): * page/PageOverlayController.h: * page/linux/ResourceUsageOverlayLinux.cpp: * page/mac/ServicesOverlayController.h: * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::Highlight::paintContents): * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::draw): * platform/graphics/BitmapImage.h: * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::paintGraphicsLayerContents): * platform/graphics/GraphicsLayer.h: * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::paintContents): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::LayerClient::platformCALayerPaintContents): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::platformCALayerPaintContents): * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/PlatformCALayerClient.h: (WebCore::PlatformCALayerClient::platformCALayerRepaintCount): * platform/graphics/ca/TileCoverageMap.cpp: (WebCore::TileCoverageMap::platformCALayerPaintContents): * platform/graphics/ca/TileCoverageMap.h: * platform/graphics/ca/TileGrid.cpp: (WebCore::TileGrid::platformCALayerPaintContents): (WebCore::TileGrid::platformCALayerRepaintCount): * platform/graphics/ca/TileGrid.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (PlatformCALayer::drawLayerContents): * platform/graphics/ca/win/PlatformCALayerWin.cpp: (PlatformCALayer::drawLayerContents): * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp: (PlatformCALayerWinInternal::displayCallback): * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp: (WebTiledBackingLayerWin::displayCallback): * platform/graphics/mac/WebLayer.mm: (-[WebLayer drawInContext:]): (-[WebSimpleLayer drawInContext:]): * rendering/PaintPhase.h: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::decodingModeForImageDraw): * rendering/RenderElement.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::paintForegroundForFragments): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintContents): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::paintContents): * rendering/RenderLayerCompositor.h: * rendering/RenderWidget.cpp: (WebCore::RenderWidget::paintContents): * testing/Internals.cpp: (WebCore::imageFromImageElement): (WebCore::bitmapImageFromImageElement): (WebCore::Internals::imageFrameIndex): (WebCore::Internals::setImageFrameDecodingDuration): (WebCore::Internals::resetImageAnimation): (WebCore::Internals::isImageAnimating): (WebCore::Internals::setClearDecoderAfterAsyncFrameRequestForTesting): (WebCore::Internals::imageDecodeCount): (WebCore::Internals::setLargeImageAsyncDecodingEnabledForTesting): * testing/Internals.h: * testing/Internals.idl: 2017-07-23 Sam Weinig [WebIDL] Add support for generating timer bindings https://bugs.webkit.org/show_bug.cgi?id=174766 Reviewed by Darin Adler. Adds a new non-standard type, ScheduledAction, which stands in for the standard (DOMString or Function). It would be good to move to that in future, but for now, this allows for forward momentum on removing custom bindings. * WebCore.xcodeproj/project.pbxproj: Add JSDOMConvertScheduledAction.h. * bindings/IDLTypes.h: Add IDLScheduledAction. * bindings/js/JSDOMConvertScheduledAction.h: Added. (WebCore::Converter::convert): Add conversion from JSValue -> ScheduledAction. This is moved from the old ScheduledAction create function. * bindings/js/JSDOMConvertVariadic.h: (WebCore::convertVariadicArguments): (WebCore::Detail::VariadicConverterBase::convert): Deleted. (WebCore::Detail::VariadicConverterBase>::convert): Deleted. * bindings/js/JSDOMConvertBase.h: * bindings/js/JSDOMConvertAny.h: (WebCore::VariadicConverter::convert): * bindings/js/JSDOMConvertInterface.h: (WebCore::VariadicConverter>::convert): Rename VariadicConverter to VariadicConverterDetails, and remove base class. Rename VariadicConverterBase to VariadicConverter, and move specializations to the file containing the base converter for that IDL type * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::setTimeout): Deleted. (WebCore::JSDOMWindow::setInterval): Deleted. * bindings/js/JSWorkerGlobalScopeCustom.cpp: (WebCore::JSWorkerGlobalScope::setTimeout): Deleted. (WebCore::JSWorkerGlobalScope::setInterval): Deleted. Remove custom implementations of setTimeout and setInterval. * bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::create): (WebCore::ScheduledAction::ScheduledAction): (WebCore::ScheduledAction::~ScheduledAction): (WebCore::ScheduledAction::addArguments): (WebCore::ScheduledAction::executeFunctionInContext): * bindings/js/ScheduledAction.h: (WebCore::ScheduledAction::ScheduledAction): Deleted. Rework ScheduledAction. Now has two create functions, one for the function form, one for the string form. These are now called by the Converter. Also, rather than extracting the arguments directly from the ExecState, allow the bindings to work as designed, and have the arguments come in as variadic arguments to setTimeout/setInterval and get added to the ScheduledAction if needed. Also, move ContentSecurityPolicy check out of construction, and into setTimeout/setInterval. * bindings/scripts/CodeGenerator.pm: (IsBuiltinType): Add ScheduledAction to the builtin list. * bindings/scripts/CodeGeneratorJS.pm: (AddToIncludesForIDLType): Add the correct include when ScheduledAction is used. (GenerateParametersCheck): Remove rule disallowing optional arguments before variadic arguments. That works just fine. (GetBaseIDLType): Add mapping of ScheduledAction -> IDLScheduledAction. (JSValueToNativeDOMConvertNeedsGlobalObject): Add ScheduledAction to the list of types that need a global object for conversion. * page/WindowOrWorkerGlobalScope.idl: Update interface to match spec and add FIXMEs for moving to TimerHandler. * page/DOMWindow.cpp: (WebCore::DOMWindow::setTimeout): (WebCore::DOMWindow::setInterval): * page/DOMWindow.h: * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::setTimeout): (WebCore::WorkerGlobalScope::setInterval): * workers/WorkerGlobalScope.h: Update for new signatures. WorkerGlobalScope now has to return ExceptionOr even though it never throws, due to having one IDL file defining these. This is unfortunate and something we should look at addressing the future. 2017-07-25 Yoshiaki Jitsukawa [WinCairo] Fix build with AllInOnes disabled https://bugs.webkit.org/show_bug.cgi?id=174784 Reviewed by Alex Christensen. * PlatformWin.cmake: Add RenderThemeWin.cpp to WebCore_SOURCES * rendering/RenderingAllInOne.cpp: Remove #include "RenderThemeWin.cpp" * testing/MemoryInfo.h: Remove #include "JSDomWindow.h" * bindings/js/JSDOMGlobalObject.cpp: * bindings/js/JSDOMPromiseDeferred.cpp: * bindings/js/JSDOMWrapper.cpp: * bindings/js/JSImageDataCustom.cpp: * bindings/scripts/CodeGeneratorJS.pm: (GenerateCallWith): * dom/ScriptExecutionContext.cpp: * inspector/InspectorController.cpp: * inspector/InspectorTimelineAgent.cpp: * rendering/RenderMediaControls.cpp: * rendering/RenderMediaControls.h: * rendering/RenderThemeWin.cpp: * bindings/scripts/test/JS/JSTestObj.cpp: Update test results. 2017-07-25 Konstantin Tokarev Unreviewed, fix Mac CMake build after r219567 * PlatformMac.cmake: 2017-07-23 Darin Adler More NeverDestroyed and related cleanup https://bugs.webkit.org/show_bug.cgi?id=174745 Reviewed by Alex Christensen. * bindings/js/JSCustomElementInterface.cpp: (WebCore::JSCustomElementInterface::constructElementWithFallback): Use isNull() rather than comparing against nullAtom() since it's slightly more efficient. * css/MediaQueryEvaluator.cpp: (WebCore::prefersReducedMotionEvaluate): Use a switch statement for the three states of forcedPrefersReducedMotionAccessibilityValue. Also update to use Theme::singleton() instead of platformTheme(). * dom/QualifiedName.h: Removed some unneeded includes, minor style tweaks, and use isNull() rather than comparing against nullAtom() since it's slightly more efficient. * html/Autofill.cpp: (WebCore::AutofillData::createFromHTMLFormControlElement): Use isNull() rather than comparing against nullAtom() since it's slightly more efficient. * html/HTMLDocument.cpp: (WebCore::addLocalNameToSet): Deleted. (WebCore::createHtmlCaseInsensitiveAttributesSet): Deleted. (WebCore::HTMLDocument::isCaseSensitiveAttribute): Moved the case-sensitive attribute set in here and made it use makeNeverDestroyed. * html/HTMLNameCollection.cpp: (WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch): Formatted vertically and sorted so it's easier to see what it does. (WebCore::WindowNameCollection::elementMatches): Use boolean logic instead of multiple return statements to make this a little more straightforward. (WebCore::isObjectElementForDocumentNameCollection): Added. Calls the new isExposed function. The old code called this isDocNamedItem. (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch): Use isObjectElementForDocumentNameCollection to clean up logic. Also sorted classes. (WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch): Use isObjectElementForDocumentNameCollection to clean up logic. Also sorted classes and formatted vertically. (WebCore::DocumentNameCollection::elementMatches): Write in terms of above functions for clarity. Efficiency is roughly the same. * html/HTMLObjectElement.cpp: (WebCore::HTMLObjectElement::HTMLObjectElement): Initialize data members in class definition instead of here. (WebCore::HTMLObjectElement::childrenChanged): Update for name change; function is now called updateExposedState rather than updateDocNamedItem. Also use m_useFallbackContent directly instead of through a function. (WebCore::HTMLObjectElement::renderFallbackContent): Ditto. (WebCore::preventsParentObjectFromExposure): Added. Replaces the old isRecognizedTagName function, and does almost the same thing, but the argument type is different and the param tag is now one of the tags exempted here. Also broke up into two overloads so we can handle the Element, Text, and other Node cases. (WebCore::shouldBeExposed): Added. Helper for the updateExposedState function that handles the logic of when the element should be exposed, separating it from what to do when the state changes. (WebCore::HTMLObjectElement::updateExposedState): Renamed from updateDocNamedItem. * html/HTMLObjectElement.h: Renamed isDocNamedItem -> isExposed, m_docNamedItem -> m_isExposed, updateDocNamedItem -> updateExposedState, stopped using bit fields for the two boolean data members, and initialized those data members here in the class definition. * platform/Theme.cpp: (WebCore::Theme::baselinePositionAdjustment): Moved here from header. (WebCore::Theme::controlFont): Ditto. (WebCore::Theme::controlSize): Ditto. (WebCore::Theme::minimumControlSize): Ditto. (WebCore::Theme::controlRequiresPreWhiteSpace): Ditto. (WebCore::Theme::paint): Ditto. (WebCore::Theme::inflateControlPaintRect): Ditto. (WebCore::Theme::userPrefersReducedMotion): Ditto. (WebCore::Theme::controlBorder): Fixed switch statement indentation. (WebCore::Theme::controlPadding): Ditto. * platform/Theme.h: Removed the many unnecessary includes. The one I was really after here was FontCascade.h. Replaced the platformTheme function with a singleton function, following our normal style. Also changed the return type to a reference rather than a pointer. Removed many unused function and data members. * platform/cocoa/ThemeCocoa.h: Tightened up implementation, removing unnecessary members and making overrides private. * platform/cocoa/ThemeCocoa.mm: Moved include in here. * platform/gamepad/glib/GamepadsGlib.cpp: (WebCore::sampleGamepads): Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL. * platform/graphics/FontCascade.cpp: (WebCore::useBackslashAsYenSignForFamily): Build the set in a cleaner way and use a NeverDestroyed set instead of a heap-allocated one. (WebCore::FontCascade::FontCascade): Moved initialization of data members to the class definition. * platform/graphics/FontCascade.h: Initialize GlyphOverflow and FonstCascade data members in the class definition. Remove the constructor for GlyphOverflow entirely. Added FIXME about the peculiar != operator we defined for GlyphOverflow. * platform/graphics/NamedImageGeneratedImage.cpp: (WebCore::NamedImageGeneratedImage::draw): Use Theme::singleton() instead of platformTheme(). (WebCore::NamedImageGeneratedImage::drawPattern): Ditto. * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::CMTimeRangeStartKey): Use CFSTR directly instead of using DEPRECATED_DEFINE_STATIC_LOCAL. (WebCore::CMTimeRangeDurationKey): Ditto. (WebCore::CACFContextNeedsFlushNotification): Ditto. * platform/graphics/ca/win/LayerChangesFlusher.cpp: (WebCore::LayerChangesFlusher::singleton): Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL. * platform/graphics/ca/win/LayerChangesFlusher.h: Ditto. * platform/graphics/cg/ImageSourceCGWin.cpp: (WebCore::preferredExtensionForImageSourceType): Use HashMap constructor instead of writing out a lot of add calls. * platform/graphics/harfbuzz/HarfBuzzFace.cpp: (WebCore::harfBuzzFaceCache): Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL. * platform/graphics/win/FontCacheWin.cpp: (WebCore::FontCache::lastResortFallbackFont): Ditto. * platform/ios/ThemeIOS.h: Tightened up implementation, removing unnecessary members and making overrides private. * platform/ios/ThemeIOS.mm: (WebCore::Theme::singleton): Renamed from platformTheme. * platform/mac/ThemeMac.h: Tightened up implementation, removing unnecessary members and making overrides private. Removed unneeded WTF_MAKE_FAST_ALLOCATED since this is never allocated on the heap. Removed unused -[NSFont webCoreFamilyName] method. * platform/mac/ThemeMac.mm: (-[NSFont webCoreFamilyName]): Deleted. (WebCore::Theme::singleton): Renamed from platformTheme. * platform/mediastream/mac/MockRealtimeAudioSourceMac.h: Removed unneeded include of FontCascade.h. * platform/mediastream/mac/MockRealtimeVideoSourceMac.h: Ditto. * platform/mock/MockRealtimeAudioSource.h: Ditto. * platform/network/win/DownloadBundleWin.cpp: (WebCore::DownloadBundle::fileExtension): Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL. * platform/win/ClipboardUtilitiesWin.cpp: (WebCore::replaceNewlinesWithWindowsStyleNewlines): Use appendLiteral instead of DEPRECATED_DEFINE_STATIC_LOCAL. * platform/win/FileSystemWin.cpp: (WebCore::bundleName): Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL, and used a lambda to initialize rather than a boolean to control one-time code. (WebCore::storageDirectory): Removed unneeded use of DEPRECATED_DEFINE_STATIC_LOCAL for a prefix we are appending to a String. The + operator can handle a literal just as efficiently without first storing it in a String. * platform/wpe/ThemeWPE.cpp: (WebCore::Theme::singleton): Renamed from platformTheme. * platform/wpe/ThemeWPE.h: Tightened up implementation, removing unnecessary members and making overrides private. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::RenderTheme): No need to initialize m_theme. (WebCore::RenderTheme::adjustStyle): Use Theme::singleton() instead of accessing it through m_theme. (WebCore::RenderTheme::paint): Ditto. (WebCore::RenderTheme::baselinePosition): Ditto. (WebCore::RenderTheme::adjustRepaintRect): Ditto. (WebCore::RenderTheme::setCustomFocusRingColor): Ditto. (WebCore::RenderTheme::platformTapHighlightColor): Ditto. * rendering/RenderTheme.h: Removed unneded m_theme and unneeded inclusion of Theme.h. * rendering/line/LineBreaker.h: Removed unneeded include of FontCascade.h. 2017-07-24 Chris Dumez ExceptionCode enumeration should use modern exception names https://bugs.webkit.org/show_bug.cgi?id=174794 Reviewed by Geoffrey Garen. ExceptionCode enumeration should use modern exception names consistently. This makes the code nicer and closer to the text of the specification. 2017-07-24 Andy Estes Consider implementing W3C Payment Request API https://bugs.webkit.org/show_bug.cgi?id=174796 Reviewed by Daniel Bates. Add Payment Request to features.json as "Under Consideration". * features.json: 2017-07-24 Konstantin Tokarev Unreviewed attempt to fix Mac cmake build * PlatformMac.cmake: 2017-07-24 Chris Dumez Make ExceptionCode a proper enumeration https://bugs.webkit.org/show_bug.cgi?id=174771 Reviewed by Sam Weinig. Make ExceptionCode a proper enumeration instead of a typedef to uint8_t. * Modules/fetch/FetchBody.h: (WebCore::FetchBody::formData): * Modules/indexeddb/shared/IDBError.h: (WebCore::IDBError::encode): (WebCore::IDBError::decode): * bindings/js/JSSubtleCryptoCustom.cpp: (WebCore::rejectWithException): * dom/Exception.h: * dom/ExceptionCode.h: * fileapi/FileReaderSync.cpp: (WebCore::errorCodeToExceptionCode): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::texSubImage2D): (WebCore::WebGLRenderingContextBase::texImage2D): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::createRequest): * xml/XMLHttpRequest.h: 2017-07-24 Simon Fraser Change "client" coordinates back to match scrolling coordinates https://bugs.webkit.org/show_bug.cgi?id=174734 rdar://problem/33336930 Reviewed by Tim Horton. Baidu.com (which uses jQuery), and various iOS apps make the assumption that getBoundingClientRect() returns a rectangle that can be used to set or compare with the scroll position. With visual viewports, that assumption is no longer valid when the page is zoomed, or when the keyboard has caused the visual viewport to detach from the layout viewport. At this point the compatibility cost of shipping layout viewport-based client rects seems higher than the gain, so revert to the shipping behavior. This reverts r216803, and will re-introduce bugs that occurred on zoomed pages on macOS, many of which are noted in webkit.org/b/170981. * page/FrameView.cpp: (WebCore::FrameView::documentToClientOffset): 2017-07-24 Zan Dobersek [WPE] libepoxy headers can use EGL_CAST, which might not be defined by eglplatform.h https://bugs.webkit.org/show_bug.cgi?id=174780 Reviewed by Carlos Garcia Campos. Newer versions of libepoxy provide EGL definitions that already use the EGL_CAST macro. We'd like to compile on systems where the eglplatform.h header doesn't yet provide that macro that was added only recently (e.g. it's available in Mesa 17.1, but not before). To address that, the EpoxyEGL.h header is added that first includes the libepoxy's EGL header and then provides the EGL_CAST definition in case the eglplatform.h header doesn't. This header should be included in place of (which is included in this new header). The EpoxyEGL.h and EpoxyShims.h headers are also moved under the platform/graphics/epoxy/ directory, with the new directory added to the list of inclusion paths for WPE. * PlatformWPE.cmake: * platform/graphics/PlatformDisplay.cpp: * platform/graphics/cairo/CairoUtilities.cpp: * platform/graphics/cairo/ImageBufferCairo.cpp: * platform/graphics/egl/GLContextEGL.cpp: * platform/graphics/egl/GLContextEGLWPE.cpp: * platform/graphics/epoxy/EpoxyEGL.h: Added. * platform/graphics/epoxy/EpoxyShims.h: Renamed from Source/WebCore/platform/graphics/EpoxyShims.h. * platform/graphics/opengl/Extensions3DOpenGLES.cpp: * platform/graphics/wpe/PlatformDisplayWPE.cpp: 2017-07-24 Zan Dobersek [CoordinatedGraphics] Remove unused GLDefs.h header https://bugs.webkit.org/show_bug.cgi?id=174712 Reviewed by Michael Catanzaro. * platform/graphics/opengl/GLDefs.h: Remove this unused header. As far as my recollection goes it was used in the IPC-based CoordinatedGraphics subsystem, which has been removed already. 2017-07-11 Frederic Wang Add attribute allow-top-navigation-by-user-activation to iframe sandbox https://bugs.webkit.org/show_bug.cgi?id=171327 Reviewed by Chris Dumez. Tests: http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-1.html http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-2.html imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation_by_user_activation_without_user_gesture-expected.txt imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation-3-expected.txt * dom/Document.cpp: (WebCore::Document::canNavigate): Case 2 of conformance verification is refined to match the current specification: Top navigation is allowed when it is triggered by user activation and when allow-top-navigation-by-user-activation is set. Because we have additional "security origin" rules with respect to the specification we also add some early return to ensure that navigation is really allowed for this new case. * dom/SecurityContext.cpp: (WebCore::SecurityContext::isSupportedSandboxPolicy): Add allow-top-navigation-by-user-activation flag. (WebCore::SecurityContext::parseSandboxPolicy): Parse the new flag to allow top user navigation by user activation. Also, make sure that allow-top-navigation allows such navigation as defined by the specification. * dom/SecurityContext.h: Declare new sandboxing flag. 2017-07-23 Wenson Hsieh [iOS WK2] 5 DataInteractionTests are failing: observed selection rects after dropping don't match expected values https://bugs.webkit.org/show_bug.cgi?id=174769 Reviewed by Tim Horton. These tests began failing after r219541, due to a change in behavior of whether or not we call setIgnoreSelectionChanges(false, RevealSelection::No) or setIgnoreSelectionChanges(false, RevealSelection::Yes) when performing a text editing drop. Before r219541, we would not reveal the selection when performing an edit drag operation. This is because in WebPage::performDragControllerAction, we would begin ignoring selection changes by calling setIgnoreSelectionChanges(true). However, while taking a text indicator snapshot, we would stop ignoring selection in TextIndicator::createWithRange due to us calling setIgnoreSelectionChanges(false, RevealSelection::No) at the end of the function. Then, when we return to the scope of WebPage::performDragControllerAction and try to setIgnoreSelectionChanges(false), this is a no-op because we've already stopped ignoring selection changes. After r219541, switching to using TemporarySelectionChange means that TextIndicator::createWithRange now means we respect whether or not we were already ignoring selection before taking the snapshot, so we won't always setIgnoreSelectionChanges(false) at the end. This means that selection changes will now be correctly ignored when performing a drag operation, but this also means that we'll try to reveal the selection, since WebPage::performDragControllerAction calls setIgnoreSelectionChanges(false), for which RevealSelection::Yes is used by default. Revealing the selection in WebPage::performDragControllerAction was unintended in the first place, so we should revert to calling setIgnoreSelectionChanges(false, RevealSelection::No). To ensure this, we adopt TemporarySelectionChange here and pass only TemporarySelectionOptionIgnoreSelectionChanges, so that we won't additionally try to reveal selection after the drop. This is consistent with behavior prior to macOS 10.13 and iOS 11. Additionally, this patch also moves the call to ignore selection change from WebKit into WebCore, so that whether we ignore selection is consistent across both WebKit1 and WebKit2. * page/DragController.cpp: (WebCore::DragController::performDragOperation): 2017-07-23 Chris Dumez Drop ExceptionCodeDescription class https://bugs.webkit.org/show_bug.cgi?id=174757 Reviewed by Darin Adler. Drop ExceptionCodeDescription class now that there is only one exception type: DOMException. Instead, we now have static methods on DOMException to get the name / message for a given exception code. * CMakeLists.txt: * Modules/indexeddb/shared/IDBError.cpp: (WebCore::IDBError::name): (WebCore::IDBError::message): * Modules/quota/StorageErrorCallback.cpp: (WebCore::StorageErrorCallback::CallbackTask::CallbackTask): * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::createDOMException): * dom/DOMAllInOne.cpp: * dom/DOMException.cpp: (WebCore::errorCodeFromName): (WebCore::DOMException::create): (WebCore::DOMException::DOMException): (WebCore::DOMException::name): (WebCore::DOMException::message): * dom/DOMException.h: * dom/ExceptionCodeDescription.cpp: Removed. * dom/ExceptionCodeDescription.h: Removed. * inspector/DOMEditor.cpp: (WebCore::populateErrorString): * inspector/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::toErrorString): * inspector/InspectorDOMStorageAgent.cpp: (WebCore::InspectorDOMStorageAgent::setDOMStorageItem): 2017-07-22 Dan Bernstein Fixed building for macOS 10.12 with the macOS 10.13 SDK after r219644. * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::update): Suppress the objc-literal-conversion warning in one place where we are calling a class method on a Class and the compiler can’t tell which class it is, so it chooses wrong and emits a warning. 2017-07-22 Chris Dumez Merge ExceptionBase into DOMException and drop custom toString https://bugs.webkit.org/show_bug.cgi?id=174755 Reviewed by Sam Weinig. Merge ExceptionBase into DOMException and drop custom toString, now that DOMException is the only remaining exception type. * CMakeLists.txt: * Modules/mediastream/MediaStream.h: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::retrieveErrorMessage): * dom/DOMAllInOne.cpp: * dom/DOMException.cpp: (WebCore::DOMException::DOMException): (WebCore::DOMException::initializeDescription): * dom/DOMException.h: (WebCore::DOMException::code): (WebCore::DOMException::name): (WebCore::DOMException::message): * dom/ExceptionBase.cpp: Removed. * dom/ExceptionBase.h: Removed. 2017-07-14 Filip Pizlo It should be easy to decide how WebKit yields https://bugs.webkit.org/show_bug.cgi?id=174298 Reviewed by Saam Barati. No new tests because the WebCore change is just a change to how we #include things. * inspector/InspectorPageAgent.h: * inspector/TimelineRecordFactory.h: * workers/Worker.h: * workers/WorkerGlobalScopeProxy.h: * workers/WorkerMessagingProxy.h: 2017-07-22 Said Abou-Hallawa REGRESSION(r219045): A partially loaded image may not be repainted when its complete frame finishes decoding https://bugs.webkit.org/show_bug.cgi?id=174230 Reviewed by Simon Fraser. Because of r219045, we now only repaint the CachedImageClinets which tried to draw the image but they could not because they have to wait for the image decoding to finish. This was done by keeping a HashSet of these clients and make CachedImage own it. This HashSet is cleared once the image frame finishes decoding and all the waited clients are repainted. But Multiple asynchronous image decoding requests are allowed for the same frame if new data is added to the image source. If we tried to draw the same image twice before it finishes decoding the first request, we will not be to record this second request since the HashSet will not add the same client twice. When he second request finishes decoding, CachedImage will not repaint any client since its HashSet is empty. To fix this problem we can do the following. When an image frame finishes decoding, CachedImage will keep its HashSet of pending drawing clients as long as the image frame is a partially loaded frame. * loader/cache/CachedImage.cpp: (WebCore::CachedImage::CachedImageObserver::imageFrameAvailable): (WebCore::CachedImage::imageFrameAvailable): * loader/cache/CachedImage.h: * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::destroyDecodedData): (WebCore::BitmapImage::dataChanged): (WebCore::BitmapImage::setCurrentFrameDecodingStatusIfNecessary): (WebCore::BitmapImage::draw): (WebCore::BitmapImage::internalStartAnimation): (WebCore::BitmapImage::internalAdvanceAnimation): (WebCore::BitmapImage::imageFrameAvailableAtIndex): * platform/graphics/BitmapImage.h: * platform/graphics/ImageFrame.cpp: (WebCore::ImageFrame::decodingStatus): * platform/graphics/ImageFrame.h: Move DecodingStatus out of this class to ImageTypes.h to avoid adding other header files to ImageObvsever.h * platform/graphics/ImageFrameCache.cpp: (WebCore::ImageFrameCache::setNativeImage): (WebCore::ImageFrameCache::cacheMetadataAtIndex): (WebCore::ImageFrameCache::cacheNativeImageAtIndex): (WebCore::ImageFrameCache::cacheNativeImageAtIndexAsync): (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): (WebCore::ImageFrameCache::frameDecodingStatusAtIndex): * platform/graphics/ImageFrameCache.h: * platform/graphics/ImageObserver.h: * platform/graphics/ImageSource.h: (WebCore::ImageSource::frameDecodingStatusAtIndex): * platform/graphics/ImageTypes.h: * platform/image-decoders/bmp/BMPImageReader.cpp: (WebCore::BMPImageReader::decodeBMP): * platform/image-decoders/gif/GIFImageDecoder.cpp: (WebCore::GIFImageDecoder::frameComplete): (WebCore::GIFImageDecoder::initFrameBuffer): * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: (WebCore::JPEGImageDecoder::outputScanlines): (WebCore::JPEGImageDecoder::jpegComplete): * platform/image-decoders/png/PNGImageDecoder.cpp: (WebCore::PNGImageDecoder::rowAvailable): (WebCore::PNGImageDecoder::pngComplete): (WebCore::PNGImageDecoder::frameComplete): * platform/image-decoders/webp/WEBPImageDecoder.cpp: (WebCore::WEBPImageDecoder::decode): * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::decodingModeForImageDraw): 2017-07-22 Timothy Horton Drag and Drop preview image for Twitter link is the wrong shape ​https://bugs.webkit.org/show_bug.cgi?id=174731 * dom/Range.cpp: (WebCore::Range::absoluteRectsForRangeInText): * page/TextIndicator.cpp: (WebCore::initializeIndicator): Apply some post-landing review feedback for r219756. 2017-07-21 Chris Dumez Drop IDBDatabaseException class https://bugs.webkit.org/show_bug.cgi?id=174743 Reviewed by Darin Adler. Drop IDBDatabaseException class and use DOMException directly. IDBDatabaseException was only an internal concept and was already exposed to the Web as a DOMException. This simplifies the code a bit and will allow for further simplification in a follow-up patch. No new tests, no Web-facing behavior change, except for some exception messages being slightly different. * CMakeLists.txt: * Modules/indexeddb/IDBCursor.cpp: (WebCore::IDBCursor::update): (WebCore::IDBCursor::advance): (WebCore::IDBCursor::continuePrimaryKey): (WebCore::IDBCursor::continueFunction): (WebCore::IDBCursor::deleteFunction): * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::createObjectStore): (WebCore::IDBDatabase::transaction): (WebCore::IDBDatabase::deleteObjectStore): * Modules/indexeddb/IDBDatabaseError.h: Removed. * Modules/indexeddb/IDBDatabaseException.cpp: Removed. * Modules/indexeddb/IDBDatabaseException.h: Removed. * Modules/indexeddb/IDBFactory.cpp: (WebCore::IDBFactory::cmp): * Modules/indexeddb/IDBIndex.cpp: (WebCore::IDBIndex::setName): (WebCore::IDBIndex::openCursor): (WebCore::IDBIndex::openKeyCursor): (WebCore::IDBIndex::count): (WebCore::IDBIndex::doCount): (WebCore::IDBIndex::get): (WebCore::IDBIndex::doGet): (WebCore::IDBIndex::getKey): (WebCore::IDBIndex::doGetKey): (WebCore::IDBIndex::getAll): (WebCore::IDBIndex::getAllKeys): * Modules/indexeddb/IDBKeyRange.cpp: (WebCore::IDBKeyRange::only): (WebCore::IDBKeyRange::lowerBound): (WebCore::IDBKeyRange::upperBound): (WebCore::IDBKeyRange::bound): (WebCore::IDBKeyRange::includes): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::setName): (WebCore::IDBObjectStore::openCursor): (WebCore::IDBObjectStore::openKeyCursor): (WebCore::IDBObjectStore::get): (WebCore::IDBObjectStore::getKey): (WebCore::IDBObjectStore::putOrAdd): (WebCore::IDBObjectStore::doDelete): (WebCore::IDBObjectStore::deleteFunction): (WebCore::IDBObjectStore::clear): (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::index): (WebCore::IDBObjectStore::deleteIndex): (WebCore::IDBObjectStore::count): (WebCore::IDBObjectStore::doCount): (WebCore::IDBObjectStore::getAll): (WebCore::IDBObjectStore::getAllKeys): * Modules/indexeddb/IDBOpenDBRequest.cpp: (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::result): (WebCore::IDBRequest::error): (WebCore::IDBRequest::uncaughtExceptionInEventHandler): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::objectStore): (WebCore::IDBTransaction::abort): (WebCore::IDBTransaction::abortOnServerAndCancelRequests): (WebCore::IDBTransaction::didCreateIndexOnServer): (WebCore::IDBTransaction::putOrAddOnServer): * Modules/indexeddb/server/IndexValueStore.cpp: (WebCore::IDBServer::IndexValueStore::addRecord): * Modules/indexeddb/server/MemoryIDBBackingStore.cpp: (WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction): (WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction): (WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction): (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore): (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore): (WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore): (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore): (WebCore::IDBServer::MemoryIDBBackingStore::createIndex): (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex): (WebCore::IDBServer::MemoryIDBBackingStore::renameIndex): (WebCore::IDBServer::MemoryIDBBackingStore::deleteRange): (WebCore::IDBServer::MemoryIDBBackingStore::addRecord): (WebCore::IDBServer::MemoryIDBBackingStore::getRecord): (WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords): (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord): (WebCore::IDBServer::MemoryIDBBackingStore::getCount): (WebCore::IDBServer::MemoryIDBBackingStore::generateKeyNumber): (WebCore::IDBServer::MemoryIDBBackingStore::openCursor): (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor): * Modules/indexeddb/server/MemoryIndex.cpp: (WebCore::IDBServer::MemoryIndex::putIndexKey): * Modules/indexeddb/server/MemoryObjectStore.cpp: (WebCore::IDBServer::MemoryObjectStore::createIndex): (WebCore::IDBServer::MemoryObjectStore::deleteIndex): * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo): (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction): (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction): (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction): (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange): (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords): (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords): (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey): (WebCore::IDBServer::SQLiteIDBBackingStore::getCount): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue): (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber): (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber): (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber): (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor): (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor): * Modules/indexeddb/server/SQLiteIDBTransaction.cpp: (WebCore::IDBServer::SQLiteIDBTransaction::begin): (WebCore::IDBServer::SQLiteIDBTransaction::commit): (WebCore::IDBServer::SQLiteIDBTransaction::abort): * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation): (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore): (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore): (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex): (WebCore::IDBServer::UniqueIDBDatabase::renameIndex): (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction): (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction): * Modules/indexeddb/shared/IDBError.cpp: (WebCore::IDBError::name): (WebCore::IDBError::message): (WebCore::IDBError::toDOMError): * Modules/indexeddb/shared/IDBError.h: (WebCore::IDBError::userDeleteError): (WebCore::IDBError::isNull): * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::createDOMException): * dom/DOMException.cpp: (WebCore::DOMException::initializeDescription): Initialize description->code from using the actual error codes in the coreExceptions table, instead of initializing it using |ec|. |ec| is the index in the ExceptionCode enumeration and it matches the error code only for legacy exceptions. New exceptions such as DataError should have a code of 0. Without this change, w3c for IDB would start failing. * dom/ExceptionCodeDescription.cpp: (WebCore::ExceptionCodeDescription::ExceptionCodeDescription): * dom/ExceptionCodeDescription.h: 2017-07-21 Sam Weinig [WebIDL] Simplify XMLHttpRequest bindings by removing built-ins https://bugs.webkit.org/show_bug.cgi?id=174740 Reviewed by Chris Dumez. The behavior we were getting from XMLHttpRequest.js can be implemented with the [CachedAttribute] extended attribute. This reduces the number of JS -> C++ jumps required and makes the code more similar to other bindings that need caching of an IDL any value. * CMakeLists.txt: * DerivedSources.make: * xml/XMLHttpRequest.js: Removed. Remove XMLHttpRequest.js. * bindings/js/JSXMLHttpRequestCustom.cpp: (WebCore::JSXMLHttpRequest::response): (WebCore::JSXMLHttpRequest::retrieveResponse): Deleted. * xml/XMLHttpRequest.idl: Replace builtin with a [CachedAttribute] and [CustomGetter] for the response property. 2017-07-21 Timothy Horton Drag and Drop preview image for Twitter link is the wrong shape https://bugs.webkit.org/show_bug.cgi?id=174731 Reviewed by Zalan Bujtas. TextIndicator uses Range::borderAndTextQuads and ::absoluteTextRects in order to get the rects of the indicated text. Currently, these functions do not respect clipping, so clipped-out text (e.g. as seen inside links on Twitter) generates lots of meaningless indicated rects. * page/TextIndicator.cpp: (WebCore::estimatedBackgroundColorForRange): (WebCore::hasAnyIllegibleColors): Change adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary to instead be hasAnyIllegibleColors, and referred to in the same place as hasNonInlineOrReplacedElements, so that it follows the same upgrade path (leaving textRects empty, so that it is later filled in with the absoluteBoundingRect). This was a mistake in r219033, which instead would end up painting all content, but filling in textRects with the actual individual text rects. This alone changes the behavior on Twitter from lots of jagged misplaced rects to a too-large bounding rect. Combined with the following changes, the bounding rect is reduced to the right size: (WebCore::initializeIndicator): Adopt the new Range::borderAndTextQuads and ::absoluteTextRects parameter and opt-in to respecting clipping for text rects. * dom/DOMRectList.cpp: (WebCore::DOMRectList::DOMRectList): * dom/DOMRectList.h: (WebCore::DOMRectList::create): Add a DOMRectList constructor and create() that take FloatRects, similar to the one that takes FloatQuads, but without the boundingRect() calls. * dom/Document.h: * dom/Document.cpp: (WebCore::Document::convertAbsoluteToClientRects): Add convertAbsoluteToClientRects, similar to covertAbsoluteToClientQuads, except acting on rects instead of quads. * dom/Range.cpp: (WebCore::Range::absoluteRectsForRangeInText): (WebCore::Range::absoluteTextRects): (WebCore::Range::getClientRects): (WebCore::Range::borderAndTextRects): (WebCore::Range::boundingRect): (WebCore::Range::absoluteBoundingRect): (WebCore::Range::borderAndTextQuads): Deleted. * dom/Range.h: Replace borderAndTextQuads with borderAndTextRects, because all callers just ended up calling boundingBox() on the quads. Factor absoluteRectsForRangeInText out of absoluteTextRects and borderAndTextQuads, and teach it to optionally intersect the text rects with their renderer's absoluteClippedOverflowRect. 2017-07-21 Per Arne Vollan Round-tripping stroke-width styles through getComputedStyle cause the text to gain a stroke. https://bugs.webkit.org/show_bug.cgi?id=174701 Reviewed by Simon Fraser. The initial value of stroke-color should be transparent, see https://www.w3.org/TR/fill-stroke-3/#stroke-color. Also, there is no need to set the graphics context in text stroke mode, if the stroke color is not visible. Test: fast/css/round-trip-stroke-width-using-computed-style.html * rendering/TextPaintStyle.cpp: (WebCore::updateGraphicsContext): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialStrokeWidth): (WebCore::RenderStyle::initialStrokeColor): * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): 2017-07-21 Timothy Horton Remove an inaccurate comment from RenderTextLineBoxes * rendering/RenderTextLineBoxes.cpp: (WebCore::RenderTextLineBoxes::absoluteRectsForRange): This comment has been wrong for at least 4 years. 2017-07-21 Timothy Horton TextIndicator::estimatedTextColorsForRange asserts inside HashSet code (inserting reserved value) https://bugs.webkit.org/show_bug.cgi?id=174733 Reviewed by Wenson Hsieh. * page/TextIndicator.cpp: (WebCore::estimatedTextColorsForRange): (WebCore::adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary): RGBA32 isn't a valid hash key, because we have no traits that define the empty or deleted values, nor do we have any bits we could feasibly use -- the full range of RGBA32 is easy to reach with various colors. Instead, hash Color directly. 2017-07-21 Nan Wang AX: Expose form validation on iOS as hint https://bugs.webkit.org/show_bug.cgi?id=174722 Reviewed by Chris Fleizach. Adding the validation message to the hint of the form control element. Test: accessibility/ios-simulator/form-control-validation-message.html * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isShowingValidationMessage): (WebCore::AccessibilityObject::validationMessage): * accessibility/AccessibilityObject.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityHint]): (-[WebAccessibilityObjectWrapper accessibilityIsShowingValidationMessage]): * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::isShowingValidationMessage): * html/HTMLFormControlElement.h: 2017-07-21 Konstantin Tokarev [cmake][Mac] Unreviewed, fix linking WebKitSystemInterface After r219560 link_directories() in PlatformXXX.cmake files does not affect corresponding targets. * PlatformMac.cmake: 2017-07-21 Sam Weinig [WebIDL] Remove the need for the side map of DeprecatedCSSOMValue roots https://bugs.webkit.org/show_bug.cgi?id=174713 Reviewed by Andreas Kling. We used to not want to bloat the size of CSSValues with a pointer to the owner CSSStyleDeclaration, so, for GC purposes we need kept a mapping of them on DOMWrapperWorld that only got set if a wrapper was made. Now that we have DeprecatedCSSOMValue, a wrapper for CSSValue that only gets created for the bindings, we no longer need the side table, and simply have the DeprecatedCSSOMValue maintain a reference to the CSSStyleDeclaration. * bindings/js/DOMWrapperWorld.h: (WebCore::DOMWrapperWorld::wrappers): Remove m_deprecatedCSSOMValueRoots and make m_wrappers private with a getter. * bindings/js/JSCSSStyleDeclarationCustom.cpp: (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue): Deleted. Remove custom implementation of getPropertyCSSValue, now that it no longer needs to update m_deprecatedCSSOMValueRoots. * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow): * bindings/js/JSDOMWrapperCache.h: (WebCore::getCachedWrapper): (WebCore::cacheWrapper): (WebCore::uncacheWrapper): * bindings/js/JSNodeCustom.cpp: (WebCore::getOutOfLineCachedWrapper): Use wrappers getter rather than direct member variable. * bindings/js/JSDeprecatedCSSOMValueCustom.cpp: (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots): Rather than checking the side table for roots, now get the root via the reference CSSStyleDeclaration. (WebCore::JSDeprecatedCSSOMValueOwner::finalize): Deleted. Remove custom finalize now that we don't have to remove ourself from m_deprecatedCSSOMValueRoots. * css/CSSStyleDeclaration.idl: Remove [Custom] from getPropertyCSSValue. * css/DeprecatedCSSOMValue.idl: Remove [JSCustomFinalize]. * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): * css/CSSImageValue.cpp: (WebCore::CSSImageValue::createDeprecatedCSSOMWrapper): * css/CSSImageValue.h: * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::createDeprecatedCSSOMPrimitiveWrapper): * css/CSSPrimitiveValue.h: * css/CSSStyleDeclaration.h: * css/CSSValue.cpp: (WebCore::CSSValue::createDeprecatedCSSOMWrapper): * css/CSSValue.h: * css/DeprecatedCSSOMCounter.h: * css/DeprecatedCSSOMPrimitiveValue.cpp: (WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue): (WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue): (WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue): * css/DeprecatedCSSOMPrimitiveValue.h: (WebCore::DeprecatedCSSOMPrimitiveValue::create): (WebCore::DeprecatedCSSOMPrimitiveValue::DeprecatedCSSOMPrimitiveValue): * css/DeprecatedCSSOMRGBColor.h: * css/DeprecatedCSSOMRect.h: * css/DeprecatedCSSOMValue.h: (WebCore::DeprecatedCSSOMValue::owner): (WebCore::DeprecatedCSSOMValue::DeprecatedCSSOMValue): (WebCore::DeprecatedCSSOMComplexValue::create): (WebCore::DeprecatedCSSOMComplexValue::DeprecatedCSSOMComplexValue): * css/DeprecatedCSSOMValueList.h: (WebCore::DeprecatedCSSOMValueList::create): (WebCore::DeprecatedCSSOMValueList::DeprecatedCSSOMValueList): * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM): * css/PropertySetCSSStyleDeclaration.h: * svg/SVGElement.cpp: (WebCore::SVGElement::getPresentationAttribute): Pass owning CSSStyleDeclaration to DeprecatedCSSOMValue and derived classes. 2017-07-21 Andreas Kling Use more references in event dispatch code https://bugs.webkit.org/show_bug.cgi?id=174681 Reviewed by Geoffrey Garen. Make EventListener::handleEvent() take a ScriptExecutionContext&, Event&. Then make everything build again. Various null checks and assertions disappear in the process. * bindings/js/JSErrorHandler.cpp: (WebCore::JSErrorHandler::handleEvent): * bindings/js/JSErrorHandler.h: * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::initializeJSFunction): (WebCore::JSEventListener::handleEvent): (WebCore::eventHandlerAttribute): * bindings/js/JSEventListener.h: (WebCore::JSEventListener::jsFunction): * bindings/js/JSLazyEventListener.cpp: (WebCore::JSLazyEventListener::initializeJSFunction): * bindings/js/JSLazyEventListener.h: * dom/EventListener.h: * dom/EventTarget.cpp: (WebCore::EventTarget::fireEventListeners): * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::defaultEventHandler): * html/ImageDocument.cpp: (WebCore::ImageEventListener::handleEvent): * inspector/CommandLineAPIHost.cpp: (WebCore::listenerEntriesFromListenerInfo): * inspector/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::buildObjectForEventListener): * inspector/InspectorIndexedDBAgent.cpp: * platform/Widget.h: (WebCore::Widget::handleEvent): * platform/cocoa/WebPlaybackSessionModelMediaElement.h: * platform/cocoa/WebPlaybackSessionModelMediaElement.mm: (WebCore::WebPlaybackSessionModelMediaElement::handleEvent): * platform/cocoa/WebVideoFullscreenModelVideoElement.h: * platform/cocoa/WebVideoFullscreenModelVideoElement.mm: (WebVideoFullscreenModelVideoElement::handleEvent): * svg/SVGTRefElement.cpp: (WebCore::SVGTRefTargetEventListener::handleEvent): * svg/animation/SVGSMILElement.cpp: (WebCore::ConditionEventListener::handleEvent): (WebCore::SVGSMILElement::handleConditionEvent): * svg/animation/SVGSMILElement.h: 2017-07-21 Zalan Bujtas iBooks: Overlapping/missing content at beginning/end of paragraph. https://bugs.webkit.org/show_bug.cgi?id=174717 Reviewed by Simon Fraser. By definiton simple and normal line layout should always produce the exact same lineboxes. It enables us not to force repaint while swapping between these 2 line layouts. However in certain cases (font size pixel rounding as an example) they don't agree on how much content fits the line and that could result in missing/overlapping content due to the lack of repaint. Unable to test. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::ensureLineBoxes): 2017-07-21 Chris Dumez Drop make_dom_exceptions.pl script that we only have DOMException https://bugs.webkit.org/show_bug.cgi?id=174699 Reviewed by Darin Adler. Drop make_dom_exceptions.pl script that we only have DOMException. * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * WebCoreMacros.cmake: * bindings/js/JSDOMExceptionHandling.cpp: * css/FontFaceSet.cpp: * dom/DOMAllInOne.cpp: * dom/DOMExceptions.in: Removed. * dom/ExceptionCodeDescription.cpp: Added. (WebCore::ExceptionCodeDescription::ExceptionCodeDescription): * dom/ExceptionCodeDescription.h: Added. * dom/make_dom_exceptions.pl: Removed. * inspector/WebInjectedScriptHost.cpp: (WebCore::WebInjectedScriptHost::subtype): 2017-07-21 Said Abou-Hallawa [CG] An image should not invoke many system calls before confirming its format is supported https://bugs.webkit.org/show_bug.cgi?id=174692 Reviewed by Tim Horton. We should be careful when invoking system calls before confirming that the image type is available and it is one of the whitelist formats. Otherwise we will be calling the parsers of the unsupported formats. * loader/cache/CachedImage.cpp: (WebCore::CachedImage::setImageDataBuffer): The check isAllowedImageUTI() is now done in ImageDecoder::encodedDataStatus() which will return Error if there is an error in the data or "isAllowedImageUTI() returns false." * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::dataChanged): Avoid calling canUseAsyncDecodingForLargeImages() before confirming the image type is available and it's supported by WebKit. canUseAsyncDecodingForLargeImages() tries to cache the first frame of the image to know its size. Asking the ImageFrameCache to destroy its decoded frames is not needed unless ImageFrameCache::decodedSize() is not zero. * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::ImageDecoder::encodedDataStatus): Avoid calling CGImageSourceGetStatus() before knowing the UTI of the image. When knowing it, we call CGImageSourceGetStatus() and if it returns kCGImageStatusIncomplete or kCGImageStatusComplete, we check whether isAllowedImageUTI() or not. If isAllowedImageUTI() returns false, return Error which will make the CachedImage cancel loading the rest of the image. 2017-07-21 Jeremy Jones AudioTrackPrivateMediaStreamCocoa shouldn't set AudioSession::setPreferredBufferSize https://bugs.webkit.org/show_bug.cgi?id=174707 rdar://problem/33446809 Reviewed by Eric Carlson. Manually tested for audio side effects. AudioChannel::copyFrom fails when AudioChannel lengths don't match. This happens because PlatformMediaSessionManager::updateSessionState() owns and sets AudioSession::setPreferredBufferSize(). However, AudioTrackPrivateMediaStreamCocoa::createAudioUnit, when it creates an input audio unit is setting AudioSession::setPreferredBufferSize() directly to its own arbitrary value. AudioSession::setPreferredBufferSize() should be managed by the higher level PlatformMediaSessionManager, and not modified by audio unit creation, in order to keep harmony within the audio pipeline. * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp: (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit): 2017-07-21 Jeremy Jones Noise when AudioChannel lengths don't match. https://bugs.webkit.org/show_bug.cgi?id=174706 rdar://problem/33389856 Reviewed by Eric Carlson. When AudioChannel lengths don't match, copyFrom() returns early leaving uninitialized data in the audio buffer. This change zeros out the data, so there isn't objectionable noise sent to the speaker. * platform/audio/AudioChannel.cpp: (WebCore::AudioChannel::copyFrom): 2017-07-21 Sam Weinig [WebIDL] Make a few parameters non-nullable in inspector IDL files https://bugs.webkit.org/show_bug.cgi?id=174719 Reviewed by Joseph Pecoraro. * inspector/CommandLineAPIHost.cpp: (WebCore::CommandLineAPIHost::databaseId): (WebCore::CommandLineAPIHost::storageId): * inspector/CommandLineAPIHost.h: * inspector/CommandLineAPIHost.idl: * inspector/InspectorDOMStorageAgent.cpp: (WebCore::InspectorDOMStorageAgent::storageId): * inspector/InspectorDOMStorageAgent.h: * inspector/InspectorDatabaseAgent.cpp: (WebCore::InspectorDatabaseAgent::databaseId): * inspector/InspectorDatabaseAgent.h: * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::showContextMenu): (WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent): * inspector/InspectorFrontendHost.h: * inspector/InspectorFrontendHost.idl: Remove nullability from arguments that should never be null. 2017-07-21 Brady Eidson Get rid of WebCore IconDatabase code. https://bugs.webkit.org/show_bug.cgi?id=174700 Reviewed by Tim Horton. No new tests (No behavior change). Tons of red. Very little green. No further explanation. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/Document.cpp: (WebCore::Document::implicitClose): * history/HistoryItem.cpp: (WebCore::HistoryItem::HistoryItem): (WebCore::HistoryItem::~HistoryItem): (WebCore::HistoryItem::reset): (WebCore::HistoryItem::setURLString): * inspector/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::willSendRequest): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::~DocumentLoader): (WebCore::DocumentLoader::startIconLoading): (WebCore::DocumentLoader::iconLoadDecisionAvailable): Deleted. (WebCore::iconLoadDecisionCallback): Deleted. (WebCore::DocumentLoader::getIconLoadDecisionForIconURL): Deleted. (WebCore::DocumentLoader::continueIconLoadWithDecision): Deleted. (WebCore::iconDataCallback): Deleted. (WebCore::DocumentLoader::getIconDataForIconURL): Deleted. * loader/DocumentLoader.h: (WebCore::DocumentLoader::linkIcons): * loader/FrameLoader.cpp: (WebCore::FrameLoader::FrameLoader): (WebCore::FrameLoader::stop): * loader/FrameLoader.h: (WebCore::FrameLoader::subframeLoader): (WebCore::FrameLoader::icon): Deleted. * loader/FrameLoaderClient.h: * loader/archive/cf/LegacyWebArchive.cpp: (WebCore::LegacyWebArchive::create): * loader/icon/IconController.cpp: Removed. * loader/icon/IconController.h: Removed. * loader/icon/IconDatabase.cpp: Removed. * loader/icon/IconDatabase.h: Removed. * loader/icon/IconDatabaseBase.cpp: Removed. * loader/icon/IconDatabaseBase.h: Removed. * loader/icon/IconDatabaseClient.h: Removed. * loader/icon/IconLoader.cpp: (WebCore::IconLoader::IconLoader): (WebCore::IconLoader::startLoading): (WebCore::IconLoader::notifyFinished): * loader/icon/IconLoader.h: * loader/icon/IconRecord.cpp: Removed. * loader/icon/IconRecord.h: Removed. * loader/icon/PageURLRecord.cpp: Removed. * loader/icon/PageURLRecord.h: Removed. * testing/Internals.cpp: (WebCore::Internals::shortcutIconURLs): 2017-07-21 Chris Dumez Rename DOMCoreException class to DOMException https://bugs.webkit.org/show_bug.cgi?id=174698 Reviewed by Darin Adler. Rename DOMCoreException class to DOMException to match its Web-exposed name. * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * Modules/quota/StorageErrorCallback.cpp: (WebCore::StorageErrorCallback::CallbackTask::CallbackTask): * Modules/quota/StorageErrorCallback.h: * Modules/quota/StorageErrorCallback.idl: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::retrieveErrorMessage): (WebCore::createDOMException): * bindings/scripts/CodeGeneratorJS.pm: (GenerateOverloadDispatcher): * css/FontFaceSet.cpp: * css/FontFaceSet.h: * dom/DOMAllInOne.cpp: * dom/DOMException.cpp: Renamed from Source/WebCore/dom/DOMCoreException.cpp. (WebCore::DOMException::create): (WebCore::DOMException::DOMException): (WebCore::DOMException::initializeDescription): * dom/DOMException.h: Renamed from Source/WebCore/dom/DOMCoreException.h. (WebCore::DOMException::create): (WebCore::DOMException::DOMException): * dom/DOMException.idl: Renamed from Source/WebCore/dom/DOMCoreException.idl. * dom/DOMExceptions.in: * dom/make_dom_exceptions.pl: (generateImplementation): 2017-07-21 Sam Weinig Follow up to https://bugs.webkit.org/show_bug.cgi?id=174659. * inspector/InspectorFrontendHost.idl: Remove unnecessary JSGenerateToJSObject noticed in review. 2017-07-20 Chris Dumez Drop legacy SVGException type https://bugs.webkit.org/show_bug.cgi?id=174695 Reviewed by Darin Adler. Drop legacy SVGException type and use DOMException instead, as per the latest SVG specification. Both Chrome and Firefox no longer expose the SVGException type. * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::createDOMException): * bindings/js/JSExceptionBase.cpp: (WebCore::toExceptionBase): * dom/DOMExceptions.in: * svg/SVGAllInOne.cpp: * svg/SVGCircleElement.cpp: * svg/SVGException.cpp: Removed. * svg/SVGException.h: Removed. * svg/SVGException.idl: Removed. * svg/SVGGraphicsElement.idl: * svg/SVGLocatable.cpp: (WebCore::SVGLocatable::getTransformToElement): * svg/SVGMatrixValue.h: * svg/SVGPathSegList.cpp: (WebCore::SVGPathSegList::getItem): (WebCore::SVGPathSegList::replaceItem): (WebCore::SVGPathSegList::removeItem): * svg/SVGPathSegList.h: * svg/SVGPathSegList.idl: * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h: * svg/properties/SVGListProperty.h: 2017-07-20 Chris Dumez Hook up ITP quirks to the needsSiteSpecificQuirks setting https://bugs.webkit.org/show_bug.cgi?id=174691 Reviewed by Darin Adler. Hook up ITP quirks to the needsSiteSpecificQuirks setting to make it easier for Web-developers to test their fixes. * loader/ResourceLoadObserver.cpp: (WebCore::shouldEnableSiteSpecificQuirks): (WebCore::areDomainsAssociated): (WebCore::ResourceLoadObserver::logFrameNavigation): (WebCore::resourceNeedsSSOQuirk): (WebCore::ResourceLoadObserver::logSubresourceLoading): (WebCore::ResourceLoadObserver::logWebSocketLoading): 2017-07-20 Matt Lewis Unreviewed, rolling out r219700. This revision caused consistent timouts on iOS. Reverted changeset: "Turn tests at media/modern-media-controls/start-support back on" https://bugs.webkit.org/show_bug.cgi?id=174683 http://trac.webkit.org/changeset/219700 2017-07-20 David Quesada Add SPI to notify WKNavigationDelegate about client redirects https://bugs.webkit.org/show_bug.cgi?id=174680 rdar://problem/33184886 Reviewed by Brady Eidson. * loader/FrameLoader.cpp: (WebCore::FrameLoader::performClientRedirect): * loader/FrameLoader.h: Add a convenience method for NavigationScheduler that handles a FrameLoadRequest as a client redirect. Currently this means loading the request and informing the client about it. * loader/FrameLoaderClient.h: Add FrameLoaderClient::dispatchDidPerformClientRedirect() to inform the client when a client redirect occurs. * loader/NavigationScheduler.cpp: Removed ScheduledURLNavigation::fire(). This class was never instantiated directly, and all subclasses override fire(), so this was unused code. For ScheduledRedirects and ScheduledLocationChange, use FrameLoader's new method to load the request as a client redirect. 2017-07-20 Chris Dumez Drop legacy XPathException type https://bugs.webkit.org/show_bug.cgi?id=174679 Reviewed by Sam Weinig. Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome no longer expose XPathException. Test: fast/dom/DOMException/XPathException-obsolete.html * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::createDOMException): * bindings/js/JSExceptionBase.cpp: (WebCore::toExceptionBase): * dom/DOMExceptions.in: * xml/XPathException.cpp: Removed. * xml/XPathException.h: Removed. * xml/XPathException.idl: Removed. * xml/XPathExpression.cpp: (WebCore::XPathExpression::evaluate): * xml/XPathParser.cpp: (WebCore::XPath::Parser::parseStatement): * xml/XPathResult.cpp: (WebCore::XPathResult::convertTo): (WebCore::XPathResult::numberValue): (WebCore::XPathResult::stringValue): (WebCore::XPathResult::booleanValue): (WebCore::XPathResult::singleNodeValue): (WebCore::XPathResult::snapshotLength): (WebCore::XPathResult::iterateNext): (WebCore::XPathResult::snapshotItem): 2017-07-20 Chris Dumez Unreviewed, rolling out r219706. Broke iOS build Reverted changeset: "Drop legacy XPathException type" https://bugs.webkit.org/show_bug.cgi?id=174679 http://trac.webkit.org/changeset/219706 2017-07-20 Chris Dumez Drop legacy XPathException type https://bugs.webkit.org/show_bug.cgi?id=174679 Reviewed by Sam Weinig. Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome no longer expose XPathException. Test: fast/dom/DOMException/XPathException-obsolete.html * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::createDOMException): * bindings/js/JSExceptionBase.cpp: (WebCore::toExceptionBase): * dom/DOMExceptions.in: * xml/XPathException.cpp: Removed. * xml/XPathException.h: Removed. * xml/XPathException.idl: Removed. * xml/XPathExpression.cpp: (WebCore::XPathExpression::evaluate): * xml/XPathParser.cpp: (WebCore::XPath::Parser::parseStatement): * xml/XPathResult.cpp: (WebCore::XPathResult::convertTo): (WebCore::XPathResult::numberValue): (WebCore::XPathResult::stringValue): (WebCore::XPathResult::booleanValue): (WebCore::XPathResult::singleNodeValue): (WebCore::XPathResult::snapshotLength): (WebCore::XPathResult::iterateNext): (WebCore::XPathResult::snapshotItem): 2017-07-20 Chris Dumez Regression(ITP): May get frequently logged out of wsj.com https://bugs.webkit.org/show_bug.cgi?id=174661 Reviewed by Geoffrey Garen. Add the concept of associated domains in the ResourceLoadObserver. We previously ignore loads to and from the same domains. We now do the same if the to and from domains are associated (i.e. owned by the same entity). For now, only add domains owned by Dow Jones & Company, Inc. to the list, to address login issues on wsj.com. No new tests, verified manually on wsj.com. * loader/ResourceLoadObserver.cpp: (WebCore::areDomainsAssociated): (WebCore::ResourceLoadObserver::logFrameNavigation): (WebCore::ResourceLoadObserver::logSubresourceLoading): (WebCore::ResourceLoadObserver::logWebSocketLoading): 2017-07-20 Chris Dumez Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable https://bugs.webkit.org/show_bug.cgi?id=174660 Reviewed by Geoffrey Garen. Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable. This essentially replaces a branch to figure out if the new size is less or greater than the current size by an assertion. * Modules/gamepad/Gamepad.cpp: (WebCore::Gamepad::Gamepad): * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::addReaction): * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::skipBuffer): * Modules/websockets/WebSocketDeflater.cpp: (WebCore::WebSocketDeflater::finish): * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::serializeSelector): * contentextensions/DFABytecodeCompiler.cpp: (WebCore::ContentExtensions::append): * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: (WebCore::gcryptEncrypt): (WebCore::gcryptDecrypt): * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp: (WebCore::gcryptDerive): * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::controllerDidConnect): * platform/gamepad/mac/HIDGamepadProvider.cpp: (WebCore::HIDGamepadProvider::deviceAdded): * platform/graphics/ImageBackingStore.h: (WebCore::ImageBackingStore::setSize): * platform/graphics/WOFFFileFormat.cpp: * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues): * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::InbandTextTrackPrivateAVF::resetCueValues): (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer): * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp: (WebCore::InbandTextTrackPrivateAVCF::readNativeSampleBuffer): * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::cfData): * platform/image-decoders/bmp/BMPImageDecoder.cpp: (WebCore::BMPImageDecoder::frameBufferAtIndex): * platform/image-decoders/ico/ICOImageDecoder.cpp: (WebCore::ICOImageDecoder::decode): * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: (WebCore::JPEGImageDecoder::frameBufferAtIndex): * platform/image-decoders/png/PNGImageDecoder.cpp: (WebCore::PNGImageDecoder::frameBufferAtIndex): (WebCore::PNGImageDecoder::readChunks): * platform/image-decoders/webp/WEBPImageDecoder.cpp: (WebCore::WEBPImageDecoder::frameBufferAtIndex): * platform/image-encoders/JPEGImageEncoder.cpp: (WebCore::compressRGBABigEndianToJPEG): * platform/text/DecodeEscapeSequences.h: (WebCore::URLEscapeSequence::decodeRun): * platform/text/SuffixTree.h: (WebCore::SuffixTree::Node::Node): * rendering/Grid.cpp: (WebCore::Grid::setNeedsItemsPlacement): * rendering/RenderTable.cpp: (WebCore::RenderTable::invalidateCachedColumns): 2017-07-20 Chris Dumez Regression(ITP): Can no longer log in on abc.go.com https://bugs.webkit.org/show_bug.cgi?id=174533 Reviewed by Geoffrey Garen. Add quirk for sp.auth.adobe.com which is used for SSO by web sites such as abc.go.com. This would otherwise cause adobe.com to be identified as a tracker and log in on abc.go.com would break. No new tests, tested manually on abc.go.com. * loader/ResourceLoadObserver.cpp: (WebCore::resourceNeedsSSOQuirk): (WebCore::ResourceLoadObserver::logSubresourceLoading): 2017-07-20 Antoine Quint Turn tests at media/modern-media-controls/start-support back on https://bugs.webkit.org/show_bug.cgi?id=174683 Reviewed by Dean Jackson. Turning those tests back on revealed a small bug that is unlikely to really affect content on the Web. In the case where the size of the video is known right away, without the need for loading its metadata, as is the case in the start-support-click-to-start.html test with a local media resource, all queued layouts are flushed at once and we may call the layout() method of the left ButtonsContainer which originally is set to contain the play/pause button, which would remove the play/pause button from the center of the media. So before we potentially set the play/pause button as the central button, we first assign the default button set for the two ButtonsContainer instances and only add the play/pause button when we're not showing the prominent play/pause button. * Modules/modern-media-controls/controls/inline-media-controls.js: (InlineMediaControls.prototype.layout): (InlineMediaControls.prototype._leftContainerButtons): 2017-07-20 Chris Dumez Drop legacy FileException type https://bugs.webkit.org/show_bug.cgi?id=174676 Reviewed by Alex Christensen. Drop legacy FileException type and use DOMException instead, as per the latest File API specification: - https://w3c.github.io/FileAPI/#ErrorAndException Both Firefox and Chrome no longer expose FileException. * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::createDOMException): * dom/DOMExceptions.in: * fileapi/FileException.cpp: Removed. * fileapi/FileException.h: Removed. * fileapi/FileException.idl: Removed. * fileapi/FileReaderLoader.cpp: (WebCore::FileReaderLoader::FileReaderLoader): (WebCore::FileReaderLoader::failed): * fileapi/FileReaderLoader.h: (WebCore::FileReaderLoader::errorCode): * fileapi/FileReaderSync.cpp: (WebCore::errorCodeToExceptionCode): (WebCore::FileReaderSync::startLoading): 2017-07-20 Sam Weinig [WebIDL] Remove custom bindings for InspectorFrontendHost https://bugs.webkit.org/show_bug.cgi?id=174659 Reviewed by Chris Dumez. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/JSInspectorFrontendHostCustom.cpp: Removed. Remove JSInspectorFrontendHostCustom.cpp. * inspector/InspectorFrontendHost.cpp: (WebCore::populateContextMenu): (WebCore::InspectorFrontendHost::showContextMenu): * inspector/InspectorFrontendHost.h: * inspector/InspectorFrontendHost.idl: Re-implement showContextMenu by using an IDL defined ContextMenuItem dictionary and converting from that to a WebCore::ContextMenu in the implementation. 2017-07-20 Charlie Turner [GTK] Layout Test http/tests/media/hls/hls-progress.html is failing https://bugs.webkit.org/show_bug.cgi?id=141469 Reviewed by Xabier Rodriguez-Calvar. A work-around for getting progress information in a timely manner from live pipelines. We cannot rely on getting BUFFERING messages within the stalled time window (3s), so we have to poll for progress information somehow. Makes the following pass reliably http/tests/media/hls/hls-audio-tracks-has-audio.html passed unexpectedly http/tests/media/hls/hls-audio-tracks.html passed unexpectedly http/tests/media/hls/hls-progress.html passed unexpectedly * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::findHLSQueue): (WebCore::isHLSProgressing): (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired): 2017-07-20 Andreas Kling Minor Node->Element type tightening fixes https://bugs.webkit.org/show_bug.cgi?id=174651 Reviewed by Sam Weinig. Tighten up some Node* into Element* or even better, Element&. * dom/Document.cpp: (WebCore::acceptsEditingFocus): Take a const Element&. (WebCore::Document::setFocusedElement): * editing/Editor.cpp: (WebCore::Editor::findEventTargetFrom): Return an Element*. (WebCore::Editor::findEventTargetFromSelection): Ditto. (WebCore::Editor::pasteAsPlainText): (WebCore::Editor::pasteAsFragment): (WebCore::Editor::dispatchCPPEvent): * editing/Editor.h: * page/DragController.cpp: (WebCore::DragController::dispatchTextInputEventFor): 2017-07-20 Brady Eidson WKHTTPCookieStore API tests fail on High Sierra. and https://bugs.webkit.org/show_bug.cgi?id=174666 Reviewed by Andy Estes. Covered by existing API tests. In r219567 I'd moved cookie storage observation off of NSHTTPCookieStorage and NSNotificationCenter to CFHTTPCookieStorage observation callbacks. This is because notifications were only sent for the default [NSHTTPCookieStorage sharedHTTPCookieStorage] and not any of the other ones we keep in flight. Unfortunately that SPI has been disabled in High Sierra. Fortunately we found a way we can get non-shared NSHTTPCookieStorages to send notifications that works everywhere. * platform/network/cocoa/CookieStorageObserver.h: * platform/network/cocoa/CookieStorageObserver.mm: (-[WebCookieObserverAdapter initWithObserver:]): (-[WebCookieObserverAdapter cookiesChangedNotificationHandler:]): (WebCore::CookieStorageObserver::create): (WebCore::CookieStorageObserver::CookieStorageObserver): (WebCore::CookieStorageObserver::~CookieStorageObserver): (WebCore::CookieStorageObserver::startObserving): Use a trick to call some SPI on non-shared NSHTTPCookieStorages to get them to send notifications. (WebCore::CookieStorageObserver::stopObserving): (WebCore::cookiesChanged): Deleted. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::cookieStorageObserver): 2017-07-20 Miguel Gomez [GStreamer] Some layout tests issue "g_mutex_clear() called on uninitialised or locked mutex" and flaky crash in ~MediaPlayerPrivateGStreamerBase https://bugs.webkit.org/show_bug.cgi?id=173952 Reviewed by Carlos Garcia Campos. Adjust MediaPlayerPrivateGStreamerBase to avoid concurrence problems with the GStreamer thread when destroying the object. Covered by existent tests. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): (WebCore::MediaPlayerPrivateGStreamerBase::repaint): (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint): 2017-07-19 Zan Dobersek [EME] Push CDMInstance, CDMPrivate and associated types into the Platform layer https://bugs.webkit.org/show_bug.cgi?id=174496 Reviewed by Xabier Rodriguez-Calvar. Move the CDMInstance and CDMPrivate interfaces into the platform layer, enabling implementations of specific key systems at that level, as well as integration with the MediaPlayerPrivate stack without any layering violations. While the platform layer still uses the WebCore namespace, the two interface files have now been moved under the platform/encryptedmedia/ directory and out of the Modules/encryptedmedia/ directory where the Web-facing API implementation resides. The two interfaces integrated closely with the Web-facing enumerations and dictionaries: MediaKeyMessageType, MediaKeySessionType, MediaKeyStatus, MediaKeySystemConfiguration, MediaKeySystemCapability, MediaKeysRequirement and MediaKeysRestrictions. Definitions of these types are also moved to the platform layer without any changes (apart from renaming), and the previous types now alias against the types now located in the platform layer. No new tests -- no change in behavior. * CMakeLists.txt: * Modules/encryptedmedia/CDM.cpp: * Modules/encryptedmedia/CDM.h: * Modules/encryptedmedia/MediaKeyMessageType.h: * Modules/encryptedmedia/MediaKeySessionType.h: * Modules/encryptedmedia/MediaKeyStatus.h: * Modules/encryptedmedia/MediaKeySystemAccess.cpp: * Modules/encryptedmedia/MediaKeySystemAccess.h: * Modules/encryptedmedia/MediaKeySystemConfiguration.h: * Modules/encryptedmedia/MediaKeySystemMediaCapability.h: * Modules/encryptedmedia/MediaKeysRequirement.h: * Modules/encryptedmedia/MediaKeysRestrictions.h: * platform/encryptedmedia/CDMInstance.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMInstance.h. * platform/encryptedmedia/CDMKeyStatus.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeyStatus.h. * platform/encryptedmedia/CDMKeySystemConfiguration.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySystemConfiguration.h. * platform/encryptedmedia/CDMMediaCapability.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySystemMediaCapability.h. * platform/encryptedmedia/CDMMessageType.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageType.h. * platform/encryptedmedia/CDMPrivate.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivate.h. * platform/encryptedmedia/CDMRequirement.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeysRequirement.h. * platform/encryptedmedia/CDMRestrictions.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeysRestrictions.h. * platform/encryptedmedia/CDMSessionType.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySessionType.h. 2017-07-19 Zan Dobersek Unreviewed follow-up to r219674. * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp: Remove the AsyncScrollingCoordinator.h header include that was added by accident. 2017-07-19 Zan Dobersek [CMake] Clean up Web Crypto build targets https://bugs.webkit.org/show_bug.cgi?id=174253 Reviewed by Alex Christensen. Gather the common WebCrypto source files in CMakeLists.txt, including them in the build unconditionally and instead relying on ENABLE_SUBTLE_CRYPTO build guards to exclude the code from compilation if the feature is disabled. PlatformGTK.cmake, PlatformMac.cmake and PlatformWPE.cmake can then remove duplicated build targets. PlatformMac.cmake still lists all the Mac-specific Web Crypto build targets. PlatformGTK.cmake and PlatformWPE.cmake now include GCrypt.cmake if the USE_GCRYPT variable is enabled. Both ports at the moment enable that variable though as they by default leverage a libgcrypt-based CrpytoDigest implementation in the PAL library. The new GCrypt.cmake file adds the libgcrypt-specific Web Crypto build targets to the build and also sets up libgcrypt include directiories and libraries. No new tests -- no change in behavior. * CMakeLists.txt: * PlatformGTK.cmake: * PlatformMac.cmake: * PlatformWPE.cmake: * platform/GCrypt.cmake: Added. 2017-07-19 Sam Weinig [WebIDL] Remove custom bindings for CommandLineAPIHost https://bugs.webkit.org/show_bug.cgi?id=174642 Reviewed by Joseph Pecoraro. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/JSCommandLineAPIHostCustom.cpp: Removed. Remove JSCommandLineAPIHostCustom.cpp. * bindings/js/JSDOMConvertObject.h: (WebCore::JSConverter::convert): Add missing JSConverter specialization for IDLObject. * inspector/CommandLineAPIHost.cpp: (WebCore::CommandLineAPIHost::inspect): (WebCore::listenerEntriesFromListenerInfo): (WebCore::CommandLineAPIHost::inspectedObject): (WebCore::CommandLineAPIHost::databaseId): (WebCore::CommandLineAPIHost::storageId): (WebCore::CommandLineAPIHost::inspectImpl): Deleted. (WebCore::CommandLineAPIHost::getEventListenersImpl): Deleted. (WebCore::CommandLineAPIHost::databaseIdImpl): Deleted. (WebCore::CommandLineAPIHost::storageIdImpl): Deleted. * inspector/CommandLineAPIHost.h: * inspector/CommandLineAPIHost.idl: Replace custom bindings with modern bindings affordances: dictionaries, records and sequences. 2017-07-19 Zan Dobersek Unreviewed CoordGraphics build fix. * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp: (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeViewportConstraints): This should be defined for the ScrollingCoordinatorCoordinatedGraphics class. Also fix the setFixedToViewport() call, fishing out the GraphicsLayer object from the ScrollingStateNode's LayerRepresentation. (WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints): Deleted. 2017-07-19 Chris Dumez Drop SQLException type https://bugs.webkit.org/show_bug.cgi?id=174665 Reviewed by Sam Weinig. Drop SQLException type. We never throw such exception. Also, Firefox and Chrome no longer expose this type. * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * Modules/webdatabase/SQLException.cpp: Removed. * Modules/webdatabase/SQLException.h: Removed. * Modules/webdatabase/SQLException.idl: Removed. * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::createDOMException): * bindings/js/JSExceptionBase.cpp: (WebCore::toExceptionBase): * dom/DOMExceptions.in: 2017-07-19 Wenson Hsieh Unreviewed, tweak a comment above TemporarySelectionOptionIgnoreSelectionChanges in Editor.cpp. The comment references the UI process, but it describes an entity in WebCore. This should have been generalized to instead refer to the client layer in general (i.e. WebKit1 or WebKit2). * editing/Editor.h: 2017-07-19 Simon Fraser getBoundingClientRects not updated for programmatic scrolls https://bugs.webkit.org/show_bug.cgi?id=174538 rdar://problem/33049012 Reviewed by Tim Horton. Baidu.com has two event handlers on its , and both query the input location with getBoundingClientRect() and the current pageYOffset (via jQuery), then try to scroll the input to the top of the screen. The bug is that programmatic scrolls did not immediately update the layout viewport rect, so the second call to getBoundingClientRect() would return stale coordinates, triggering an extra scroll. To fix this, undo the fix for r219320 which tried to keep getBoundingClientRect() current during unstable scroll updates by adding a shadow layout viewport rect. Instead, almost always update the layout viewport rect on FrameView, even during unstable visible rect updates, but not if content insets are being changed interactively, since changing viewport heights cause problems with bottom-fixed elements. Also, we need to compute a new layout viewport rect in FrameView::updateLayoutViewport() for programmatic scrolls. However, always updating the layout viewport triggered issues with the scrolling tree. The scrolling state tree fossilizes layer positions relative to a specific viewport rect, and that relationship has to be maintained. There are code paths that recompute fixed/sticky viewport constraints when the layout viewport has changed but we haven't done layout or recomputed layer positions (e.g. updating viewport-constrained layers via updateScrollCoordinatedLayersAfterFlush()) and in these cases using a new layout viewport for those computations results in an inconsistent scrolling tree. Fix this by not updating scrolling constraints every time we have to re-register scrolling nodes. updateScrollCoordinatedLayersAfterFlush() only needs to update the layer on the scrolling node (to handle tiled/non-tiled switches), so make updateScrollCoordinatedLayer() a little more fine-grained, and only update constraints when we've just computed layer geometry. This allows for different scrolling nodes to have constraints computed at different times, with different layout viewports, which happens. Two additional fixes were required to make bottom-fixed bars behave correctly. First, FrameView::computeLayoutViewportOrigin() had a bug where rounding of half-pixel values would cause it to fall into the if (visualViewport.height() > layoutViewport.height()) clause, but then fail to clamp for rubber-banding. Second, the FrameView::unscaledMaximumScrollPosition() was wrong after zooming on iOS, since it uses visibleSize() which is affected by page scale on iOS only (and the function wants scale-independent values). Fix with a hack that should be cleaned up via webkit.org/b/174648. Tested by existing tests. * page/FrameView.cpp: (WebCore::FrameView::computeUpdatedLayoutViewportRect): (WebCore::FrameView::computeLayoutViewportOrigin): (WebCore::FrameView::setLayoutViewportOverrideRect): (WebCore::FrameView::updateLayoutViewport): (WebCore::FrameView::unscaledMaximumScrollPosition): (WebCore::FrameView::documentToClientOffset): (WebCore::FrameView::setUnstableLayoutViewportRect): Deleted. * page/FrameView.h: * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): (WebCore::AsyncScrollingCoordinator::reconcileScrollingState): (WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions): (WebCore::AsyncScrollingCoordinator::updateNodeLayer): (WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints): (WebCore::AsyncScrollingCoordinator::updateViewportConstrainedNode): Deleted. * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.cpp: (WebCore::operator<<): * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::reconcileScrollingState): (WebCore::ScrollingCoordinator::updateNodeLayer): (WebCore::ScrollingCoordinator::updateNodeViewportConstraints): (WebCore::ScrollingCoordinator::updateViewportConstrainedNode): Deleted. * page/scrolling/ScrollingStateFixedNode.cpp: (WebCore::ScrollingStateFixedNode::updateConstraints): * page/scrolling/ScrollingStateStickyNode.cpp: (WebCore::ScrollingStateStickyNode::updateConstraints): (WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::commitTreeState): * page/scrolling/mac/ScrollingTreeFixedNode.mm: (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange): * page/scrolling/mac/ScrollingTreeStickyNode.mm: (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGeometry): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush): (WebCore::RenderLayerCompositor::updateBacking): (WebCore::RenderLayerCompositor::fixedRootBackgroundLayerChanged): (WebCore::RenderLayerCompositor::requiresCompositingForPosition): (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): (WebCore::RenderLayerCompositor::computeFixedViewportConstraints): (WebCore::RenderLayerCompositor::computeStickyViewportConstraints): (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): (WebCore::RenderLayerCompositor::didAddScrollingLayer): * rendering/RenderLayerCompositor.h: 2017-07-19 Megan Gardner Don't write file URLs to iOS Pasteboard https://bugs.webkit.org/show_bug.cgi?id=174647 Reviewed by Wenson Hsieh. Tests updated to reflect the changes. We are no longer vending file URLs in Drag & Drop and Copy/Paste. * editing/ios/EditorIOS.mm: (WebCore::Editor::writeImageToPasteboard): * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::write): 2017-07-19 Myles C. Maxfield Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap https://bugs.webkit.org/show_bug.cgi?id=174406 Reviewed by Simon Fraser. Reviewed by NOBODY. When the minimumFontSize API preference is set, we will increase the font size without increasing the line height. If the content specifies line-height as an absolute value, there can be two unfortunate results: - Adjacent lines in a paragraph can overlap - If the paragraph (or containin block or whatever) uses overflow: hidden, the first and last lines can be cut off and potentially indecipherable. Instead, we should use the minimum font size preference as a signal that we should increase the line-height as well as the font-size. Eventually, we will want to increase it by an amount proportional to the increase in font-size (which can be due to minimumFontSize, minimumLogicalFontSize, text autosizing, etc.). However, because minimumLogicalFontSize is on by default, this would cause a behavior change on many webpages which use small text, so such a change would be too risky right now. Instead, we can pretend that minimumFontSize is the only cause that text increases, and use this as the only signal to boost the corresponding line-height. Tests: fast/text/line-height-minimumFontSize-text-zoom.html fast/text/line-height-minimumFontSize-visual.html fast/text/line-height-minimumFontSize-zoom.html fast/text/line-height-minimumFontSize.html fast/text/line-height-minimumFontSize-autosize.html * css/StyleBuilderCustom.h: (WebCore::computeBaseSpecifiedFontSize): (WebCore::computeLineHeightMultiplierDueToFontSize): (WebCore::StyleBuilderCustom::applyValueLineHeight): (WebCore::StyleBuilderCustom::applyValueFill): (WebCore::StyleBuilderCustom::applyValueStroke): (WebCore::StyleBuilderCustom::applyValueContent): * rendering/TextAutoSizing.cpp: 2017-07-18 Myles C. Maxfield Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap https://bugs.webkit.org/show_bug.cgi?id=174406 Reviewed by Simon Fraser. When the minimumFontSize API preference is set, we will increase the font size without increasing the line height. If the content specifies line-height as an absolute value, there can be two unfortunate results: - Adjacent lines in a paragraph can overlap - If the paragraph (or containin block or whatever) uses overflow: hidden, the first and last lines can be cut off and potentially indecipherable. Instead, we should use the minimum font size preference as a signal that we should increase the line-height as well as the font-size. Eventually, we will want to increase it by an amount proportional to the increase in font-size (which can be due to minimumFontSize, minimumLogicalFontSize, text autosizing, etc.). However, because minimumLogicalFontSize is on by default, this would cause a behavior change on many webpages which use small text, so such a change would be too risky right now. Instead, we can pretend that minimumFontSize is the only cause that text increases, and use this as the only signal to boost the corresponding line-height. Tests: fast/text/line-height-minimumFontSize-text-zoom.html fast/text/line-height-minimumFontSize-visual.html fast/text/line-height-minimumFontSize-zoom.html fast/text/line-height-minimumFontSize.html fast/text/line-height-minimumFontSize-autosize.html * css/StyleBuilderCustom.h: (WebCore::computeBaseSpecifiedFontSize): (WebCore::computeLineHeightMultiplierDueToFontSize): (WebCore::StyleBuilderCustom::applyValueLineHeight): (WebCore::StyleBuilderCustom::applyValueFill): (WebCore::StyleBuilderCustom::applyValueStroke): (WebCore::StyleBuilderCustom::applyValueContent): * rendering/TextAutoSizing.cpp: 2017-07-19 Chris Dumez DOMException should not have its own toString() https://bugs.webkit.org/show_bug.cgi?id=174630 Reviewed by Sam Weinig. DOMException should not have its own toString() and should use the one from Error.prototype.toString() instead: - https://heycam.github.io/webidl/#idl-DOMException No new tests, rebaselined existing tests. * dom/DOMCoreException.idl: 2017-07-19 Antoine Quint [iOS] REGRESSION: Scrubbing media using built-in controls does not pause media https://bugs.webkit.org/show_bug.cgi?id=174650 Reviewed by Dean Jackson. We would only pause when scrubbing on macOS because we only listened to "mousedown" events on the scrubber's backing element to identify that the user had started interacting with the scrubber. Implementing the same technique on iOS required a little more work than just listening to "touchstart" events on the same element. On top of that, we needed to make sure that we would only respond to "touchstart" events on the slider's thumb, and not on the track, since only on macOS should the user be able to click anywhere on the track to scrub. So we turn off pointer-events for the on iOS only, and turn them back on specifically for the thumb. There is also some finessing when dealing with touch events where we need to track the identifier of the touch that started the user interaction. So we keep track of it in an ivar and wait until we get a "touchend" event where the changedTouches list contains a touch with that same identifier to ensure the same touch that initiates and ends the scrubbing interaction. Finally, we fix another issue that was uncovered while turning back on the ScrubbingSupport tests where we would not trash the cached _value ivar when we initiated scrubbing, which was important since we would mistakenly use the pre-srubbing value during a scrub. * Modules/modern-media-controls/controls/slider.css: (.ios .slider > input): (.slider > input::-webkit-slider-thumb): * Modules/modern-media-controls/controls/slider.js: (Slider.prototype.handleEvent): (Slider.prototype._handleMousedownEvent): (Slider.prototype._interactionEndTarget): (Slider.prototype._handleTouchstartEvent): (Slider.prototype._valueWillStartChanging): (Slider.prototype._valueDidStopChanging): (Slider.prototype._handleMouseupEvent): (Slider.prototype._handleTouchendEvent): 2017-07-19 Nan Wang AX: Web page reloaded when a node is labelling multiple childnodes https://bugs.webkit.org/show_bug.cgi?id=174655 Reviewed by Chris Fleizach. When we are asking for the aria-labelledby attribute of a node and its sibling is also labelled by the same node, we get into an infinite loop in textUnderElement since we only ignore one child. Added checks for siblings to avoid such loop. Test: accessibility/mac/aria-labelledby-multiple-child-crash.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::textUnderElement): 2017-07-19 Andy Estes Use a cast to work around clang's false -Wobjc-literal-conversion warnings https://bugs.webkit.org/show_bug.cgi?id=174631 Reviewed by Dan Bernstein. Instead of ignoring -Wobjc-literal-conversion, use a cast to work around rdar://problem/33383354. * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::write): 2017-07-19 Chris Dumez Make cross-origin properties enumerable https://bugs.webkit.org/show_bug.cgi?id=174576 Reviewed by Darin Adler. Makes cross-origin properties enumerable on Window and Location objects as per: - https://github.com/whatwg/html/pull/2777 This simplifies our code quite a bit. No new tests, updated existing tests. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): (WebCore::JSDOMWindow::getOwnPropertySlotByIndex): (WebCore::JSDOMWindow::getOwnPropertyNames): * bindings/js/JSLocationCustom.cpp: (WebCore::getOwnPropertySlotCommon): (WebCore::JSLocation::getOwnPropertyNames): * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): 2017-07-18 Carlos Alberto Lopez Perez [EME] Build failure with Clang-3.8 on InitDataRegistry.cpp https://bugs.webkit.org/show_bug.cgi?id=174628 Reviewed by Žan Doberšek. * Modules/encryptedmedia/InitDataRegistry.cpp: (WebCore::extractKeyIDsKeyids): Add an explicit cast to unsigned. 2017-07-19 Matt Lewis Unreviewed, rolling out r219646. The test added are failing on all platforms Reverted changeset: "Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap" https://bugs.webkit.org/show_bug.cgi?id=174406 http://trac.webkit.org/changeset/219646 2017-07-19 Yusuke Suzuki [WTF] Implement WTF::ThreadGroup https://bugs.webkit.org/show_bug.cgi?id=174081 Reviewed by Mark Lam. * page/ResourceUsageThread.h: 2017-07-18 Andy Estes [Xcode] Enable CLANG_WARN_RANGE_LOOP_ANALYSIS https://bugs.webkit.org/show_bug.cgi?id=174631 Reviewed by Tim Horton. * Configurations/Base.xcconfig: * rendering/Grid.cpp: (WebCore::Grid::insert): * rendering/RenderTreeAsText.cpp: (WebCore::write): * rendering/SimpleLineLayoutCoverage.cpp: (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage): 2017-07-18 Yusuke Suzuki WTF::Thread should have the threads stack bounds. https://bugs.webkit.org/show_bug.cgi?id=173975 Reviewed by Mark Lam. When creating WebThread, we first allocate WebCore::ThreadGlobalData in UI thread and share it with WebThread. The problem is that WebCore::ThreadGlobalData has CachedResourceRequestInitiators. It allocates AtomicString, which requires WTFThreadData. In this patch, we call WTF::initializeThreading() before allocating WebCore::ThreadGlobalData. And we also call AtomicString::init() before calling WebCore::ThreadGlobalData since WebCore::ThreadGlobalData allocates AtomicString. * platform/ios/wak/WebCoreThread.mm: (StartWebThread): 2017-07-18 Myles C. Maxfield Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap https://bugs.webkit.org/show_bug.cgi?id=174406 Reviewed by Simon Fraser. When the minimumFontSize API preference is set, we will increase the font size without increasing the line height. If the content specifies line-height as an absolute value, there can be two unfortunate results: - Adjacent lines in a paragraph can overlap - If the paragraph (or containin block or whatever) uses overflow: hidden, the first and last lines can be cut off and potentially indecipherable. Instead, we should use the minimum font size preference as a signal that we should increase the line-height as well as the font-size. Eventually, we will want to increase it by an amount proportional to the increase in font-size (which can be due to minimumFontSize, minimumLogicalFontSize, text autosizing, etc.). However, because minimumLogicalFontSize is on by default, this would cause a behavior change on many webpages which use small text, so such a change would be too risky right now. Instead, we can pretend that minimumFontSize is the only cause that text increases, and use this as the only signal to boost the corresponding line-height. Tests: fast/text/line-height-minimumFontSize-text-zoom.html fast/text/line-height-minimumFontSize-visual.html fast/text/line-height-minimumFontSize-zoom.html fast/text/line-height-minimumFontSize.html fast/text/line-height-minimumFontSize-autosize.html * css/StyleBuilderCustom.h: (WebCore::computeBaseSpecifiedFontSize): (WebCore::computeLineHeightMultiplierDueToFontSize): (WebCore::StyleBuilderCustom::applyValueLineHeight): (WebCore::StyleBuilderCustom::applyValueFill): (WebCore::StyleBuilderCustom::applyValueStroke): (WebCore::StyleBuilderCustom::applyValueContent): * rendering/TextAutoSizing.cpp: 2017-07-18 Zalan Bujtas Media controls are missing content in fullscreen when document has scroll offset. https://bugs.webkit.org/show_bug.cgi?id=174644 Reviewed by Simon Fraser. If a non-user initiated scrolling (result of resize for example) is processed asynchronously, it might leapfrog other, programatic scrollings and trigger unintentional scroll offsets (and turn into unwanted clippings). This patch ensures that both resize and top content inset change are translated into programatic scrolling. Unable to test full screen video. * page/FrameView.cpp: (WebCore::FrameView::setFrameRect): (WebCore::FrameView::topContentInsetDidChange): 2017-07-18 Andy Estes [Xcode] Enable CLANG_WARN_OBJC_LITERAL_CONVERSION https://bugs.webkit.org/show_bug.cgi?id=174631 Reviewed by Sam Weinig. * Configurations/Base.xcconfig: * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::write): 2017-07-18 Ali Juma Align quirky number parsing with other browsers https://bugs.webkit.org/show_bug.cgi?id=155874 Reviewed by Simon Fraser. Parse unit-less non-zero values for animation-duration and transition-duration as invalid time values in quirks mode. Test: fast/css/animation-transition-duration-quirksmode.html * css/parser/CSSPropertyParser.cpp: (WebCore::consumeAnimationValue): 2017-07-18 Chris Dumez HysteresisActivity cannot be used in the UIProcess https://bugs.webkit.org/show_bug.cgi?id=174643 Reviewed by Tim Horton. Port HysteresisActivity to RunLoop::Timer so that it can safely be used in the UIProcess as well. * platform/HysteresisActivity.h: 2017-07-18 Joseph Pecoraro Web Inspector: Modernize InjectedScriptSource https://bugs.webkit.org/show_bug.cgi?id=173890 Reviewed by Brian Burg. Covered by existing tests. * inspector/CommandLineAPIModuleSource.js: (CommandLineAPIImpl.prototype.copy): (CommandLineAPIImpl.prototype._inspect): Use RemoteObject, a new parameter. 2017-07-18 Ryosuke Niwa REGRESSION(r218910): Crash when password field changes to text field https://bugs.webkit.org/show_bug.cgi?id=174560 Reviewed by Zalan Bujtas. The crash was caused by textMarkerDataForFirstPositionInTextControl accessing a nullptr returned by getOrCreate. Unfortunately, in order to this fix bug while preserving the exact behavior would require synchronously creating a renderer for the editing host when the input type changed since we can't create an accessbility object out of a renderer-less node. Instead, revert back to pre-r218910 behavior of always using the text control element's axID when notifying the value change. While this is inconsistent with the way editing commands report content changes, I've since learned that VoiceOver has code to deal with this exact situation. Test: accessibility/mac/input-type-change-crash-2.html * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl): 2017-07-18 Matt Baker Web Inspector: Refactoring: replace InspectorCanvasAgent::CanvasEntry with a helper class https://bugs.webkit.org/show_bug.cgi?id=174311 Reviewed by Devin Rousso. This patch adds a helper class for tracking canvases and their data. The current approach of defining a helper structure in the agent's header is awkward to use and maintain, and won't scale well as more canvas instrumentation points and data are added. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: New file. * inspector/InspectorCanvas.cpp: Added. (WebCore::InspectorCanvas::create): (WebCore::InspectorCanvas::InspectorCanvas): (WebCore::InspectorCanvas::buildObjectForCanvas): * inspector/InspectorCanvas.h: Added. * inspector/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::InspectorCanvasAgent): (WebCore::InspectorCanvasAgent::enable): (WebCore::InspectorCanvasAgent::requestNode): (WebCore::InspectorCanvasAgent::requestContent): (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes): (WebCore::InspectorCanvasAgent::resolveCanvasContext): (WebCore::InspectorCanvasAgent::frameNavigated): (WebCore::InspectorCanvasAgent::didCreateCSSCanvas): (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes): (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext): (WebCore::InspectorCanvasAgent::didChangeCanvasMemory): (WebCore::InspectorCanvasAgent::canvasDestroyed): (WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired): (WebCore::InspectorCanvasAgent::clearCanvasData): (WebCore::InspectorCanvasAgent::unbindCanvas): (WebCore::InspectorCanvasAgent::assertInspectorCanvas): (WebCore::InspectorCanvasAgent::findInspectorCanvas): (WebCore::InspectorCanvasAgent::getCanvasEntry): Deleted. (WebCore::InspectorCanvasAgent::buildObjectForCanvas): Deleted. * inspector/InspectorCanvasAgent.h: * inspector/InspectorController.cpp: (WebCore::InspectorController::InspectorController): Remove unused constructor argument. 2017-07-18 Basuke Suzuki [Curl] Move detail implementation from ResourceHandle to ResourceHandleInternal https://bugs.webkit.org/show_bug.cgi?id=174641 After moving stuff from ResourceHandleManager to ResourceHandle on https://bugs.webkit.org/show_bug.cgi?id=173630, still there're many violation remains between ResourceHandle and ResourceHandleInternal classes. Many of implementation detail should be move to ResourceHandleInternal to improve build speed. Reviewed by Alex Christensen. * platform/network/ResourceHandle.h: * platform/network/ResourceHandleInternal.h: (WebCore::ResourceHandleInternal::ResourceHandleInternal): * platform/network/curl/ResourceHandleCurl.cpp: (WebCore::ResourceHandleInternal::~ResourceHandleInternal): (WebCore::ResourceHandle::start): (WebCore::ResourceHandle::cancel): (WebCore::ResourceHandleInternal::initialize): (WebCore::ResourceHandleInternal::applyAuthentication): (WebCore::ResourceHandleInternal::setupPUT): (WebCore::ResourceHandleInternal::setupPOST): (WebCore::ResourceHandleInternal::setupFormData): (WebCore::ResourceHandle::platformSetDefersLoading): (WebCore::ResourceHandleInternal::didFinish): (WebCore::ResourceHandleInternal::didFail): (WebCore::ResourceHandleInternal::calculateWebTimingInformations): (WebCore::ResourceHandleInternal::handleLocalReceiveResponse): (WebCore::ResourceHandleInternal::willPrepareSendData): (WebCore::ResourceHandleInternal::didReceiveHeaderLine): (WebCore::ResourceHandleInternal::didReceiveAllHeaders): (WebCore::ResourceHandleInternal::didReceiveContentData): (WebCore::ResourceHandleInternal::readCallback): (WebCore::ResourceHandleInternal::headerCallback): (WebCore::ResourceHandleInternal::writeCallback): (WebCore::ResourceHandle::platformLoadResourceSynchronously): (WebCore::ResourceHandleInternal::dispatchSynchronousJob): (WebCore::ResourceHandleInternal::handleDataURL): (WebCore::ResourceHandle::initialize): Deleted. (WebCore::ResourceHandle::applyAuthentication): Deleted. (WebCore::ResourceHandle::setupPUT): Deleted. (WebCore::ResourceHandle::setupPOST): Deleted. (WebCore::ResourceHandle::setupFormData): Deleted. (WebCore::ResourceHandle::didFinish): Deleted. (WebCore::ResourceHandle::didFail): Deleted. (WebCore::ResourceHandle::calculateWebTimingInformations): Deleted. (WebCore::ResourceHandle::handleLocalReceiveResponse): Deleted. (WebCore::ResourceHandle::willPrepareSendData): Deleted. (WebCore::ResourceHandle::didReceiveHeaderLine): Deleted. (WebCore::ResourceHandle::didReceiveAllHeaders): Deleted. (WebCore::ResourceHandle::didReceiveContentData): Deleted. (WebCore::ResourceHandle::readCallback): Deleted. (WebCore::ResourceHandle::headerCallback): Deleted. (WebCore::ResourceHandle::writeCallback): Deleted. (WebCore::ResourceHandle::dispatchSynchronousJob): Deleted. (WebCore::ResourceHandle::handleDataURL): Deleted. 2017-07-18 Andy Estes [Xcode] Enable CLANG_WARN_NON_LITERAL_NULL_CONVERSION https://bugs.webkit.org/show_bug.cgi?id=174631 Reviewed by Dan Bernstein. * Configurations/Base.xcconfig: 2017-07-18 Antoine Quint [macOS] Mouse pointer does not hide during fullscreen playback https://bugs.webkit.org/show_bug.cgi?id=174638 Reviewed by Dean Jackson. Test: media/modern-media-controls/css/webkit-cursor-visibility-auto-hide.html The user-agent stylesheet sets the "-webkit-cursor-visibility" to "auto-hide" for fullscreen