2018-12-17 Zalan Bujtas Reproducible ASSERTion failure when toggling layer borders with find-in-page up https://bugs.webkit.org/show_bug.cgi?id=192762 Reviewed by Simon Fraser. DocumentMarkerController::markersFor() should take a reference instead of a Node*. Test: editing/document-marker-null-check.html * dom/DocumentMarkerController.cpp: (DocumentMarkerController::hasMarkers): * dom/DocumentMarkerController.h: * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::respondToChangedSelection): * editing/Editor.cpp: (WebCore::Editor::selectionStartHasMarkerFor const): * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const): * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::paint): * rendering/RenderText.cpp: (WebCore::RenderText::draggedContentRangesBetweenOffsets const): * rendering/SimpleLineLayout.cpp: (WebCore::SimpleLineLayout::canUseForWithReason): * testing/Internals.cpp: (WebCore::Internals::markerCountForNode): 2018-12-17 Commit Queue Unreviewed, rolling out r239265 and r239274. https://bugs.webkit.org/show_bug.cgi?id=192765 unorm_normalize is deprecated, and broke an internal build (Requested by Truitt on #webkit). Reverted changesets: "[GTK][WPE] Need a function to convert internal URI to display ("pretty") URI" https://bugs.webkit.org/show_bug.cgi?id=174816 https://trac.webkit.org/changeset/239265 "Fix the Apple Internal Mac build with a newer SDK" https://trac.webkit.org/changeset/239274 2018-12-17 Daniel Bates [iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:] https://bugs.webkit.org/show_bug.cgi?id=192633 Reviewed by Wenson Hsieh. UIKit has long adopted the newer -[WebEvent initWithKeyEventType:] initializer that takes an input manager hint. We no longer need to keep the variant -[WebEvent initWithKeyEventType:...:characterSet:] for binary compatibility. * platform/ios/WebEvent.h: * platform/ios/WebEvent.mm: (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): Deleted. 2018-12-17 Matt Lewis Unreviewed, rolling out r239254. This broke the Windows 10 Debug build Reverted changeset: "Replace many uses of String::format with more type-safe alternatives" https://bugs.webkit.org/show_bug.cgi?id=192742 https://trac.webkit.org/changeset/239254 2018-12-17 Antoine Quint [Web Animations] Remove the redundant m_scheduledMicrotask from WebAnimation https://bugs.webkit.org/show_bug.cgi?id=192758 Reviewed by Dean Jackson. We tracked whether we had a pending microtask twice so we remove the m_scheduledMicrotask flag as m_finishNotificationStepsMicrotaskPending gives us enough information as it is. Additionally, we remove the scheduleMicrotaskIfNeeded() and performMicrotask() functions since there is less bookkeeping to perform. No new test since there is no user-observable change. * animation/WebAnimation.cpp: (WebCore::WebAnimation::updateFinishedState): (WebCore::WebAnimation::scheduleMicrotaskIfNeeded): Deleted. (WebCore::WebAnimation::performMicrotask): Deleted. * animation/WebAnimation.h: 2018-12-17 Antoine Quint [Web Animations] Ensure we don't update an animation's finished state twice when updating animations https://bugs.webkit.org/show_bug.cgi?id=192757 Reviewed by Dean Jackson. When animations are udpated and DocumentTimeline::updateAnimationsAndSendEvents() is called, we used to update an animation's finished state twice since we'd do it once when calling tick() and once again when calling resolve() in the ensuing style invalidation. We now keep track of whether we've already updated an animation's finished state during animation update in the call to tick() and avoid updating in the immediate next call to resolve(), unless any of the timing properties have changed in the meantime. No new test since there is no user-observable change. * animation/WebAnimation.cpp: (WebCore::WebAnimation::timingDidChange): (WebCore::WebAnimation::tick): (WebCore::WebAnimation::resolve): * animation/WebAnimation.h: 2018-12-17 Simon Fraser REGRESSION (r233268): Elements animated in from offscreen sometimes don't display https://bugs.webkit.org/show_bug.cgi?id=192725 rdar://problem/46011418 Reviewed by Antoine Quint. There were two problems with backing store attachment and animation. First, animations are an input into the "backing store attached" logic, so when they change we should set the CoverageRectChanged bit on GraphicsLayerCA. Secondly, when an ancestor has unknown animation extent, all its descendants need to get backing store, so we need to set childCommitState.ancestorWithTransformAnimationIntersectsCoverageRect when the current layer has no animation extent. Tests: compositing/backing/animate-into-view-with-descendant.html compositing/backing/animate-into-view.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::addAnimation): (WebCore::GraphicsLayerCA::removeAnimation): (WebCore::GraphicsLayerCA::recursiveCommitChanges): 2018-12-17 Zalan Bujtas [LFC][BFC][MarginCollapsing] Unify margin collapse function naming https://bugs.webkit.org/show_bug.cgi?id=192747 Reviewed by Antti Koivisto. Rename some margin collapse getters. * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter): (WebCore::Layout::isMarginBeforeCollapsedWithSibling): Deleted. (WebCore::Layout::isMarginAfterCollapsedWithSibling): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent): Deleted. (WebCore::Layout::isMarginAfterCollapsedThrough): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter): Deleted. 2018-12-17 David Kilzer clang-tidy: loop variable is copied but only used as const reference in WebCore, WebKit, Tools Reviewed by Daniel Bates. Change loop variables to const references to avoid unnecessary copies. * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp: (WebCore::IDBServer::MemoryBackingStoreTransaction::abort): * Modules/indexeddb/server/MemoryObjectStore.cpp: (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords): * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange): * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp: (WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers): * Modules/indexeddb/shared/IDBDatabaseInfo.cpp: (WebCore::IDBDatabaseInfo::IDBDatabaseInfo): (WebCore::IDBDatabaseInfo::loggingString const): * Modules/mediasource/SourceBuffer.cpp: (WebCore::removeSamplesFromTrackBuffer): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const): * accessibility/AccessibilityTableRow.cpp: (WebCore::AccessibilityTableRow::headerObject): * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::computedNeedsForcedLayout): * crypto/keys/CryptoKeyRSA.cpp: (WebCore::CryptoKeyRSA::importJwk): (WebCore::CryptoKeyRSA::exportJwk const): * css/CSSComputedStyleDeclaration.cpp: (WebCore::OrderedNamedLinesCollector::appendLines const): * dom/DataTransfer.cpp: (WebCore::readURLsFromPasteboardAsString): * dom/TreeScope.cpp: (WebCore::TreeScope::elementsFromPoint): * html/track/WebVTTParser.cpp: (WebCore::WebVTTParser::checkAndStoreRegion): * inspector/agents/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::setInstruments): * page/Page.cpp: (WebCore::Page::updateIntersectionObservations): * page/TextIndicator.cpp: (WebCore::estimatedBackgroundColorForRange): * page/animation/KeyframeAnimation.cpp: (WebCore::KeyframeAnimation::computeLayoutDependency): * platform/graphics/DisplayRefreshMonitorManager.cpp: (WebCore::DisplayRefreshMonitorManager::displayWasUpdated): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::moveOrCopyAnimations): (WebCore::GraphicsLayerCA::updateAnimations): (WebCore::GraphicsLayerCA::isRunningTransformAnimation const): * platform/graphics/mac/ImageMac.mm: (WebCore::BitmapImage::tiffRepresentation): * rendering/HitTestResult.cpp: (WebCore::HitTestResult::append): * testing/Internals.cpp: (WebCore::Internals::acceleratedAnimationsForElement): 2018-12-17 Ms2ger [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI https://bugs.webkit.org/show_bug.cgi?id=174816 Reviewed by Michael Catanzaro. Tests: enabled fast/url/user-visible/. * testing/Internals.cpp: (WebCore::Internals::userVisibleString): Enable method on all platforms. 2018-12-15 Yusuke Suzuki Null pointer dereference in JSC::WriteBarrierBase() https://bugs.webkit.org/show_bug.cgi?id=191252 Reviewed by Keith Miller. * bindings/js/JSCustomElementRegistryCustom.cpp: (WebCore::JSCustomElementRegistry::whenDefined): * bindings/js/JSDOMPromiseDeferred.cpp: (WebCore::createDeferredPromise): * bindings/js/JSDOMPromiseDeferred.h: (WebCore::DeferredPromise::create): (WebCore::callPromiseFunction): * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::moduleLoaderFetch): (WebCore::JSDOMWindowBase::moduleLoaderImportModule): * bindings/js/ScriptModuleLoader.cpp: (WebCore::ScriptModuleLoader::fetch): (WebCore::rejectPromise): 2018-12-15 Darin Adler Use warning-ignoring macros more consistently and simply https://bugs.webkit.org/show_bug.cgi?id=192743 Reviewed by Mark Lam. * bridge/objc/WebScriptObject.mm: Use IGNORE_WARNINGS_BEGIN rather than IGNORE_CLANG_WARNINGS_BEGIN here. There is no need to compile Objective-C++ files like this one with non-clang compilers, and no need to worry about them when choosing the macro. * crypto/mac/CryptoKeyRSAMac.cpp: (WebCore::getPublicKeyComponents): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END. * css/makeprop.pl: Use IGNORE_WARNINGS_BEGIN/END, obviating the need for the "unknown-pragmas" trick, which the macro should take care of. * css/makevalues.pl: Ditto. * platform/ColorData.gperf: Ditto. * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::update): Use IGNORE_WARNINGS_BEGIN/END (see rationale above for Objective-C++). * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics): Use ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics): Ditto. * platform/ios/DragImageIOS.mm: Use IGNORE_WARNINGS_BEGIN/END (see rationale above for Objective-C++). * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]): Use ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END. * platform/mac/WebPlaybackControlsManager.mm: Use IGNORE_WARNINGS_BEGIN/END (see rationale above for Objective-C++). * platform/network/cocoa/ResourceResponseCocoa.mm: (WebCore::ResourceResponse::platformCertificateInfo const): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END. 2018-12-15 Darin Adler Replace many uses of String::format with more type-safe alternatives https://bugs.webkit.org/show_bug.cgi?id=192742 Reviewed by Mark Lam. A while back, String::format was more efficient than string concatenation, but that is no longer true, and we should prefer String::number, makeString, or concatenation with the "+" operator to String::format for new code. This is not as good for programmers who are fond of printf formatting style, and in some cases it's a little harder to read the strings interspersed with variables rather than a format string, but it's better in a few ways: - more efficient (I didn't measure the difference, but it's definitely slower to use String::Format which calls vsnprintf twice than to use the WTF code) - works in a type-safe way without a need to use a format specifier such as "%" PRIu64 or "%tu" making it much easier to avoid problems due to subtle differences between platforms - allows us to use StringView in some cases to sidestep the need to allocate temporary WTF::String objects - does not require converting each WTF::String to a C string, allowing us to remove many cases of ".utf8().data()" and similar expressions, eliminating the allocation of temporary WTF::CString objects This patch covers a batch of easiest-to-convert call sites. Later patches will allow us to deprecate or remove String::format. * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString. * Modules/indexeddb/shared/IDBCursorInfo.cpp: (WebCore::IDBCursorInfo::loggingString const): Ditto. * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp: (WebCore::IDBGetAllRecordsData::loggingString const): Ditto. * Modules/indexeddb/shared/IDBGetRecordData.cpp: (WebCore::IDBGetRecordData::loggingString const): Ditto. * Modules/indexeddb/shared/IDBIndexInfo.cpp: (WebCore::IDBIndexInfo::loggingString const): Ditto. (WebCore::IDBIndexInfo::condensedLoggingString const): Ditto. * Modules/indexeddb/shared/IDBIterateCursorData.cpp: (WebCore::IDBIterateCursorData::loggingString const): Ditto. * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp: (WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto. * Modules/indexeddb/shared/IDBResourceIdentifier.cpp: (WebCore::IDBResourceIdentifier::loggingString const): Ditto. * Modules/webdatabase/Database.cpp: (WebCore::formatErrorMessage): Ditto. * Modules/webdatabase/SQLError.h: (WebCore::SQLError::create): Ditto. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): Use makeString. * bindings/scripts/test/JS/JSInterfaceName.cpp: * bindings/scripts/test/JS/JSMapLike.cpp: * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: * bindings/scripts/test/JS/JSTestCEReactions.cpp: * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: * bindings/scripts/test/JS/JSTestCallTracer.cpp: * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp: * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: * bindings/scripts/test/JS/JSTestDOMJIT.cpp: * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: * bindings/scripts/test/JS/JSTestEventConstructor.cpp: * bindings/scripts/test/JS/JSTestEventTarget.cpp: * bindings/scripts/test/JS/JSTestException.cpp: * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: * bindings/scripts/test/JS/JSTestGlobalObject.cpp: * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestInterface.cpp: * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: * bindings/scripts/test/JS/JSTestIterable.cpp: * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: * bindings/scripts/test/JS/JSTestNode.cpp: * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: * bindings/scripts/test/JS/JSTestPluginInterface.cpp: * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: * bindings/scripts/test/JS/JSTestSerialization.cpp: * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp: * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: * bindings/scripts/test/JS/JSTestStringifier.cpp: * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: * bindings/scripts/test/JS/JSTestTypedefs.cpp: Updated expected results. : * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseHexColor): Use String::number and makeString. * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::setLength): Use makeString. * html/ImageDocument.cpp: (WebCore::ImageDocument::imageUpdated): Ditto. * html/parser/XSSAuditor.cpp: (WebCore::XSSAuditor::init): Ditto. * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorFrontendClientLocal::setDockingUnavailable): Ditto. (WebCore::InspectorFrontendClientLocal::setAttachedWindow): Ditto. (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): Ditto. (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): Ditto. (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Ditto. * inspector/agents/InspectorCSSAgent.cpp: Ditto. * inspector/agents/InspectorIndexedDBAgent.cpp: Ditto. * page/MemoryRelease.cpp: (WebCore::logMemoryStatisticsAtTimeOfDeath): Ditto. * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::formatByteNumber): Use String::number. (WebCore::ResourceUsageOverlay::platformDraw): Use string concatenation. * page/cocoa/ResourceUsageThreadCocoa.mm: (WebCore::logFootprintComparison): Use makeString. * platform/animation/TimingFunction.cpp: (WebCore::TimingFunction::cssText const): Ditto. * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm: (WebCore::AVTrackPrivateAVFObjCImpl::id const): Use AtomicString::number. * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Ditto. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setContentsToSolidColor): Use makeString. (WebCore::GraphicsLayerCA::updateContentsImage): Ditto. (WebCore::GraphicsLayerCA::updateContentsRects): Ditto. (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): Ditto. * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawText): Ditto. * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Use String::number. * platform/network/ParsedContentRange.cpp: (WebCore::ParsedContentRange::headerValue const): Use makeString. * platform/network/cf/NetworkStorageSessionCFNet.cpp: Removed some unnecessary compiler conditionals and reorganized the start/stop of namespaces. (WebCore::NetworkStorageSession::switchToNewTestingSession): Use makeString. * platform/sql/SQLiteDatabase.cpp: (WebCore::unauthorizedSQLFunction): Use makeString. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::logLayerInfo): Ditto. * workers/service/server/RegistrationDatabase.cpp: (WebCore::RegistrationDatabase::ensureValidRecordsTable): Ditto. (WebCore::RegistrationDatabase::importRecords): Ditto. 2018-12-15 Youenn Fablet Make RTCRtpSender.setParameters to activate specific encodings https://bugs.webkit.org/show_bug.cgi?id=192732 Reviewed by Eric Carlson. The conversion between libwebrtc and WebCore is lossy for send parameters. Libwebrtc checking the differences of values, call to setParameters will often fail. Given some parameters cannot be exposed, the sender backend keeps the current set of parameters when gathered and reuses them when parameters are set. For encodings, we only change activate/maxBitRate/maxFrameRate as these are the most important parameters to be able to modify. Covered by added tests in webrtc/video.html. * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp: (WebCore::LibWebRTCRtpSenderBackend::getParameters const): (WebCore::LibWebRTCRtpSenderBackend::setParameters): * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::fromRTCRtpSendParameters): (WebCore::fromRTCEncodingParameters): Deleted. * Modules/mediastream/libwebrtc/LibWebRTCUtils.h: 2018-12-14 Joseph Pecoraro Web Inspector: Avoid creating and evaluating in the InspectorOverlay page on iOS as it is unused https://bugs.webkit.org/show_bug.cgi?id=192724 Reviewed by Devin Rousso. iOS never installs the InspectorOverlay page as a page overlay. It also uses its own node highlighting painting. Avoid any work and resources associated with the overlay page for iOS. * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::paint): (WebCore::InspectorOverlay::update): (WebCore::InspectorOverlay::overlayPage): (WebCore::evaluateCommandInOverlay): 2018-12-14 Youenn Fablet MediaRecorderPrivateAVFImpl should have a Ref as member https://bugs.webkit.org/show_bug.cgi?id=192720 Reviewed by Eric Carlson. Make sure that MediaRecorderPrivateAVFImpl takes a Ref as member, as the latter is a ref counted object. Made some refactoring to return early in case of error. Also made sure that in the case of a MediaRecorder stopped by a track removal in the recorded stream the MediaRecorder will stop listening for its tracks. Otherwise, the tracks will continue calling the MediaRecorder even after it is dead. Test: http/wpt/mediarecorder/MediaRecorder-onremovetrack.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::didAddOrRemoveTrack): (WebCore::MediaRecorder::setNewRecordingState): Deleted. * Modules/mediarecorder/MediaRecorder.h: * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::create): (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl): (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated): (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable): (WebCore::MediaRecorderPrivateAVFImpl::stopRecording): (WebCore::MediaRecorderPrivateAVFImpl::fetchData): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::create): (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter): (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::setupWriter): Deleted. 2018-12-14 Youenn Fablet getSenders/getReceivers() should not return closed transceiver senders/receivers https://bugs.webkit.org/show_bug.cgi?id=192706 Reviewed by Eric Carlson. Updated as per https://github.com/w3c/webrtc-pc/commit/85284b76baebf9e149d194e692be16a21768a91a This forces us to compute the sender/receiver list at getter call time. Updated the internal call sites of senders to use the list of transceivers instead. Covered by updated WPT tests. * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::addTrack): (WebCore::RTCPeerConnection::getSenders const): (WebCore::RTCPeerConnection::getReceivers const): * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/RTCRtpTransceiver.cpp: (WebCore::RTCRtpTransceiver::stopped const): (WebCore::RtpTransceiverSet::append): (WebCore::RtpTransceiverSet::senders const): (WebCore::RtpTransceiverSet::receivers const): * Modules/mediastream/RTCRtpTransceiver.h: (WebCore::RtpTransceiverSet::senders const): Deleted. (WebCore::RtpTransceiverSet::receivers const): Deleted. * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::findExistingSender): (WebCore::LibWebRTCPeerConnectionBackend::addTrack): 2018-12-14 David Kilzer clang-tidy: Fix unnecessary copy of objects for operator==() methods Reviewed by Andy Estes. * contentextensions/HashableActionList.h: (WebCore::ContentExtensions::HashableActionList::operator== const): (WebCore::ContentExtensions::HashableActionList::operator!= const): * platform/network/FormData.h: (WebCore::FormDataElement::EncodedFileData::operator== const): (WebCore::FormDataElement::EncodedBlobData::operator== const): - Change arguments from const to const reference to avoid copies. 2018-12-14 Jer Noble CRASH in CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession(WTF::String const&, WTF::Function&&) https://bugs.webkit.org/show_bug.cgi?id=192713 Reviewed by Eric Carlson. A callback is being called twice, and the second time has a null Promise. Instead of these callbacks being WTF::Function, make them WTF::CompletionHandlers, which self-nullify and have ASSERTS() that they are called once-and-only-once. * platform/encryptedmedia/CDMInstanceSession.h: * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::CDMInstanceSessionClearKey::closeSession): * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed): 2018-12-14 David Kilzer clang-tidy: Fix unnecessary object copies in WebCore/platform/graphics/avfoundation/objc/ Reviewed by Jer Noble. * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (WebCore::toSample): - Make argument a const reference. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: - Update method signatures for implementation changes. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::setAsset): (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesDidChange): (WebCore::MediaPlayerPrivateAVFoundationObjC::loadedTimeRangesDidChange): - Make RetainPtr<> argument an rvalue reference and use WTFMove(). (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange): - Make RetainPtr<> argument a const reference. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch): - Change for loop keys to be const references. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: - Update method signatures for implementation changes. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime): (WebCore::SourceBufferPrivateAVFObjC::seekToTime): - Make Mediatime arguments a const reference. 2018-12-14 Simon Fraser REGRESSION (r233268): contents of an animated element inside overflow:hidden disappear https://bugs.webkit.org/show_bug.cgi?id=188655 rdar://problem/43382687 Reviewed by Antoine Quint. The logic that computes animation extent, used by backing store attachment code, failed to account for the behavior where a keyframe animation with a missing 0% keyframe uses the transform from the unanimated style. This resulted in the computed extent being wrong, which caused us to remove the layer's backing store in some scenarios. Fix both animation code paths to use the renderer style if the first keyframe doesn't contain a transform. Tests: compositing/backing/backing-store-attachment-empty-keyframe.html legacy-animation-engine/compositing/backing/backing-store-attachment-empty-keyframe.html * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const): * page/animation/KeyframeAnimation.cpp: (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation const): 2018-12-14 Chris Dumez [PSON] Stop exposing PolicyAction::Suspend to WebCore https://bugs.webkit.org/show_bug.cgi?id=192701 Reviewed by Brady Eidson. Drop PolicyAction::Suspend enum value and stop dealing with it in WebCore. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::continueAfterContentPolicy): * loader/FrameLoaderTypes.h: * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): (WebCore::PolicyChecker::checkNewWindowPolicy): 2018-12-14 Youenn Fablet IDB should store RTCCertificate https://bugs.webkit.org/show_bug.cgi?id=192599 Reviewed by Brady Eidson. In case there is no script execution context, do not create a JS DOM wrapper for RTCCertificate. Instead, create an empty object so that the deserialization can still succeed. This should only impact IDB deserialization in the Network Process which does not need the actual JS DOM wrapper. Test: webrtc/certificates-indexeddb.html * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readTerminal): 2018-12-14 Zalan Bujtas [LFC][BFC] Transition to logical margin types. https://bugs.webkit.org/show_bug.cgi?id=192699 Reviewed by Antti Koivisto. This is in preparation for moving over to logical types. (This patch also transitions to singlular margin naming (verticalMargins -> VerticalMargin)) * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const): (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::complicatedCases): (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue): (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue): * layout/FormattingContextQuirks.cpp: (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight): * layout/MarginTypes.h: (WebCore::Layout::VerticalMargin::usedValues const): * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const): (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const): (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const): (WebCore::Layout::hasPrecomputedMarginBefore): (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const): (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const): (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const): Deleted. (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const): Deleted. (WebCore::Layout::hasPrecomputedMarginTop): Deleted. * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints): (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginAfter): (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBottom): Deleted. * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::hasMarginBeforeQuirkValue): (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight): (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore): (WebCore::Layout::hasMarginTopQuirkValue): Deleted. (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginTop): Deleted. * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::isMarginBeforeCollapsedWithSibling): (WebCore::Layout::isMarginAfterCollapsedWithSibling): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent): (WebCore::Layout::isMarginAfterCollapsedThrough): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter): (WebCore::Layout::isMarginTopCollapsedWithSibling): Deleted. (WebCore::Layout::isMarginBottomCollapsedWithSibling): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent): Deleted. (WebCore::Layout::isMarginBottomCollapsedThrough): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom): Deleted. * layout/displaytree/DisplayBox.cpp: (WebCore::Display::Box::Box): (WebCore::Display::Box::marginBox const): (WebCore::Display::Box::nonCollapsedMarginBox const): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::rectWithMargin const): (WebCore::Display::Box::estimatedMarginBefore const): (WebCore::Display::Box::setEstimatedMarginBefore): (WebCore::Display::Box::top const): (WebCore::Display::Box::topLeft const): (WebCore::Display::Box::setVerticalMargin): (WebCore::Display::Box::marginBefore const): (WebCore::Display::Box::marginStart const): (WebCore::Display::Box::marginAfter const): (WebCore::Display::Box::marginEnd const): (WebCore::Display::Box::nonCollapsedMarginBefore const): (WebCore::Display::Box::nonCollapsedMarginAfter const): (WebCore::Display::Box::nonComputedMarginStart const): (WebCore::Display::Box::nonComputedMarginEnd const): (WebCore::Display::Box::estimatedMarginTop const): Deleted. (WebCore::Display::Box::setEstimatedMarginTop): Deleted. (WebCore::Display::Box::marginTop const): Deleted. (WebCore::Display::Box::marginLeft const): Deleted. (WebCore::Display::Box::marginBottom const): Deleted. (WebCore::Display::Box::marginRight const): Deleted. (WebCore::Display::Box::nonCollapsedMarginTop const): Deleted. (WebCore::Display::Box::nonCollapsedMarginBottom const): Deleted. (WebCore::Display::Box::nonComputedMarginLeft const): Deleted. (WebCore::Display::Box::nonComputedMarginRight const): Deleted. * layout/floats/FloatAvoider.cpp: (WebCore::Layout::FloatAvoider::setHorizontalConstraints): (WebCore::Layout::FloatAvoider::initialHorizontalPosition const): (WebCore::Layout::FloatAvoider::overflowsContainingBlock const): * layout/floats/FloatAvoider.h: (WebCore::Layout::FloatAvoider::marginBefore const): (WebCore::Layout::FloatAvoider::marginAfter const): (WebCore::Layout::FloatAvoider::marginStart const): (WebCore::Layout::FloatAvoider::marginEnd const): (WebCore::Layout::FloatAvoider::marginBoxWidth const): (WebCore::Layout::FloatAvoider::marginTop const): Deleted. (WebCore::Layout::FloatAvoider::marginBottom const): Deleted. (WebCore::Layout::FloatAvoider::marginLeft const): Deleted. (WebCore::Layout::FloatAvoider::marginRight const): Deleted. * layout/floats/FloatBox.cpp: (WebCore::Layout::FloatBox::rect const): (WebCore::Layout::FloatBox::horizontalPositionCandidate): (WebCore::Layout::FloatBox::verticalPositionCandidate): (WebCore::Layout::FloatBox::initialVerticalPosition const): * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): 2018-12-14 Zalan Bujtas [LFC][BFC] Introduce VerticalMargin and HorizontalMargin types. https://bugs.webkit.org/show_bug.cgi?id=192692 Reviewed by Antti Koivisto. This is in preparation for completing block margin collapsing. * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::complicatedCases): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue): (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::LayoutState): * layout/LayoutUnits.h: (WebCore::Layout::HeightAndMargin::usedMarginValues const): Deleted. * layout/MarginTypes.h: Added. (WebCore::Layout::VerticalMargin::nonCollapsedValues const): (WebCore::Layout::VerticalMargin::collapsedValues const): (WebCore::Layout::VerticalMargin::setCollapsedValues): (WebCore::Layout::VerticalMargin::VerticalMargin): (WebCore::Layout::VerticalMargin::usedValues const): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight): * layout/displaytree/DisplayBox.cpp: (WebCore::Display::Box::Box): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::setHorizontalMargin): (WebCore::Display::Box::setVerticalMargin): (WebCore::Display::Box::setHorizontalNonComputedMargin): (WebCore::Display::Box::verticalMargin const): (WebCore::Display::Box::marginTop const): (WebCore::Display::Box::marginLeft const): (WebCore::Display::Box::marginBottom const): (WebCore::Display::Box::marginRight const): (WebCore::Display::Box::nonCollapsedMarginTop const): (WebCore::Display::Box::nonCollapsedMarginBottom const): (WebCore::Display::Box::setVerticalNonCollapsedMargin): Deleted. * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const): 2018-12-14 Fujii Hironori [Win][Clang] Fix compilation warnings under Source/WebCore/platform/win https://bugs.webkit.org/show_bug.cgi?id=192693 Reviewed by Ross Kirsling. No new tests, no behavior changes. * platform/win/ClipboardUtilitiesWin.cpp: Reordered ClipboardDataItem members to match with the initializer list. * platform/win/CursorWin.cpp: (WebCore::loadCursorByName): Changed the argument type of 'name' to const char*. * platform/win/DefWndProcWindowClass.cpp: (WebCore::defWndProcWindowClassName): Removed an unused variable 'atom'. * platform/win/DragImageWin.cpp: Removed an unused variable 'MinDragLabelWidthBeforeClip'. * platform/win/PasteboardWin.cpp: (WebCore::createGlobalImageFileDescriptor): Removed an unused variable 'hr'. (WebCore::createGlobalHDropContent): Use reinterpret_cast to suppress warning. * platform/win/PlatformMouseEventWin.cpp: (WebCore::PlatformMouseEvent::PlatformMouseEvent): Reordered the initializer list. * platform/win/PopupMenuWin.cpp: (WebCore::PopupMenuWin::paint): Removed an unused variable 'itemCount'. * platform/win/PopupMenuWin.h: Marked override methods with 'override'. * platform/win/SSLKeyGeneratorWin.cpp: (WebCore::getSupportedKeySizes): Removed WebCore namespace prefix in WebCore namespace. (WebCore::signedPublicKeyAndChallengeString): Ditto. * platform/win/SearchPopupMenuDB.cpp: (WebCore::SearchPopupMenuDB::createPreparedStatement): Use ASSERT_UNUSED instead of ASSERT. * platform/win/StructuredExceptionHandlerSuppressor.h: Enclosed m_savedExceptionRegistration with #if defined(_M_IX86). * platform/win/SystemInfo.cpp: (WebCore::osVersionForUAString): Added default case. 2018-12-13 Youenn Fablet RTCRtpTransceiver.stopped should be true when applying a remote description with the corresponding m section rejected https://bugs.webkit.org/show_bug.cgi?id=192685 Reviewed by Eric Carlson. In case the remote description contains a rejected m section, the corresponding transceiver should be marked as stopped. Libwebrtc backend has that information so pipe it up to JS. Covered by updated WPT test. * Modules/mediastream/RTCRtpTransceiver.cpp: (WebCore::RTCRtpTransceiver::stopped const): * Modules/mediastream/RTCRtpTransceiver.h: (WebCore::RTCRtpTransceiver::stopped const): Deleted. * Modules/mediastream/RTCRtpTransceiverBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp: (WebCore::LibWebRTCRtpTransceiverBackend::stopped const): * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h: 2018-12-13 Mark Lam Ensure that StructureFlags initialization always starts with Base::StructureFlags. https://bugs.webkit.org/show_bug.cgi?id=192686 Reviewed by Keith Miller. No new tests needed because there's no new functionality. Just refactoring. * bindings/js/JSDOMWindowProperties.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GeneratePrototypeDeclaration): * bindings/scripts/test/JS/JSTestActiveDOMObject.h: * bindings/scripts/test/JS/JSTestEnabledBySetting.h: * bindings/scripts/test/JS/JSTestEventTarget.h: * bindings/scripts/test/JS/JSTestGlobalObject.h: * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h: * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h: * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h: * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h: * bindings/scripts/test/JS/JSTestObj.h: * bindings/scripts/test/JS/JSTestOverrideBuiltins.h: * bindings/scripts/test/JS/JSTestPluginInterface.h: * bindings/scripts/test/JS/JSTestTypedefs.h: 2018-12-13 Ryosuke Niwa Make HTMLConverter work across shadow boundaries https://bugs.webkit.org/show_bug.cgi?id=192640 Reviewed by Wenson Hsieh. Made HTMLConverter work with shadow boundaries by replacing the various tree traversal functions. Tests: editing/mac/attributed-string/attributed-string-across-shadow-boundaries-1.html editing/mac/attributed-string/attributed-string-across-shadow-boundaries-2.html editing/mac/attributed-string/attributed-string-across-shadow-boundaries-3.html editing/mac/attributed-string/attributed-string-across-shadow-boundaries-4.html editing/mac/attributed-string/attributed-string-across-shadow-boundaries-5.html editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-1.html editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-2.html editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-3.html * dom/Position.cpp: (WebCore::commonShadowIncludingAncestor): Moved from markup.cpp to be shared between HTMLConverter and serializePreservingVisualAppearanceInternal. * dom/Position.h: * editing/cocoa/HTMLConverter.mm: (HTMLConverter::convert): (HTMLConverterCaches::propertyValueForNode): (HTMLConverterCaches::floatPropertyValueForNode): (HTMLConverter::_blockLevelElementForNode): (HTMLConverterCaches::colorPropertyValueForNode): (HTMLConverter::aggregatedAttributesForAncestors): (HTMLConverter::aggregatedAttributesForElementAndItsAncestors): (HTMLConverter::_processElement): (HTMLConverter::_traverseNode): (HTMLConverter::_traverseFooterNode): (HTMLConverterCaches::cacheAncestorsOfStartToBeConverted): (WebCore::attributedStringFromSelection): * editing/markup.cpp: (WebCore::commonShadowIncludingAncestor): Moved to Position.cpp. 2018-12-13 Youenn Fablet Trying to play a media element synchronously after setting srcObject should succeed without user gesture https://bugs.webkit.org/show_bug.cgi?id=192679 Reviewed by Eric Carlson. Check the srcObject mediaProvider value which is set synchronously. Covered by updated fast/mediastream/local-audio-playing-event.html. * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::hasMediaStreamSrcObject const): 2018-12-13 Wenson Hsieh [iOS] Support dropping contact card data (public.vcard) in editable content https://bugs.webkit.org/show_bug.cgi?id=192570 Reviewed by Tim Horton. Adds support for accepting vCard (.vcf) data via drop on iOS. See below for more details. Tests: DragAndDropTests.ExternalSourceContactIntoEditableAreas DragAndDropTests.ExternalSourceMapItemAndContactToUploadArea DragAndDropTests.ExternalSourceMapItemIntoEditableAreas WKAttachmentTestsIOS.InsertDroppedContactAsAttachment WKAttachmentTestsIOS.InsertDroppedMapItemAsAttachment * editing/WebContentReader.h: * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::attachmentForFilePath): Pull out logic to create an attachment from a file path out into a static helper. Use this in `readFilePaths` as well as `readVirtualContactFile`. (WebCore::WebContentReader::readFilePaths): (WebCore::WebContentReader::readVirtualContactFile): Add a pasteboard reading method that reads a vCard file (with an optional URL) as web content. The resulting fragment consists of either an anchor and an attachment element, or just an attachment element if the URL is empty. In the case of an `MKMapItem`, the URL is populated, so we generate both elements; when dragging a contact, there is no associated URL, so we only have an attachment. * platform/Pasteboard.h: * platform/ios/PasteboardIOS.mm: (WebCore::Pasteboard::readPasteboardWebContentDataForType): Augment this to take the current `PasteboardItemInfo` as well; use this item information to get a file path for "public.vcard" data, which is then passed on to the web content reader. Additionally, by returning `ReaderResult::DidNotReadType` here, we prevent the web content reader from extracting the plain text contents of the vCard and dumping it as plain text in the editable element (this would otherwise happen, since "public.vcard" conforms to "public.text"). (WebCore::Pasteboard::read): (WebCore::Pasteboard::readRespectingUTIFidelities): * platform/ios/WebItemProviderPasteboard.mm: (-[NSItemProvider web_fileUploadContentTypes]): Prevent the "com.apple.mapkit.map-item" UTI from being considered as file upload content. This special case is tricky, since "com.apple.mapkit.map-item" conforms to "public.content", yet its corresponding data is only suitable for deserialization into an `MKMapItem`. 2018-12-13 Devin Rousso Web Inspector: remove DOM.BackendNodeId and associated commands/events https://bugs.webkit.org/show_bug.cgi?id=192478 Reviewed by Matt Baker. Removing unused code, so no change in functionality. * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::discardBindings): (WebCore::InspectorDOMAgent::backendNodeIdForNode): Deleted. (WebCore::InspectorDOMAgent::releaseBackendNodeIds): Deleted. (WebCore::InspectorDOMAgent::pushNodeByBackendIdToFrontend): Deleted. 2018-12-13 Chris Dumez [PSON] We should not need to navigate to 'about:blank' to suspend pages https://bugs.webkit.org/show_bug.cgi?id=192668 Reviewed by Alex Christensen. * history/PageCache.cpp: (WebCore::PageCache::addIfCacheable): * history/PageCache.h: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::redirectReceived): (WebCore::DocumentLoader::willSendRequest): (WebCore::DocumentLoader::startLoadingMainResource): * loader/DocumentLoader.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::init): (WebCore::FrameLoader::stopAllLoaders): (WebCore::FrameLoader::setDocumentLoader): (WebCore::FrameLoader::commitProvisionalLoad): (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): * loader/FrameLoaderTypes.h: * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): * loader/PolicyChecker.h: 2018-12-13 Per Arne Vollan [macOS] Inline WebVTT styles should override styles from Captions settings in System Preferences https://bugs.webkit.org/show_bug.cgi?id=192638 Reviewed by Eric Carlson. It is currently not possible to override caption styles generated from System Preferences with inline WebVTT styles without adding !important. The reason for this is that the generated styles from System preferences are author styles which have higher priority than the inline WebVTT styles, which are user agent styles in the video user agent shadow tree. This can be fixed by moving the generated styles to the video user agent shadow tree. Inline WebVTT styles will then have higher priority since they are added after the generated styles. This patch also fixes a problem where inline styles could be added twice to the video user agent shadow root. Test: media/track/track-cue-css.html * dom/ExtensionStyleSheets.cpp: (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const): * html/track/VTTCue.cpp: (WebCore::VTTCue::getDisplayTree): * page/CaptionUserPreferences.cpp: (WebCore::CaptionUserPreferences::setCaptionsStyleSheetOverride): * page/Page.cpp: (WebCore::Page::setCaptionUserPreferencesStyleSheet): 2018-12-13 Jer Noble Fix leak of AVPlayer boundaryTimeObserver object. https://bugs.webkit.org/show_bug.cgi?id=192674 Reviewed by Eric Carlson. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::performTaskAtMediaTime): 2018-12-13 Brent Fulgham Don't attempt to animate invalid CSS properties https://bugs.webkit.org/show_bug.cgi?id=192630 Reviewed by Antoine Quint. Inherited animation properties can cause child elements to think they need to animate CSS properties that they do not support, leading to nullptr crashes. Recognize that CSSPropertyInvalid is a potential requested animation property, and handle it cleanly. Tests: animations/invalid-property-animation.html * page/animation/CompositeAnimation.cpp: (WebCore::CompositeAnimation::updateTransitions): * svg/SVGAnimateElementBase.cpp: (WebCore::SVGAnimateElementBase::calculateAnimatedValue): 2018-12-13 Timothy Hatcher REGRESSION (r230064): Focus rings on webpages are fainter than in native UI. https://bugs.webkit.org/show_bug.cgi?id=192639 rdar://problem/42669297 Reviewed by Tim Horton. The focus ring color passed to CoreGraphics is expected to be opaque, since they will apply opacity when drawing (because opacity is normally animated). We were getting this by accident before when the old `RenderThemeMac::systemColor()` used the old `convertNSColorToColor()`, which ignored alpha on NSColor. Existing tests use fixed test focus ring color. * css/StyleResolver.cpp: (WebCore::StyleResolver::colorFromPrimitiveValue const): Use RenderTheme singleton for `focusRingColor()`. * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal): Ditto. * platform/graphics/cocoa/GraphicsContextCocoa.mm: (WebCore::drawFocusRingAtTime): Use `CGContextStateSaver`. * platform/mac/ThemeMac.mm: (WebCore::drawCellFocusRingWithFrameAtTime): Force alpha to 1 on the focus ring color. Use `CGContextStateSaver`. * rendering/RenderElement.cpp: (WebCore::RenderElement::paintFocusRing): Use RenderTheme singleton for `focusRingColor()`. * rendering/RenderImage.cpp: (WebCore::RenderImage::paintAreaElementFocusRing): Ditto. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::focusRingColor const): Made const. Cache the result of `platformFocusRingColor()`. * rendering/RenderTheme.h: Made `focusRingColor()` a member function instead of static. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::platformFocusRingColor const): Force alpha to 1 on the focus ring color. (WebCore::RenderThemeMac::systemColor const): Use `focusRingColor()`, instead of caching color here. 2018-12-13 Eric Carlson [MediaStream] Calculate width or height when constraints contain only the other https://bugs.webkit.org/show_bug.cgi?id=192632 Unreviewed, remove an unneeded assert. * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers): 2018-12-13 Zach Li Update Credit Card AutoFill button icon https://bugs.webkit.org/show_bug.cgi?id=192637 rdar://problem/46545006 Reviewed by Chris Dumez. * css/html.css: (input::-webkit-credit-card-auto-fill-button): 2018-12-13 Eric Carlson [MediaStream] Calculate width or height when constraints contain only the other https://bugs.webkit.org/show_bug.cgi?id=192632 Reviewed by Youenn Fablet. Test: fast/mediastream/constraint-intrinsic-size.html * platform/graphics/RemoteVideoSample.cpp: (WebCore::RemoteVideoSample::create): Log errors with RELEASE_LOG_ERROR. * platform/graphics/cv/ImageTransferSessionVT.h: (WebCore::ImageTransferSessionVT::pixelFormat const): New. * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::setSizeAndFrameRate): Replace current size with new size. (WebCore::RealtimeMediaSource::setSize): Don't notify about width and height. (WebCore::RealtimeMediaSource::size const): Use intrinsic size when necessary. (WebCore::RealtimeMediaSource::setIntrinsicSize): New. (WebCore::RealtimeMediaSource::remoteVideoSampleAvailable): Deleted. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers): No more remoteVideoSampleAvailable. * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::settings): Report size correctly. (WebCore::DisplayCaptureSourceCocoa::frameSize const): Use intrinsicSize(). (WebCore::DisplayCaptureSourceCocoa::emitFrame): No more remoteVideoSampleAvailable. (WebCore::DisplayCaptureSourceCocoa::setIntrinsicSize): Deleted. * platform/mediastream/mac/DisplayCaptureSourceCocoa.h: (WebCore::DisplayCaptureSourceCocoa::intrinsicSize const): Deleted. * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Report intrinsic size. (WebCore::MockRealtimeVideoSource::setSizeAndFrameRate): Minor cleanup. (WebCore::MockRealtimeVideoSource::setSizeAndFrameRateWithPreset): Report intrinsic size. (WebCore::MockRealtimeVideoSource::drawText): Don't render preset info for display source. * platform/mock/MockRealtimeVideoSource.h: 2018-12-13 David Kilzer clang-tidy: loop variable is copied but only used as const reference in Document.cpp, Element.cpp Reviewed by Daniel Bates. * dom/Document.cpp: (WebCore::Document::updateIntersectionObservations): (WebCore::Document::notifyIntersectionObserversTimerFired): * dom/Element.cpp: (WebCore::Element::didMoveToNewDocument): (WebCore::Element::disconnectFromIntersectionObservers): - Change loop variables from `auto` to `const auto&` to prevent unnecessary copies of WeakPtr or struct IntersectionObserverRegistration objects. 2018-12-13 Carlos Garcia Campos [FreeType] Remove HarfBuzzFace https://bugs.webkit.org/show_bug.cgi?id=192589 Reviewed by Michael Catanzaro. This was used to share the common implementation with the chromium port, but now that only freetype based ports use it, it can be removed and use hb_ft_face_create_cached() instead. We don't need the glyph cache either, since we are already caching glyphs in Font. * platform/FreeType.cmake: Remove HarfBuzzFaceCairo.cpp and HarfBuzzFace.cpp. * platform/graphics/FontPlatformData.h: Remove HarfBuzzFace member. * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: Add missing include. * platform/graphics/freetype/FontPlatformDataFreeType.cpp: (WebCore::FontPlatformData::operator=): Remove m_harfBuzzFace handling. (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): New funtction to create a hb_font_t for OpenType math. * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: (WebCore::floatToHarfBuzzPosition): Moved from HarfBuzzFaceCairo.cpp. (WebCore::doubleToHarfBuzzPosition): Ditto. (WebCore::harfBuzzFontFunctions): Also moved from HarfBuzzFaceCairo.cpp, but implement get_nominal/variation functions when using HarfBuzz >= 1.2.3 and use Font::glyphForCharacter() to make it simpler. (WebCore::fontFeatures): Moved from HarfBuzzFaceCairo.cpp. (WebCore::findScriptForVerticalGlyphSubstitution): Moved from HarfBuzzFace.cpp. (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Create the HarfBuzz face and font here. * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Removed. * platform/graphics/harfbuzz/HarfBuzzFace.h: Removed. * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Removed. * platform/graphics/harfbuzz/HbUniquePtr.h: (WebCore::HbPtrDeleter::operator() const): Add deleter for hb_face_t. * platform/graphics/opentype/OpenTypeMathData.cpp: (WebCore::OpenTypeMathData::OpenTypeMathData): Use FontPlatformData::createOpenTypeMathHarfBuzzFont(). 2018-12-12 Carlos Garcia Campos [FreeType] Add initial implementation of variation fonts https://bugs.webkit.org/show_bug.cgi?id=192151 Reviewed by Michael Catanzaro. * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::font): Remove platform ifdefs. * loader/cache/CachedFont.cpp: (WebCore::CachedFont::platformDataFromCustomData): Ditto. * platform/graphics/FontPlatformData.h: (WebCore::FontPlatformData::isFixedWidth const): * platform/graphics/cairo/FontCustomPlatformData.h: Use RefPtr for cairo_font_face_t. * platform/graphics/freetype/FontCacheFreeType.cpp: (WebCore::getFontPropertiesFromPattern): Helper function to get several font properties from the fontconfig pattern. (WebCore::FontCache::systemFallbackForCharacters): Use getFontPropertiesFromPattern(). (WebCore::FontCache::createFontPlatformData): Pass FC_VARIABLE to the pattern and call buildVariationSettings() before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern. (WebCore::defaultVariationValues): Parse font variations table. (WebCore::buildVariationSettings): Build a font variations string from the settings that can be passed to cairo. * platform/graphics/freetype/FontCacheFreeType.h: Added. * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: (WebCore::FontCustomPlatformData::FontCustomPlatformData): Use RefPtr and make freeTypeFaceKey global. (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Remove explicit destroy. (WebCore::defaultFontconfigOptions): Moved here from FontCacheFreeType. (WebCore::FontCustomPlatformData::fontPlatformData): Call buildVariationSettings() before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern. (WebCore::FontCustomPlatformData::supportsFormat): Add variation formats. * platform/graphics/freetype/FontPlatformDataFreeType.cpp: (WebCore::setCairoFontOptionsFromFontConfigPattern): Call cairo_font_options_set_variations() with the FC_FONT_VARIATIONS value from the pattern. (WebCore::FontPlatformData::FontPlatformData): Use a single constructor that always receives a valid fontconfig pattern. (WebCore::FontPlatformData::fcPattern const): Return the fontconfig pattern. (WebCore::FontPlatformData::platformIsEqual const): Update the condition now that m_pattern can't be nullptr. (WebCore::FontPlatformData::buildScaledFont): Use m_pattern unconditionally. * platform/graphics/freetype/SimpleFontDataFreeType.cpp: (WebCore::Font::platformCreateScaledFont const): Update it to use the new FontPlatformData constructor. * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: (WebCore::HarfBuzzFace::createFont): Pass variations to HarfBuzz. * platform/graphics/win/FontCustomPlatformData.cpp: (WebCore::FontCustomPlatformData::fontPlatformData): * platform/graphics/win/FontCustomPlatformData.h: 2018-12-12 Fujii Hironori [Win][Clang][WebKitLegacy] WebFrame.cpp: warning: delete called on non-final 'WebFrame' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] https://bugs.webkit.org/show_bug.cgi?id=192618 Reviewed by Alex Christensen. No new tests, no behavior changes. * platform/win/PopupMenuWin.h: * platform/win/WCDataObject.cpp: * platform/win/WCDataObject.h: 2018-12-12 Simon Fraser REGRESSION (r238090): CAPCHA UI jumps to the wrong location https://bugs.webkit.org/show_bug.cgi?id=192651 rdar://problem/46531919 Reviewed by Zalan Bujtas. When a RenderLayer becomes non-composited because of a style change, we need to set a dirty bit to say that descendants need their geometry updated (because they now have to compute their positions relative to a different ancestor). This wasn't happening in the layerStyleChanged() code path. In the code path that did do this correctly (in the computeCompositingRequirements() tree walk), we can address a FIXME and only dirty direct children, not all descendants (that code was written before the child-only dirty bit existed). Test: compositing/geometry/update-child-geometry-on-compositing-change.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::layerStyleChanged): 2018-12-13 Ryosuke Niwa Make TextInputController.legacyAttributedString take DOM nodes and offsets https://bugs.webkit.org/show_bug.cgi?id=192653 Reviewed by Wenson Hsieh. No new tests since there should be no observable behavioral change other than TextInputController API in DumpRenderTree. * editing/cocoa/HTMLConverter.h: * editing/cocoa/HTMLConverter.mm: (WebCore::attributedStringFromSelection): (WebCore::attributedStringBetweenStartAndEnd): Added. 2018-12-12 Ryosuke Niwa Fix macOS builds after r239145. * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: 2018-12-12 Simon Fraser REGRESSION (r238357): Pins on Yelp map disappear https://bugs.webkit.org/show_bug.cgi?id=192597 rdar://problem/46578285 Reviewed by Zalan Bujtas. RenderLayerCompositor::updateBackingAndHierarchy() had a bug where if a RenderLayer gained a negative z-order child (triggering creation of a foreground layer), we'd fail to call the "setChildren()" with the vector containing that foreground layer. When updateBackingAndHierarchy() stops visiting descendants because none are composited, it may still have to update the child list with the foreground layer, so make sure the code handles this case. Tests: compositing/z-order/add-negative-z-child.html compositing/z-order/rebuild-sibling-of-layer-with-foreground-layer.html * rendering/RenderLayer.cpp: (WebCore::outputPaintOrderTreeRecursive): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): 2018-12-12 YUHAN WU Implement non-timeslice mode encoding for MediaRecorder https://bugs.webkit.org/show_bug.cgi?id=192069 Reviewed by Eric Carlson. Implement the encoding for non-timeslice mode of MediaRecorder. It only supports to record MP4 file through H264 and AAC encoding, we will need to support more MIME types and encoding methods. Add a API in internals to allow testings to turn on the mock source. Test: http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): (WebCore::MediaRecorder::setCustomPrivateRecorderCreator): (WebCore::MediaRecorder::getPrivateImpl): (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::stopRecording): (WebCore::MediaRecorder::stopRecordingInternal): (WebCore::MediaRecorder::createRecordingDataBlob): (WebCore::MediaRecorder::scheduleDeferredTask): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorder.idl: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mediarecorder/MediaRecorderPrivate.h: (WebCore::MediaRecorderPrivate::stopRecording): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: Added. (WebCore::MediaRecorderPrivateAVFImpl::create): (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl): (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated): (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable): (WebCore::MediaRecorderPrivateAVFImpl::stopRecording): (WebCore::MediaRecorderPrivateAVFImpl::fetchData): (WebCore::MediaRecorderPrivateAVFImpl::mimeType): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: Added. * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::fetchData): (WebCore::MediaRecorderPrivateMock::mimeType): * platform/mediarecorder/MediaRecorderPrivateMock.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: added. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Added. (WebCore::MediaRecorderPrivateWriter::clear): (WebCore::MediaRecorderPrivateWriter::setupWriter): (WebCore::MediaRecorderPrivateWriter::setVideoInput): (WebCore::MediaRecorderPrivateWriter::setAudioInput): (WebCore::copySampleBufferWithCurrentTimeStamp): (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::stopRecording): * testing/Internals.cpp: (WebCore::createRecorderMockSource): (WebCore::Internals::setCustomPrivateRecorderCreator): * testing/Internals.h: * testing/Internals.idl: 2018-12-12 Justin Fan [WebGPU] Vertex buffers and WebGPUInputState https://bugs.webkit.org/show_bug.cgi?id=192611 Reviewed by Dean Jackson. Test: webgpu/vertex-buffer-triangle-strip.html Basic implementation of vertex buffers with Metal shading language in WebGPU. In WebGPURenderPipelineDescriptor, refactor to match updated shader stage structure and add WebGPUInputStateDescriptor. Also implement WebGPURenderPassEncoder::setVertexBuffers. Add symbols and files for WebGPUIndexFormat, WebGPUInputStateDescriptor, WebGPUInputStepMode, WebGPUVertexAttributeDescriptor, WebGPUVertexFormat, WebGPUVertexInputDescriptor: * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: Add and implement interfaces and dictionaries for WebGPUInputState: * Modules/webgpu/WebGPUBuffer.cpp: (WebCore::WebGPUBuffer::WebGPUBuffer): * Modules/webgpu/WebGPUBuffer.h: (WebCore::WebGPUBuffer::buffer const): Added getter for backing GPUBuffer. * Modules/webgpu/WebGPUBufferDescriptor.h: * Modules/webgpu/WebGPUBufferDescriptor.idl: Moving WebGPUBufferUsage out into its own IDL. * Modules/webgpu/WebGPUDevice.h: * Modules/webgpu/WebGPUIndexFormat.h: Added. * Modules/webgpu/WebGPUIndexFormat.idl: Added. * Modules/webgpu/WebGPUInputStateDescriptor.h: Added. * Modules/webgpu/WebGPUInputStateDescriptor.idl: Added. * Modules/webgpu/WebGPUInputStepMode.h: Added. * Modules/webgpu/WebGPUInputStepMode.idl: Added. * Modules/webgpu/WebGPUVertexAttributeDescriptor.h: Added. * Modules/webgpu/WebGPUVertexAttributeDescriptor.idl: Added. * Modules/webgpu/WebGPUVertexFormat.h: Added. * Modules/webgpu/WebGPUVertexFormat.idl: Added. * Modules/webgpu/WebGPUVertexInputDescriptor.h: Added. * Modules/webgpu/WebGPUVertexInputDescriptor.idl: Added. * platform/graphics/gpu/GPUInputStateDescriptor.h: Added. * platform/graphics/gpu/GPURenderPassEncoder.h: Added. * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Added. * platform/graphics/gpu/GPUVertexAttributeDescriptor.h: Added. * platform/graphics/gpu/GPUVertexInputDescriptor.h: Added. Refactor to support updated structure of pipeline descriptor in sketch IDL: * Modules/webgpu/WebGPUDevice.cpp: (WebCore::validateAndConvertPipelineStage): (WebCore::WebGPUDevice::createRenderPipeline const): * Modules/webgpu/WebGPUPipelineDescriptorBase.h: * Modules/webgpu/WebGPUPipelineDescriptorBase.idl: * Modules/webgpu/WebGPUPipelineStageDescriptor.h: * Modules/webgpu/WebGPUPipelineStageDescriptor.idl: * Modules/webgpu/WebGPURenderPipelineDescriptor.h: * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: * Modules/webgpu/WebGPUShaderStage.*: Removed. Add and implement setVertexBuffers: * Modules/webgpu/WebGPURenderPassEncoder.cpp: (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Added. * Modules/webgpu/WebGPURenderPassEncoder.h: * Modules/webgpu/WebGPURenderPassEncoder.idl: * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: (WebCore::GPURenderPassEncoder::setVertexBuffers): * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: (WebCore::setInputStateForPipelineDescriptor): (WebCore::GPURenderPipeline::create): 2018-12-12 Tim Horton REGRESSION (r237565): >20 Find in Page highlights in one tile results in a single giant highlight https://bugs.webkit.org/show_bug.cgi?id=192642 Reviewed by Geoffrey Garen. No new tests; adjusted an existing test instead. * platform/graphics/PathUtilities.cpp: (WebCore::PathUtilities::pathsWithShrinkWrappedRects): Instead of uniting when we fail to shrink-wrap, just return the original rects. This seems like a more reasonable default in most cases. 2018-12-12 Vivek Seth HTTPS Upgrade: Figure out if/how to tell clients that the HTTPS upgrade happened https://bugs.webkit.org/show_bug.cgi?id=192375 Reviewed by Chris Dumez. Use simulated redirect to tell clients that HTTPS Upgrade happened. * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::syntheticRedirectResponse): * platform/network/ResourceResponseBase.h: * platform/network/mac/WebCoreURLResponse.mm: (WebCore::synthesizeRedirectResponseIfNecessary): 2018-12-12 Chris Dumez Add a preference to enable / disable devicemotion and deviceorientation events https://bugs.webkit.org/show_bug.cgi?id=192631 Reviewed by Geoffrey Garen. Add setting to toggle support for the deviceorientation / devicemotion events: - https://w3c.github.io/deviceorientation/ * page/DOMWindow.cpp: (WebCore::DOMWindow::addEventListener): * page/Settings.yaml: 2018-12-11 Ryosuke Niwa Make HTMLConverter take two Positions in preparation to make it work with shadow DOM https://bugs.webkit.org/show_bug.cgi?id=192613 Reviewed by Darin Adler. This patch makes HTMLConverter store two Position's instead of a Range so that HTMLConverter can work with a selection which spans across shadow boundaries in the future. No new tests since there should be no observable behavioral change. * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::writeSelectionToPasteboard): Uses the newly introduced writeSelectionToPasteboard. (WebCore::Editor::writeSelection): Ditto. * editing/cocoa/HTMLConverter.h: * editing/cocoa/HTMLConverter.mm: (HTMLConverter::HTMLConverter): Now takes two Position's. (HTMLConverter::convert): Updated to work with Position's. (HTMLConverter::_processText): Ditto. (HTMLConverter::_traverseNode): Ditto. (HTMLConverter::_traverseFooterNode): Ditto. (HTMLConverterCaches::cacheAncestorsOfStartToBeConverted): Ditto. (WebCore::attributedStringFromRange): Ditto. (WebCore::attributedStringFromSelection): Added. For now, we first create a Range via toNormalizedRange in order to preserve the exact behavior. 2018-12-12 Michael Catanzaro Unreviewed manual rollout of r239100-r239102 and r239116 https://bugs.webkit.org/show_bug.cgi?id=192151 * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::font): * loader/cache/CachedFont.cpp: (WebCore::CachedFont::platformDataFromCustomData): * platform/FreeType.cmake: * platform/graphics/FontPlatformData.h: (WebCore::FontPlatformData::isFixedWidth const): Deleted. * platform/graphics/cairo/FontCustomPlatformData.h: * platform/graphics/freetype/FontCacheFreeType.cpp: (WebCore::FontCache::systemFallbackForCharacters): (WebCore::FontCache::createFontPlatformData): (WebCore::getFontPropertiesFromPattern): Deleted. (WebCore::defaultVariationValues): Deleted. (WebCore::buildVariationSettings): Deleted. * platform/graphics/freetype/FontCacheFreeType.h: Removed. * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: (WebCore::FontCustomPlatformData::FontCustomPlatformData): (WebCore::FontCustomPlatformData::~FontCustomPlatformData): (WebCore::FontCustomPlatformData::fontPlatformData): (WebCore::FontCustomPlatformData::supportsFormat): (WebCore::defaultFontconfigOptions): Deleted. * platform/graphics/freetype/FontPlatformDataFreeType.cpp: (WebCore::setCairoFontOptionsFromFontConfigPattern): (WebCore::getDefaultFontconfigOptions): (WebCore::FontPlatformData::FontPlatformData): (WebCore::FontPlatformData::operator=): (WebCore::FontPlatformData::harfBuzzFace const): (WebCore::FontPlatformData::platformIsEqual const): (WebCore::FontPlatformData::buildScaledFont): (WebCore::FontPlatformData::fcPattern const): Deleted. (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): Deleted. * platform/graphics/freetype/SimpleFontDataFreeType.cpp: (WebCore::Font::platformCreateScaledFont const): * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: (WebCore::fontFeatures): (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): (WebCore::floatToHarfBuzzPosition): Deleted. (WebCore::doubleToHarfBuzzPosition): Deleted. (WebCore::harfBuzzFontFunctions): Deleted. (WebCore::findScriptForVerticalGlyphSubstitution): Deleted. * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Added. (WebCore::HarfBuzzFace::CacheEntry::CacheEntry): (WebCore::HarfBuzzFace::CacheEntry::~CacheEntry): (WebCore::HarfBuzzFace::cache): (WebCore::HarfBuzzFace::HarfBuzzFace): (WebCore::HarfBuzzFace::~HarfBuzzFace): (WebCore::findScriptForVerticalGlyphSubstitution): (WebCore::HarfBuzzFace::setScriptForVerticalGlyphSubstitution): * platform/graphics/harfbuzz/HarfBuzzFace.h: Added. (WebCore::HarfBuzzFace::CacheEntry::create): (WebCore::HarfBuzzFace::CacheEntry::face): (WebCore::HarfBuzzFace::CacheEntry::glyphCache): * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Added. (WebCore::floatToHarfBuzzPosition): (WebCore::doubleToHarfBuzzPosition): (WebCore::CairoGetGlyphWidthAndExtents): (WebCore::harfBuzzGetGlyph): (WebCore::harfBuzzGetGlyphHorizontalAdvance): (WebCore::harfBuzzGetGlyphHorizontalOrigin): (WebCore::harfBuzzGetGlyphExtents): (WebCore::harfBuzzCairoTextGetFontFuncs): (WebCore::harfBuzzCairoGetTable): (WebCore::HarfBuzzFace::createFace): (WebCore::HarfBuzzFace::createFont): * platform/graphics/harfbuzz/HbUniquePtr.h: (WebCore::HbPtrDeleter::operator() const): Deleted. * platform/graphics/opentype/OpenTypeMathData.cpp: (WebCore::OpenTypeMathData::OpenTypeMathData): * platform/graphics/win/FontCustomPlatformData.cpp: (WebCore::FontCustomPlatformData::fontPlatformData): * platform/graphics/win/FontCustomPlatformData.h: * platform/graphics/win/FontCustomPlatformDataCairo.cpp: (WebCore::FontCustomPlatformData::fontPlatformData): 2018-12-12 Chris Dumez Unreviewed attempt to fix Windows Cairo build after r239100. * platform/graphics/win/FontCustomPlatformDataCairo.cpp: (WebCore::FontCustomPlatformData::fontPlatformData): 2018-12-12 Wenson Hsieh [iOS] A few API tests are failing after r239086 https://bugs.webkit.org/show_bug.cgi?id=192608 Reviewed by Zalan Bujtas. These test failures were caused by a missing Vector size check in `Pasteboard::readFilePaths` before accessing the first item. Fix this by adding a helper method on PasteboardItemInfo to grab the file path for the highest fidelity pasteboard item (returning the null string if there are none), and use this in a few places that grab the highest fidelity path using Vector::first(). While `Pasteboard::readRespectingUTIFidelities` does have a bounds check before accessing the list of paths, this patch still replaces it with a call to `pathForHighestFidelityItem()`, so that the intent is more clear. * platform/PasteboardItemInfo.h: (WebCore::PasteboardItemInfo::pathForHighestFidelityItem const): * platform/ios/PasteboardIOS.mm: (WebCore::Pasteboard::readRespectingUTIFidelities): (WebCore::Pasteboard::readFilePaths): 2018-12-12 Carlos Garcia Campos Unreviewed. Fix WPE build after r239101. * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: Include 2018-12-12 Carlos Garcia Campos [FreeType] Remove HarfBuzzFace https://bugs.webkit.org/show_bug.cgi?id=192589 Reviewed by Michael Catanzaro. This was used to share the common implementation with the chromium port, but now that only freetype based ports use it, it can be removed and use hb_ft_face_create_cached() instead. We don't need the glyph cache either, since we are already caching glyphs in Font. * platform/FreeType.cmake: Remove HarfBuzzFaceCairo.cpp and HarfBuzzFace.cpp. * platform/graphics/FontPlatformData.h: Remove HarfBuzzFace member. * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: Add missing include. * platform/graphics/freetype/FontPlatformDataFreeType.cpp: (WebCore::FontPlatformData::operator=): Remove m_harfBuzzFace handling. (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): New funtction to create a hb_font_t for OpenType math. * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: (WebCore::floatToHarfBuzzPosition): Moved from HarfBuzzFaceCairo.cpp. (WebCore::doubleToHarfBuzzPosition): Ditto. (WebCore::harfBuzzFontFunctions): Also moved from HarfBuzzFaceCairo.cpp, but implement get_nominal/variation functions when using HarfBuzz >= 1.2.3 and use Font::glyphForCharacter() to make it simpler. (WebCore::fontFeatures): Moved from HarfBuzzFaceCairo.cpp. (WebCore::findScriptForVerticalGlyphSubstitution): Moved from HarfBuzzFace.cpp. (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Create the HarfBuzz face and font here. * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Removed. * platform/graphics/harfbuzz/HarfBuzzFace.h: Removed. * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Removed. * platform/graphics/harfbuzz/HbUniquePtr.h: (WebCore::HbPtrDeleter::operator() const): Add deleter for hb_face_t. * platform/graphics/opentype/OpenTypeMathData.cpp: (WebCore::OpenTypeMathData::OpenTypeMathData): Use FontPlatformData::createOpenTypeMathHarfBuzzFont(). 2018-12-12 Carlos Garcia Campos [FreeType] Add initial implementation of variation fonts https://bugs.webkit.org/show_bug.cgi?id=192151 Reviewed by Michael Catanzaro. * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::font): Remove platform ifdefs. * loader/cache/CachedFont.cpp: (WebCore::CachedFont::platformDataFromCustomData): Ditto. * platform/graphics/FontPlatformData.h: (WebCore::FontPlatformData::isFixedWidth const): * platform/graphics/cairo/FontCustomPlatformData.h: Use RefPtr for cairo_font_face_t. * platform/graphics/freetype/FontCacheFreeType.cpp: (WebCore::getFontPropertiesFromPattern): Helper function to get several font properties from the fontconfig pattern. (WebCore::FontCache::systemFallbackForCharacters): Use getFontPropertiesFromPattern(). (WebCore::FontCache::createFontPlatformData): Pass FC_VARIABLE to the pattern and call buildVariationSettings() before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern. (WebCore::defaultVariationValues): Parse font variations table. (WebCore::buildVariationSettings): Build a font variations string from the settings that can be passed to cairo. * platform/graphics/freetype/FontCacheFreeType.h: Added. * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: (WebCore::FontCustomPlatformData::FontCustomPlatformData): Use RefPtr and make freeTypeFaceKey global. (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Remove explicit destroy. (WebCore::defaultFontconfigOptions): Moved here from FontCacheFreeType. (WebCore::FontCustomPlatformData::fontPlatformData): Call buildVariationSettings() before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern. (WebCore::FontCustomPlatformData::supportsFormat): Add variation formats. * platform/graphics/freetype/FontPlatformDataFreeType.cpp: (WebCore::setCairoFontOptionsFromFontConfigPattern): Call cairo_font_options_set_variations() with the FC_FONT_VARIATIONS value from the pattern. (WebCore::FontPlatformData::FontPlatformData): Use a single constructor that always receives a valid fontconfig pattern. (WebCore::FontPlatformData::fcPattern const): Return the fontconfig pattern. (WebCore::FontPlatformData::platformIsEqual const): Update the condition now that m_pattern can't be nullptr. (WebCore::FontPlatformData::buildScaledFont): Use m_pattern unconditionally. * platform/graphics/freetype/SimpleFontDataFreeType.cpp: (WebCore::Font::platformCreateScaledFont const): Update it to use the new FontPlatformData constructor. * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: (WebCore::HarfBuzzFace::createFont): Pass variations to HarfBuzz. * platform/graphics/win/FontCustomPlatformData.cpp: (WebCore::FontCustomPlatformData::fontPlatformData): * platform/graphics/win/FontCustomPlatformData.h: 2018-12-11 Justin Michaud Implement feature flag for CSS Typed OM https://bugs.webkit.org/show_bug.cgi?id=192610 Reviewed by Ryosuke Niwa. * Configurations/FeatureDefines.xcconfig: * bindings/js/JSTypedOMCSSStyleValueCustom.cpp: * css/typedom/StylePropertyMapReadOnly.h: * css/typedom/StylePropertyMapReadOnly.idl: * css/typedom/TypedOMCSSImageValue.h: * css/typedom/TypedOMCSSImageValue.idl: * css/typedom/TypedOMCSSNumericValue.h: * css/typedom/TypedOMCSSNumericValue.idl: * css/typedom/TypedOMCSSStyleValue.h: * css/typedom/TypedOMCSSStyleValue.idl: * css/typedom/TypedOMCSSUnitValue.h: * css/typedom/TypedOMCSSUnitValue.idl: * css/typedom/TypedOMCSSUnparsedValue.h: * css/typedom/TypedOMCSSUnparsedValue.idl: * features.json: * html/ImageBitmap.cpp: * html/ImageBitmap.h: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasRenderingContext2DBase.cpp: * html/canvas/CanvasRenderingContext2DBase.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildAction): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setCSSTypedOMEnabled): (WebCore::RuntimeEnabledFeatures::cssTypedOMEnabled const): * page/WindowOrWorkerGlobalScope.idl: 2018-12-10 Ryosuke Niwa connectedCallback is invoked during the removal of the element inside another element's connectedCallback https://bugs.webkit.org/show_bug.cgi?id=183586 Reviewed by Frédéric Wang. Align WebKit's behavior with Chrome/Firefox with regards to https://github.com/w3c/webcomponents/issues/760 After much discussion, it's unclear that there is a clear path forward to fixing the oddness that the presence of a custom element reaction changes the timing at which another reaction callback gets invoked. So matching Chrome/Firefox behaviors in this case seems the path of the least resistance to interoperability. Namely, this patch makes WebKit not insert a custom element to the appropriate element queue when the element does not have a matching reaction callback. Put it another way, steps 3-5 in would be done before step 6 in: https://html.spec.whatwg.org/multipage/custom-elements.html#enqueue-a-custom-element-callback-reaction 1. Let definition be element's custom element definition. 2. Let callback be the value of the entry in definition's lifecycle callbacks with key callbackName. 3. If callback is null, then return 4. If callbackName is "attributeChangedCallback", then: 1. Let attributeName be the first element of args. 2. If definition's observed attributes does not contain attributeName, then return. 5. Add a new callback reaction to element's custom element reaction queue, with callback function callback and arguments args. 6. Enqueue an element on the appropriate element queue given element. Test: fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback.html * dom/CustomElementReactionQueue.cpp: (WebCore::CustomElementReactionQueue::enqueueElementUpgrade): (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded): (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded): (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded): (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded): (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions): (WebCore::CustomElementReactionQueue::enqueueElementOnAppropriateElementQueue): Renamed from ensureCurrentQueue. * dom/CustomElementReactionQueue.h: 2018-12-11 Justin Fan [WebGPU] Implement WebGPUBuffer, and some nullibility consistency in WebGPU https://bugs.webkit.org/show_bug.cgi?id=192516 Reviewed by Dean Jackson. Test: webgpu/buffers.html Enable basic creation of WebGPUBuffers, and fix nullability inconsitencies in WebGPU implementation. Add necessary symbols and files for Web/GPUBuffer, Web/GPUBufferUsage, and Web/GPUBufferDescriptor: * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * Modules/webgpu/WebGPUBuffer.cpp: Added. (WebCore::WebGPUBuffer::create): (WebCore::WebGPUBuffer::WebGPUBuffer): * Modules/webgpu/WebGPUBuffer.h: Added. (WebCore::WebGPUBuffer::mapping const): (WebCore::WebGPUBuffer::unmap): Unimplemented stub, for now, as Metal equivalent is unclear. (WebCore::WebGPUBuffer::destroy): Unimplemented stub. * Modules/webgpu/WebGPUBuffer.idl: Added. * Modules/webgpu/WebGPUBufferDescriptor.h: Added. * Modules/webgpu/WebGPUBufferDescriptor.idl: Added. * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::createBuffer const): Added. * platform/graphics/gpu/GPUBuffer.h: (WebCore::GPUBuffer::platformBuffer const): (WebCore::GPUBuffer::mapping const): * platform/graphics/gpu/GPUBufferDescriptor.h: Added. * platform/graphics/gpu/GPUDevice.cpp: (WebCore::GPUDevice::createBuffer const): Added. * platform/graphics/gpu/GPUDevice.h: * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Added. (WebCore::GPUBuffer::create): Attempt to create a page-aligned Gigacage to back the GPUBuffer's ArrayBuffer. (WebCore::GPUBuffer::GPUBuffer): (WebCore::GPUBuffer::~GPUBuffer): Dereference mapped ArrayBuffer first. Small benign edits, most to make nullability more consistent in WebGPU classes: * Modules/webgpu/WebGPUCommandBuffer.cpp: (WebCore::WebGPUCommandBuffer::create): (WebCore::WebGPUCommandBuffer::beginRenderPass): * Modules/webgpu/WebGPUCommandBuffer.h: * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::create): (WebCore::WebGPUDevice::WebGPUDevice): (WebCore::WebGPUDevice::createShaderModule const): (WebCore::WebGPUDevice::createRenderPipeline const): (WebCore::WebGPUDevice::createCommandBuffer const): * Modules/webgpu/WebGPUDevice.h: (WebCore::WebGPUDevice::device const): * Modules/webgpu/WebGPUDevice.idl: * Modules/webgpu/WebGPUQueue.cpp: (WebCore::WebGPUQueue::create): * Modules/webgpu/WebGPURenderPassEncoder.cpp: (WebCore::WebGPURenderPassEncoder::create): * Modules/webgpu/WebGPURenderPassEncoder.h: * Modules/webgpu/WebGPUShaderModule.cpp: (WebCore::WebGPUShaderModule::create): (WebCore::WebGPUShaderModule::WebGPUShaderModule): * Modules/webgpu/WebGPUShaderModule.h: (WebCore::WebGPUShaderModule::module const): * Modules/webgpu/WebGPUSwapChain.idl: Sync with IDL changes. * Modules/webgpu/WebGPUTexture.cpp: (WebCore::WebGPUTexture::create): (WebCore::WebGPUTexture::createDefaultTextureView): * Modules/webgpu/WebGPUTextureView.cpp: (WebCore::WebGPUTextureView::create): * Modules/webgpu/WebGPUTextureView.h: * platform/graphics/gpu/cocoa/GPUQueueMetal.mm: (WebCore::GPUQueue::create): * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: (WebCore::GPURenderPipeline::create): * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm: (WebCore::GPUShaderModule::create): * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: (WebCore::GPUSwapChain::setDevice): * platform/graphics/gpu/cocoa/GPUTextureMetal.mm: (WebCore::GPUTexture::GPUTexture): 2018-12-11 Fujii Hironori [Win][Clang] Fix warning -Wmissing-field-initializers https://bugs.webkit.org/show_bug.cgi?id=192584 Reviewed by Yusuke Suzuki. Initialize a struct with '{ }' instead of '= {0}'. No new tests, no behavior changes. * platform/graphics/win/FontCacheWin.cpp: (WebCore::FontCache::lastResortFallbackFont): * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp: (WebCore::MediaPlayerPrivateFullscreenWindow::createWindow): * platform/win/ClipboardUtilitiesWin.cpp: (WebCore::setFileDescriptorData): (WebCore::setFileContentData): (WebCore::setUCharData): (WebCore::setUtf8Data): (WebCore::setCFData): * platform/win/CursorWin.cpp: (WebCore::createSharedCursor): * platform/win/DefWndProcWindowClass.cpp: (WebCore::registerClass): * platform/win/DragImageWin.cpp: (WebCore::createDragImageIconForCachedImageFilename): * platform/win/PasteboardWin.cpp: (WebCore::writeURL): (WebCore::Pasteboard::writeString): (WebCore::Pasteboard::writeRangeToDataObject): (WebCore::Pasteboard::writePlainTextToDataObject): (WebCore::writeFileToDataObject): (WebCore::Pasteboard::writeMarkup): * platform/win/PopupMenuWin.cpp: (WebCore::PopupMenuWin::show): * platform/win/SSLKeyGeneratorWin.cpp: (WebCore::WebCore::signedPublicKeyAndChallengeString): 2018-12-11 Jer Noble Globally namespaced objects shouldn't use framework-prefixed names https://bugs.webkit.org/show_bug.cgi?id=192600 Reviewed by Eric Carlson. Rename CMSampleBufferIs... -> isCMSampleBuffer... * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::isCMSampleBufferRandomAccess): (WebCore::isCMSampleBufferNonDisplaying): (WebCore::MediaSampleAVFObjC::flags const): (WebCore::CMSampleBufferIsRandomAccess): Deleted. (WebCore::CMSampleBufferIsNonDisplaying): Deleted. 2018-12-11 Brent Fulgham Don't attempt to compute animated values when there is no relevant animation https://bugs.webkit.org/show_bug.cgi?id=192591 Reviewed by Dean Jackson. Check if the property is supposed to be animated, or has animatable features, before attempting to calculate the current animated value. Test: svg/animations/avoid-calculating-for-non-animating-elements.html * svg/SVGAnimateElementBase.cpp: (WebCore::SVGAnimateElementBase::calculateAnimatedValue): 2018-12-11 Chris Dumez Unreviewed, fix typos in console log from r239087. * page/DOMWindow.cpp: (WebCore::DOMWindow::addEventListener): 2018-12-11 Tim Horton WebCore shouldn't have a Objective-C class named NSCursor https://bugs.webkit.org/show_bug.cgi?id=192602 Reviewed by Wenson Hsieh. * platform/ios/wak/WAKAppKitStubs.h: * platform/ios/wak/WAKAppKitStubs.m: (+[NSCursor setHiddenUntilMouseMoves:]): Deleted. Get rid of the class. Also remove a comment that seems to have detached from wherever it's supposed to be. 2018-12-11 Chris Dumez Restrict DeviceMotion / DeviceOrientation APIs to secure contexts https://bugs.webkit.org/show_bug.cgi?id=192595 Reviewed by Dean Jackson. Tests: http/tests/events/device-orientation-motion-non-secure-context.html http/tests/events/device-orientation-motion-secure-context.html * page/DOMWindow.cpp: (WebCore::DOMWindow::addEventListener): * page/SecurityOrigin.h: (WebCore::SecurityOrigin::setIsPotentiallyTrustworthy): * testing/Internals.cpp: (WebCore::Internals::markContextAsInsecure): (WebCore::Internals::postTask): * testing/Internals.h: * testing/Internals.idl: 2018-12-11 Wenson Hsieh [iOS] Send the full list of file upload URLs and types in PasteboardItemInfo https://bugs.webkit.org/show_bug.cgi?id=192598 Work towards Reviewed by Tim Horton. Refactors PasteboardItemInfo to contain lists of file URLs and corresponding pasteboard types, instead of just a "preferred" file upload URL and type. See below for more details. * platform/PasteboardItemInfo.h: (WebCore::PasteboardItemInfo::pathForContentType const): Add a helper method to find a file upload URL corresponding to a given type. (WebCore::PasteboardItemInfo::encode const): (WebCore::PasteboardItemInfo::decode): Change `pathForFileUpload` to `pathsForFileUpload`, and `contentTypeForFileUpload` to `contentTypesForFileUpload`. * platform/ios/AbstractPasteboard.h: * platform/ios/PasteboardIOS.mm: (WebCore::Pasteboard::readRespectingUTIFidelities): Adjust this to take the file path for the highest fidelity representation in `pathsForContentType`. (WebCore::Pasteboard::readFilePaths): * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::informationForItemAtIndex): * platform/ios/WebItemProviderPasteboard.h: * platform/ios/WebItemProviderPasteboard.mm: (-[NSItemProvider web_containsFileURLAndFileUploadContent]): (-[NSItemProvider web_fileUploadContentTypes]): Replace `web_containsFileUploadContent` with `web_fileUploadContentTypes`, which returns the full list of file upload content types (rather than just a `BOOL` indicating whether one or more of these types exist). (-[WebItemProviderPasteboard fileUploadURLsAtIndex:fileTypes:]): (-[WebItemProviderPasteboard numberOfFiles]): (-[NSItemProvider web_containsFileUploadContent]): Deleted. (-[WebItemProviderPasteboard preferredFileUploadURLAtIndex:fileType:]): Deleted. Replaced with `-fileUploadURLsAtIndex:fileTypes:`. This implementation currently just returns the highest fidelity loaded type identifier, but this is wrong because it doesn't take into account inline data types that shouldn't be represented as data for file uploads (for instance, it never makes sense to upload the internal data serialization for an `NSURL` as a file on the web). Instead, use existing logic in `web_fileUploadContentTypes` to determine which file types can be treated as file uploads, and return all of these file types that we've loaded. 2018-12-11 Don Olmstead Resource Load Statistics: Use common implementation within NetworkStorageSession https://bugs.webkit.org/show_bug.cgi?id=192592 Reviewed by Alex Christensen. There's nothing within the resource load statistics implementation contained in NetworkStorageSessionCFNet that was CF specific. All of the resource load statistics methods are moved from that file to the root NetworkStorageSession implementation. * platform/network/NetworkStorageSession.cpp: (WebCore::getPartitioningDomain): (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const): (WebCore::NetworkStorageSession::shouldBlockCookies const): (WebCore::NetworkStorageSession::maxAgeCacheCap): (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies): (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor): (WebCore::NetworkStorageSession::removePrevalentDomains): (WebCore::NetworkStorageSession::hasStorageAccess const): (WebCore::NetworkStorageSession::getAllStorageAccessEntries const): (WebCore::NetworkStorageSession::grantStorageAccess): (WebCore::NetworkStorageSession::removeStorageAccessForFrame): (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): (WebCore::NetworkStorageSession::removeAllStorageAccess): (WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources): (WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources): * platform/network/NetworkStorageSession.h: * platform/network/cf/NetworkStorageSessionCFNet.cpp: (WebCore::getPartitioningDomain): Deleted. (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const): Deleted. (WebCore::NetworkStorageSession::shouldBlockCookies const): Deleted. (WebCore::NetworkStorageSession::maxAgeCacheCap): Deleted. (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies): Deleted. (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor): Deleted. (WebCore::NetworkStorageSession::removePrevalentDomains): Deleted. (WebCore::NetworkStorageSession::hasStorageAccess const): Deleted. (WebCore::NetworkStorageSession::getAllStorageAccessEntries const): Deleted. (WebCore::NetworkStorageSession::grantStorageAccess): Deleted. (WebCore::NetworkStorageSession::removeStorageAccessForFrame): Deleted. (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): Deleted. (WebCore::NetworkStorageSession::removeAllStorageAccess): Deleted. (WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources): Deleted. (WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources): Deleted. 2018-12-11 Devin Rousso Web Inspector: overlay bounds rulers don't match element when page is scrolled https://bugs.webkit.org/show_bug.cgi?id=192577 Reviewed by Joseph Pecoraro. When drawing the highlight for a node, the canvas is translated based on the scroll position of the node. This translation was not applied to the bounds calculations, which meant that the bounds always drew where the node would have been if it wasn't scrolled. * inspector/InspectorOverlayPage.js: (Bounds.prototype.get minX): (Bounds.prototype.get minY): (Bounds.prototype.get maxX): (Bounds.prototype.get maxY): (Bounds.prototype.offset): Added. (drawNodeHighlight): Drive-by: draw bounds for every node being highlighted instead of just the first one. Drive-by: switch the bounds color to be a semi-transparent red for more visibility/contrast. 2018-12-11 Andy Estes Introduce makeBlockPtr for lambdas https://bugs.webkit.org/show_bug.cgi?id=192594 Reviewed by Alex Christensen. Adopted makeBlockPtr. * platform/cocoa/FileMonitorCocoa.mm: (WebCore::FileMonitor::FileMonitor): * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm: (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer): * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandBufferMetal.mm: (WebCore::GPULegacyCommandBuffer::GPULegacyCommandBuffer): * platform/network/cocoa/WebCoreNSURLSession.mm: (-[WebCoreNSURLSession addDelegateOperation:]): (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:completionHandler:]): * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]): 2018-12-10 Brent Fulgham SVGViewSpec objects should mark relevant SVG elements https://bugs.webkit.org/show_bug.cgi?id=192567 Reviewed by Ryosuke Niwa. SVGViewSpec elements reflect the state of an underlying SVGElement. Teach the mark algorithm to recognize the relevant SVGElement as active as long as the SVGViewSpec is active. Update SVGElement so that it can vend WeakPtrs. I also noticed that SVGAttributeOwner used a bare pointer to the SVGElement, so switched to a WeakPtr. Test: svg/animations/view-dependency-crash.html * Sources.txt: Add new files. * WebCore.xcodeproj/project.pbxproj: Ditto. * bindings/js/JSSVGViewSpecCustom.cpp: Added. (WebCore::JSSVGViewSpec::visitAdditionalChildren): * svg/SVGElement.h: * svg/SVGPathElement.h: * svg/SVGViewSpec.cpp: (WebCore::SVGViewSpec::SVGViewSpec): Hold a weak pointer (rather than a bare pointer) to the underlying element. * svg/SVGViewSpec.h: * svg/SVGViewSpec.idl: * svg/properties/SVGAttributeOwnerProxy.cpp: Added. (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): Hold a weak pointer (rather than a bare pointer) to the underling SVGElement. (WebCore::SVGAttributeOwnerProxy::element const): Ditto. * svg/properties/SVGAttributeOwnerProxy.h: (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): Move implementation to cpp file. (WebCore::SVGAttributeOwnerProxy::element const): Ditto. * svg/properties/SVGAttributeOwnerProxyImpl.h: Update for WeakPtr use. 2018-12-10 Benjamin Poulain Content blocker rule "raw" blocks media elements from loading https://bugs.webkit.org/show_bug.cgi?id=192439 Reviewed by Dean Jackson. This broken when WebKit switched to NSURLSession. In CachedResourceLoader::requestResource(), toResourceType() was turning media load into RAW. Test: http/tests/contentextensions/video-element-resource-type.html * loader/ResourceLoadInfo.cpp: (WebCore::toResourceType): 2018-12-10 Don Olmstead Move ENABLE_RESOURCE_LOAD_STATISTICS to FeatureDefines.xcconfig https://bugs.webkit.org/show_bug.cgi?id=192573 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: 2018-12-10 Justin Michaud CS Painting API should support multiple worklets. https://bugs.webkit.org/show_bug.cgi?id=192335 Reviewed by Dean Jackson. Adds a new map to support separate paint worklet global scopes (one for each worklet). Also adds some tests and a fix for a repaint bug that this oncovered, where changing a custom property required for paint would not trigger a repaint if there had not been a valid value set before. Test: fast/css-custom-paint/multiple-worklets.html * css/CSSPaintImageValue.cpp: (WebCore::CSSPaintImageValue::image): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyProperty): * dom/Document.cpp: (WebCore::Document::prepareForDestruction): (WebCore::Document::paintWorkletGlobalScope): (WebCore::Document::setPaintWorkletGlobalScope): * dom/Document.h: (WebCore::Document::paintWorkletGlobalScope): Deleted. * rendering/style/RenderStyle.cpp: (WebCore::changedCustomPaintWatchedProperty): * worklets/Worklet.cpp: (WebCore::Worklet::addModule): * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::prepareForDestruction): 2018-12-10 Youenn Fablet Remove derived classes of RealtimeMediaSourceCenter https://bugs.webkit.org/show_bug.cgi?id=192546 Reviewed by Eric Carlson. Remove virtual methods of RealtimeMediaSourceCenter and remove derived classes of it. Instead port specific implementation directly implement the needed default factory methods. Renamed some methods for improved consistency. Moved some static variables as RealtimeMediaSourceCenter members. No change of behavior. * WebCore.xcodeproj/project.pbxproj: * page/DeprecatedGlobalSettings.cpp: * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::createMediaStream): (WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices): (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices): (WebCore::RealtimeMediaSourceCenter::setVideoCapturePageState): (WebCore::RealtimeMediaSourceCenter::setAudioFactory): (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory): (WebCore::RealtimeMediaSourceCenter::audioCaptureFactory): (WebCore::RealtimeMediaSourceCenter::setVideoFactory): (WebCore::RealtimeMediaSourceCenter::unsetVideoFactory): (WebCore::RealtimeMediaSourceCenter::videoCaptureFactory): (WebCore::RealtimeMediaSourceCenter::setDisplayCaptureFactory): (WebCore::RealtimeMediaSourceCenter::unsetDisplayCaptureFactory): (WebCore::RealtimeMediaSourceCenter::displayCaptureFactory): * platform/mediastream/RealtimeMediaSourceCenter.h: * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::~RealtimeVideoSource): (WebCore::RealtimeVideoSource::prepareToProduceData): * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp: (WebCore::RealtimeMediaSourceCenter::singleton): (WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureFactory): (WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureFactory): (WebCore::RealtimeMediaSourceCenter::defaultDisplayCaptureFactory): * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h: Removed. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): (WebCore::AVVideoCaptureSource::setupCaptureSession): * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::~DisplayCaptureSourceCocoa): (WebCore::DisplayCaptureSourceCocoa::startProducingData): * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: (WebCore::RealtimeMediaSourceCenter::singleton): (WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureFactory): (WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureFactory): (WebCore::RealtimeMediaSourceCenter::defaultDisplayCaptureFactory): * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h: Removed. * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource): (WebCore::MockRealtimeAudioSource::startProducingData): * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled): (WebCore::MockRealtimeMediaSourceCenter::audioCaptureFactory): (WebCore::MockRealtimeMediaSourceCenter::videoCaptureFactory): * platform/mock/MockRealtimeMediaSourceCenter.h: 2018-12-10 Youenn Fablet DataChannels created asynchronously never open and are unusable https://bugs.webkit.org/show_bug.cgi?id=192566 Reviewed by Eric Carlson. For every new data channel (remote or local), we should check the underlying backend state. This allows firing events if needed. We were not always doing that which was prohibiting sending some open events for data channels created after the SCTP connection is set up. Covered by updated test. * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp: (WebCore::LibWebRTCDataChannelHandler::channelEvent): (WebCore::LibWebRTCDataChannelHandler::setClient): (WebCore::LibWebRTCDataChannelHandler::OnStateChange): (WebCore::LibWebRTCDataChannelHandler::checkState): * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h: 2018-12-10 Ryosuke Niwa Use WeakPtr to refer to VTTCue in VTTCueBox https://bugs.webkit.org/show_bug.cgi?id=192575 Reviewed by Eric Carlson. Address the FIXME in VTTCue::~VTTCue by clearing VTTCueBox::m_cue when VTTCue goes away. This is implemented by simply using WeakPtr. No new tests since there shoul be no behaivoral change. * html/track/TextTrackCueGeneric.cpp: (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties): * html/track/VTTCue.cpp: (WebCore::VTTCueBox::VTTCueBox): (WebCore::VTTCueBox::getCue const): (WebCore::VTTCueBox::applyCSSProperties): (WebCore::VTTCue::~VTTCue): * html/track/VTTCue.h: (WebCore::VTTCueBox::fontSizeFromCaptionUserPrefs const): 2018-12-10 Mark Lam PropertyAttribute needs a CustomValue bit. https://bugs.webkit.org/show_bug.cgi?id=191993 Reviewed by Saam Barati. This patch revealed a bug in the CodeGenerator where a constructor property is set with a ReadOnly attribute. This conflicts with the WebIDL link (see clause 12 in https://heycam.github.io/webidl/#interface-prototype-object) which states that it should be [Writable]. The ReadOnly attribute is now removed. On the WebCore side, this change is covered by existing tests. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor): 2018-12-10 Antti Koivisto Rename "forced style recalc" to "full style rebuild" https://bugs.webkit.org/show_bug.cgi?id=192572 Reviewed by Zalan Bujtas. The old name is confusing. * css/CSSComputedStyleDeclaration.cpp: (WebCore::hasValidStyleForProperty): * dom/Document.cpp: (WebCore::Document::scheduleStyleRebuild): (WebCore::Document::scheduleStyleRecalc): (WebCore::Document::unscheduleStyleRecalc): (WebCore::Document::hasPendingStyleRebuild const): (WebCore::Document::resolveStyle): (WebCore::Document::needsStyleRecalc const): (WebCore::Document::updateLayoutIgnorePendingStylesheets): (WebCore::Document::invalidateMatchedPropertiesCacheAndForceStyleRecalc): (WebCore::Document::setDesignMode): (WebCore::Document::webkitDidExitFullScreenForElement): (WebCore::Document::setAnimatingFullScreen): (WebCore::Document::setFullscreenControlsHidden): (WebCore::Document::scheduleForcedStyleRecalc): Deleted. (WebCore::Document::hasPendingForcedStyleRecalc const): Deleted. * dom/Document.h: * dom/Element.cpp: (WebCore::Element::needsStyleInvalidation const): * page/Page.cpp: (WebCore::Page::updateStyleAfterChangeInEnvironment): * style/StyleScope.cpp: (WebCore::Style::Scope::updateActiveStyleSheets): 2018-12-10 Alexey Proskuryakov Include CoreGraphics.h from WebCorePrefix.h https://bugs.webkit.org/show_bug.cgi?id=192557 Reviewed by Tim Horton. The theory is that this will improve build time. Let's try and see what bots say. * WebCorePrefix.h: 2018-12-10 Wenson Hsieh [iOS] Unable to upload data that conforms to "public.item" but not "public.content" https://bugs.webkit.org/show_bug.cgi?id=192555 Reviewed by Tim Horton. Add support for uploading content that conforms to "public.item" via drag and drop. Currently, iOS WebKit only supports data that conforms to "public.content", but there exist several types of files that conform to "public.item" but not "public.content". See below for more detail. Test: DragAndDropTests.ExternalSourcePKCS12ToSingleFileInput * platform/ios/PasteboardIOS.mm: (WebCore::Pasteboard::supportedFileUploadPasteboardTypes): Update this to include "public.item", and remove "public.folder", which is now redundant because "public.folder" conforms to "public.item". * platform/ios/WebItemProviderPasteboard.mm: (-[NSItemProvider web_containsFileURLAndFileUploadContent]): Pull out the "contains content that is supported for file uploads" part of this helper method into a separate method, and use it within `-web_containsFileURLAndFileUploadContent`. Note that this prevents "public.url"- conformant data from being uploaded as files (i.e., we never want to upload a URL string *itself* as a file). Drawing this distinction ensures that we don't confuse item providers that contain just a URL as files when dropping into a file upload area or file input (see API test: ExternalSourceZIPArchiveAndURLToSingleFileInput for an example of this corner case). (-[NSItemProvider web_containsFileUploadContent]): (-[WebItemProviderPasteboard numberOfFiles]): Refactor this to use `-web_containsFileUploadContent`. 2018-12-10 Chris Dumez Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess https://bugs.webkit.org/show_bug.cgi?id=192509 Reviewed by Alex Christensen. * loader/DocumentLoader.h: (WebCore::DocumentLoader::setCustomUserAgent): (WebCore::DocumentLoader::customUserAgent const): * loader/FrameLoader.cpp: (WebCore::FrameLoader::userAgent const): 2018-12-10 Adrian Perez de Castro [GLib] FileSystem::moveFile() should fall back to copying https://bugs.webkit.org/show_bug.cgi?id=192562 Reviewed by Michael Catanzaro. No new tests needed. * platform/glib/FileSystemGlib.cpp: (WebCore::FileSystem::moveFile): Use g_file_move() instead of a plain g_rename(), which provides a fall-back which does copy+delete when a direct move or rename cannot be done. 2018-12-10 Simon Fraser Allow control over child order when adding nodes to the scrolling tree https://bugs.webkit.org/show_bug.cgi?id=176914 Re-land r239010 after over-zealous rollout. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::attachToStateTree): (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::attachToStateTree): * page/scrolling/ScrollingStateNode.cpp: (WebCore::ScrollingStateNode::insertChild): (WebCore::ScrollingStateNode::indexOfChild const): * page/scrolling/ScrollingStateNode.h: * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::nodeTypeAndParentMatch const): (WebCore::ScrollingStateTree::attachNode): * page/scrolling/ScrollingStateTree.h: 2018-12-10 Antti Koivisto Document should throttle style recalc even when m_pendingStyleRecalcShouldForce is true. https://bugs.webkit.org/show_bug.cgi?id=191695 Reviewed by Zalan Bujtas. * dom/Document.cpp: (WebCore::Document::scheduleStyleRecalc): Don't test for m_pendingStyleRecalcShouldForce. (WebCore::Document::hasPendingStyleRecalc const): (WebCore::Document::hasPendingForcedStyleRecalc const): Don't base the pending status of these function on whether the timer is running. Instead check if the style is invalid. 2018-12-10 Rob Buis XMLHttpRequest removes spaces from content-types before processing https://bugs.webkit.org/show_bug.cgi?id=8644 Reviewed by Chris Dumez. Stop trimming white space characters from the middle of type/subtype value. Also make sure whitespace being parsed adheres to OWS definition from RFC 7230 Section 3.2.3 (referenced by RFC 7231), i.e. space or HT. Based on http://crrev.com/416586. Behavior matches Firefox and Chrome. Tests: http/tests/xmlhttprequest/supported-xml-content-types.html web-platform-tests/mimesniff/mime-types/parsing.any.html web-platform-tests/mimesniff/mime-types/parsing.any.worker.html * platform/network/HTTPParsers.cpp: (WebCore::extractMIMETypeFromMediaType): 2018-12-10 Wenson Hsieh [iOS] Caret is obscured by finger when dragging over an editable element https://bugs.webkit.org/show_bug.cgi?id=192499 Reviewed by Tim Horton. * page/DragActions.h: Move DragHandlingMethod to DragActions.h, and drive-by fix some minor issues (i.e. make a couple of enum classes use 8 bits, fix the indentation levels, and update the copyright year). Also add `EnumTraits` for DragHandlingMethod so that it may be encoded over IPC. * page/DragController.cpp: (WebCore::dragIsHandledByDocument): Simplify this helper function. (WebCore::DragController::tryDocumentDrag): * page/DragController.h: Expose the current DragHandlingMethod via a const getter method. (WebCore::DragController::dragHandlingMethod const): 2018-12-10 Youenn Fablet Make mock capture happen in the process used for real capture https://bugs.webkit.org/show_bug.cgi?id=192544 Reviewed by Eric Carlson. MockRealtimeMediaSourceCenter previously was setting its factories whenever mock capture is on. Add booleans to choose which source (audio, video, display) will actually be toggled on. Covered by existing tests. * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled): * platform/mock/MockRealtimeMediaSourceCenter.h: (WebCore::MockRealtimeMediaSourceCenter::setMockAudioCaptureEnabled): (WebCore::MockRealtimeMediaSourceCenter::setMockVideoCaptureEnabled): (WebCore::MockRealtimeMediaSourceCenter::setMockDisplayCaptureEnabled): 2018-12-10 Dean Jackson Use text/javascript as recommended by the HTML specification https://bugs.webkit.org/show_bug.cgi?id=192525 Reviewed by Jon Lee. The HTML specification says we should use text/javascript for JavaScript files: https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages:javascript-mime-type * loader/cache/CachedScript.cpp: Replace application/javascript with text/javascript. (WebCore::CachedScript::CachedScript): * platform/network/ios/WebCoreURLResponseIOS.mm: Ditto. (WebCore::createExtensionToMIMETypeMap): * platform/network/mac/WebCoreURLResponse.mm: Ditto. (WebCore::createExtensionToMIMETypeMap): 2018-12-10 Dean Jackson [iOS] Make WebGPU work with remote layer hosting https://bugs.webkit.org/show_bug.cgi?id=192508 Reviewed by Tim Horton. WebGPU wasn't working on iOS because we were not correctly identifying the CALayers for remote hosting. Fix this by adding a new CALayer type, WebGPULayer. This will also eventually hold the code to render WebGPU into a canvas. Covered by the existing reference tests (on device). * SourcesCocoa.txt: Add new files. * WebCore.xcodeproj/project.pbxproj: Ditto. * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Recognise the WebGPULayer class for remote hosting. (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer): (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa): * platform/graphics/cocoa/WebGPULayer.h: Added. Very simple inheritance from CAMetalLayer. * platform/graphics/cocoa/WebGPULayer.mm: Added. (-[WebGPULayer init]): (-[WebGPULayer copyImageSnapshotWithColorSpace:]): * platform/graphics/gpu/GPUSwapChain.h: Reference WebGPULayer rather than CALayer. * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Ensure that the WebGPULayer has a reference back to this object, which it will use in the future. (WebCore::GPUSwapChain::create): (WebCore::GPUSwapChain::GPUSwapChain): 2018-12-10 Truitt Savell Unreviewed, rolling out r238965. Caused internal iOS build failures Reverted changeset: "[iOS] Make WebGPU work with remote layer hosting" https://bugs.webkit.org/show_bug.cgi?id=192508 https://trac.webkit.org/changeset/238965 2018-12-10 Youenn Fablet MockLibWebRTCPeerConnectionFactory should isolate copy its test case https://bugs.webkit.org/show_bug.cgi?id=192545 Reviewed by Eric Carlson. Isolate copy the test case member so that it can be destroyed on another thread. Covered by existing test that should no longer crash. * testing/MockLibWebRTCPeerConnection.cpp: (WebCore::useMockRTCPeerConnectionFactory): (WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory): * testing/MockLibWebRTCPeerConnection.h: (WebCore::MockLibWebRTCPeerConnectionFactory::create): 2018-12-09 Youenn Fablet Move capture manager from RealtimeMediaSourceCenter to capture factory https://bugs.webkit.org/show_bug.cgi?id=192542 Reviewed by Eric Carlson. We should be able to run mock captures in wither UIProcess or WebProcess. Currently, mock capture is only done in WebProcess. This patch is a first step towards that goal. It also simplifies RealtimeMediaSourceCenter implementation by starting to remove virtual methods. Further refactoring will remove the need to subclass RealtimeMediaSourceCenter. Instead, remaining virtual methods will become non virtual and their implementation will become port specific. Removed a JS internal method that is not longer used to further simplify RealtimeMediaSourceCenter. No visible change of behavior. Covered by existing tests. * platform/mediastream/CaptureDeviceManager.h: * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::singleton): (WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices): (WebCore::RealtimeMediaSourceCenter::getDisplayMediaDevices): (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices): (WebCore::RealtimeMediaSourceCenter::captureDeviceWithPersistentID): (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory): (WebCore::RealtimeMediaSourceCenter::unsetVideoFactory): (WebCore::RealtimeMediaSourceCenter::unsetDisplayCaptureFactory): * platform/mediastream/RealtimeMediaSourceCenter.h: * platform/mediastream/RealtimeMediaSourceFactory.h: * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp: * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp: * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp: * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h: * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSourceFactory::audioCaptureDeviceManager): * platform/mediastream/mac/CoreAudioCaptureSource.h: * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h: * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled): (WebCore::MockRealtimeMediaSourceCenter::audioFactory): (WebCore::MockRealtimeMediaSourceCenter::videoFactory): (WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactory): * platform/mock/MockRealtimeMediaSourceCenter.h: (WebCore::MockRealtimeMediaSourceCenter::audioCaptureDeviceManager): (WebCore::MockRealtimeMediaSourceCenter::videoCaptureDeviceManager): (WebCore::MockRealtimeMediaSourceCenter::displayCaptureDeviceManager): * testing/Internals.cpp: * testing/Internals.h: * testing/Internals.idl: 2018-12-09 Commit Queue Unreviewed, rolling out r239010. https://bugs.webkit.org/show_bug.cgi?id=192537 Breaks fast/visual-viewport/tiled-drawing/zoomed-fixed- scrolling-layers-state.html again (Requested by ap on #webkit). Reverted changeset: "Allow control over child order when adding nodes to the scrolling tree" https://bugs.webkit.org/show_bug.cgi?id=176914 https://trac.webkit.org/changeset/239010 2018-12-08 Eric Carlson [MediaStream] Scaled video frames should be resized in letterbox mode https://bugs.webkit.org/show_bug.cgi?id=192528 Reviewed by Darin Adler. Test: fast/mediastream/resize-letterbox.html * platform/graphics/cv/ImageTransferSessionVT.mm: (WebCore::ImageTransferSessionVT::ImageTransferSessionVT): Use letterbox resize mode, not trim. * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::captureSize const): "Capture" at the preset size, not necessarily at the requested size to be more like a physical camera. (WebCore::MockRealtimeVideoSource::settingsDidChange): (WebCore::MockRealtimeVideoSource::drawAnimation): (WebCore::MockRealtimeVideoSource::drawBoxes): (WebCore::MockRealtimeVideoSource::drawText): (WebCore::MockRealtimeVideoSource::generateFrame): (WebCore::MockRealtimeVideoSource::imageBuffer const): * platform/mock/MockRealtimeVideoSource.h: 2018-12-08 Alex Christensen Don't programmatically capitalize safe browsing warning buttons https://bugs.webkit.org/show_bug.cgi?id=192531 Reviewed by Darin Adler. This doesn't work so well in other languages. Capitalize the source strings in English instead. * en.lproj/Localizable.strings: 2018-12-08 Frederic Wang Allow control over child order when adding nodes to the scrolling tree https://bugs.webkit.org/show_bug.cgi?id=176914 Reviewed by Simon Fraser. Based on an earlier patch by Simon Fraser. Previously ScrollingCoordinator just allowed nodes to be "attached" with a given parent, but with no control over sibling order. To allow for correct hit-testing overflow and frame scrolling nodes, we have to build the scrolling tree in z-order. This patch adds a 'childIndex' parameter to attachNode() which gives control over sibling order. For now, RenderLayerCompositor always uses the default 'notFound' value for childIndex so the current behavior (appending new nodes at the end of child list) is preserved. One test marked as flakey, since scrolling tree order is currently dependent on HashSet traversal order. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::attachToStateTree): (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::attachToStateTree): * page/scrolling/ScrollingStateNode.cpp: (WebCore::ScrollingStateNode::insertChild): (WebCore::ScrollingStateNode::indexOfChild const): * page/scrolling/ScrollingStateNode.h: * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::nodeTypeAndParentMatch const): (WebCore::ScrollingStateTree::attachNode): * page/scrolling/ScrollingStateTree.h: 2018-12-07 Eric Carlson [MediaStream] 'devicechange' event should not fire in frames that can't access capture devices https://bugs.webkit.org/show_bug.cgi?id=192511 Reviewed by Youenn Fablet. Test: http/tests/media/media-stream/device-change-event-in-iframe.html * Modules/mediastream/MediaDevices.cpp: (WebCore::MediaDevices::addEventListener): Don't fire the event unless the document can access a camera or microphone. 2018-12-07 Eric Carlson [MediaStream] Address post-review comments after r238904 https://bugs.webkit.org/show_bug.cgi?id=192514 Reviewed by Youenn Fablet. No new tests, no functional change. * platform/graphics/cv/ImageTransferSessionVT.mm: (WebCore::ImageTransferSessionVT::setSize): * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): 2018-12-07 Antti Koivisto [LFC] Rename LayoutFormattingState files to LayoutState https://bugs.webkit.org/show_bug.cgi?id=192520 Reviewed by Zalan Bujtas. Match the class name. * layout/FormattingContext.cpp: * layout/FormattingContextQuirks.cpp: * layout/FormattingState.h: * layout/LayoutFormattingState.cpp: Removed. * layout/LayoutFormattingState.h: Removed. * layout/LayoutState.cpp: Copied from Source/WebCore/layout/LayoutFormattingState.cpp. * layout/LayoutState.h: Copied from Source/WebCore/layout/LayoutFormattingState.h. * layout/Verification.cpp: * layout/blockformatting/BlockFormattingContext.cpp: * layout/blockformatting/BlockFormattingContextQuirks.cpp: * layout/blockformatting/BlockInvalidation.cpp: * layout/floats/FloatAvoider.cpp: * layout/floats/FloatingContext.cpp: * layout/floats/FloatingState.cpp: * layout/inlineformatting/InlineFormattingContext.cpp: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: * layout/inlineformatting/InlineInvalidation.cpp: * layout/layouttree/LayoutTreeBuilder.cpp: * page/FrameViewLayoutContext.cpp: 2018-12-07 Justin Michaud CSS Painting API code cleanup https://bugs.webkit.org/show_bug.cgi?id=192480 Reviewed by Dean Jackson. No new tests, since the existing tests should cover it. * bindings/js/JSDOMWrapper.cpp: (WebCore::outputConstraintSubspaceFor): (WebCore::globalObjectOutputConstraintSubspaceFor): * bindings/js/JSWorkletGlobalScopeBase.cpp: (WebCore::toJS): * css/CSSPaintCallback.h: * platform/graphics/CustomPaintImage.cpp: (WebCore::CustomPaintImage::doCustomPaint): * platform/graphics/CustomPaintImage.h: * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::addCustomPaintWatchProperty): (WebCore::changedCustomPaintWatchedProperty): (WebCore::RenderStyle::changeRequiresRepaint const): * worklets/PaintWorkletGlobalScope.cpp: (WebCore::PaintWorkletGlobalScope::registerPaint): * worklets/PaintWorkletGlobalScope.h: 2018-12-07 Youenn Fablet Update libwebrtc up to 0d007d7c4f https://bugs.webkit.org/show_bug.cgi?id=192316 Reviewed by Eric Carlson. Update include according new libwebrtc. * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: 2018-12-07 Dean Jackson [iOS] Make WebGPU work with remote layer hosting https://bugs.webkit.org/show_bug.cgi?id=192508 Reviewed by Tim Horton. WebGPU wasn't working on iOS because we were not correctly identifying the CALayers for remote hosting. Fix this by adding a new CALayer type, WebGPULayer. This will also eventually hold the code to render WebGPU into a canvas. Covered by the existing reference tests (on device). * SourcesCocoa.txt: Add new files. * WebCore.xcodeproj/project.pbxproj: Ditto. * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Recognise the WebGPULayer class for remote hosting. (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer): (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa): * platform/graphics/cocoa/WebGPULayer.h: Added. Very simple inheritance from CAMetalLayer. * platform/graphics/cocoa/WebGPULayer.mm: Added. (-[WebGPULayer init]): (-[WebGPULayer copyImageSnapshotWithColorSpace:]): * platform/graphics/gpu/GPUSwapChain.h: Reference WebGPULayer rather than CALayer. * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Ensure that the WebGPULayer has a reference back to this object, which it will use in the future. (WebCore::GPUSwapChain::create): (WebCore::GPUSwapChain::GPUSwapChain): 2018-12-07 Antti Koivisto Rename LayoutState to RenderLayoutState https://bugs.webkit.org/show_bug.cgi?id=192504 Reviewed by Zalan Bujtas. The name is better used in LFC. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::layoutState const): (WebCore::FrameViewLayoutContext::pushLayoutState): (WebCore::FrameViewLayoutContext::pushLayoutStateForPaginationIfNeeded): * page/FrameViewLayoutContext.h: * rendering/LayoutState.cpp: Removed. * rendering/LayoutState.h: Removed. * rendering/RenderBlock.cpp: * rendering/RenderBlock.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange): * rendering/RenderBlockLineLayout.cpp: * rendering/RenderBox.cpp: * rendering/RenderEmbeddedObject.cpp: * rendering/RenderFragmentedFlow.cpp: * rendering/RenderGrid.cpp: * rendering/RenderImage.cpp: * rendering/RenderInline.cpp: * rendering/RenderLayoutState.cpp: Copied from Source/WebCore/rendering/LayoutState.cpp. (WebCore::RenderLayoutState::RenderLayoutState): (WebCore::RenderLayoutState::computeOffsets): (WebCore::RenderLayoutState::computeClipRect): (WebCore::RenderLayoutState::computePaginationInformation): (WebCore::RenderLayoutState::pageLogicalOffset const): (WebCore::RenderLayoutState::computeLineGridPaginationOrigin): (WebCore::RenderLayoutState::propagateLineGridInfo): (WebCore::RenderLayoutState::establishLineGrid): (WebCore::RenderLayoutState::addLayoutDelta): (WebCore::RenderLayoutState::layoutDeltaMatches const): (WebCore::LayoutState::LayoutState): Deleted. (WebCore::LayoutState::computeOffsets): Deleted. (WebCore::LayoutState::computeClipRect): Deleted. (WebCore::LayoutState::computePaginationInformation): Deleted. (WebCore::LayoutState::pageLogicalOffset const): Deleted. (WebCore::LayoutState::computeLineGridPaginationOrigin): Deleted. (WebCore::LayoutState::propagateLineGridInfo): Deleted. (WebCore::LayoutState::establishLineGrid): Deleted. (WebCore::LayoutState::addLayoutDelta): Deleted. (WebCore::LayoutState::layoutDeltaMatches const): Deleted. * rendering/RenderLayoutState.h: Copied from Source/WebCore/rendering/LayoutState.h. (WebCore::RenderLayoutState::RenderLayoutState): (WebCore::LayoutState::LayoutState): Deleted. (WebCore::LayoutState::isPaginated const): Deleted. (WebCore::LayoutState::pageLogicalHeight const): Deleted. (WebCore::LayoutState::pageLogicalHeightChanged const): Deleted. (WebCore::LayoutState::lineGrid const): Deleted. (WebCore::LayoutState::lineGridOffset const): Deleted. (WebCore::LayoutState::lineGridPaginationOrigin const): Deleted. (WebCore::LayoutState::paintOffset const): Deleted. (WebCore::LayoutState::layoutOffset const): Deleted. (WebCore::LayoutState::pageOffset const): Deleted. (WebCore::LayoutState::needsBlockDirectionLocationSetBeforeLayout const): Deleted. (WebCore::LayoutState::renderer const): Deleted. (WebCore::LayoutState::clipRect const): Deleted. (WebCore::LayoutState::isClipped const): Deleted. (WebCore::LayoutState::layoutDelta const): Deleted. * rendering/RenderListBox.cpp: * rendering/RenderMediaControlElements.cpp: * rendering/RenderMultiColumnFlow.cpp: * rendering/RenderTable.cpp: * rendering/RenderTableRow.cpp: * rendering/RenderTableSection.cpp: * rendering/RenderVTTCue.cpp: * rendering/RenderView.cpp: * rendering/RenderView.h: * rendering/RootInlineBox.cpp: * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::layout): 2018-12-07 Antti Koivisto [LFC] Rename formattingContext() to createFormattingContext() https://bugs.webkit.org/show_bug.cgi?id=192500 Reviewed by Zalan Bujtas. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const): * layout/FormattingState.h: * layout/LayoutFormattingState.cpp: (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): * layout/blockformatting/BlockFormattingState.cpp: (WebCore::Layout::BlockFormattingState::createFormattingContext): (WebCore::Layout::BlockFormattingState::formattingContext): Deleted. * layout/blockformatting/BlockFormattingState.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const): * layout/inlineformatting/InlineFormattingState.h: 2018-12-07 Truitt Savell Unreviewed, rolling out r238947. Revision caused fast/visual-viewport/tiled-drawing/zoomed- fixed-scrolling-layers-state.html to constantly fail Reverted changeset: "Allow control over child order when adding nodes to the scrolling tree" https://bugs.webkit.org/show_bug.cgi?id=176914 https://trac.webkit.org/changeset/238947 2018-12-07 Wenson Hsieh [Attachment Support] Cloned attachment elements lose their unique identifiers https://bugs.webkit.org/show_bug.cgi?id=192483 Reviewed by Tim Horton. This patch adds logic to ensure that the unique identifier of a cloned attachment element is the same as the unique identifier of the original attachment element. If the cloned attachment is inserted into the same document as the original attachment, then we will exercise the same codepath for copied-and-pasted attachments, and assign a new unique identifier to the attachment element, while creating a new `_WKAttachment` in the client that's backed by the same `NSFileWrapper`. Test: WKAttachmentTests.AttachmentIdentifierOfClonedAttachment * html/HTMLAttachmentElement.cpp: (WebCore::HTMLAttachmentElement::copyNonAttributePropertiesFromElement): * html/HTMLAttachmentElement.h: 2018-12-07 Rob Buis Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList https://bugs.webkit.org/show_bug.cgi?id=192288 Reviewed by Frédéric Wang. Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList as they do the same thing. Also remove std::optional from parseAccessControlAllowList since the function can't fail. * WebCore.order: * loader/CrossOriginAccessControl.cpp: (WebCore::validatePreflightResponse): * loader/CrossOriginPreflightResultCache.cpp: (WebCore::CrossOriginPreflightResultCacheItem::parse): * loader/CrossOriginPreflightResultCache.h: * platform/network/HTTPParsers.cpp: (WebCore::parseAccessControlExposeHeadersAllowList): Deleted. * platform/network/HTTPParsers.h: (WebCore::parseAccessControlAllowList): * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::filter): (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting): 2018-12-07 Eric Carlson [iOS] Don't update AVPlayerViewController currentTime while scrubbing https://bugs.webkit.org/show_bug.cgi?id=192438 Reviewed by Jer Noble. No new tests, tested manually. * platform/ios/PlaybackSessionInterfaceAVKit.mm: (WebCore::PlaybackSessionInterfaceAVKit::currentTimeChanged): Don't report change during scrubbing. * platform/ios/WebAVPlayerController.h: * platform/ios/WebAVPlayerController.mm: (-[WebAVPlayerController beginScrubbing:]): Set _isScrubbing. (-[WebAVPlayerController endScrubbing:]): Ditto. (-[WebAVPlayerController isScrubbing]): Return _isScrubbing. 2018-12-07 Thibault Saunier [WPE][GTK] Implement WebAudioSourceProviderGStreamer to allow bridging MediaStream and the WebAudio APIs https://bugs.webkit.org/show_bug.cgi?id=186933 Reusing the AudioSourceProviderGStreamer itself as it was doing almost everything we needed, just added a constructor to be able to create it from a MediaStreamTrackPrivate and made it a WebAudioSourceProvider which only means it is now a ThreadSafeRefCounted. Sensibily refactored GStreamerMediaStreamSource so that we could reuse it to track a single MediaStreamTrack. Reviewed by Philippe Normand. Enabled all tests depending on that feature. * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp: (WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer): (WebCore::AudioSourceProviderGStreamer::~AudioSourceProviderGStreamer): (WebCore::AudioSourceProviderGStreamer::setClient): * platform/audio/gstreamer/AudioSourceProviderGStreamer.h: * platform/mediastream/MediaStreamTrackPrivate.cpp: (WebCore::MediaStreamTrackPrivate::audioSourceProvider): * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp: (WebCore::GStreamerAudioCapturer::GStreamerAudioCapturer): * platform/mediastream/gstreamer/GStreamerAudioStreamDescription.h: * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (WebCore::webkitMediaStreamSrcSetupSrc): (WebCore::webkitMediaStreamSrcSetupAppSrc): (WebCore::webkitMediaStreamSrcAddTrack): (WebCore::webkitMediaStreamSrcSetStream): (WebCore::webkitMediaStreamSrcNew): * platform/mediastream/gstreamer/GStreamerMediaStreamSource.h: * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp: (WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource): (WebCore::WrappedMockRealtimeAudioSource::start): (WebCore::WrappedMockRealtimeAudioSource::addHum): (WebCore::WrappedMockRealtimeAudioSource::render): (WebCore::WrappedMockRealtimeAudioSource::settingsDidChange): (WebCore::MockGStreamerAudioCaptureSource::startProducingData): * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): Handle the case where input buffers are "big" and process all the data we can for each runs of the method. 2018-12-06 Alexey Proskuryakov Move USE_NEW_THEME out of WebCore's config.h https://bugs.webkit.org/show_bug.cgi?id=192426 Reviewed by Tim Horton. * config.h: 2018-12-06 Frederic Wang Allow control over child order when adding nodes to the scrolling tree https://bugs.webkit.org/show_bug.cgi?id=176914 Reviewed by Simon Fraser. Based on an earlier patch by Simon Fraser. Previously ScrollingCoordinator just allowed nodes to be "attached" with a given parent, but with no control over sibling order. To allow for correct hit-testing overflow and frame scrolling nodes, we have to build the scrolling tree in z-order. This patch adds a 'childIndex' parameter to attachNode() which gives control over sibling order. For now, RenderLayerCompositor always uses the default 'notFound' value for childIndex so the current behavior (appending new nodes at the end of child list) is preserved. No new tests, behavior unchanged and already covered by existing tests. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::attachToStateTree): (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::attachToStateTree): * page/scrolling/ScrollingStateNode.cpp: (WebCore::ScrollingStateNode::insertChild): (WebCore::ScrollingStateNode::indexOfChild const): * page/scrolling/ScrollingStateNode.h: * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::nodeTypeAndParentMatch const): (WebCore::ScrollingStateTree::attachNode): * page/scrolling/ScrollingStateTree.h: 2018-12-06 Yongjun Zhang We should ignore minimumEffectiveDeviceWidth if the page specifies device-width in viewport meta-tag. https://bugs.webkit.org/show_bug.cgi?id=192377 Reviewed by Tim Horton. If the page specifies width=device-width or initial-scale=1 in the viewport meta tag, we should use the native device width and ignore the minimum effective device width in ViewportConfiguration. The patch also introduces scalableNativeWebpageParameters() which uses the device width as default and also allows the page to shrink-to-fit. If a page doesn't have viewport meta tag, or if the width argument isn't device-width and the initial scale isn't 1, we will use scalableNativeWebpageParameters() as the default configuration. Tests: fast/viewport/ios/ignore-minimum-device-width-for-page-with-viewport-device-width.html fast/viewport/ios/use-minimum-device-width-for-page-without-viewport-meta.html * page/ViewportConfiguration.cpp: (WebCore::ViewportConfiguration::updateDefaultConfiguration): pick the default configuration based on the page's viewport arguments. Also, we will always fall back to scalableNativeWebpageParameters() if we can ignore scaling constraints. (WebCore::ViewportConfiguration::setViewportArguments): When page sends us new ViewportArguments, pick up the correponsding default configuration before updating the configuration. (WebCore::ViewportConfiguration::setCanIgnoreScalingConstraints): When m_canIgnoreScalingConstraints is changed, try to pick up the correponsding default configuration. (WebCore::ViewportConfiguration::scalableNativeWebpageParameters): Add a new default set of viewport Parameters this is very close to nativeWebpageParameters() excpet that it allows shrink to fit and its minimum scale is 0.25. We will use this Parameters for pages that doesn't have viewport meta tag; or the width is not device-width and initial scale is not 1. (WebCore::ViewportConfiguration::updateConfiguration): If the page's viewport argument doesn't override the default width, use the m_minimumLayoutSize.width(). * page/ViewportConfiguration.h: (WebCore::ViewportConfiguration::shouldIgnoreMinimumEffectiveDeviceWidth const): A helper method to tell if we should avoid using minimum effective device width. (WebCore::ViewportConfiguration::canOverrideConfigurationParameters const): If we are using a default configuration that is neither nativeWebpageParameters() nor scalableNativeWebpageParameters(), don't override it. (WebCore::ViewportConfiguration::minimumEffectiveDeviceWidth const): Add a helper method to return minimum effective device width based on shouldIgnoreMinimumEffectiveDeviceWidth(). (WebCore::ViewportConfiguration::effectiveLayoutSizeScaleFactor const): Use minimumEffectiveDeviceWidth(). 2018-12-06 Adrian Perez de Castro Content Extensions: Misc fixes to debugging / perf testing code https://bugs.webkit.org/show_bug.cgi?id=192474 Reviewed by Mark Lam. This make it possible to build the content extensions support with the debugging features enabled. In particular, building with CONTENT_EXTENSIONS_PERFORMANCE_REPORTING enabled was broken. No new tests needed. * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::compileRuleList): Remove usage of removed variables machinesWihthoutConditionsCount, totalBytecodeSizeForMachinesWithoutConditions, machinesWithConditionsCount, and totalBytecodeSizeForMachinesWithConditions. * contentextensions/DFA.cpp: (WebCore::ContentExtensions::DFA::debugPrintDot const): Use "%" PRIu64 instead of "%llu" to format uint64_t values. * contentextensions/NFA.cpp: (WebCore::ContentExtensions::NFA::debugPrintDot const): Use "%" PRIu64 instead of "%llu" to format uint64_t values. 2018-12-06 Alex Christensen Remove unused LoaderStrategy::storeDerivedDataToCache and associated dead code https://bugs.webkit.org/show_bug.cgi?id=192452 Reviewed by Anders Carlsson. * loader/LoaderStrategy.h: * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::didRetrieveDerivedDataFromCache): Deleted. * loader/ResourceLoader.h: * loader/ResourceLoaderOptions.h: * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::didRetrieveDerivedDataFromCache): Deleted. * loader/SubresourceLoader.h: * loader/ThreadableLoader.cpp: (WebCore::ThreadableLoaderOptions::isolatedCopy const): * loader/cache/CachedResource.h: (WebCore::CachedResource::didRetrieveDerivedDataFromCache): Deleted. 2018-12-06 Zalan Bujtas [LFC][BFC][MarginCollapsing] HeightAndMargin::margin is always the non-collapsed margin value. https://bugs.webkit.org/show_bug.cgi?id=192345 Reviewed by Antti Koivisto. Rename HeightAndMargin::margin to HeightAndMargin::nonCollapsedMargin. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const): * layout/LayoutUnits.h: (WebCore::Layout::HeightAndMargin::usedMarginValues const): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const): 2018-12-06 Zalan Bujtas [LFC][BFC][MarginCollapsing] Add MarginCollapse::establishesBlockFormattingContext https://bugs.webkit.org/show_bug.cgi?id=192297 Reviewed by Antti Koivisto. WebKit treats the document element renderer as a block formatting context root. * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::establishesBlockFormattingContext): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent): 2018-12-06 Carlos Eduardo Ramalho [GStreamer] -DENABLE_VIDEO=ON -DENABLE_OPENGL=OFF still tries to build GstreamerGL https://bugs.webkit.org/show_bug.cgi?id=191998 Reviewed by Philippe Normand. Fix compilation with -DENABLE_VIDEO=ON and -DENABLE_OPENGL=OFF due to GStreamerGL. No new tests required. Only fixing the build with certain flags. * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp: (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): add required #if ENABLE(WEBGL). 2018-12-06 Carlos Eduardo Ramalho REGRESSION(r231043): [GTK] Undefined references to WebCore::LayerRepresentation::* with -DENABLE_OPENGL=OFF builds https://bugs.webkit.org/show_bug.cgi?id=191997 Reviewed by Philippe Normand. Fix build with -DENABLE_OPENGL=OFF and -DENABLE_VIDEO=OFF. No new tests required. Only fixing build. * platform/gtk/PlatformWheelEventGtk.cpp: (WebCore::PlatformWheelEvent::PlatformWheelEvent): add required #if ENABLE(ASYNC_SCROLLING) 2018-12-05 Don Olmstead [PlayStation] Enable WebCore https://bugs.webkit.org/show_bug.cgi?id=192384 Reviewed by Brent Fulgham. Implements WebCore for the PlayStation platform. * PlatformPlayStation.cmake: Added. * loader/cache/CachedResourceLoader.cpp: * platform/generic/KeyedDecoderGeneric.cpp: Added. (WebCore::KeyedDecoder::decoder): (WebCore::KeyedDecoderGeneric::KeyedDecoderGeneric): (WebCore::KeyedDecoderGeneric::~KeyedDecoderGeneric): (WebCore::KeyedDecoderGeneric::decodeBytes): (WebCore::KeyedDecoderGeneric::decodeBool): (WebCore::KeyedDecoderGeneric::decodeUInt32): (WebCore::KeyedDecoderGeneric::decodeUInt64): (WebCore::KeyedDecoderGeneric::decodeInt32): (WebCore::KeyedDecoderGeneric::decodeInt64): (WebCore::KeyedDecoderGeneric::decodeFloat): (WebCore::KeyedDecoderGeneric::decodeDouble): (WebCore::KeyedDecoderGeneric::decodeString): (WebCore::KeyedDecoderGeneric::beginObject): (WebCore::KeyedDecoderGeneric::endObject): (WebCore::KeyedDecoderGeneric::beginArray): (WebCore::KeyedDecoderGeneric::beginArrayElement): (WebCore::KeyedDecoderGeneric::endArrayElement): (WebCore::KeyedDecoderGeneric::endArray): * platform/generic/KeyedDecoderGeneric.h: Added. * platform/generic/KeyedEncoderGeneric.cpp: Added. (WebCore::KeyedEncoder::encoder): (WebCore::KeyedEncoderGeneric::KeyedEncoderGeneric): (WebCore::KeyedEncoderGeneric::~KeyedEncoderGeneric): (WebCore::KeyedEncoderGeneric::encodeBytes): (WebCore::KeyedEncoderGeneric::encodeBool): (WebCore::KeyedEncoderGeneric::encodeUInt32): (WebCore::KeyedEncoderGeneric::encodeUInt64): (WebCore::KeyedEncoderGeneric::encodeInt32): (WebCore::KeyedEncoderGeneric::encodeInt64): (WebCore::KeyedEncoderGeneric::encodeFloat): (WebCore::KeyedEncoderGeneric::encodeDouble): (WebCore::KeyedEncoderGeneric::encodeString): (WebCore::KeyedEncoderGeneric::beginObject): (WebCore::KeyedEncoderGeneric::endObject): (WebCore::KeyedEncoderGeneric::beginArray): (WebCore::KeyedEncoderGeneric::beginArrayElement): (WebCore::KeyedEncoderGeneric::endArrayElement): (WebCore::KeyedEncoderGeneric::endArray): (WebCore::KeyedEncoderGeneric::finishEncoding): * platform/generic/KeyedEncoderGeneric.h: Added. * platform/network/curl/NetworkStorageSessionCurl.cpp: (WebCore::defaultCookieJarPath): * platform/network/playstation/CurlSSLHandlePlayStation.cpp: Added. (WebCore::getCACertPathEnv): (WebCore::CurlSSLHandle::platformInitialize): * platform/network/playstation/NetworkStateNotifierPlayStation.cpp: Added. (WebCore::NetworkStateNotifier::updateStateWithoutNotifying): (WebCore::NetworkStateNotifier::startObserving): * platform/playstation/EventLoopPlayStation.cpp: Added. (WebCore::EventLoop::cycle): * platform/playstation/MIMETypeRegistryPlayStation.cpp: Added. (WebCore::MIMETypeRegistry::getMIMETypeForExtension): (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType): (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): * platform/playstation/PlatformScreenPlayStation.cpp: Added. (WebCore::screenDepth): (WebCore::screenDepthPerComponent): (WebCore::screenIsMonochrome): (WebCore::screenHasInvertedColors): (WebCore::screenRect): (WebCore::screenAvailableRect): (WebCore::screenSupportsExtendedColor): * platform/playstation/ScrollbarThemePlayStation.cpp: Added. (WebCore::ScrollbarTheme::nativeTheme): (WebCore::ScrollbarThemePlayStation::scrollbarThickness): (WebCore::ScrollbarThemePlayStation::hasButtons): (WebCore::ScrollbarThemePlayStation::hasThumb): (WebCore::ScrollbarThemePlayStation::backButtonRect): (WebCore::ScrollbarThemePlayStation::forwardButtonRect): (WebCore::ScrollbarThemePlayStation::trackRect): (WebCore::ScrollbarThemePlayStation::paintTrackBackground): (WebCore::ScrollbarThemePlayStation::paintThumb): * platform/playstation/ScrollbarThemePlayStation.h: Added. * platform/playstation/UserAgentPlayStation.cpp: Added. (WebCore::standardUserAgent): (WebCore::standardUserAgentForURL): * rendering/RenderThemePlayStation.cpp: Added. (WebCore::RenderTheme::singleton): (WebCore::RenderThemePlayStation::updateCachedSystemFontDescription const): * rendering/RenderThemePlayStation.h: Added. 2018-12-05 Ryosuke Niwa Null pointer crash in DocumentOrderedMap::getElementById via FormAssociatedElement::findAssociatedForm https://bugs.webkit.org/show_bug.cgi?id=192392 Reviewed by Dean Jackson. The crash was caused by FormAssociatedElement::findAssociatedForm invoking DocumentOrderedMap::getElementById and de-referencing nullptr Attribute* via IdTargetObserver before Element::attributeChanged had updated ElementData::m_idForStyleResolution. Fixed it by updating m_idForStyleResolution before invoking IdTargetObservers. Test: fast/dom/remove-id-form-associated-elemet-id-observer-crash.html * dom/Element.cpp: (WebCore::Element::attributeChanged): Fixed the bug. 2018-12-05 Youenn Fablet Enable the possibility to do video capture in UIProcess https://bugs.webkit.org/show_bug.cgi?id=192394 Reviewed by Eric Carlson. Create IOSurface-backed sample buffers so that we can easily send them through IPC. Manually tested. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset): 2018-12-05 Youenn Fablet Update ServiceWorkerContainer::getRegistration lambdas https://bugs.webkit.org/show_bug.cgi?id=192376 Reviewed by Chris Dumez. There is no need to pass 'this' in lambdas as the last lambda takes a ScriptExecutionContext&. No change of behavior. * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::getRegistration): (WebCore::ServiceWorkerContainer::getRegistrations): 2018-12-05 Chris Dumez Crash under WebCore::cachedDocumentWrapper() https://bugs.webkit.org/show_bug.cgi?id=192421 Reviewed by Alex Christensen. Fix potential null defererence of the value returned by toJSDOMWindow(). For example, if the window is frameless, it would return null. * bindings/js/JSDocumentCustom.cpp: (WebCore::cachedDocumentWrapper): 2018-12-05 Eric Carlson [MediaStream] Cleanup up Mac screen capture class https://bugs.webkit.org/show_bug.cgi?id=192379 Reviewed by Youenn Fablet. No new tests, tested manually. * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp: (WebCore::DisplayCaptureManagerCocoa::captureDevices): Initialize Screen devices first so they are first in the list of devices. * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h: * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Cleanup. Always capture at the native screen size to work around a bug. (WebCore::ScreenDisplayCaptureSourceMac::settingsDidChange): Deleted. 2018-12-05 Commit Queue Unreviewed, rolling out r238844, r238846, and r238874. https://bugs.webkit.org/show_bug.cgi?id=192414 The layout tests added with this change are flaky. (Requested by ryanhaddad on #webkit). Reverted changesets: "Implement non-timeslice mode encoding for MediaRecorder" https://bugs.webkit.org/show_bug.cgi?id=192069 https://trac.webkit.org/changeset/238844 "Fix the build" https://trac.webkit.org/changeset/238846 "Fix MediaRecorder flaky tests" https://bugs.webkit.org/show_bug.cgi?id=192371 https://trac.webkit.org/changeset/238874 2018-12-05 Frederic Wang Minor refactoring of the scrolling code https://bugs.webkit.org/show_bug.cgi?id=192398 Reviewed by Simon Fraser. Based on an earlier patch by Simon Fraser. This patch performs some minor refactoring of the scrolling code: - Rename ScrollingCoordinator::uniqueScrollLayerID() to uniqueScrollingNodeID() since it is really a node id. - Inline ScrollingStateTree::setRootStateNode() so we only need to forward declare ScrollingStateFrameScrollingNode in headers. - Pass argument to ScrollingStateTree::addNode() as a reference rather than a pointer. - Initialize ScrollingStateTree::m_changedProperties and ScrollingStateTree::m_parent in the header file. - Remove obsolete comment about ScrollingCoordinatorMac. No new tests, behavior unchanged. * page/scrolling/ScrollingCoordinator.cpp: (WebCore::ScrollingCoordinator::uniqueScrollingNodeID): (WebCore::ScrollingCoordinator::uniqueScrollLayerID): Deleted. * page/scrolling/ScrollingCoordinator.h: * page/scrolling/ScrollingStateNode.cpp: (WebCore::ScrollingStateNode::ScrollingStateNode): * page/scrolling/ScrollingStateNode.h: * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::attachNode): (WebCore::ScrollingStateTree::setRootStateNode): (WebCore::ScrollingStateTree::addNode): * page/scrolling/ScrollingStateTree.h: (WebCore::ScrollingStateTree::setRootStateNode): Deleted. * page/scrolling/ScrollingTree.cpp: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::attachScrollingNode): 2018-12-05 Wenson Hsieh Turn WritingDirection into an enum class https://bugs.webkit.org/show_bug.cgi?id=192401 Work towards Reviewed by Dan Bernstein. Change WritingDirection from an enum to an enum class. No change in behavior. * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi): (WebCore::ApplyStyleCommand::applyInlineStyle): * editing/EditingStyle.cpp: (WebCore::EditingStyle::textDirection const): (WebCore::EditingStyle::textDirectionForSelection): * editing/Editor.cpp: (WebCore::Editor::setBaseWritingDirection): (WebCore::Editor::baseWritingDirectionForSelectionStart const): * editing/EditorCommand.cpp: (WebCore::stateTextWritingDirectionLeftToRight): (WebCore::stateTextWritingDirectionNatural): (WebCore::stateTextWritingDirectionRightToLeft): * editing/WritingDirection.h: Additionally wrap this enum in `namespace WebCore`, and update the copyright year. * editing/ios/EditorIOS.mm: (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection): * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): * testing/Internals.cpp: (WebCore::Internals::setBaseWritingDirection): 2018-12-05 Alicia Boya García [MSE][GStreamer] Remove the AppendPipeline state machine https://bugs.webkit.org/show_bug.cgi?id=192204 Reviewed by Xabier Rodriguez-Calvar. This patch tries to reduce the complexity of the AppendPipeline by removing the appendState state machine and cleaning all the conditional code around it that is not necessary anymore. For the most part the behavior is the same, but some edge cases have been improved in the process: Demuxing errors now result in the append being flagged as ParsingFailed and the error being propagated to the application. This fixes media/media-source/media-source-error-crash.html (or at least gets it up to date with cross platform expectations). AbortableTaskQueue now allows the task handler to perform an abort safely. This is used in the GstBus error message sync handler, since it needs to ask the MainThread to raise a parse error, which will in turn abort. An API test has been added for this new functionality. Also, code has been added to the API tests to ensure the correct destruction of the response object, especially in this case. The code handling invalid track codecs has been made clearer by also explicitly raising a parse error, but it should not expose behavior differences for the application. A test has been added for this behavior: web-platform-tests/media-source/mediasource-invalid-codec.html The reporting of EOS events have been made more rigorous. EOS is only expected after a demuxing error, otherwise it's a g_critical. AppendPipeline::abort() has been renamed to AppendPipeline::resetParserState() to honor the fact that it's not only called when the user calls abort() and match better the names used in the spec. Test: imported/w3c/web-platform-tests/media-source/mediasource-invalid-codec.html * platform/AbortableTaskQueue.h: * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::assertedElementSetState): (WebCore::AppendPipeline::AppendPipeline): (WebCore::AppendPipeline::~AppendPipeline): (WebCore::AppendPipeline::handleErrorSyncMessage): (WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe): (WebCore::AppendPipeline::handleNeedContextSyncMessage): (WebCore::AppendPipeline::appsinkCapsChanged): (WebCore::AppendPipeline::handleEndOfAppend): (WebCore::AppendPipeline::appsinkNewSample): (WebCore::AppendPipeline::didReceiveInitializationSegment): (WebCore::AppendPipeline::resetParserState): (WebCore::AppendPipeline::pushNewBuffer): (WebCore::AppendPipeline::handleAppsinkNewSampleFromStreamingThread): (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromStreamingThread): (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink): (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread): (WebCore::AppendPipeline::dumpAppendState): Deleted. (WebCore::AppendPipeline::demuxerNoMorePads): Deleted. (WebCore::AppendPipeline::setAppendState): Deleted. (WebCore::AppendPipeline::appsinkEOS): Deleted. (WebCore::AppendPipeline::resetPipeline): Deleted. (WebCore::AppendPipeline::abort): Deleted. * platform/graphics/gstreamer/mse/AppendPipeline.h: (WebCore::AppendPipeline::appendState): Deleted. * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp: (WebCore::MediaSourceClientGStreamerMSE::abort): (WebCore::MediaSourceClientGStreamerMSE::resetParserState): * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::appendParsingFailed): * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: 2018-12-05 Rob Buis [Mac] HEAD requests changed to GET after 301, 302, and 303 redirections (http/tests/xmlhttprequest/head-redirection.html) https://bugs.webkit.org/show_bug.cgi?id=114965 Reviewed by Frédéric Wang. HEAD requests should not be changed to GET after 303 redirects, see [1]. This was fixed earlier for GTK [2]. Behavior matches Firefox and Chrome. [1] http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-21#section-7.4 [2] https://bugs.webkit.org/show_bug.cgi?id=110127 Tests: web-platform-tests/fetch/api/redirect/redirect-method.html web-platform-tests/fetch/api/redirect/redirect-method-worker.html http/tests/xmlhttprequest/head-redirection.html * platform/network/mac/ResourceHandleMac.mm: (WebCore::ResourceHandle::willSendRequest): 2018-12-05 Rob Buis Align with Fetch on data: URLs https://bugs.webkit.org/show_bug.cgi?id=182325 Reviewed by Alex Christensen. Do not accept data URLs that do not contain a comma character, as specified in the relevant specs [1, 2]. Behavior matches Firefox and Chrome. Test: web-platform-tests/fetch/api/basic/scheme-data.any.html [1] https://tools.ietf.org/html/rfc2397 [2] https://fetch.spec.whatwg.org/#data-url-processor * platform/network/DataURLDecoder.cpp: (WebCore::DataURLDecoder::parseMediaType): (WebCore::DataURLDecoder::DecodeTask::DecodeTask): (WebCore::DataURLDecoder::DecodeTask::process): (WebCore::DataURLDecoder::createDecodeTask): (WebCore::DataURLDecoder::decode): 2018-12-05 Frederic Wang Unreviewed build fix. * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Add missing header. 2018-12-05 Javier Fernandez [css-grid] Crash on debug changing the style of a positioned element https://bugs.webkit.org/show_bug.cgi?id=191473 Reviewed by Dean Jackson and Zalan Bujtas. When an box becomes {out-of,in}-flow, it may be re-parented and it may become a grid item. In that case, we must mark the RenderGrid as dirty, so that the grid items placement logic is executed again. Test: fast/css-grid-layout/grid-crash-out-of-flow-positioned-element.html * rendering/updating/RenderTreeBuilder.cpp: (WebCore::childFlowStateChangesAndAffectsParentBlock): Consider the case of a box's new parent being a grid container. 2018-12-04 Frederic Wang Always pass scrollingGeometry to update*ScrollingNode functions https://bugs.webkit.org/show_bug.cgi?id=192358 Reviewed by Simon Fraser. Currently, the scrollingGeometry parameter of updateOverflowScrollingNode is always used while the one of updateFrameScrollingNode is never used. Both of them are passed as possibly null pointers. This commit makes things more consistent by making the parameter a reference and explicitly setting the scrollingGeometry of updateFrameScrollingNode. This will help other efforts (such as support for macOS/iOS asynchronous scrolling of overflow nodes / subframes or for CSS overscroll-behavior) for which new data members have to be passed to the scrolling nodes. No new tests, no behavior changes. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode): (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::updateFrameScrollingNode): (WebCore::ScrollingCoordinator::updateOverflowScrollingNode): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): 2018-12-04 Ryosuke Niwa Crash in HTMLCollection::updateNamedElementCache https://bugs.webkit.org/show_bug.cgi?id=192347 Reviewed by Darin Adler. The bug was caused by CollectionIndexCache's nodeAt caching the length of 1 when there are no matching elements in the subtree when the index is non-zero. A related bug was fixed in r182125 but we were not considering the possibility that the index given to this function might be non-zero even when there were no matching elements. Test: fast/dom/options-collection-zero-length-crash.html * dom/CollectionIndexCache.h: (WebCore::CollectionIndexCache::nodeAt): 2018-11-30 Jiewen Tan Don't report resource timing to parent frame for history items https://bugs.webkit.org/show_bug.cgi?id=192273 Reviewed by Youenn Fablet. We should not report history items to its parent frame as those are less interested to its parent and might not be the first navigation in the iframes. This change aligns the behavior when a cached document is not available for the history item with the available case as we don't report resource timing for any cached main document. Test: http/tests/misc/resource-timing-navigation-in-restored-iframe-2.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadDifferentDocumentItem): 2018-12-04 Simon Fraser REGRESSION (r238090): position:fixed sidebar on https://www.w3.org/TR/SVG2/coords.html does not stay fixed https://bugs.webkit.org/show_bug.cgi?id=192320 Reviewed by Zalan Bujtas. Re-land r238840 with a more reliable test. When we fall into slow scrolling mode (for example, because of background-attachment: fixed), RenderLayerCompositor::updateCompositingLayers() needs to set the geometry dirty bit on layers for viewport-constrained objects so we update them. This is only necessary for page scrolling; for overflow scrolls, updateLayerPositions() already does enough dirtying that fixed layers nested inside scrollers get updated. Test: compositing/fixed-with-main-thread-scrolling.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateCompositingLayers): 2018-12-04 Youenn Fablet Fix MediaRecorder flaky tests https://bugs.webkit.org/show_bug.cgi?id=192371 Reviewed by Eric Carlson. No change of behavior. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Reset to use real MediaRecorder by default. 2018-12-04 Justin Michaud CSS Painting API should allow image values in inputProperties https://bugs.webkit.org/show_bug.cgi?id=192200 Reviewed by Dean Jackson. Adds new TypedOMCSSImageValue wrapper. We rename all the existing ones so that the naming is consistent (CSSImageValue is already a thing). Finally, we let CanvasRenderingContext2DBase render these. Tests: fast/css-custom-paint/arguments.html fast/css-custom-paint/image.html * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/CallTracerTypes.h: * bindings/js/JSTypedOMCSSStyleValueCustom.cpp: Renamed from Source/WebCore/bindings/js/JSCSSStyleValueCustom.cpp. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/WebCoreBuiltinNames.h: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::equals const): (WebCore::CSSCustomPropertyValue::customCSSText const): (WebCore::CSSCustomPropertyValue::tokens const): * css/CSSCustomPropertyValue.h: * css/CSSPaintImageValue.cpp: (WebCore::CSSPaintImageValue::image): * css/typedom/StylePropertyMapReadOnly.h: (WebCore::StylePropertyMapReadOnly::create): (WebCore::StylePropertyMapReadOnly::get const): (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): * css/typedom/StylePropertyMapReadOnly.idl: * css/typedom/TypedOMCSSImageValue.h: Copied from Source/WebCore/css/typedom/CSSUnitValue.h. * css/typedom/TypedOMCSSImageValue.idl: Copied from Source/WebCore/css/typedom/CSSStyleValue.idl. * css/typedom/TypedOMCSSNumericValue.h: Renamed from Source/WebCore/css/typedom/CSSNumericValue.h. * css/typedom/TypedOMCSSNumericValue.idl: Renamed from Source/WebCore/css/typedom/CSSNumericValue.idl. * css/typedom/TypedOMCSSStyleValue.h: Renamed from Source/WebCore/css/typedom/CSSStyleValue.h. (WebCore::TypedOMCSSStyleValue::isImageValue): * css/typedom/TypedOMCSSStyleValue.idl: Renamed from Source/WebCore/css/typedom/CSSStyleValue.idl. * css/typedom/TypedOMCSSUnitValue.h: Renamed from Source/WebCore/css/typedom/CSSUnitValue.h. * css/typedom/TypedOMCSSUnitValue.idl: Renamed from Source/WebCore/css/typedom/CSSUnitValue.idl. * css/typedom/TypedOMCSSUnparsedValue.h: Renamed from Source/WebCore/css/typedom/CSSUnparsedValue.h. * css/typedom/TypedOMCSSUnparsedValue.idl: Renamed from Source/WebCore/css/typedom/CSSUnparsedValue.idl. * html/ImageBitmap.cpp: (WebCore::ImageBitmap::createPromise): * html/ImageBitmap.h: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasRenderingContext.cpp: (WebCore::CanvasRenderingContext::checkOrigin): * html/canvas/CanvasRenderingContext.h: * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::size): (WebCore::CanvasRenderingContext2DBase::drawImage): (WebCore::CanvasRenderingContext2DBase::createPattern): * html/canvas/CanvasRenderingContext2DBase.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildAction): * page/WindowOrWorkerGlobalScope.idl: * platform/graphics/CustomPaintImage.cpp: (WebCore::CustomPaintImage::doCustomPaint): 2018-12-04 Chris Dumez Regression(r238817) PSON Page Cache API tests are failing https://bugs.webkit.org/show_bug.cgi?id=192348 Reviewed by Alex Christensen. * page/MemoryRelease.cpp: (WebCore::releaseCriticalMemory): (WebCore::releaseMemory): * page/MemoryRelease.h: 2018-12-04 Ryan Haddad Unreviewed, rolling out r238838. The layout test added with this change is failing on iOS. Reverted changeset: "Thick overlines and line-throughs grow in the wrong direction" https://bugs.webkit.org/show_bug.cgi?id=192264 https://trac.webkit.org/changeset/238838 2018-12-04 Ryan Haddad Unreviewed, rolling out r238840. The layout test added with this change is frequently failing. Reverted changeset: "REGRESSION (r238090): position:fixed sidebar on https://www.w3.org/TR/SVG2/coords.html does not stay fixed" https://bugs.webkit.org/show_bug.cgi?id=192320 https://trac.webkit.org/changeset/238840 2018-12-04 Carlos Garcia Campos [SOUP] Move URLSoup back to WebCore after r238771 https://bugs.webkit.org/show_bug.cgi?id=192306 Reviewed by Michael Catanzaro. Add soupURIToURL() and urlToSoupURI() to replace the URL contructor taking a Soup URI and URL::createSoupURI(). Fix several build failures that showed up after removing the soup includes from URL header. * platform/Cookie.h: * platform/SharedBuffer.h: * platform/SourcesSoup.txt: * platform/network/soup/CookieSoup.cpp: * platform/network/soup/GUniquePtrSoup.h: Renamed from Source/WTF/wtf/glib/GUniquePtrSoup.h. * platform/network/soup/NetworkStorageSessionSoup.cpp: (WebCore::NetworkStorageSession::setCookiesFromDOM const): (WebCore::NetworkStorageSession::deleteCookie const): (WebCore::NetworkStorageSession::getCookies): (WebCore::NetworkStorageSession::getRawCookies const): (WebCore::cookiesForSession): * platform/network/soup/ResourceErrorSoup.cpp: (WebCore::failingURI): * platform/network/soup/ResourceHandleSoup.cpp: * platform/network/soup/ResourceRequest.h: (WebCore::ResourceRequest::ResourceRequest): * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::ResourceRequest::updateSoupMessageMembers const): (WebCore::ResourceRequest::updateFromSoupMessage): (WebCore::ResourceRequest::createSoupURI const): * platform/network/soup/ResourceResponseSoup.cpp: (WebCore::ResourceResponse::updateFromSoupMessage): * platform/network/soup/SocketStreamHandleImpl.h: * platform/network/soup/SocketStreamHandleImplSoup.cpp: (WebCore::SocketStreamHandleImpl::create): * platform/network/soup/SoupNetworkSession.cpp: * platform/network/soup/URLSoup.cpp: Copied from Source/WTF/wtf/glib/URLSoup.cpp. (WebCore::soupURIToURL): (WebCore::urlToSoupURI): * platform/network/soup/URLSoup.h: Renamed from Source/WTF/wtf/glib/URLSoup.cpp. 2018-12-04 Devin Rousso Web Inspector: Audit: tests should support async operations https://bugs.webkit.org/show_bug.cgi?id=192171 Reviewed by Joseph Pecoraro. * page/Settings.yaml: * dom/ScriptExecutionContext.cpp: (ScriptExecutionContext::reportUnhandledPromiseRejection): Add setting for muting the "Unhandled Promise Rejection" console message. 2018-12-03 Tim Horton Fix the build * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Unified sources, of course. 2018-12-03 Youenn Fablet A sender created through addTransceiver and populated using addTrack should have its source set https://bugs.webkit.org/show_bug.cgi?id=192136 Reviewed by Eric Carlson. In case libwebrtc backend is already created, we need to make sure to set the track source to the libwebrtc sender backend that is actually tied to the sender. Covered by updated test. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCPeerConnectionBackend::removeTrack): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::addTrack): * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: 2018-12-03 YUHAN WU Implement non-timeslice mode encoding for MediaRecorder https://bugs.webkit.org/show_bug.cgi?id=192069 Reviewed by Youenn Fablet. Implement the encoding for non-timeslice mode of MediaRecorder. It only supports to record MP4 file through H264 and AAC encoding, we will need to support more MIME types and encoding methods. Add a API in internals to allow testings to turn on the mock source. Tests: http/wpt/mediarecorder/MediaRecorder-AV-audio-only-dataavailable.html http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html http/wpt/mediarecorder/MediaRecorder-AV-video-only-dataavailable.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): (WebCore::MediaRecorder::setCustomPrivateRecorderCreator): (WebCore::MediaRecorder::getPrivateImpl): (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::stopRecording): (WebCore::MediaRecorder::stopRecordingInternal): (WebCore::MediaRecorder::createRecordingDataBlob): (WebCore::MediaRecorder::scheduleDeferredTask): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorder.idl: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mediarecorder/MediaRecorderPrivate.h: (WebCore::MediaRecorderPrivate::stopRecording): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: Added. (WebCore::MediaRecorderPrivateAVFImpl::create): (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVImpl): (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated): (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable): (WebCore::MediaRecorderPrivateAVFImpl::stopRecording): (WebCore::MediaRecorderPrivateAVFImpl::fetchData): (WebCore::MediaRecorderPrivateAVFImpl::mimeType): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: Added. * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::fetchData): (WebCore::MediaRecorderPrivateMock::mimeType): * platform/mediarecorder/MediaRecorderPrivateMock.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: Added. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Added. (WebCore::MediaRecorderPrivateWriter::setupWriter): (WebCore::MediaRecorderPrivateWriter::setVideoInput): (WebCore::MediaRecorderPrivateWriter::setAudioInput): (WebCore::copySampleBufferWithCurrentTimeStamp): (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::stopRecording): (WebCore::MediaRecorderPrivateWriter::fetchData): * testing/Internals.cpp: (WebCore::createRecorderMockSource): (WebCore::Internals::setCustomPrivateRecorderCreator): * testing/Internals.h: * testing/Internals.idl: 2018-12-03 Simon Fraser REGRESSION (r238090): position:fixed sidebar on https://www.w3.org/TR/SVG2/coords.html does not stay fixed https://bugs.webkit.org/show_bug.cgi?id=192320 Reviewed by Zalan Bujtas. When we fall into slow scrolling mode (for example, because of background-attachment: fixed), RenderLayerCompositor::updateCompositingLayers() needs to set the geometry dirty bit on layers for viewport-constrained objects so we update them. This is only necessary for page scrolling; for overflow scrolls, updateLayerPositions() already does enough dirtying that fixed layers nested inside scrollers get updated. Test: compositing/fixed-with-main-thread-scrolling.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateCompositingLayers): 2018-12-03 Justin Michaud CSS Painting API should scale display list when drawing https://bugs.webkit.org/show_bug.cgi?id=192217 Reviewed by Simon Fraser. When we replay the display list, fix the scaling. The separate buffer is needed to make sure that globalCompositeOperation functions correctly. * html/CustomPaintCanvas.cpp: (WebCore::CustomPaintCanvas::replayDisplayList const): * html/CustomPaintCanvas.h: * platform/graphics/CustomPaintImage.cpp: (WebCore::CustomPaintImage::doCustomPaint): 2018-12-03 Myles C. Maxfield Thick overlines and line-throughs grow in the wrong direction https://bugs.webkit.org/show_bug.cgi?id=192264 Reviewed by Dean Jackson. Overlines should grow upward, and line-throughs should stay centered. Test: fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html * rendering/TextDecorationPainter.cpp: (WebCore::TextDecorationPainter::paintTextDecoration): * style/InlineTextBoxStyle.cpp: (WebCore::visualOverflowForDecorations): 2018-12-03 Simon Fraser Viewport-constrained renderers are always RenderLayerModelObjects https://bugs.webkit.org/show_bug.cgi?id=192342 Reviewed by Myles C. Maxfield. addViewportConstrainedObject/removeViewportConstrainedObject can take RenderLayerModelObjects, since all viewport-constrained renderers have layers. * page/FrameView.cpp: (WebCore::FrameView::addViewportConstrainedObject): (WebCore::FrameView::removeViewportConstrainedObject): * page/FrameView.h: * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::styleDidChange): The 0 argument is actually a nullptr RenderGeometryMap, which has a default value, and the comment was obsolete. 2018-12-03 Don Olmstead Fix some unused parameter warnings https://bugs.webkit.org/show_bug.cgi?id=192336 Reviewed by Fujii Hironori. * Modules/indexeddb/server/IDBSerialization.cpp: (WebCore::isLegacySerializedIDBKeyData): * platform/FileSystem.cpp: (WebCore::FileSystem::openAndLockFile): * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: (WebCore::GraphicsContext3D::bindVertexArray): * platform/network/curl/CertificateInfo.h: (WTF::Persistence::Coder::encode): (WTF::Persistence::Coder::decode): 2018-12-03 Keith Rollin Add .xcfilelist files https://bugs.webkit.org/show_bug.cgi?id=192082 Reviewed by Brent Fulgham. Add .xcfilelist files for Generate Derived Sources and Generate Unified Sources build phases in Xcode. These are just being staged for now; they'll be added to the Xcode projects later. No new tests -- no changed functionality. * DerivedSources-input.xcfilelist: Added. * DerivedSources-output.xcfilelist: Added. * UnifiedSources-input.xcfilelist: Added. * UnifiedSources-output.xcfilelist: Added. 2018-12-03 Alex Christensen Add WKWebProcessPlugInLoadDelegate SPI willStartProvisionalLoadForFrame with a completion handler https://bugs.webkit.org/show_bug.cgi?id=192272 Reviewed by Brady Eidson. This is needed for rdar://problem/45910057 Covered by an API test. * loader/EmptyFrameLoaderClient.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::prepareForLoadStart): (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): (WebCore::FrameLoader::loadProvisionalItemFromCachedPage): * loader/FrameLoader.h: * loader/FrameLoaderClient.h: 2018-12-03 Zalan Bujtas [iOS] Unreviewed build fix. * page/DOMTimer.cpp: (WebCore::DOMTimer::fired): 2018-12-03 Jer Noble Get rid of old, dead Mac video fullscreen code. https://bugs.webkit.org/show_bug.cgi?id=192315 Reviewed by Eric Carlson. * PlatformMac.cmake: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::supportsFullscreen const): 2018-12-03 Ryosuke Niwa title attribute on style & link elements should be ignored inside a shadow tree https://bugs.webkit.org/show_bug.cgi?id=191297 Reviewed by Antti Koivisto. Fixed the by not setting the stylesheet's title even when the title content attribute is present or set on SVG/HTML style and link elements inside a shadow tree. Test: fast/shadow-dom/stylesheet-title-in-shadow-tree.html * dom/InlineStyleSheetOwner.cpp: (WebCore::InlineStyleSheetOwner::createSheet): * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::parseAttribute): (WebCore::HTMLLinkElement::initializeStyleSheet): * html/HTMLStyleElement.cpp: (WebCore::HTMLStyleElement::parseAttribute): * style/StyleScope.cpp: (WebCore::Style::Scope::collectActiveStyleSheets): * svg/SVGStyleElement.cpp: (WebCore::SVGStyleElement::parseAttribute): 2018-12-03 Zalan Bujtas [iOS] Add logging channel for hover related content observation https://bugs.webkit.org/show_bug.cgi?id=192312 Reviewed by Simon Fraser. * dom/Document.cpp: (WebCore::Document::scheduleStyleRecalc): (WebCore::Document::updateStyleIfNeeded): (WebCore::Document::platformSuspendOrStopActiveDOMObjects): * page/DOMTimer.cpp: (WebCore::DOMTimer::install): (WebCore::DOMTimer::fired): * page/DOMWindow.cpp: (WebCore::DOMWindow::clearTimeout): * page/Frame.cpp: (WebCore::Frame::willDetachPage): * platform/Logging.h: 2018-12-03 Michael Catanzaro [SOUP] Use SoupSession instead of SoupSessionAsync https://bugs.webkit.org/show_bug.cgi?id=107451 Reviewed by Carlos Garcia Campos. With glib-networking 2.57.1, WebKit is no longer able to load TLS error pages. The problem is a network process deadlock caused by a change in how glib-networking performs certificate verification. Previously it verified certificates *after* the TLS handshake had completed, which was weirdly late, but previously not problematic. But now that TLS 1.3 exists, application data can be sent before certificate verification occurs, which is no good. So I moved verification to occur during the handshake. I needed to do this regardless because I need to add a new callback in GnuTLS for another feature. This introduced a deadlock in WebKit: - glib-networking detects an unacceptable certificate, emits accept-certificate signal - NetworkDataTaskSoup::tlsConnectionAcceptCertificate calls NetworkDataTaskSoup::invalidateAndCancel calls NetworkDataTaskSoup::clearRequest - NetworkDataTaskSoup::clearRequest calls soup_session_cancel_message The problem is that, in the deprecated SoupSessionAsync used by WebKit, cancellation is always *synchronous* despite the name of the class. So soup_session_cancel_message winds up doing its thing to close everything out, and that eventually ends up in a synchronous call to g_tls_connection_gnutls_close. The close operation can't proceed until the TLS handshake is finished, and the handshake is blocked waiting for WebKit to return from its accept-certificate handler. So the close operation winds up polling forever waiting for the handshake to finish. Deadlock. The only changes required in WebKit to use the modern SoupSession are adjustments for the new default property values. Most of the properties we used to set explicitly are now defaults and should be removed. Additionally, SoupSession has default timeouts, which we want to override to allow NetworkDataTaskSoup to implement its own timeouts. No new tests because this is covered by TestSSL (which would be failing if run with the newer glib-networking). * platform/network/soup/SoupNetworkSession.cpp: (WebCore::SoupNetworkSession::SoupNetworkSession): 2018-12-03 Yusuke Suzuki Use WallTime for file time https://bugs.webkit.org/show_bug.cgi?id=192287 Reviewed by Darin Adler. This patch changes a type of file time from double to WallTime to use strongly typed file time. No behavior change. * Modules/webdatabase/Database.cpp: (WebCore::Database::details const): * Modules/webdatabase/DatabaseDetails.h: (WebCore::DatabaseDetails::DatabaseDetails): (WebCore::DatabaseDetails::creationTime const): (WebCore::DatabaseDetails::modificationTime const): * Modules/webdatabase/DatabaseManager.cpp: (WebCore::DatabaseManager::ProposedDatabase::ProposedDatabase): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::detailsForNameAndOrigin): * fileapi/AsyncFileStream.cpp: (WebCore::AsyncFileStream::getSize): * fileapi/AsyncFileStream.h: * fileapi/File.cpp: (WebCore::File::lastModified const): * page/Page.cpp: (WebCore::Page::userStyleSheetLocationChanged): (WebCore::Page::userStyleSheet const): * page/Page.h: * platform/FileMetadata.h: * platform/FileStream.cpp: (WebCore::FileStream::getSize): * platform/FileStream.h: * platform/FileSystem.cpp: (WebCore::FileSystem::getFileModificationTime): Deleted. * platform/FileSystem.h: (WebCore::FileSystem::invalidFileTime): Deleted. (WebCore::FileSystem::isValidFileTime): Deleted. * platform/glib/FileSystemGlib.cpp: (WebCore::FileSystem::getFileCreationTime): (WebCore::FileSystem::getFileModificationTime): (WebCore::FileSystem::fileMetadataUsingFunction): * platform/network/BlobDataFileReference.cpp: (WebCore::BlobDataFileReference::BlobDataFileReference): (WebCore::BlobDataFileReference::expectedModificationTime): * platform/network/BlobDataFileReference.h: * platform/network/FormData.cpp: (WebCore::FormData::appendFile): (WebCore::FormData::appendFileRange): * platform/network/FormData.h: (WebCore::FormDataElement::FormDataElement): (WebCore::FormDataElement::EncodedFileData::decode): * platform/network/cf/FormDataStreamCFNet.cpp: (WebCore::advanceCurrentStream): * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::appendEncodedBlobItemToSoupMessageBody): * platform/posix/FileSystemPOSIX.cpp: (WebCore::FileSystem::getFileCreationTime): (WebCore::FileSystem::getFileModificationTime): * platform/sql/SQLiteFileSystem.cpp: (WebCore::SQLiteFileSystem::databaseCreationTime): (WebCore::SQLiteFileSystem::databaseModificationTime): * platform/sql/SQLiteFileSystem.h: * platform/win/FileSystemWin.cpp: (WebCore::FileSystem::getFileModificationTime): (WebCore::FileSystem::getFileCreationTime): (WebCore::FileSystem::findDataToFileMetadata): 2018-12-03 Dean Jackson Fix iOS Simulator Release test crashes. * platform/network/ios/WebCoreURLResponseIOS.mm: (WebCore::adjustMIMETypeIfNecessary): Check for null before using the new MIME type. 2018-12-03 Eric Carlson [MediaStream] 'devicechange' event when more capture device information are revealed. https://bugs.webkit.org/show_bug.cgi?id=192268 Reviewed by Youenn Fablet. Test: fast/mediastream/enumerate-devices-change-event.html * Modules/mediastream/MediaDevicesRequest.cpp: (WebCore::MediaDevicesRequest::start): Remove code to modify device based on access, that is now done in the UI process. (WebCore::MediaDevicesRequest::filterDeviceList): Deleted. * Modules/mediastream/MediaDevicesRequest.h: * platform/mediastream/RealtimeMediaSourceCenter.h: 2018-12-03 Wenson Hsieh [iOSMac] Unable to upload non-image files using drag and drop in WKWebView https://bugs.webkit.org/show_bug.cgi?id=192283 Reviewed by Ryosuke Niwa. Currently on iOS, file URLs aren't generally written to the pasteboard during drag and drop unless the application providing the data explicitly registers "public.file-url" to item providers. As such, our current logic on iOS for handling drops does not attempt to prevent "public.file-url" from being advertised as the "text/uri-list" MIME type in DataTransfer, though we do currently succeed in suppressing access to the file URL. However, on iOSMac, the scenario in which file URLs are registered to item providers becomes pertinent when uploading files from other macOS apps (e.g. Finder) into a WKWebView running in iOSMac. Furthermore, the `preferredPresentationStyle` flag on `NSItemProvider` is unavailable in iOSMac; currently, this flag is our primary cue on iOS that an item should be treated as an attachment rather than inline data. In order to support file uploads in iOSMac, we make several adjustments to drop handling logic in iOS to handle the case where the "public.file-url" type is registered. See below for more details. Tests: DragAndDropTests.DataTransferExposePlainTextWithFileURLAsFile DragAndDropTests.DataTransferGetDataWhenDroppingImageWithFileURL * platform/PasteboardItemInfo.h: (WebCore::PasteboardItemInfo::encode const): (WebCore::PasteboardItemInfo::decode): Add a new flag that is set if and only if the item provider contains the "public.file-url" type, and also contains some non-URL data type that conforms to one of the file types supported for file uploads (i.e. "public.content", zip archives, and folders). * platform/cocoa/PasteboardCocoa.mm: (WebCore::Pasteboard::fileContentState): Consider the pasteboard to contain files in the case where one or more of the items contains a file URL, along with some other pasteboard data that can be represented as a file upload. * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::informationForItemAtIndex): (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): If the pasteboard contains "public.file-url", don't consider "text/uri-list" to be one of the data types that's safe to expose to the page. Our current behavior in this case is that we will advertise "text/uri-list" as a pasteboard type in the DataTransfer, but if the page attempts to request this information, we simply return the empty string. Instead, we shouldn't expose "text/uri-list" as a type in the first place. * platform/ios/WebItemProviderPasteboard.h: * platform/ios/WebItemProviderPasteboard.mm: Add a few more `__bridge`-ing casts where appropriate. (typeConformsToTypes): Move this further up the file so that it can be used in `NSItemProvider (WebCoreExtras)`. (-[NSItemProvider web_containsFileURLAndFileUploadContent]): Add a helper method on NSItemProvider to determine whether an item provider has a file URL, as well as a content type suitable for file uploads. (-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]): This currently always returns `NO` in iOSMac; instead, return `YES` on both iOS and iOSMac in the case where the item provider contains a file URL and content which may be uploaded. (-[WebItemProviderPasteboard preferredFileUploadURLAtIndex:fileType:]): (-[WebItemProviderPasteboard typeIdentifiersToLoad:]): Refactor this to take an `NSItemProvider` instead of a list of type identifiers, and bail out of loading data for "public.url" if the item provider contains a file URL. (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]): (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentifiers:]): Deleted. 2018-12-02 Zalan Bujtas Add a runtime feature flag for LayoutFormattingContext. https://bugs.webkit.org/show_bug.cgi?id=192280 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setLayoutFormattingContextEnabled): (WebCore::RuntimeEnabledFeatures::layoutFormattingContextEnabled const): 2018-12-01 Brent Fulgham Lifetime of HTMLMediaElement is not properly handled in asynchronous actions https://bugs.webkit.org/show_bug.cgi?id=192087 Reviewed by Dean Jackson. The HTMLMediaElement performs operations that allow arbitrary JavaScript to run. We need to make sure the active media element is protected until those calls complete. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::didFinishInsertingNode): (WebCore::HTMLMediaElement::exitFullscreen): (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): (WebCore::HTMLMediaElement::scheduleConfigureTextTracks): (WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated): (WebCore::HTMLMediaElement::scheduleUpdatePlayState): (WebCore::HTMLMediaElement::scheduleUpdateMediaState): 2018-12-01 Chris Dumez [PSON] process-swapping may occur even though opener has handle to openee https://bugs.webkit.org/show_bug.cgi?id=192277 Reviewed by Antti Koivisto. Process-swapping may occur even though opener has handle to openee, which is not Web-compatible. The reason is that we rely on the window not having an opener to process-swap. However, the opener can be disowned, which does not mean that the opener doesn't still have a handle to its openee. To address the issue: - Renamed openedViaWindowOpenWithOpener flag to openedByDOMWithOpener - Make sure this flag gets set if an opener have ever been set for the browsing context - Do not process-swap if this flag is set - Drop opener from NavigationAction since it does not provide meaningful information to decide whether to process-swap or not. * loader/FrameLoader.cpp: (WebCore::FrameLoader::setOpener): * loader/NavigationAction.h: (WebCore::NavigationAction::openedByDOMWithOpener const): (WebCore::NavigationAction::setOpenedByDOMWithOpener): (WebCore::NavigationAction::setOpener): Deleted. (WebCore::NavigationAction::opener const): Deleted. (WebCore::NavigationAction::openedViaWindowOpenWithOpener const): Deleted. (WebCore::NavigationAction::setOpenedViaWindowOpenWithOpener): Deleted. * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): * page/DOMWindow.cpp: (WebCore::DOMWindow::createWindow): * page/Page.h: (WebCore::Page::openedByDOMWithOpener const): (WebCore::Page::setOpenedByDOMWithOpener): (WebCore::Page::openedViaWindowOpenWithOpener const): Deleted. (WebCore::Page::setOpenedViaWindowOpenWithOpener): Deleted. 2018-12-01 Christopher Reid Add generic implementations to FileSystemPOSIX.cpp https://bugs.webkit.org/show_bug.cgi?id=192263 Reviewed by Yusuke Suzuki. No new tests, no change in behavior. Add generic FileSystemPOSIX implementations for: - stringFromFileSystemRepresentation - fileSystemRepresentation - moveFile - getVolumeFreeSpace Also removing an unneeded PLATFORM(GTK) check since GTK is only using FileSystemGlib * platform/posix/FileSystemPOSIX.cpp: 2018-12-01 Zalan Bujtas [LFC][BFC] Call instrinsicWidthConstraints on the correct formatting state. https://bugs.webkit.org/show_bug.cgi?id=192274 Reviewed by Antti Koivisto. When we call intrinsic width on a formatting context root, we need to use the formatting state that this root constructs and not the one it lives in. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const): it's the caller's responsiblitiy to store the intrinsic values. 2018-11-30 Alex Christensen Fix Windows build. * platform/network/curl/CookieJarCurl.cpp: * platform/network/curl/PublicSuffixCurl.cpp: 2018-11-30 Alex Christensen Fix Windows build. * platform/network/curl/CookieJarCurl.h: 2018-11-30 Alex Christensen Move URL from WebCore to WTF https://bugs.webkit.org/show_bug.cgi?id=190234 Reviewed by Keith Miller. A URL is a low-level concept that does not depend on other classes in WebCore. We are starting to use URLs in JavaScriptCore for modules. I need URL and URLParser in a place with fewer dependencies for rdar://problem/44119696 * Modules/applepay/ApplePaySession.h: * Modules/applepay/ApplePayValidateMerchantEvent.h: * Modules/applepay/PaymentCoordinator.cpp: * Modules/applepay/PaymentCoordinator.h: * Modules/applepay/PaymentCoordinatorClient.h: * Modules/applepay/PaymentSession.h: * Modules/applicationmanifest/ApplicationManifest.h: * Modules/beacon/NavigatorBeacon.cpp: * Modules/cache/DOMCache.cpp: * Modules/fetch/FetchLoader.h: * Modules/mediasession/MediaSessionMetadata.h: * Modules/mediasource/MediaSourceRegistry.cpp: * Modules/mediasource/MediaSourceRegistry.h: * Modules/mediastream/MediaStream.cpp: * Modules/mediastream/MediaStreamRegistry.cpp: * Modules/mediastream/MediaStreamRegistry.h: * Modules/navigatorcontentutils/NavigatorContentUtilsClient.h: * Modules/notifications/Notification.h: * Modules/paymentrequest/MerchantValidationEvent.h: * Modules/paymentrequest/PaymentRequest.h: * Modules/plugins/PluginReplacement.h: * Modules/webaudio/AudioContext.h: * Modules/websockets/ThreadableWebSocketChannel.h: * Modules/websockets/WebSocket.h: * Modules/websockets/WebSocketHandshake.cpp: * Modules/websockets/WebSocketHandshake.h: * Modules/websockets/WorkerThreadableWebSocketChannel.h: * PlatformMac.cmake: * PlatformWin.cmake: * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/CachedModuleScriptLoader.h: * bindings/js/CachedScriptFetcher.h: * bindings/js/ScriptController.cpp: (WebCore::ScriptController::executeIfJavaScriptURL): * bindings/js/ScriptController.h: * bindings/js/ScriptModuleLoader.h: * bindings/js/ScriptSourceCode.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): * bindings/scripts/test/JS/JSInterfaceName.cpp: * bindings/scripts/test/JS/JSMapLike.cpp: * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: * bindings/scripts/test/JS/JSTestCEReactions.cpp: * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: * bindings/scripts/test/JS/JSTestCallTracer.cpp: * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp: * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: * bindings/scripts/test/JS/JSTestDOMJIT.cpp: * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: * bindings/scripts/test/JS/JSTestEventConstructor.cpp: * bindings/scripts/test/JS/JSTestEventTarget.cpp: * bindings/scripts/test/JS/JSTestException.cpp: * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: * bindings/scripts/test/JS/JSTestGlobalObject.cpp: * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestInterface.cpp: * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: * bindings/scripts/test/JS/JSTestIterable.cpp: * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: * bindings/scripts/test/JS/JSTestNode.cpp: * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: * bindings/scripts/test/JS/JSTestPluginInterface.cpp: * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: * bindings/scripts/test/JS/JSTestSerialization.cpp: * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp: * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: * bindings/scripts/test/JS/JSTestStringifier.cpp: * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: * bindings/scripts/test/JS/JSTestTypedefs.cpp: * contentextensions/ContentExtensionsBackend.cpp: (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad): (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForPingLoad): (WebCore::ContentExtensions::applyBlockedStatusToRequest): * contentextensions/ContentExtensionsBackend.h: * css/CSSValue.h: * css/StyleProperties.h: * css/StyleResolver.h: * css/StyleSheet.h: * css/StyleSheetContents.h: * css/parser/CSSParserContext.h: (WebCore::CSSParserContextHash::hash): (WTF::HashTraits::constructDeletedValue): * css/parser/CSSParserIdioms.h: * dom/DataTransfer.cpp: (WebCore::DataTransfer::setDataFromItemList): * dom/Document.cpp: (WebCore::Document::setURL): (WebCore::Document::processHttpEquiv): (WebCore::Document::completeURL const): (WebCore::Document::ensureTemplateDocument): * dom/Document.h: (WebCore::Document::urlForBindings const): * dom/Element.cpp: (WebCore::Element::isJavaScriptURLAttribute const): * dom/InlineStyleSheetOwner.cpp: (WebCore::parserContextForElement): * dom/Node.cpp: (WebCore::Node::baseURI const): * dom/Node.h: * dom/ScriptElement.h: * dom/ScriptExecutionContext.h: * dom/SecurityContext.h: * editing/Editor.cpp: (WebCore::Editor::pasteboardWriterURL): * editing/Editor.h: * editing/MarkupAccumulator.cpp: (WebCore::MarkupAccumulator::appendQuotedURLAttributeValue): * editing/cocoa/DataDetection.h: * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::userVisibleString): * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::replaceRichContentWithAttachments): (WebCore::WebContentReader::readWebArchive): * editing/mac/EditorMac.mm: (WebCore::Editor::plainTextFromPasteboard): (WebCore::Editor::writeImageToPasteboard): * editing/markup.cpp: (WebCore::removeSubresourceURLAttributes): (WebCore::createFragmentFromMarkup): * editing/markup.h: * fileapi/AsyncFileStream.cpp: * fileapi/AsyncFileStream.h: * fileapi/Blob.h: * fileapi/BlobURL.cpp: * fileapi/BlobURL.h: * fileapi/File.h: * fileapi/FileReaderLoader.h: * fileapi/ThreadableBlobRegistry.h: * history/CachedFrame.h: * history/HistoryItem.h: * html/DOMURL.cpp: (WebCore::DOMURL::create): * html/DOMURL.h: * html/HTMLAttachmentElement.cpp: (WebCore::HTMLAttachmentElement::archiveResourceURL): * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::isURLAllowed const): (WebCore::HTMLFrameElementBase::openURL): (WebCore::HTMLFrameElementBase::setLocation): * html/HTMLInputElement.h: * html/HTMLLinkElement.h: * html/HTMLMediaElement.cpp: (WTF::LogArgument::toString): (WTF::LogArgument::toString): Deleted. * html/HTMLPlugInImageElement.cpp: (WebCore::HTMLPlugInImageElement::allowedToLoadFrameURL): * html/ImageBitmap.h: * html/MediaFragmentURIParser.h: * html/PublicURLManager.cpp: * html/PublicURLManager.h: * html/URLInputType.cpp: * html/URLRegistry.h: * html/URLSearchParams.cpp: (WebCore::URLSearchParams::URLSearchParams): (WebCore::URLSearchParams::toString const): (WebCore::URLSearchParams::updateURL): (WebCore::URLSearchParams::updateFromAssociatedURL): * html/URLUtils.h: (WebCore::URLUtils::setHost): (WebCore::URLUtils::setPort): * html/canvas/CanvasRenderingContext.cpp: * html/canvas/CanvasRenderingContext.h: * html/parser/HTMLParserIdioms.cpp: * html/parser/XSSAuditor.cpp: (WebCore::semicolonSeparatedValueContainsJavaScriptURL): (WebCore::XSSAuditor::filterScriptToken): (WebCore::XSSAuditor::filterObjectToken): (WebCore::XSSAuditor::filterParamToken): (WebCore::XSSAuditor::filterEmbedToken): (WebCore::XSSAuditor::filterFormToken): (WebCore::XSSAuditor::filterInputToken): (WebCore::XSSAuditor::filterButtonToken): (WebCore::XSSAuditor::eraseDangerousAttributesIfInjected): (WebCore::XSSAuditor::isLikelySafeResource): * html/parser/XSSAuditor.h: * html/parser/XSSAuditorDelegate.h: * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::openInNewTab): * inspector/InspectorInstrumentation.h: * inspector/agents/InspectorNetworkAgent.cpp: * inspector/agents/InspectorNetworkAgent.h: * inspector/agents/InspectorPageAgent.h: * inspector/agents/InspectorWorkerAgent.h: * loader/ApplicationManifestLoader.h: * loader/CookieJar.h: * loader/CrossOriginAccessControl.h: * loader/CrossOriginPreflightResultCache.h: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::willSendRequest): (WebCore::DocumentLoader::maybeLoadEmpty): * loader/DocumentLoader.h: (WebCore::DocumentLoader::serverRedirectSourceForHistory const): * loader/DocumentWriter.h: * loader/FormSubmission.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::submitForm): (WebCore::FrameLoader::receivedFirstData): (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): (WebCore::createWindow): * loader/FrameLoaderClient.h: * loader/HistoryController.cpp: (WebCore::HistoryController::currentItemShouldBeReplaced const): (WebCore::HistoryController::initializeItem): * loader/LinkLoader.h: * loader/LoadTiming.h: * loader/LoaderStrategy.h: * loader/MixedContentChecker.cpp: (WebCore::MixedContentChecker::checkFormForMixedContent const): * loader/MixedContentChecker.h: * loader/NavigationScheduler.cpp: (WebCore::NavigationScheduler::shouldScheduleNavigation const): * loader/NavigationScheduler.h: * loader/PingLoader.h: * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): * loader/ResourceLoadInfo.h: * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener): * loader/ResourceLoadObserver.h: * loader/ResourceLoadStatistics.h: * loader/ResourceLoader.h: * loader/ResourceTiming.h: * loader/SubframeLoader.cpp: (WebCore::SubframeLoader::requestFrame): * loader/SubframeLoader.h: * loader/SubstituteData.h: * loader/appcache/ApplicationCache.h: * loader/appcache/ApplicationCacheGroup.h: * loader/appcache/ApplicationCacheHost.h: * loader/appcache/ApplicationCacheStorage.cpp: * loader/appcache/ApplicationCacheStorage.h: * loader/appcache/ManifestParser.cpp: * loader/appcache/ManifestParser.h: * loader/archive/ArchiveResourceCollection.h: * loader/archive/cf/LegacyWebArchive.cpp: (WebCore::LegacyWebArchive::createFromSelection): * loader/cache/CachedResource.cpp: * loader/cache/CachedResourceLoader.h: * loader/cache/CachedStyleSheetClient.h: * loader/cache/MemoryCache.h: * loader/icon/IconLoader.h: * loader/mac/LoaderNSURLExtras.mm: * page/CaptionUserPreferencesMediaAF.cpp: * page/ChromeClient.h: * page/ClientOrigin.h: * page/ContextMenuClient.h: * page/ContextMenuController.cpp: (WebCore::ContextMenuController::checkOrEnableIfNeeded const): * page/DOMWindow.cpp: (WebCore::DOMWindow::isInsecureScriptAccess): * page/DragController.cpp: (WebCore::DragController::startDrag): * page/DragController.h: * page/EventSource.h: * page/Frame.h: * page/FrameView.h: * page/History.h: * page/Location.cpp: (WebCore::Location::url const): (WebCore::Location::reload): * page/Location.h: * page/Page.h: * page/PageSerializer.h: * page/Performance.h: * page/PerformanceResourceTiming.cpp: * page/SecurityOrigin.cpp: (WebCore::SecurityOrigin::SecurityOrigin): (WebCore::SecurityOrigin::create): * page/SecurityOrigin.h: * page/SecurityOriginData.h: * page/SecurityOriginHash.h: * page/SecurityPolicy.cpp: (WebCore::SecurityPolicy::shouldInheritSecurityOriginFromOwner): * page/SecurityPolicy.h: * page/SettingsBase.h: * page/ShareData.h: * page/SocketProvider.h: * page/UserContentProvider.h: * page/UserContentURLPattern.cpp: * page/UserContentURLPattern.h: * page/UserScript.h: * page/UserStyleSheet.h: * page/VisitedLinkStore.h: * page/csp/ContentSecurityPolicy.h: * page/csp/ContentSecurityPolicyClient.h: * page/csp/ContentSecurityPolicyDirectiveList.h: * page/csp/ContentSecurityPolicySource.cpp: (WebCore::ContentSecurityPolicySource::portMatches const): * page/csp/ContentSecurityPolicySource.h: * page/csp/ContentSecurityPolicySourceList.cpp: * page/csp/ContentSecurityPolicySourceList.h: * page/csp/ContentSecurityPolicySourceListDirective.cpp: * platform/ContentFilterUnblockHandler.h: * platform/ContextMenuItem.h: * platform/Cookie.h: * platform/CookiesStrategy.h: * platform/DragData.h: * platform/DragImage.h: * platform/FileStream.h: * platform/LinkIcon.h: * platform/Pasteboard.cpp: (WebCore::Pasteboard::canExposeURLToDOMWhenPasteboardContainsFiles): * platform/Pasteboard.h: * platform/PasteboardStrategy.h: * platform/PasteboardWriterData.cpp: (WebCore::PasteboardWriterData::setURLData): (WebCore::PasteboardWriterData::setURL): Deleted. * platform/PasteboardWriterData.h: * platform/PlatformPasteboard.h: * platform/PromisedAttachmentInfo.h: * platform/SSLKeyGenerator.h: * platform/SchemeRegistry.cpp: (WebCore::SchemeRegistry::isBuiltinScheme): * platform/SharedBuffer.h: * platform/SharedStringHash.cpp: * platform/SharedStringHash.h: * platform/SourcesSoup.txt: * platform/UserAgent.h: * platform/UserAgentQuirks.cpp: * platform/UserAgentQuirks.h: * platform/cocoa/NetworkExtensionContentFilter.h: * platform/cocoa/NetworkExtensionContentFilter.mm: (WebCore::NetworkExtensionContentFilter::willSendRequest): * platform/glib/SSLKeyGeneratorGLib.cpp: Copied from Source/WebCore/page/ShareData.h. (WebCore::getSupportedKeySizes): (WebCore::signedPublicKeyAndChallengeString): * platform/glib/UserAgentGLib.cpp: * platform/graphics/GraphicsContext.h: * platform/graphics/Image.cpp: * platform/graphics/Image.h: * platform/graphics/ImageObserver.h: * platform/graphics/ImageSource.cpp: * platform/graphics/ImageSource.h: * platform/graphics/MediaPlayer.h: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: * platform/graphics/cg/GraphicsContextCG.cpp: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: (webKitMediaSrcSetUri): * platform/graphics/iso/ISOVTTCue.cpp: * platform/graphics/win/GraphicsContextDirect2D.cpp: * platform/gtk/DragImageGtk.cpp: * platform/gtk/PasteboardGtk.cpp: * platform/gtk/PlatformPasteboardGtk.cpp: * platform/gtk/SelectionData.h: * platform/ios/PasteboardIOS.mm: * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::write): * platform/ios/QuickLook.h: * platform/mac/DragDataMac.mm: (WebCore::DragData::asPlainText const): * platform/mac/DragImageMac.mm: * platform/mac/FileSystemMac.mm: (WebCore::FileSystem::setMetadataURL): * platform/mac/PasteboardMac.mm: * platform/mac/PasteboardWriter.mm: (WebCore::createPasteboardWriter): * platform/mac/PlatformPasteboardMac.mm: * platform/mac/PublicSuffixMac.mm: (WebCore::decodeHostName): * platform/mac/SSLKeyGeneratorMac.mm: * platform/mac/WebCoreNSURLExtras.h: * platform/mac/WebCoreNSURLExtras.mm: (WebCore::isArmenianLookalikeCharacter): Deleted. (WebCore::isArmenianScriptCharacter): Deleted. (WebCore::isASCIIDigitOrValidHostCharacter): Deleted. (WebCore::isLookalikeCharacter): Deleted. (WebCore::whiteListIDNScript): Deleted. (WebCore::readIDNScriptWhiteListFile): Deleted. (WebCore::allCharactersInIDNScriptWhiteList): Deleted. (WebCore::isSecondLevelDomainNameAllowedByTLDRules): Deleted. (WebCore::isRussianDomainNameCharacter): Deleted. (WebCore::allCharactersAllowedByTLDRules): Deleted. (WebCore::mapHostNameWithRange): Deleted. (WebCore::hostNameNeedsDecodingWithRange): Deleted. (WebCore::hostNameNeedsEncodingWithRange): Deleted. (WebCore::decodeHostNameWithRange): Deleted. (WebCore::encodeHostNameWithRange): Deleted. (WebCore::decodeHostName): Deleted. (WebCore::encodeHostName): Deleted. (WebCore::collectRangesThatNeedMapping): Deleted. (WebCore::collectRangesThatNeedEncoding): Deleted. (WebCore::collectRangesThatNeedDecoding): Deleted. (WebCore::applyHostNameFunctionToMailToURLString): Deleted. (WebCore::applyHostNameFunctionToURLString): Deleted. (WebCore::mapHostNames): Deleted. (WebCore::stringByTrimmingWhitespace): Deleted. (WebCore::URLByTruncatingOneCharacterBeforeComponent): Deleted. (WebCore::URLByRemovingResourceSpecifier): Deleted. (WebCore::URLWithData): Deleted. (WebCore::dataWithUserTypedString): Deleted. (WebCore::URLWithUserTypedString): Deleted. (WebCore::URLWithUserTypedStringDeprecated): Deleted. (WebCore::hasQuestionMarkOnlyQueryString): Deleted. (WebCore::dataForURLComponentType): Deleted. (WebCore::URLByRemovingComponentAndSubsequentCharacter): Deleted. (WebCore::URLByRemovingUserInfo): Deleted. (WebCore::originalURLData): Deleted. (WebCore::createStringWithEscapedUnsafeCharacters): Deleted. (WebCore::userVisibleString): Deleted. (WebCore::isUserVisibleURL): Deleted. (WebCore::rangeOfURLScheme): Deleted. (WebCore::looksLikeAbsoluteURL): Deleted. * platform/mediastream/MediaEndpointConfiguration.h: * platform/network/BlobPart.h: * platform/network/BlobRegistry.h: * platform/network/BlobRegistryImpl.h: * platform/network/BlobResourceHandle.cpp: * platform/network/CookieRequestHeaderFieldProxy.h: * platform/network/CredentialStorage.cpp: * platform/network/CredentialStorage.h: * platform/network/DataURLDecoder.cpp: * platform/network/DataURLDecoder.h: * platform/network/FormData.h: * platform/network/ProxyServer.h: * platform/network/ResourceErrorBase.h: * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::didReceiveResponse): * platform/network/ResourceHandle.h: * platform/network/ResourceHandleClient.h: * platform/network/ResourceRequestBase.cpp: (WebCore::ResourceRequestBase::redirectedRequest const): * platform/network/ResourceRequestBase.h: * platform/network/ResourceResponseBase.h: * platform/network/SocketStreamHandle.h: * platform/network/cf/DNSResolveQueueCFNet.cpp: * platform/network/cf/NetworkStorageSessionCFNet.cpp: * platform/network/cf/ProxyServerCFNet.cpp: * platform/network/cf/ResourceErrorCF.cpp: * platform/network/cocoa/NetworkStorageSessionCocoa.mm: * platform/network/curl/CookieJarCurlDatabase.cpp: Added. (WebCore::cookiesForSession): (WebCore::CookieJarCurlDatabase::setCookiesFromDOM const): (WebCore::CookieJarCurlDatabase::setCookiesFromHTTPResponse const): (WebCore::CookieJarCurlDatabase::cookiesForDOM const): (WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const): (WebCore::CookieJarCurlDatabase::cookiesEnabled const): (WebCore::CookieJarCurlDatabase::getRawCookies const): (WebCore::CookieJarCurlDatabase::deleteCookie const): (WebCore::CookieJarCurlDatabase::getHostnamesWithCookies const): (WebCore::CookieJarCurlDatabase::deleteCookiesForHostnames const): (WebCore::CookieJarCurlDatabase::deleteAllCookies const): (WebCore::CookieJarCurlDatabase::deleteAllCookiesModifiedSince const): * platform/network/curl/CookieJarDB.cpp: * platform/network/curl/CookieUtil.h: * platform/network/curl/CurlContext.h: * platform/network/curl/CurlProxySettings.h: * platform/network/curl/CurlResponse.h: * platform/network/curl/NetworkStorageSessionCurl.cpp: * platform/network/curl/ProxyServerCurl.cpp: * platform/network/curl/SocketStreamHandleImplCurl.cpp: * platform/network/mac/ResourceErrorMac.mm: * platform/network/soup/NetworkStorageSessionSoup.cpp: * platform/network/soup/ProxyServerSoup.cpp: * platform/network/soup/ResourceHandleSoup.cpp: * platform/network/soup/ResourceRequest.h: * platform/network/soup/ResourceRequestSoup.cpp: * platform/network/soup/SocketStreamHandleImplSoup.cpp: * platform/network/soup/SoupNetworkSession.cpp: * platform/network/soup/SoupNetworkSession.h: * platform/text/TextEncoding.h: * platform/win/BString.cpp: * platform/win/BString.h: * platform/win/ClipboardUtilitiesWin.cpp: (WebCore::markupToCFHTML): * platform/win/ClipboardUtilitiesWin.h: * platform/win/DragImageWin.cpp: * platform/win/PasteboardWin.cpp: * plugins/PluginData.h: * rendering/HitTestResult.h: * rendering/RenderAttachment.cpp: * svg/SVGImageLoader.cpp: (WebCore::SVGImageLoader::sourceURI const): * svg/SVGURIReference.cpp: * svg/graphics/SVGImage.h: * svg/graphics/SVGImageCache.h: * svg/graphics/SVGImageForContainer.h: * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): * testing/Internals.mm: (WebCore::Internals::userVisibleString): * testing/MockContentFilter.cpp: (WebCore::MockContentFilter::willSendRequest): * testing/MockPaymentCoordinator.cpp: * testing/js/WebCoreTestSupport.cpp: * workers/AbstractWorker.h: * workers/WorkerGlobalScope.h: * workers/WorkerGlobalScopeProxy.h: * workers/WorkerInspectorProxy.h: * workers/WorkerLocation.h: * workers/WorkerScriptLoader.h: * workers/WorkerThread.cpp: * workers/WorkerThread.h: * workers/service/ServiceWorker.h: * workers/service/ServiceWorkerClientData.h: * workers/service/ServiceWorkerContainer.cpp: * workers/service/ServiceWorkerContextData.h: * workers/service/ServiceWorkerData.h: * workers/service/ServiceWorkerJobData.h: * workers/service/ServiceWorkerRegistrationKey.cpp: * workers/service/ServiceWorkerRegistrationKey.h: (WTF::HashTraits::constructDeletedValue): * worklets/WorkletGlobalScope.h: * xml/XMLHttpRequest.h: 2018-11-30 Chris Dumez Drop unused Cross-Origin-Window-Policy from HTTPHeaderNames.in https://bugs.webkit.org/show_bug.cgi?id=192253 Reviewed by Geoffrey Garen. * platform/network/HTTPHeaderNames.in: 2018-11-30 Justin Fan [WebGPU] WebGPUQueue::submit and WebGPURenderingContext::present() implementation https://bugs.webkit.org/show_bug.cgi?id=192254 Reviewed by Dean Jackson. Final plumbing to render onto an HTMLCanvasElement with WebGPU. Also added ref-test that draws a green square onto a canvas using WebGPU; reference uses 2D canvas. Test: webgpu/simple-triangle-strip.html * Modules/webgpu/WebGPUCommandBuffer.h: * Modules/webgpu/WebGPUSwapChain.h: Needs to override platformLayer() for CanvasBasedRenderingContext. * platform/graphics/gpu/GPUQueue.h: * platform/graphics/gpu/GPUSwapChain.h: (WebCore::GPUSwapChain::metalLayer const): Renamed from platformLayer. (WebCore::GPUSwapChain::platformLayer const): Deleted. * platform/graphics/gpu/cocoa/GPUQueueMetal.mm: (WebCore::GPUQueue::submit): * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: (WebCore::GPUSwapChain::getNextTexture): Returns the texture of the swap layer's next drawable. (WebCore::GPUSwapChain::present): Presents the last-returned drawable from getNextTexture, and frees it. (WebCore::GPUSwapChain::platformLayer const): 2018-11-30 Zalan Bujtas Can’t use RalphLauren.com on iPad because hover menus don’t stay up https://bugs.webkit.org/show_bug.cgi?id=192236 Reviewed by Geoffrey Garen. This patch introduces asynchronous content change observation. 1. Start observing synchronous content change and timer install as the result of dispatching mouseMoved event. 2. Start observing synchronous content change and style recalc schedule as the result of a timer callback (installed at #1). 3. Start observing synchronous content change as the result of a style recalc (scheduled at #2). This patch also extends the timeout value from 100ms to 250ms. Certain content prefer longer timeouts (see http://briancherne.github.io/jquery-hoverIntent/ for details). Test: fast/events/touch/ios/hover-when-style-change-is-async.html * dom/Document.cpp: (WebCore::Document::scheduleStyleRecalc): (WebCore::Document::updateStyleIfNeeded): * page/DOMTimer.cpp: (WebCore::DOMTimer::install): (WebCore::DOMTimer::fired): * platform/ios/wak/WKContentObservation.cpp: (WKStartObservingStyleRecalcScheduling): (WKStopObservingStyleRecalcScheduling): (WKIsObservingStyleRecalcScheduling): (WKSetShouldObserveNextStyleRecalc): (WKShouldObserveNextStyleRecalc): (WKSetObservedContentChange): * platform/ios/wak/WKContentObservation.h: 2018-11-30 Ryosuke Niwa ShadowRoot should have styleSheets property https://bugs.webkit.org/show_bug.cgi?id=191311 Reviewed by Antti Koivisto. Added the support for ShadowRoot.prototype.styleSheets by making StyleSheetList refer to either a document or a shadow root. We don't support the named getter in shadow root since that's not a standard feature: https://drafts.csswg.org/cssom/#the-stylesheetlist-interface Tests: fast/shadow-dom/shadowroot-stylesheets-wrapper-gc.html imported/w3c/web-platform-tests/shadow-dom/ShadowRoot-interface.html * css/StyleSheetList.cpp: (WebCore::StyleSheetList::StyleSheetList): Added a variant which takes ShadowRoot. (WebCore::StyleSheetList::styleSheets const): (WebCore::StyleSheetList::ownerNode): Added. The replacement for document() since now the opaque root could be either a Document or a ShadowRoot. (WebCore::StyleSheetList::detach): Renamed from detachFromDocument. (WebCore::StyleSheetList::namedItem const): Added a comment that the named getter is only supported for Document since it's not in the standard. * css/StyleSheetList.h: (WebCore::StyleSheetList::create): Added a variant which takes ShadowRoot. (WebCore::StyleSheetList::document): Deleted. Replaced by StyleSheetList::ownerNode in .cpp file. * css/StyleSheetList.idl: * dom/Document.cpp: (WebCore::Document::~Document): (WebCore::Document::styleSheets): * dom/Document.idl: * dom/DocumentOrShadowRoot.idl: Moved the declaration of styleSheets here from Document.idl. * dom/ShadowRoot.cpp: (WebCore::ShadowRoot::~ShadowRoot): Call detach. (WebCore::ShadowRoot::styleSheets): * dom/ShadowRoot.h: 2018-11-30 Chris Dumez [PSON] We are sometimes swapping processes even though there is an opened window with an opener link to us https://bugs.webkit.org/show_bug.cgi?id=192242 Reviewed by Geoffrey Garen. Move the setting of the openedViaWindowOpenWithOpener & hasOpenedFrames flags on the NavigationAction from FrameLoader::loadURL(), to PolicyChecker::checkNavigationPolicy() to make sure those are always accurate and so that the UIProcess can make correct process swapping decisions. NavigationAction objects are created in other places than FrameLoader::loadURL() as well. Even PolicyChecker::checkNavigationPolicy() will create a NavigationAction object if there is not already one. * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadURL): * loader/FrameLoader.h: (WebCore::FrameLoader::hasOpenedFrames const): * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): 2018-11-30 Don Olmstead Rename ENABLE_SUBTLE_CRYPTO to ENABLE_WEB_CRYPTO https://bugs.webkit.org/show_bug.cgi?id=192197 Reviewed by Jiewen Tan. No new tests. No change in behavior. * Configurations/FeatureDefines.xcconfig: * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::CloneDeserializer::readTerminal): * crypto/CommonCryptoUtilities.cpp: * crypto/CommonCryptoUtilities.h: * crypto/CryptoAlgorithm.cpp: * crypto/CryptoAlgorithm.h: * crypto/CryptoAlgorithmIdentifier.h: * crypto/CryptoAlgorithmParameters.h: * crypto/CryptoAlgorithmParameters.idl: * crypto/CryptoAlgorithmRegistry.cpp: * crypto/CryptoAlgorithmRegistry.h: * crypto/CryptoKey.cpp: * crypto/CryptoKey.h: * crypto/CryptoKey.idl: * crypto/CryptoKeyFormat.h: * crypto/CryptoKeyPair.h: * crypto/CryptoKeyPair.idl: * crypto/CryptoKeyType.h: * crypto/CryptoKeyUsage.h: * crypto/CryptoKeyUsage.idl: * crypto/JsonWebKey.h: * crypto/JsonWebKey.idl: * crypto/RsaOtherPrimesInfo.h: * crypto/RsaOtherPrimesInfo.idl: * crypto/SerializedCryptoKeyWrap.h: * crypto/SubtleCrypto.cpp: * crypto/SubtleCrypto.h: * crypto/SubtleCrypto.idl: * 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: * crypto/algorithms/CryptoAlgorithmSHA1.cpp: * crypto/algorithms/CryptoAlgorithmSHA1.h: * crypto/algorithms/CryptoAlgorithmSHA224.cpp: * crypto/algorithms/CryptoAlgorithmSHA224.h: * crypto/algorithms/CryptoAlgorithmSHA256.cpp: * crypto/algorithms/CryptoAlgorithmSHA256.h: * crypto/algorithms/CryptoAlgorithmSHA384.cpp: * crypto/algorithms/CryptoAlgorithmSHA384.h: * crypto/algorithms/CryptoAlgorithmSHA512.cpp: * crypto/algorithms/CryptoAlgorithmSHA512.h: * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp: * crypto/gcrypt/CryptoKeyECGCrypt.cpp: * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: * crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp: * crypto/keys/CryptoAesKeyAlgorithm.idl: * crypto/keys/CryptoEcKeyAlgorithm.idl: * crypto/keys/CryptoHmacKeyAlgorithm.idl: * crypto/keys/CryptoKeyAES.cpp: * crypto/keys/CryptoKeyAES.h: * crypto/keys/CryptoKeyAlgorithm.idl: * crypto/keys/CryptoKeyEC.cpp: * crypto/keys/CryptoKeyEC.h: * crypto/keys/CryptoKeyHMAC.cpp: * crypto/keys/CryptoKeyHMAC.h: * crypto/keys/CryptoKeyRSA.cpp: * crypto/keys/CryptoKeyRSA.h: * crypto/keys/CryptoKeyRSAComponents.cpp: * crypto/keys/CryptoKeyRSAComponents.h: * crypto/keys/CryptoKeyRaw.cpp: * crypto/keys/CryptoKeyRaw.h: * crypto/keys/CryptoRsaHashedKeyAlgorithm.idl: * crypto/keys/CryptoRsaKeyAlgorithm.idl: * crypto/mac/CommonCryptoDERUtilities.cpp: * crypto/mac/CommonCryptoDERUtilities.h: * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp: * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp: * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp: * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp: * crypto/mac/CryptoAlgorithmAES_KWMac.cpp: * crypto/mac/CryptoAlgorithmECDHMac.cpp: * crypto/mac/CryptoAlgorithmECDSAMac.cpp: * crypto/mac/CryptoAlgorithmHKDFMac.cpp: * crypto/mac/CryptoAlgorithmHMACMac.cpp: * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp: * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp: * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp: * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp: * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp: * crypto/mac/CryptoAlgorithmRegistryMac.cpp: * crypto/mac/CryptoDigestAlgorithm.h: * crypto/mac/CryptoKeyECMac.cpp: * crypto/mac/CryptoKeyMac.cpp: * crypto/mac/CryptoKeyRSAMac.cpp: * crypto/mac/SerializedCryptoKeyWrapMac.mm: * crypto/parameters/AesCbcCfbParams.idl: * crypto/parameters/AesCtrParams.idl: * crypto/parameters/AesGcmParams.idl: * crypto/parameters/AesKeyParams.idl: * crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h: * crypto/parameters/CryptoAlgorithmAesCtrParams.h: * crypto/parameters/CryptoAlgorithmAesGcmParams.h: * crypto/parameters/CryptoAlgorithmAesKeyParams.h: * crypto/parameters/CryptoAlgorithmEcKeyParams.h: * crypto/parameters/CryptoAlgorithmEcdhKeyDeriveParams.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/CryptoAlgorithmRsaKeyGenParams.h: * crypto/parameters/CryptoAlgorithmRsaOaepParams.h: * crypto/parameters/CryptoAlgorithmRsaPssParams.h: * crypto/parameters/EcKeyParams.idl: * crypto/parameters/EcdhKeyDeriveParams.idl: * crypto/parameters/EcdsaParams.idl: * crypto/parameters/HkdfParams.idl: * crypto/parameters/HmacKeyParams.idl: * crypto/parameters/Pbkdf2Params.idl: * crypto/parameters/RsaHashedImportParams.idl: * crypto/parameters/RsaHashedKeyGenParams.idl: * crypto/parameters/RsaKeyGenParams.idl: * crypto/parameters/RsaOaepParams.idl: * crypto/parameters/RsaPssParams.idl: * dom/Document.cpp: * dom/Document.h: * dom/ScriptExecutionContext.h: * page/ChromeClient.h: * page/Crypto.cpp: (WebCore::Crypto::Crypto): * page/Crypto.h: * page/Crypto.idl: * platform/GCrypt.cmake: * platform/LocalizedStrings.cpp: * platform/LocalizedStrings.h: * workers/WorkerGlobalScope.cpp: * workers/WorkerGlobalScope.h: * worklets/WorkletGlobalScope.h: 2018-11-30 Wenson Hsieh Replace "auto fill" with "AutoFill" in some localizable strings https://bugs.webkit.org/show_bug.cgi?id=192233 Reviewed by Chris Fleizach. Replace "autofill" with "AutoFill". * en.lproj/Localizable.strings: * platform/LocalizedStrings.cpp: (WebCore::AXAutoFillCredentialsLabel): (WebCore::AXAutoFillContactsLabel): (WebCore::AXAutoFillStrongPasswordLabel): (WebCore::AXAutoFillCreditCardLabel): 2018-11-29 Ryosuke Niwa Add CEReactions=NotNeeded on all the relevant IDL files https://bugs.webkit.org/show_bug.cgi?id=188368 Rubber-stamped by Antti Koivisto. Based on a patch written by Frederic Wang. Added CEReactions=NotNeeded to all the places we don't need CEReactions because we don't implement customized builtins but are marked with CEReactions in the HTML specification. * html/HTMLAnchorElement.idl: * html/HTMLAreaElement.idl: * html/HTMLBRElement.idl: * html/HTMLBaseElement.idl: * html/HTMLBodyElement.idl: * html/HTMLButtonElement.idl: * html/HTMLCanvasElement.idl: * html/HTMLDListElement.idl: * html/HTMLDataElement.idl: * html/HTMLDetailsElement.idl: * html/HTMLDirectoryElement.idl: * html/HTMLDivElement.idl: * html/HTMLEmbedElement.idl: * html/HTMLFieldSetElement.idl: * html/HTMLFontElement.idl: * html/HTMLFormElement.idl: * html/HTMLFrameElement.idl: * html/HTMLFrameSetElement.idl: * html/HTMLHRElement.idl: * html/HTMLHeadingElement.idl: * html/HTMLHtmlElement.idl: * html/HTMLHyperlinkElementUtils.idl: * html/HTMLImageElement.idl: * html/HTMLInputElement.idl: * html/HTMLLIElement.idl: * html/HTMLLabelElement.idl: * html/HTMLLegendElement.idl: * html/HTMLLinkElement.idl: * html/HTMLMapElement.idl: * html/HTMLMarqueeElement.idl: * html/HTMLMediaElement.idl: * html/HTMLMenuElement.idl: * html/HTMLMetaElement.idl: * html/HTMLMeterElement.idl: * html/HTMLModElement.idl: * html/HTMLOListElement.idl: * html/HTMLObjectElement.idl: * html/HTMLOptGroupElement.idl: * html/HTMLOptionElement.idl: * html/HTMLOutputElement.idl: * html/HTMLParagraphElement.idl: * html/HTMLParamElement.idl: * html/HTMLPreElement.idl: * html/HTMLProgressElement.idl: * html/HTMLQuoteElement.idl: * html/HTMLScriptElement.idl: * html/HTMLSlotElement.idl: * html/HTMLSourceElement.idl: * html/HTMLStyleElement.idl: * html/HTMLTableCaptionElement.idl: * html/HTMLTableCellElement.idl: * html/HTMLTableColElement.idl: * html/HTMLTableElement.idl: * html/HTMLTableRowElement.idl: * html/HTMLTableSectionElement.idl: * html/HTMLTextAreaElement.idl: * html/HTMLTimeElement.idl: * html/HTMLTrackElement.idl: * html/HTMLUListElement.idl: * html/HTMLVideoElement.idl: 2018-11-30 Alexey Proskuryakov Move USE_CFNETWORK_IGNORE_HSTS to its proper place https://bugs.webkit.org/show_bug.cgi?id=192173 Reviewed by Tim Horton. * platform/network/mac/WebCoreURLResponse.mm: (WebCore::schemeWasUpgradedDueToDynamicHSTS): 2018-11-30 Basuke Suzuki [Curl] Add API for ProtectionSpace. https://bugs.webkit.org/show_bug.cgi?id=191648 Reviewed by Alex Christensen. Create a platform dependent header and implementation files for ProtectionSpace. No new tests because there's no behavior change. * platform/Curl.cmake: * platform/network/ProtectionSpace.h: * platform/network/curl/ProtectionSpaceCurl.cpp: Added. (WebCore::ProtectionSpace::certificateInfo const): * platform/network/curl/ProtectionSpaceCurl.h: Added. (WebCore::ProtectionSpace::ProtectionSpace): (WebCore::ProtectionSpace::encodingRequiresPlatformData const): (WebCore::ProtectionSpace::platformCompare): 2018-11-30 Justin Fan [WebGPU] Flesh out WebGPURenderPassDescriptor to match the WebGPU IDL https://bugs.webkit.org/show_bug.cgi?id=192213 Reviewed by Dean Jackson. WebGPU prototype now uses WebGPURenderPassColorAttachmentDescriptor in WebGPURenderPassDescriptor to match the WebGPU Sketch. WebGPU developer can now also set the clearColor in WebGPURenderPassDescriptor. No new tests. Older WebGPURenderPass* tests updated. * CMakeLists.txt: * DerivedSources.make: * Modules/webgpu/WebGPUColor.h: Added. Typedef'd to GPUColor.h. * Modules/webgpu/WebGPUColor.idl: Added. * Modules/webgpu/WebGPUCommandBuffer.cpp: (WebCore::WebGPUCommandBuffer::beginRenderPass): Updated to error check and support the new structure of WebGPURenderPassDescriptor. * Modules/webgpu/WebGPURenderPassColorAttachmentDescriptor.h: Added. * Modules/webgpu/WebGPURenderPassColorAttachmentDescriptor.idl: Added. * Modules/webgpu/WebGPURenderPassDescriptor.h: * Modules/webgpu/WebGPURenderPassDescriptor.idl: Updated to match the sketch IDL. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/gpu/GPUColor.h: Added. * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h: Added. Backing struct for WebGPU__. * platform/graphics/gpu/GPURenderPassDescriptor.h: Updated to match new WebGPURenderPassDescriptor. * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: (WebCore::GPURenderPassEncoder::create): Now also uses clearColor set by developer. 2018-11-30 Andy Estes [Cocoa] Add some WKA extension points https://bugs.webkit.org/show_bug.cgi?id=192131 Reviewed by Tim Horton. * DerivedSources.make: Added an extension point for derived sources. * Modules/applepay/PaymentCoordinatorClient.h: Added an extension point for PaymentCoordinatorClient. * SourcesCocoa.txt: Added WebCoreAdditions.mm as a non-unified source. * WebCore.xcodeproj/project.pbxproj: Added WebCoreAdditions.mm. * bindings/js/WebCoreBuiltinNames.h: Added an extension point for built-in names. * page/SettingsBase.h: Added an extension point for settings. * platform/cocoa/WebCoreAdditions.mm: Added. 2018-11-30 Xabier Rodriguez Calvar [GStreamer][EME] CDMInstance should be shipped as a GstContext to the decryptors https://bugs.webkit.org/show_bug.cgi?id=192075 Reviewed by Philippe Normand. So far, we were shipping the CDMInstance in an event to the decryptors and they were requesting it with bus messages when it was not found. Now we ship it with a GstContext that is set to the pipeline and read from the decryptors, which is now always available. As a consequence of changing this flow, the attemptToDecrypt one was affected as well because it was tied to CDMInstance shipment. A workaround was added: when the decryptors send the waitingForKey, an attemptToDecrypt will be performed. A FIXME was added for this. A subconsequence is that attemptToDecryptWithInstance is reworked to rely always in attemptToDecryptWithLocal instance, the former becomes final and the latter virtual. This is a rework, no new tests needed. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::handleMessage): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached): (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached): (WebCore::MediaPlayerPrivateGStreamerBase::attemptToDecryptWithLocalInstance): (WebCore::MediaPlayerPrivateGStreamerBase::dispatchCDMInstance): Deleted. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (webkit_media_common_encryption_decrypt_class_init): (webkitMediaCommonEncryptionDecryptTransformInPlace): (webkitMediaCommonEncryptionDecryptIsCDMInstanceAvailable): (webkitMediaCommonEncryptionDecryptSinkEventHandler): (webKitMediaCommonEncryptionDecryptorSetContext): * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithLocalInstance): (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance): Deleted. * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: 2018-11-30 Zalan Bujtas [LFC][BFC] Compute min/maxHeight margins only when they are needed. https://bugs.webkit.org/show_bug.cgi?id=192223 Reviewed by Antti Koivisto. Test: fast/block/block-only/collapsed-margin-with-min-height.html * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): 2018-11-30 Zalan Bujtas [LFC][BFC] Geometry::inFlowNonReplacedHeightAndMargin should check for empty inline formatting context. https://bugs.webkit.org/show_bug.cgi?id=192215 Reviewed by Antti Koivisto. Check if the inline formatting context actually has any lines. * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): 2018-11-30 Zalan Bujtas [LFC][BFC][MarginCollapsing] Do not use computed display box values for border and padding https://bugs.webkit.org/show_bug.cgi?id=192214 Reviewed by Antti Koivisto. Border and padding values are not necessarily computed yet when we try to estimate the margin top value. Estimating margin top is required to be able to place floats (vertically) sooner than we would compute the final vertical position for a regular block box.
In the above example, to estimate a final vertical position of the floating box, we need to know whether the nested div's margin is collapsed all the way up to the body. However in order to find it out we need to check for borders and paddings (they stop margin collapsing). At the time when the floating box is being laied out, those
block boxes are still far down in the layout queue. * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::hasBorder): (WebCore::Layout::hasPadding): (WebCore::Layout::hasBorderBefore): (WebCore::Layout::hasBorderAfter): (WebCore::Layout::hasPaddingBefore): (WebCore::Layout::hasPaddingAfter): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent): (WebCore::Layout::isMarginBottomCollapsedThrough): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild): 2018-11-29 Frederic Wang Separate paint and scroll offsets for RenderLayerBacking::m_scrollingContentsLayer https://bugs.webkit.org/show_bug.cgi?id=183040 Currently, scroll offset of RenderLayerBacking::m_scrollingContentsLayer is stored in the GraphicsLayer::m_offsetFromRenderer member used for paint offset. This patch separates these two concept by introducing a new GraphicsLayer::m_scrollOffset for the scroll offset. This makes the API a little bit cleaner, the code easier to understand and might avoid unnecessary repaints in composited scroll. Reviewed by Simon Fraser. No new tests, already covered by existing tests. * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::setScrollOffset): Setter function to update the scroll offset of the content layer inside its scrolling parent layer. Ask a repaint if it has changed and is requested by the caller. (WebCore::GraphicsLayer::paintGraphicsLayerContents): Take into account the scroll offset when painting. (WebCore::GraphicsLayer::dumpProperties const): Dump the scroll offset property. * platform/graphics/GraphicsLayer.h: Include ScrollableArea for the ScrollOffset typedef. Add member for the scroll offset of the content layer inside its scrolling parent layer. (WebCore::GraphicsLayer::scrollOffset const): Getter function. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGeometry): Do not include the scroll offset in the paint offset of m_scrollingContentsLayer since it is now taken into account in paintGraphicsLayerContents. Update the scroll offset of m_scrollingContentsLayer separately. Leave the paint offset of m_foregroundLayer unchanged. (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect): Take into account the scroll offset of m_scrollingContentsLayer when calculating the dirty rect. 2018-11-29 Simon Fraser Overflow scrolling layers need to be self-painting https://bugs.webkit.org/show_bug.cgi?id=192201 Reviewed by Dean Jackson. Overflow scrolling layers paint their contents, so need to be self-painting in the RenderLayer sense. Without this change, the overflow in the testcase doesn't get any compositing layers. Test: compositing/scrolling/overflow-scrolling-layers-are-self-painting.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects const): 2018-11-29 Christopher Reid [Win] listDirectory in FileSystemWin.cpp should not skip all directories https://bugs.webkit.org/show_bug.cgi?id=192042 Reviewed by Fujii Hironori. Covered by existing tests. listDirectory is not returning any child directories which is causing ASSERT(diskUsage >= databaseFileSize) in SQLiteIDBBackingStore.cpp to fail. Change listDirectory in FileSystemWin to match FileSystemPOSIX's behavior. listDirectory should only skip the current and previous directories. * platform/win/FileSystemWin.cpp: 2018-11-29 Ryan Haddad Unreviewed, rolling out r238713. Breaks internal builds. Reverted changeset: "[Cocoa] Add some WKA extension points" https://bugs.webkit.org/show_bug.cgi?id=192131 https://trac.webkit.org/changeset/238713 2018-11-29 Ryan Haddad Unreviewed, rolling out r238680. Caused existing webrtc layout tests to fail an assertion. Reverted changeset: "A sender created through addTransceiver and populated using addTrack should have its source set" https://bugs.webkit.org/show_bug.cgi?id=192136 https://trac.webkit.org/changeset/238680 2018-11-29 Justin Fan Remove dangling WebGPU file references from WebCore project https://bugs.webkit.org/show_bug.cgi?id=192185 Unreviewed project file gardening. No new tests. * WebCore.xcodeproj/project.pbxproj: 2018-11-29 Keith Rollin Unreviewed build fix. r238637 introduced some DerivedSources.make changes that could produce some invalid .idl files, leading to IDLParser.pm error messages. * DerivedSources.make: 2018-11-29 Simon Fraser Add an internal feature flag to enable async overflow scrolling https://bugs.webkit.org/show_bug.cgi?id=192184 Reviewed by Tim Horton. Add a new internal feature flag that will enable async overflow-scrolling for most overflow:scroll elements. Defaults to off. Make the "UseAcceleratedTouchScrolling" terminology in RenderLayer etc be more generic, and refer to async overflow scrolling. * page/Settings.yaml: * rendering/RenderLayer.cpp: (WebCore::canCreateStackingContext): Remove a line which is not necessary, since -webkit-overflow-scrolling: touch already triggers non-auto z-index via code in StyleResolver::adjustRenderStyle(). (WebCore::RenderLayer::canUseCompositedScrolling const): (WebCore::RenderLayer::hasCompositedScrollableOverflow const): (WebCore::RenderLayer::handleTouchEvent): (WebCore::RenderLayer::usesAsyncScrolling const): (WebCore::RenderLayer::updateScrollInfoAfterLayout): (WebCore::RenderLayer::showsOverflowControls const): (WebCore::RenderLayer::calculateClipRects const): (WebCore::RenderLayer::canUseAcceleratedTouchScrolling const): Deleted. (WebCore::RenderLayer::hasTouchScrollableOverflow const): Deleted. * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling): (WebCore::RenderLayerBacking::updateConfiguration): (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const): (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const): (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const): 2018-11-29 Andy Estes [Cocoa] Add some WKA extension points https://bugs.webkit.org/show_bug.cgi?id=192131 Reviewed by Tim Horton. * DerivedSources.make: Added an extension point for derived sources. * Modules/applepay/PaymentCoordinatorClient.h: Added an extension point for PaymentCoordinatorClient. * SourcesCocoa.txt: Added WebCoreAdditions.mm as a non-unified source. * WebCore.xcodeproj/project.pbxproj: Added WebCoreAdditions.mm. * bindings/js/WebCoreBuiltinNames.h: Added an extension point for built-in names. * page/SettingsBase.h: Added an extension point for settings. * platform/cocoa/WebCoreAdditions.mm: Added. 2018-11-29 Tim Horton Make drawing tools available when an editable image is focused https://bugs.webkit.org/show_bug.cgi?id=192172 Reviewed by Dean Jackson. * editing/Editor.cpp: (WebCore::Editor::insertEditableImage): * editing/Editor.h: * editing/InsertEditableImageCommand.cpp: (WebCore::InsertEditableImageCommand::insertEditableImage): (WebCore::InsertEditableImageCommand::doApply): * editing/InsertEditableImageCommand.h: Add InsertEditableImageCommand::insertEditableImage, which returns the inserted image element. * html/HTMLImageElement.h: Make HTMLImageElement focusable if it is editable. 2018-11-29 Zalan Bujtas [LFC][BFC][Quirk] Body and html height stretching. https://bugs.webkit.org/show_bug.cgi?id=192154 Reviewed by Antti Koivisto. This patch takes the document box's margin/border/padding into account when stretching html/body to the height of the initial containing block. Tests: fast/block/block-only/body-height-with-auto-html-height-quirk.html fast/block/block-only/body-height-with-auto-html-height-quirk2.html fast/block/block-only/body-height-with-non-auto-html-height-quirk.html fast/block/block-only/body-height-with-non-auto-html-height-quirk2.html * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBottom): * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight): 2018-11-29 Justin Fan [WebGPU] Replace forward declare of WebGPUCommandBuffer with include https://bugs.webkit.org/show_bug.cgi?id=192179 Unreviewed build fix. No new tests. No behavior change. * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: * Modules/webgpu/WebGPUProgrammablePassEncoder.h: 2018-11-29 Zalan Bujtas [ContentObservation] Make WKSetObservedContentChange logic more explicit. https://bugs.webkit.org/show_bug.cgi?id=192183 Reviewed by Simon Fraser. * platform/ios/wak/WKContentObservation.cpp: (WKSetObservedContentChange): (WebThreadRemoveObservedDOMTimer): 2018-11-29 Youenn Fablet CSS subresource loads should not be observable from resource timing if the stylesheet is opaque https://bugs.webkit.org/show_bug.cgi?id=192132 Reviewed by Ryosuke Niwa. Introduce a new ResourceLoaderOptions to determine whether a load is made from a resource that is opaque. Make use of that option to disable exposing such loads to the web page through resource timing. The same option might later be used to bypass service workers. Make use of this option for CSS subresource loads. When the CSS stylesheet is opaque for the page, set this option. Test: http/tests/security/clean-origin-exposed-resource-timing.html http/tests/security/cross-origin-resource-timing.html * css/CSSCursorImageValue.cpp: (WebCore::CSSCursorImageValue::CSSCursorImageValue): (WebCore::CSSCursorImageValue::loadImage): * css/CSSCursorImageValue.h: * css/CSSFontFaceSrcValue.cpp: (WebCore::CSSFontFaceSrcValue::cachedFont): * css/CSSFontFaceSrcValue.h: * css/CSSImageSetValue.cpp: (WebCore::CSSImageSetValue::CSSImageSetValue): (WebCore::CSSImageSetValue::loadBestFitImage): * css/CSSImageSetValue.h: * css/CSSImageValue.cpp: (WebCore::CSSImageValue::CSSImageValue): (WebCore::CSSImageValue::loadImage): * css/CSSImageValue.h: * css/CSSStyleSheet.h: * css/StyleRuleImport.cpp: (WebCore::StyleRuleImport::setCSSStyleSheet): (WebCore::StyleRuleImport::requestStyleSheet): * css/StyleSheetContents.h: * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::consumeCursor): (WebCore::consumeFontFaceSrcURI): * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeImageSet): (WebCore::CSSPropertyParserHelpers::consumeImage): * html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::collectStyleForPresentationAttribute): * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::initializeStyleSheet): (WebCore::HTMLLinkElement::setCSSStyleSheet): * html/HTMLTableElement.cpp: (WebCore::HTMLTableElement::collectStyleForPresentationAttribute): * html/HTMLTablePartElement.cpp: (WebCore::HTMLTablePartElement::collectStyleForPresentationAttribute): * loader/ResourceLoaderOptions.h: * loader/ResourceTimingInformation.cpp: (WebCore::ResourceTimingInformation::shouldAddResourceTiming): * svg/SVGFontFaceUriElement.cpp: (WebCore::SVGFontFaceUriElement::srcValue const): 2018-11-29 Megan Gardner Move Lookup Code for better cross platform usage https://bugs.webkit.org/show_bug.cgi?id=191732 Reviewed by Alex Christensen. Not currenlty testable DictionaryLookup uses Reveal now, which is slated to be cross-platform. That patch gates the parts of DictionaryLookup that currently do not have an available implementation on iOS. Once Reveal is ready, this code will be replaced or expanded upon, as appropriate. * editing/mac/DictionaryLookup.h: * editing/mac/DictionaryLookup.mm: (WebCore::showPopupOrCreateAnimationController): (WebCore::DictionaryLookup::showPopup): (WebCore::DictionaryLookup::hidePopup): (WebCore::DictionaryLookup::animationControllerForPopup): 2018-11-29 Joseph Pecoraro [Cocoa] Move ServerTimingParser.* into a better group in the Xcode project https://bugs.webkit.org/show_bug.cgi?id=192180 Reviewed by Simon Fraser. * WebCore.xcodeproj/project.pbxproj: 2018-11-29 Zalan Bujtas [ContentObservation] DOMTimer::install should explicitly check if timer observation is on https://bugs.webkit.org/show_bug.cgi?id=192181 Reviewed by Simon Fraser. * page/DOMTimer.cpp: (WebCore::DOMTimer::install): * platform/ios/wak/WKContentObservation.cpp: (WKIsObservingDOMTimerScheduling): * platform/ios/wak/WKContentObservation.h: 2018-11-29 Ryosuke Niwa Executing "insertunorderedlist" while selecting a contenteditable element inside a shadow dom hangs the browser https://bugs.webkit.org/show_bug.cgi?id=184049 Reviewed by Antti Koivisto. The primary hung was caused by TextIterator::advance traversing the next node in the tree order using NodeTraversal::next which doesn't take the composed tree into account. Fixed the bug by traversing the composed tree while sharing code with StylizedMarkupAccumulator. This revealed a second hang in InsertListCommand::doApply() caused by endingSelection() being null, which was caused by CompositeEditCommand::moveParagraphs failing to restore the ending selection properly because it was computing the text indices difference from the beginning of the document until the destination. Fixed this second bug by computing the indices against the beginning of the root editable element. Note that editability never crosses a shadow boundary. Test: editing/execCommand/insert-unordered-list-in-shadow-tree.html * dom/ComposedTreeIterator.h: (WebCore::nextSkippingChildrenInComposedTreeIgnoringUserAgentShadow): Extracted out of nextSkippingChildren in markup.cpp. (WebCore::nextInComposedTreeIgnoringUserAgentShadow): Added. * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): Compute the index from the beginning of the root editable element as opposed to the beginning of the document. * editing/TextIterator.cpp: (WebCore::nextNode): Added. (WebCore::isDescendantOf): Added. (WebCore::TextIterator::advance): Use the newly added functions to traverse the composed tree when the options contains TextIteratorTraversesFlatTree. * editing/markup.cpp: 2018-11-29 Zalan Bujtas [ContentObservation] Decouple content change and DOM timer scheduling observation https://bugs.webkit.org/show_bug.cgi?id=192170 Reviewed by Simon Fraser. This is in preparation for adding style recalc scheduling observation (the main goal here is to simplify the indeterminate change logic). * page/DOMTimer.cpp: (WebCore::DOMTimer::fired): * page/ios/EventHandlerIOS.mm: (WebCore::EventHandler::mouseMoved): * platform/ios/wak/WKContentObservation.cpp: (WKStartObservingContentChanges): (WKStopObservingContentChanges): (WKStartObservingDOMTimerSchedules): (WKStopObservingDOMTimerSchedules): (WKSetObservedContentChange): (WebThreadAddObservedDOMTimer): (WKBeginObservingContentChanges): Deleted. * platform/ios/wak/WKContentObservation.h: 2018-11-29 Frederic Wang Make reconcileViewportConstrainedLayerPositions start from a specified scrolling node https://bugs.webkit.org/show_bug.cgi?id=180002 Reviewed by Simon Fraser. For non-programmatic scrolling of frames, AsyncScrollingCoordinator::reconcileScrollingState currently always call reconcileViewportConstrainedLayerPositions for the main frame since async subframe scrolling is not supported yet (bug 171667 and bug 149264). This function in turn calls reconcileLayerPositionForViewportRect on the whole scrolling tree to readjust position of fixed/sticky descendants. This patch refactors a bit the code so that the operation is actually only applied to the descendants of the frame's scrolling node, which would mean a small optimization when subframe are asynchronously scrollable. The code is already covered by reconcile-layer-position-recursive.html. No new tests, behavior unchanged and already covered by existing tests. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::reconcileScrollingState): Pass the frame's scrolling node id. (WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions): Start reconciliation from the specified scrolling node and log its ID. * page/scrolling/AsyncScrollingCoordinator.h: Add ScrollingNodeID parameter. * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::reconcileViewportConstrainedLayerPositions): Ditto. 2018-11-29 Zalan Bujtas Rename *ObservedContentModifier(s) to *ObservedDOMTimer(s) https://bugs.webkit.org/show_bug.cgi?id=192168 Reviewed by Simon Fraser. * dom/Document.cpp: (WebCore::Document::platformSuspendOrStopActiveDOMObjects): * page/DOMTimer.cpp: (WebCore::DOMTimer::install): (WebCore::DOMTimer::fired): * page/DOMWindow.cpp: (WebCore::DOMWindow::clearTimeout): * page/Frame.cpp: (WebCore::Frame::willDetachPage): * platform/ios/wak/WKContentObservation.cpp: (WKBeginObservingContentChanges): (WKSetObservedContentChange): (WebThreadGetObservedDOMTimers): (WebThreadCountOfObservedDOMTimers): (WebThreadClearObservedDOMTimers): (WebThreadContainsObservedDOMTimer): (WebThreadAddObservedDOMTimer): (WebThreadRemoveObservedDOMTimer): (WebThreadCountOfObservedContentModifiers): Deleted. (WebThreadClearObservedContentModifiers): Deleted. (WebThreadContainsObservedContentModifier): Deleted. (WebThreadAddObservedContentModifier): Deleted. (WebThreadRemoveObservedContentModifier): Deleted. * platform/ios/wak/WKContentObservation.h: * platform/ios/wak/WKContentObservationInternal.h: 2018-11-29 Justin Fan [WebGPU] WebGPURenderPassEncoder::setPipeline, draw, and endPass prototypes https://bugs.webkit.org/show_bug.cgi?id=192134 Reviewed by Dean Jackson. Wrap up prototype features for WebGPURenderPassEncoder. Test: webgpu/render-command-encoding.html * Modules/webgpu/WebGPUCommandBuffer.cpp: (WebCore::WebGPUCommandBuffer::beginRenderPass): * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::createRenderPipeline const): * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: (WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder): (WebCore::WebGPUProgrammablePassEncoder::endPass): Returns a reference to the WebGPUCommandBuffer that created this encoder. (WebCore::WebGPUProgrammablePassEncoder::setPipeline): * Modules/webgpu/WebGPUProgrammablePassEncoder.h: Updated to support endPass and setPipeline. * Modules/webgpu/WebGPUProgrammablePassEncoder.idl: * Modules/webgpu/WebGPURenderPassEncoder.cpp: (WebCore::WebGPURenderPassEncoder::create): Must be provided with the WebGPUCommandBuffer. (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder): (WebCore::WebGPURenderPassEncoder::draw): * Modules/webgpu/WebGPURenderPassEncoder.h: Updated to cache a reference to the WebGPUCommandBuffer, and for draw. * Modules/webgpu/WebGPURenderPassEncoder.idl: * Modules/webgpu/WebGPURenderPipeline.cpp: (WebCore::WebGPURenderPipeline::create): (WebCore::WebGPURenderPipeline::WebGPURenderPipeline): * Modules/webgpu/WebGPURenderPipeline.h: (WebCore::WebGPURenderPipeline::renderPipeline): * Modules/webgpu/WebGPUTexture.cpp: * Modules/webgpu/WebGPUTexture.h: Replaced include with forward declaration. * platform/graphics/gpu/GPUProgrammablePassEncoder.h: Updated to support new WebGPU_PassEncoder functionality. * platform/graphics/gpu/GPURenderPassEncoder.h: (WebCore::GPURenderPassEncoder::~GPURenderPassEncoder): Now ends encoding on the MTLCommandEncoder, if not already ended, before freeing it. * platform/graphics/gpu/GPURenderPipeline.h: Now remembers the GPUPrimitiveTopology that it was created with. (WebCore::GPURenderPipeline::primitiveTopology const): * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: (WebCore::GPUProgrammablePassEncoder::endPass): Calls endEncoding on the backing MTLCommandEncoder, if not already ended. * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: (WebCore::GPURenderPassEncoder::platformPassEncoder const): (WebCore::GPURenderPassEncoder::setPipeline): Added. (WebCore::primitiveTypeForGPUPrimitiveTopology): Added. Helper function to convert GPUPrimitiveTopology to MTLPrimitiveType. (WebCore::GPURenderPassEncoder::draw): Added. Draws using primitive topology specified during pipeline creation. * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: (WebCore::setFunctionsForPipelineDescriptor): (WebCore::GPURenderPipeline::create): (WebCore::GPURenderPipeline::GPURenderPipeline): Now must store the GPURenderPipelineDescriptor for later reference. 2018-11-29 Justin Michaud CSS Painting API should pass 'this' correctly to paint callback, and repaint when properties change. https://bugs.webkit.org/show_bug.cgi?id=191443 Reviewed by Dean Jackson. Instantiate a new instance of the paint class, and pass it as 'this' object when the paint callback is called. Also, this patch makes sure that custom paint elements get repainted when properties that they care about get changed. Finally, we fix two reference cycles that caused WorkletGlobalScope to never be destroyed. Tests: fast/css-custom-paint/animate-repaint.html fast/css-custom-paint/animate.html * bindings/js/JSDOMWrapper.cpp: * bindings/js/JSPaintWorkletGlobalScopeCustom.cpp: (WebCore::JSPaintWorkletGlobalScope::visitAdditionalChildren): * bindings/js/JSWorkletGlobalScopeBase.cpp: (WebCore::toJS): * bindings/js/ScriptState.cpp: (WebCore::execStateFromWorkletGlobalScope): * css/CSSPaintCallback.h: * css/CSSPaintCallback.idl: * css/CSSPaintImageValue.h: * css/StyleResolver.cpp: (WebCore::StyleResolver::applyProperty): * dom/Document.cpp: (WebCore::Document::prepareForDestruction): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::vm): * platform/graphics/CustomPaintImage.cpp: (WebCore::CustomPaintImage::CustomPaintImage): (WebCore::CustomPaintImage::doCustomPaint): * platform/graphics/CustomPaintImage.h: * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::addCustomPaintWatchProperty): (WebCore::RenderStyle::changeRequiresRepaint const): * rendering/style/RenderStyle.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * testing/Internals.cpp: (WebCore::Internals::isAnyWorkletGlobalScopeAlive const): * testing/Internals.h: * testing/Internals.idl: * worklets/PaintWorkletGlobalScope.cpp: (WebCore::PaintWorkletGlobalScope::devicePixelRatio const): (WebCore::PaintWorkletGlobalScope::PaintDefinition::PaintDefinition): (WebCore::PaintWorkletGlobalScope::registerPaint): * worklets/PaintWorkletGlobalScope.h: (WebCore::PaintWorkletGlobalScope::~PaintWorkletGlobalScope): * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::WorkletGlobalScope): (WebCore::WorkletGlobalScope::~WorkletGlobalScope): (WebCore::WorkletGlobalScope::prepareForDestruction): (WebCore::WorkletGlobalScope::allWorkletGlobalScopesSet): (WebCore::WorkletGlobalScope::isJSExecutionForbidden const): (WebCore::WorkletGlobalScope::logExceptionToConsole): (WebCore::WorkletGlobalScope::addConsoleMessage): (WebCore::WorkletGlobalScope::addMessage): * worklets/WorkletGlobalScope.h: (WebCore::WorkletGlobalScope::script): (WebCore::WorkletGlobalScope::responsibleDocument): (WebCore::WorkletGlobalScope::responsibleDocument const): (WebCore::WorkletGlobalScope::identifier const): Deleted. (WebCore::WorkletGlobalScope::responsableDocument): Deleted. (WebCore::WorkletGlobalScope::responsableDocument const): Deleted. * worklets/WorkletScriptController.cpp: (WebCore::WorkletScriptController::~WorkletScriptController): (WebCore::WorkletScriptController::disableEval): (WebCore::WorkletScriptController::disableWebAssembly): (WebCore::WorkletScriptController::initScript): 2018-11-29 Alexey Proskuryakov Modernize the check for kCFURLRequestContentDecoderSkipURLCheck existence https://bugs.webkit.org/show_bug.cgi?id=192041 Reviewed by Tim Horton. * loader/ResourceLoaderOptions.h: Added a FIXME for poor naming of loader options. There is a lot of code that needs to be cleaned up here. * platform/network/mac/ResourceHandleMac.mm: (WebCore::ResourceHandle::applySniffingPoliciesIfNeeded): 2018-11-29 Youenn Fablet Updating a service worker during a navigation load sometimes makes the load fail https://bugs.webkit.org/show_bug.cgi?id=191986 Reviewed by Chris Dumez. Previously, we were registering a document as service worker client at creation of the document. According the service worker spec, this should be done when handling the fetch event of the corresponding navigation load. This ensures that the service worker will have a client and will not get updated in the middle of the navigation load. At navigation load start, we do not have a document yet since it is created when receiving the first bytes. Instead, we register a temporary document when starting the navigation load and unregister it when the real document is registered. Test: imported/w3c/web-platform-tests/service-workers/service-worker/update-on-navigation.https.html * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::commitData): (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient): (WebCore::DocumentLoader::unregisterTemporaryServiceWorkerClient): (WebCore::DocumentLoader::loadMainResource): (WebCore::DocumentLoader::clearMainResource): * loader/DocumentLoader.h: 2018-11-29 Ryan Haddad Unreviewed, rolling out r238678. Breaks internal builds. Reverted changeset: "Move Lookup Code for better cross platform usage" https://bugs.webkit.org/show_bug.cgi?id=191732 https://trac.webkit.org/changeset/238678 2018-11-29 Youenn Fablet A sender created through addTransceiver and populated using addTrack should have its source set https://bugs.webkit.org/show_bug.cgi?id=192136 Reviewed by Eric Carlson. In case libwebrtc backend is already created, we need to make sure to set the track source to the libwebrtc sender backend that is actually tied to the sender. Covered by updated test. * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::addTrack): * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: 2018-11-29 Megan Gardner Move Lookup Code for better cross platform usage https://bugs.webkit.org/show_bug.cgi?id=191732 Reviewed by Alex Christensen. Not currenlty testable DictionaryLookup uses Reveal now, which is slated to be cross-platform. That patch gates the parts of DictionaryLookup that currently do not have an available implementation on iOS. Once Reveal is ready, this code will be replaced or expanded upon, as appropriate. * editing/mac/DictionaryLookup.h: * editing/mac/DictionaryLookup.mm: (WebCore::showPopupOrCreateAnimationController): (WebCore::DictionaryLookup::showPopup): (WebCore::DictionaryLookup::hidePopup): (WebCore::DictionaryLookup::animationControllerForPopup): 2018-11-29 Sihui Liu IndexedDB: breaks if binary data (Uint8Array) and autoIncrement key in store https://bugs.webkit.org/show_bug.cgi?id=185869 Reviewed by Geoffrey Garen. lexicalGlobalObject is casted to JSDOMGlobalObject in CloneSerializer::dumpArrayBufferView, so we should use JSDOMGlobalObject instead of JSGlobalObject in IDB database thread. Covered by modified test: storage/indexeddb/objectstore-autoincrement.html * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadVM): (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadExecState): * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::create): * bindings/js/JSDOMGlobalObject.h: * bindings/js/JSDOMWrapper.cpp: (WebCore::JSDOMObject::JSDOMObject): 2018-11-29 Sihui Liu Unexpected constructor / instanceof behavior when retrieving indexedDB data in an iframe https://bugs.webkit.org/show_bug.cgi?id=185906 Reviewed by Geoffrey Garen. ScriptExecutionContext::execState() returned state of main frame, so deserialization of IDBValue in iframe used constructors of main frame, which is wrong. Test: storage/indexeddb/instanceof-iframe.html * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::execState): 2018-11-29 Don Olmstead Make generic ScrollAnimator https://bugs.webkit.org/show_bug.cgi?id=192128 Reviewed by Michael Catanzaro. No new tests. No change in behavior. Moves ScrollAnimatorGtk into ScrollAnimatorGeneric where it can be used by other implementations. Fixed some compilation issues around using this as a default implementation. Removing ScrollAnimatorSmooth since it is dead code and doesn't even compile at this time. Fixing a compilation issue within LowPowerModeNotifierGLib implementation that appeared due to unified sources changes. * PlatformGTK.cmake: * SourcesGTK.txt: * platform/LowPowerModeNotifier.h: * platform/PlatformWheelEvent.h: (WebCore::PlatformWheelEvent::swipeVelocity const): * platform/ScrollAnimatorSmooth.cpp: Removed. * platform/ScrollAnimatorSmooth.h: Removed. * platform/generic/ScrollAnimatorGeneric.cpp: Renamed from Source/WebCore/platform/gtk/ScrollAnimatorGtk.cpp. (WebCore::ScrollAnimator::create): (WebCore::ScrollAnimatorGeneric::ScrollAnimatorGeneric): (WebCore::ScrollAnimatorGeneric::ensureSmoothScrollingAnimation): (WebCore::ScrollAnimatorGeneric::scroll): (WebCore::ScrollAnimatorGeneric::scrollToOffsetWithoutAnimation): (WebCore::ScrollAnimatorGeneric::computeVelocity): (WebCore::ScrollAnimatorGeneric::handleWheelEvent): (WebCore::ScrollAnimatorGeneric::willEndLiveResize): (WebCore::ScrollAnimatorGeneric::updatePosition): (WebCore::ScrollAnimatorGeneric::didAddVerticalScrollbar): (WebCore::ScrollAnimatorGeneric::didAddHorizontalScrollbar): (WebCore::ScrollAnimatorGeneric::willRemoveVerticalScrollbar): (WebCore::ScrollAnimatorGeneric::willRemoveHorizontalScrollbar): (WebCore::ScrollAnimatorGeneric::updateOverlayScrollbarsOpacity): (WebCore::ScrollAnimatorGeneric::overlayScrollbarAnimationTimerFired): (WebCore::ScrollAnimatorGeneric::showOverlayScrollbars): (WebCore::ScrollAnimatorGeneric::hideOverlayScrollbars): (WebCore::ScrollAnimatorGeneric::mouseEnteredContentArea): (WebCore::ScrollAnimatorGeneric::mouseExitedContentArea): (WebCore::ScrollAnimatorGeneric::mouseMovedInContentArea): (WebCore::ScrollAnimatorGeneric::contentAreaDidShow): (WebCore::ScrollAnimatorGeneric::contentAreaDidHide): (WebCore::ScrollAnimatorGeneric::notifyContentAreaScrolled): (WebCore::ScrollAnimatorGeneric::lockOverlayScrollbarStateToHidden): * platform/generic/ScrollAnimatorGeneric.h: Renamed from Source/WebCore/platform/gtk/ScrollAnimatorGtk.h. * platform/glib/LowPowerModeNotifierGLib.cpp: * platform/gtk/PlatformWheelEventGtk.cpp: (WebCore::PlatformWheelEvent::swipeVelocity const): Deleted. 2018-11-28 Dean Jackson [ES Modules] Allow .mjs content when loaded from file:// https://bugs.webkit.org/show_bug.cgi?id=192100 Reviewed by Sam Weinig. Node JS requires ES Module files to be identified by the file extension of ".mjs" (no relation to Maciej Stachowiak). This new extension causes issues because it isn't recognised as a JavaScript file. When using the script tag, the author is able to force the type of the referenced file using an attribute, but this isn't possible for the import() function or import statement. Add a new entry into our table that maps file extensions to MIME types so that when a .mjs file is loaded from a file:// reference it is identified as JavaScript. Test: js/dom/modules/import-mjs-module.html * platform/network/mac/WebCoreURLResponse.mm: Add .mjs to the existing dictionary. (WebCore::createExtensionToMIMETypeMap): * platform/network/ios/WebCoreURLResponseIOS.mm: Add code just for .mjs. (WebCore::createExtensionToMIMETypeMap): 2018-11-29 Zalan Bujtas [LFC][BFC][Quirk] Width does not need stretching quirk. https://bugs.webkit.org/show_bug.cgi?id=192135 Reviewed by Antti Koivisto. In BFC the block box's width (auto) always streches to the content width of the containing block. * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::needsStretching): (WebCore::Layout::BlockFormattingContext::Quirks::isStretchedToInitialContainingBlock): Deleted. (WebCore::Layout::BlockFormattingContext::Quirks::stretchedWidth): Deleted. 2018-11-29 Zalan Bujtas [LFC][Quirk] Move quirk functions to dedicated classes. https://bugs.webkit.org/show_bug.cgi?id=192133 Reviewed by Antti Koivisto. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::computedHeightValue): * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): (WebCore::Layout::initialContainingBlock): Deleted. (WebCore::Layout::isStretchedToInitialContainingBlock): Deleted. (WebCore::Layout::stretchHeightToInitialContainingBlockQuirk): Deleted. (WebCore::Layout::stretchWidthToInitialContainingBlock): Deleted. * layout/blockformatting/BlockFormattingState.cpp: * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop): (WebCore::Layout::isQuirkContainer): Deleted. (WebCore::Layout::hasMarginTopQuirkValue): Deleted. (WebCore::Layout::shouldIgnoreMarginTopInQuirkContext): Deleted. (WebCore::Layout::isMarginTopCollapsedWithParent): Deleted. * layout/inlineformatting/InlineFormattingContext.cpp: * layout/inlineformatting/text/TextUtil.h: 2018-11-29 Rob Buis Remove some superfluous code in ContentSecurityPolicy::upgradeInsecureRequestIfNeeded https://bugs.webkit.org/show_bug.cgi?id=192076 Reviewed by Frédéric Wang. Since we do an early return if the protocol is not http or ws, the if check for ws protocol and else statement are not needed, so use an ASSERT instead. * page/csp/ContentSecurityPolicy.cpp: (WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded const): 2018-11-29 Frederic Wang Add ParentRelativeScrollableRect to ScrollingCoordinator::ScrollingGeometry https://bugs.webkit.org/show_bug.cgi?id=172914 Reviewed by Simon Fraser. This patch adds a ParentRelativeScrollableRect ScrollingCoordinator::ScrollingGeometry and the corresponding set/get/dump APIs. Currently, the setter is never used so the behavior is unchanged. In the future, this rect will be used for hit testing of subframes during asynchronous macOS scrolling (but 172917). No new tests, behavior unchanged. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode): (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): * page/scrolling/ScrollingCoordinator.h: * page/scrolling/ScrollingStateScrollingNode.cpp: (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): (WebCore::ScrollingStateScrollingNode::setParentRelativeScrollableRect): (WebCore::ScrollingStateScrollingNode::dumpProperties const): * page/scrolling/ScrollingStateScrollingNode.h: (WebCore::ScrollingStateScrollingNode::parentRelativeScrollableRect const): * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren): (WebCore::ScrollingTreeScrollingNode::dumpProperties const): * page/scrolling/ScrollingTreeScrollingNode.h: (WebCore::ScrollingTreeScrollingNode::parentRelativeScrollableRect const): 2018-11-28 Wenson Hsieh [iOSMac] Dropping text selections from web content into editable elements crashes the web process https://bugs.webkit.org/show_bug.cgi?id=192113 Reviewed by Ryosuke Niwa. In iOSMac, registering invalid UTIs on NSItemProvider when starting a drag or handling a drop does not work. Since iOS writes and reads only "Apple Web Archive pasteboard type" (a.k.a. `WebArchivePboardType`) during drag and drop as well as copy and paste, we fail to read or write any web archive data, and subsequently fall back to reading RTF or flat RTFD, both of which are not supported in iOSMac, since UIFoundation links against the system's macOS WebKit stack. To fix this, we add support for reading and writing com.apple.webarchive (`kUTTypeWebArchive`) on iOS, so that WebKit-based iOSMac applications can understand web archive data from the host running macOS, and the host can also understand web archive data written by the iOSMac app. Additionally, don't allow reading RTF and flat RTFD as web content in iOSMac. (Note that writing RTF and flat RTFD is still safe, since it does not depend on UIFoundation.framework but rather `WebCore::HTMLConverter`). Test: DragAndDropTests.ModernWebArchiveType * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::createFragment): Additionally make sure that we never call into UIFoundation's NSAttributedString to markup conversion codepath by making `createFragment` an empty stub on iOSMac. * platform/ios/PasteboardIOS.mm: (WebCore::supportedImageTypes): (WebCore::isTypeAllowedByReadingPolicy): (WebCore::Pasteboard::readPasteboardWebContentDataForType): (WebCore::Pasteboard::supportedWebContentPasteboardTypes): * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::write): 2018-11-28 Commit Queue Unreviewed, rolling out r238653 and r238656. https://bugs.webkit.org/show_bug.cgi?id=192130 Breaks iOS build (Requested by smfr on #webkit). Reverted changesets: "Move Lookup Code for better cross platform usage" https://bugs.webkit.org/show_bug.cgi?id=191732 https://trac.webkit.org/changeset/238653 "Attempt to fix the iOS build by only including RevealSPI.h when it's needed." https://trac.webkit.org/changeset/238656 2018-11-28 Simon Fraser Attempt to fix the iOS build by only including RevealSPI.h when it's needed. * editing/cocoa/DictionaryLookup.mm: 2018-11-28 Alex Christensen Modernize BlobRegistry::writeBlobsToTemporaryFiles https://bugs.webkit.org/show_bug.cgi?id=192117 Reviewed by Dean Jackson. No change in behavior. Just use CompletionHandlers and the new sendWithAsyncReply instead of two way messaging and manual completion handler management. * bindings/js/SerializedScriptValue.cpp: (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB): * platform/network/BlobRegistry.h: * platform/network/BlobRegistryImpl.cpp: (WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles): * platform/network/BlobRegistryImpl.h: 2018-11-15 Megan Gardner Move Lookup Code for better cross platform usage https://bugs.webkit.org/show_bug.cgi?id=191732 Reviewed by Alex Christensen. Not currenlty testable DictionaryLookup uses Reveal now, which is slated to be cross-platform. That patch gates the parts of DictionaryLookup that currently do not have an available implementation on iOS. Once Reveal is ready, this code will be replaced or expanded upon, as appropriate. * editing/mac/DictionaryLookup.h: * editing/mac/DictionaryLookup.mm: (WebCore::showPopupOrCreateAnimationController): (WebCore::DictionaryLookup::showPopup): (WebCore::DictionaryLookup::hidePopup): (WebCore::DictionaryLookup::animationControllerForPopup): 2018-11-28 Christopher Reid SQLiteDatabase::open is constantly printing "SQLite database failed to checkpoint: database table is locked" errors https://bugs.webkit.org/show_bug.cgi?id=192111 Reviewed by Alex Christensen. Ensure the journal_mode=WAL statement is finalized before wal_checkpoint is executed. * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::open): 2018-11-28 Said Abou-Hallawa Updating href on linearGradient and radialGradient doesn't update its rendering https://bugs.webkit.org/show_bug.cgi?id=191934 Reviewed by Ryosuke Niwa. Mark the gradient renderer for repaint when the value of the 'href' attribute changes. Tests: fast/shadow-dom/svg-linear-gradient-dynamic-update-href-in-shadow-tree.html fast/shadow-dom/svg-radial-gradient-dynamic-update-href-in-shadow-tree.html svg/dynamic-updates/SVGLinearGradientElement-svgdom-href-prop.html svg/dynamic-updates/SVGRadialGradientElement-svgdom-href-prop.html * svg/SVGGradientElement.cpp: (WebCore::SVGGradientElement::svgAttributeChanged): 2018-11-28 Youenn Fablet imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-transceivers.https.html is flaky on iOS simulator https://bugs.webkit.org/show_bug.cgi?id=192037 Reviewed by Eric Carlson. The stats report JS map should be created when resolving the stats promise with WebCore RTCStatsReport. But resolving the promise might fail in case of a page being suspended. In that case, no JSRTCStatsReport is created and there is no backing map. Update the code to reflect that. Covered by existing test. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::getStats): * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: (WebCore::LibWebRTCStatsCollector::~LibWebRTCStatsCollector): (WebCore::LibWebRTCStatsCollector::OnStatsDelivered): * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.h: 2018-11-28 Keith Rollin Update generate-{derived,unified}-sources scripts to support generating .xcfilelist files https://bugs.webkit.org/show_bug.cgi?id=192031 Reviewed by Alex Christensen. The Generate Derived Sources and Generate Unified Sources build phases in Xcode need to have their inputs and outputs specified. This specification will come in the form of .xcfilelist files that will be attached to these build phases. There is one .xcfilelist file that lists the input file and one that lists the output files. As part of this work, the various generate-{derived,unified}-sources scripts that are executed in these Generate build phases are modified to help in the creation of these .xcfilelist files. In particular, they can now be invoked with command-line parameters. These parameters are then used to alter the normal execution of these scripts, causing them to produce the .xcfilelist files as opposed to actually generating the files that are listed in those files. No new tests -- no changed functionality. * Scripts/generate-derived-sources.sh: * Scripts/generate-unified-sources.sh: 2018-11-28 Keith Rollin Revert print_all_generated_files work in r238008; tighten up target specifications https://bugs.webkit.org/show_bug.cgi?id=192025 Reviewed by Alex Christensen. In r238008, I added a facility for DerivedSources.make makefiles to print out the list of files that they generate. This output was used in the generation of .xcfilelist files used to specify the output of the associated Generate Derived Sources build phases in Xcode. This approach worked, but it meant that people would need to follow a specific convention to keep this mechanism working. Instead of continuing this approach, I'm going to implement a new facility based on the output of `make` when passed the -d flag (which prints dependency information). This new mechanism is completely automatic and doesn't need maintainers to follow a convention. To that end, remove most of the work performed in r238008 that supports the print_all_generated_files target. At the same time, it's important for the sets of targets and their dependencies to be complete and correct. Therefore, also include changes to bring those up-to-date. As part of that, you'll see prevalent use of a particular technique. Here's an example: BYTECODE_FILES = \ Bytecodes.h \ BytecodeIndices.h \ BytecodeStructs.h \ InitBytecodes.asm \ # BYTECODE_FILES_PATTERNS = $(subst .,%,$(BYTECODE_FILES)) all : $(BYTECODE_FILES) $(BYTECODE_FILES_PATTERNS): $(wildcard $(JavaScriptCore)/generator/*.rb) $(JavaScriptCore)/bytecode/BytecodeList.rb ... These lines indicate a set of generated files (those specified in BYTECODE_FILES). These files are generated by the BytecodeList.rb tool. But, as opposed to the normal rule where a single foo.output is generated by foo.input plus some additional dependencies, this rule produces multiple output files from a tool whose connection to the output files is not immediately clear. A special approach is needed where a single rule produces multiple output files. The normal way to implement this is to use an .INTERMEDIATE target. However, we used this approach in the past and ran into a problem with it, addressing it with an alternate approach in r210507. The above example shows this approach. The .'s in the list of target files are replaced with %'s, and the result is used as the left side of the dependency rule. No new tests -- no changed functionality. * DerivedSources.make: 2018-11-28 Alex Christensen Remove dead code from an earlier attempt at implementing safe browsing https://bugs.webkit.org/show_bug.cgi?id=192067 Reviewed by Chris Dumez. * WebCore.xcodeproj/project.pbxproj: * loader/EmptyClients.cpp: (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * loader/EmptyFrameLoaderClient.h: * loader/FrameLoadRequest.h: (WebCore::FrameLoadRequest::setShouldSkipSafeBrowsingCheck): Deleted. (WebCore::FrameLoadRequest::shouldSkipSafeBrowsingCheck): Deleted. * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadArchive): (WebCore::FrameLoader::loadURL): (WebCore::FrameLoader::load): (WebCore::FrameLoader::loadWithNavigationAction): (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::loadPostRequest): * loader/FrameLoader.h: (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::loadWithNavigationAction): * loader/FrameLoaderClient.h: * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): * loader/PolicyChecker.h: * loader/ShouldSkipSafeBrowsingCheck.h: Removed. 2018-11-28 Alex Christensen Add SessionIDs wherever BlobURLs are used in SerializedScriptValue https://bugs.webkit.org/show_bug.cgi?id=192062 Reviewed by Dean Jackson. Just adding infrastructure for fixing "the blob bug" * Modules/indexeddb/IDBDatabaseIdentifier.cpp: (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier): (WebCore::IDBDatabaseIdentifier::isolatedCopy const): * Modules/indexeddb/IDBDatabaseIdentifier.h: (WebCore::IDBDatabaseIdentifier::hash const): (WebCore::IDBDatabaseIdentifier::sessionID const): (WebCore::IDBDatabaseIdentifier::encode const): (WebCore::IDBDatabaseIdentifier::decode): * Modules/indexeddb/IDBFactory.cpp: (WebCore::IDBFactory::openInternal): (WebCore::IDBFactory::deleteDatabase): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::putOrAddOnServer): * Modules/indexeddb/IDBValue.cpp: (WebCore::IDBValue::IDBValue): (WebCore::IDBValue::setAsIsolatedCopy): * Modules/indexeddb/IDBValue.h: (WebCore::IDBValue::sessionID const): (WebCore::IDBValue::encode const): (WebCore::IDBValue::decode): * Modules/indexeddb/server/MemoryIndexCursor.cpp: (WebCore::IDBServer::MemoryIndexCursor::currentData): * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp: (WebCore::IDBServer::MemoryObjectStoreCursor::currentData): * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey): * Modules/indexeddb/server/SQLiteIDBBackingStore.h: * Modules/indexeddb/server/SQLiteIDBCursor.cpp: (WebCore::IDBServer::SQLiteIDBCursor::internalFetchNextRecord): * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): * bindings/js/IDBBindingUtilities.cpp: (WebCore::deserializeIDBValueToJSValue): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::serialize): (WebCore::CloneSerializer::CloneSerializer): (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::CloneDeserializer::deserialize): (WebCore::CloneDeserializer::CloneDeserializer): (WebCore::SerializedScriptValue::SerializedScriptValue): (WebCore::SerializedScriptValue::create): (WebCore::SerializedScriptValue::deserialize): (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB): (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDBSynchronously): * bindings/js/SerializedScriptValue.h: (WebCore::SerializedScriptValue::sessionID const): 2018-11-28 Justin Fan [WebGPU] Begin implementation of WebGPURenderPassEncoder and barebones WebGPURenderPassDescriptor https://bugs.webkit.org/show_bug.cgi?id=191990 Reviewed by Dean Jackson. Begin implementation of WebGPURenderPassEncoder and its parent interface, WebGPUProgrammablePassEncoder. Also add code to allow creation of a primitive WebGPURenderPassDescriptor with the sole purpose of providing a WebGPUTextureView reference to the render pass creation function, WebGPUCommandBuffer::beginRenderPass(). Test: webgpu/render-passes.html * CMakeLists.txt: * DerivedSources.make: * Modules/webgpu/WebGPUCommandBuffer.cpp: (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer): (WebCore::WebGPUCommandBuffer::beginRenderPass): Added. Returns a WebGPURenderPassEncoder upon success. * Modules/webgpu/WebGPUCommandBuffer.h: * Modules/webgpu/WebGPUCommandBuffer.idl: * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: Added. * Modules/webgpu/WebGPUProgrammablePassEncoder.h: Added. * Modules/webgpu/WebGPUProgrammablePassEncoder.idl: Added. Empty (for now) interface parenting WebGPURenderPassEncoder. * Modules/webgpu/WebGPURenderPassDescriptor.h: * Modules/webgpu/WebGPURenderPassDescriptor.idl: Added. Directly handles a WebGPUTextureView attachment; all other color attachment properties set by implementation for now. * Modules/webgpu/WebGPURenderPassEncoder.cpp: Added. (WebCore::WebGPURenderPassEncoder::create): (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder): (WebCore::WebGPURenderPassEncoder::passEncoder const): * Modules/webgpu/WebGPURenderPassEncoder.h: Added. Interface to GPURenderPassEncoder. * Modules/webgpu/WebGPURenderPassEncoder.idl: Added. Allows WebGPU developer to encode commands for the WebGPUCommandBuffer. * Modules/webgpu/WebGPUTextureView.cpp: (WebCore::WebGPUTextureView::WebGPUTextureView): * Modules/webgpu/WebGPUTextureView.h: (WebCore::WebGPUTextureView::texture): * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * platform/graphics/gpu/GPUCommandBuffer.h: (WebCore::GPUCommandBuffer::platformCommandBuffer const): * platform/graphics/gpu/GPUProgrammablePassEncoder.h: Added. Base class for GPURenderPassEncoder. * platform/graphics/gpu/GPURenderPassDescriptor.h: Added. * platform/graphics/gpu/GPURenderPassEncoder.h: Added. Wrapper class for MTLRenderCommandEncoder. * platform/graphics/gpu/GPUTexture.h: (WebCore::GPUTexture::platformTexture const): * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Added. * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: Added. (WebCore::GPURenderPassEncoder::create): Creates the backing MTLRenderCommandEncoder; returns null if this fails. (WebCore::GPURenderPassEncoder::GPURenderPassEncoder): (WebCore::GPURenderPassEncoder::~GPURenderPassEncoder): End encoding before destroying the MTLCommandEncoder to prevent an exception. (WebCore::GPURenderPassEncoder::platformPassEncoder const): 2018-11-28 Rob Buis [XHR] Document.lastModified doesn't work for non-rendered documents https://bugs.webkit.org/show_bug.cgi?id=179375 Reviewed by Alexey Proskuryakov. Add setOverrideLastModified to override last modified date for standalone Documents. Behavior matches Firefox and Chrome. Test: web-platform-tests/xhr/responsexml-document-properties.htm * dom/Document.cpp: (WebCore::Document::overrideLastModified): (WebCore::Document::lastModified const): no need to test m_frame since that's already done in loader(). (WebCore::Document::lastModified): Deleted. * dom/Document.h: * xml/XMLHttpRequest.cpp: 2018-11-28 Yongjun Zhang Allow WebKit clients to specify a minimum effective width for layout. https://bugs.webkit.org/show_bug.cgi?id=191499 Reviewed by Wenson Hsieh. If we ignore the meta viewport (_shouldIgnoreMetaViewport is true), the default layout width will be device width. For clients that wish to lay out the content with a different width value, we would need to add a way to specify the effective width for layout. Tests: fast/viewport/ios/ipad/viewport-overriden-by-minimum-effective-width-if-ignore-meta-viewport.html fast/viewport/ios/ipad/viewport-unchanged-by-minimum-effective-width-if-not-ignore-meta-viewport.html * page/ViewportConfiguration.cpp: (WebCore::ViewportConfiguration::setViewLayoutSize): Add a new argument effectiveWidth. (WebCore::ViewportConfiguration::nativeWebpageParameters): Make sure minimumScale for nativeWebpageParameters is small enough so that it won't clamp out the initial scale. If content is wider than the viewport, this ensures we can still zoom out the page. (WebCore::ViewportConfiguration::updateConfiguration): update _minimumEffectiveDeviceWidth and apply that to the layout size scale computation. (WebCore::ViewportConfiguration::effectiveLayoutSizeScaleFactor): A helper method to return the effective layout scale factor which is also effected by _minimumEffectiveDeviceWidth. (WebCore::ViewportConfiguration::updateMinimumLayoutSize): Update m_minimumLayoutSize based on effectiveLayoutSizeScaleFactor(). (WebCore::ViewportConfiguration::description const): Also dump m_minimumEffectiveDeviceWidth. * page/ViewportConfiguration.h: Add a member variable m_minimumEffectiveDeviceWidth. 2018-11-28 Stephan Szabo Make generic EventHandler methods https://bugs.webkit.org/show_bug.cgi?id=192032 Reviewed by Michael Catanzaro. No new tests. No new behavior. Move mostly generic for non-Apple platform implementations of methods from EventHandlerGlib into EventHandler. Two of these also had different Windows implementations, so to limit behavior change from this, those are currently overridden for Windows as well as Mac and IOS. * page/EventHandler.cpp: (WebCore::EventHandler::passMousePressEventToSubframe): (WebCore::EventHandler::passMouseReleaseEventToSubframe): (WebCore::EventHandler::widgetDidHandleWheelEvent): (WebCore::EventHandler::tabsToAllFormControls const): (WebCore::EventHandler::passWidgetMouseDownEventToWidget): (WebCore::EventHandler::passMouseDownEventToWidget): (WebCore::EventHandler::focusDocumentView): (WebCore::EventHandler::eventActivatedView const): (WebCore::EventHandler::passMouseMoveEventToSubframe): * page/win/EventHandlerWin.cpp: (WebCore::EventHandler::passMouseMoveEventToSubframe): (WebCore::EventHandler::passMousePressEventToSubframe): Deleted. (WebCore::EventHandler::passMouseReleaseEventToSubframe): Deleted. (WebCore::EventHandler::widgetDidHandleWheelEvent): Deleted. (WebCore::EventHandler::tabsToAllFormControls const): Deleted. (WebCore::EventHandler::focusDocumentView): Deleted. (WebCore::EventHandler::passWidgetMouseDownEventToWidget): Deleted. (WebCore::EventHandler::accessKeyModifiers): Deleted. * platform/glib/EventHandlerGLib.cpp: (WebCore::EventHandler::tabsToAllFormControls const): Deleted. (WebCore::EventHandler::focusDocumentView): Deleted. (WebCore::EventHandler::passWidgetMouseDownEventToWidget): Deleted. (WebCore::EventHandler::passMouseDownEventToWidget): Deleted. (WebCore::EventHandler::eventActivatedView const): Deleted. (WebCore::EventHandler::widgetDidHandleWheelEvent): Deleted. (WebCore::EventHandler::passMousePressEventToSubframe): Deleted. (WebCore::EventHandler::passMouseMoveEventToSubframe): Deleted. (WebCore::EventHandler::passMouseReleaseEventToSubframe): Deleted. (WebCore::EventHandler::accessKeyModifiers): Deleted. 2018-11-28 Zalan Bujtas [LFC][Quirk] Use non-collapsed vertical margin values when the container is stretched to the size of the ICB. https://bugs.webkit.org/show_bug.cgi?id=192078 Reviewed by Antti Koivisto. This quirk happens when the body height is 0 which means its vertical margins collapse through (top and bottom margins are adjoining). However now that we stretch the body they don't collapse through anymore, so we need to use the non-collapsed values instead. * layout/LayoutUnits.h: (WebCore::Layout::HeightAndMargin::usedMarginValues const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::stretchHeightToInitialContainingBlock): 2018-11-28 Zalan Bujtas [LFC] Add support for quirk container's collapsing top margin in quirks mode. https://bugs.webkit.org/show_bug.cgi?id=192070 Reviewed by Antti Koivisto. In quirk mode when the top margin collapsing is computed for a quirk container (body, table cell) and the canditate margin value is also a quirk value, we just ignore it. * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::isQuirkContainer): (WebCore::Layout::hasMarginTopQuirkValue): (WebCore::Layout::shouldIgnoreMarginTopInQuirkContext): (WebCore::Layout::isMarginTopCollapsedWithParent): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop): * layout/layouttree/LayoutBox.h: (WebCore::Layout::Box::isTableCell const): 2018-11-28 Ali Juma Intersection Observer: rootMargin: '' gives weird results https://bugs.webkit.org/show_bug.cgi?id=191975 Reviewed by Simon Fraser. When converting the rootMargin string into a LengthBox, explicitly construct a Length of size 0px for each dimension, instead of using Length's default constructor. The default constructor creates a Length with value Auto, which causes us to incorrectly apply a non-zero rootMargin. Test: imported/w3c/web-platform-tests/intersection-observer/empty-root-margin.html * page/IntersectionObserver.cpp: (WebCore::parseRootMargin): 2018-11-28 Thibault Saunier [WebRTC][GStreamer] Make sure to have the default microphone on the top of the list https://bugs.webkit.org/show_bug.cgi?id=192026 Reviewed by Philippe Normand. Otherwise we might end up picking a useless one in some applications (not sure what those application do though). GStreamer patch proposed as https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/merge_requests/34/diffs * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp: (WebCore::sortDevices): (WebCore::GStreamerCaptureDeviceManager::addDevice): (WebCore::GStreamerCaptureDeviceManager::refreshCaptureDevices): * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h: 2018-11-28 Thibault Saunier [WebRTC][GStreamer] Tag all cameras with as 'Unknown' facing mode https://bugs.webkit.org/show_bug.cgi?id=192028 Reviewed by Philippe Normand. * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp: (WebCore::GStreamerVideoCaptureSource::capabilities): 2018-11-28 Thibault Saunier [WebRTC][GStreamer] Use a GUniquePtr to hold the GstAudioConverter in our OutgoingAudioSource https://bugs.webkit.org/show_bug.cgi?id=192027 Reviewed by Xabier Rodriguez-Calvar. Cleaning up a bit the code. It is a minor refactoring, no new test required. * platform/graphics/gstreamer/GUniquePtrGStreamer.h: * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::~RealtimeOutgoingAudioSourceLibWebRTC): (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h: 2018-11-28 Thibault Saunier [GStreamer][WebRTC] Do not run device monitor for device type we do not handle https://bugs.webkit.org/show_bug.cgi?id=191904 This is useless work and it throws warning about use GstDeviceMonitor without filters. Reviewed by Philippe Normand. * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp: (WebCore::GStreamerCaptureDeviceManager::refreshCaptureDevices): 2018-11-27 Rob Buis Block more ports (427, 548, 6697) https://bugs.webkit.org/show_bug.cgi?id=186092 Reviewed by Frédéric Wang. Block port 427, ports 548 and 6697 are aleady blocked and are tested by the updated request-bad-port.html wpt test. Behavior matches Firefox and Chrome. Test: web-platform-tests/fetch/api/request/request-bad-port.html * platform/URL.cpp: (WebCore::portAllowed): 2018-11-27 Youenn Fablet Log WebRTC stats in inspector console only when setting is verbose https://bugs.webkit.org/show_bug.cgi?id=192014 Reviewed by Eric Carlson. Add a WebRTCStats channel that is used by default to output WebRTC stats in console. When WebRTC Debug logging is enabled, log WebRTC stats in WebRTC channel, so that they appear as debug information in Web Inspector. No change of JS behavior. Covered by manually testing what is logged in inspector and console. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered): * platform/Logging.h: 2018-11-27 Simon Fraser Fix the mis-spelled "m_clienstWaitingForAsyncDecoding" https://bugs.webkit.org/show_bug.cgi?id=192060 Reviewed by Wenson Hsieh. Fix the mis-spelling of "m_clienstWaitingForAsyncDecoding". * loader/cache/CachedImage.cpp: (WebCore::CachedImage::didRemoveClient): (WebCore::CachedImage::isClientWaitingForAsyncDecoding const): (WebCore::CachedImage::addClientWaitingForAsyncDecoding): (WebCore::CachedImage::removeAllClientsWaitingForAsyncDecoding): (WebCore::CachedImage::allClientsRemoved): (WebCore::CachedImage::clear): (WebCore::CachedImage::createImage): (WebCore::CachedImage::imageFrameAvailable): * loader/cache/CachedImage.h: 2018-11-27 Mark Lam ENABLE_FAST_JIT_PERMISSIONS should be false for iosmac. https://bugs.webkit.org/show_bug.cgi?id=192055 Reviewed by Saam Barati. No new tests needed. Removing an invalid configuration that is not used in WebCore. * Configurations/FeatureDefines.xcconfig: 2018-11-27 Jiewen Tan Remove kCCNotVerified https://bugs.webkit.org/show_bug.cgi?id=192034 Reviewed by Alexey Proskuryakov. No change of behaviours. * crypto/CommonCryptoUtilities.h: * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp: (WebCore::verifyRSASSA_PKCS1_v1_5): 2018-11-27 Simon Fraser Avoid triggering compositing updates when only the root layer is composited https://bugs.webkit.org/show_bug.cgi?id=191813 Reviewed by Zalan Bujtas. If we know that the only composited layer is the root, we can avoid triggering deep compositing updates sometimes, for example when layout changes size or position, or when z-order lists change. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::addChild): (WebCore::RenderLayer::removeChild): (WebCore::RenderLayer::updateLayerPosition): (WebCore::RenderLayer::scrollTo): (WebCore::RenderLayer::updateCompositingLayersAfterScroll): (WebCore::outputPaintOrderTreeRecursive): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): Consult the layer.hasCompositingDescendant() flag to cut off descendants traversal when possible. (WebCore::RenderLayerCompositor::layerStyleChanged): 2018-11-27 Eric Carlson Refactor duplicate code for calling into media controls https://bugs.webkit.org/show_bug.cgi?id=192040 Reviewed by Youenn Fablet. No new tests, no functional change. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::setupAndCallJS): (WebCore::HTMLMediaElement::updateCaptionContainer): (WebCore::HTMLMediaElement::configureTextTrackDisplay): (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript): (WebCore::HTMLMediaElement::setControllerJSProperty): (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot): (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange): (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus): * html/HTMLMediaElement.h: 2018-11-27 Simon Fraser Momentum scrolling ends at the wrong place when a scrolling overflow element has a non-zero border https://bugs.webkit.org/show_bug.cgi?id=191322 Reviewed by Dean Jackson. The scrolling momentum logic in ScrollController::handleWheelEvent() which computes whether the scroll is pinned to the end makes use of ScrollableArea::visibleContentRect(). RenderLayer's implementation of this was incorrect when the layer's element had borders, causing the momentum scroll to stop early. Fix by using the correct size (visible size, not layer size). Test: fast/scrolling/momentum-scroll-with-borders.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::visibleContentRectInternal const): 2018-11-27 Simon Fraser Composited and tiled layers fail to update on scrolling in WebView https://bugs.webkit.org/show_bug.cgi?id=191821 rdar://problem/46009272 Reviewed by Zalan Bujtas. We relied on AppKit calling -[NSView viewWillDraw] on scrolling to trigger compositing layer flushes which are necessary to update backing store attachment, and tile coverage for tiled layers. However, we no longer get these reliably in WebView, so explicitly trigger flushes if necessary from FrameView::scrollOffsetChangedViaPlatformWidgetImpl(). didChangeVisibleRect() is the same code path used by iOS UIWebView for the same purpose. Tests: compositing/backing/backing-store-attachment-scroll.html compositing/tiling/tile-coverage-on-scroll.html * page/FrameView.cpp: (WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateCoverage): 2018-11-27 Timothy Hatcher Web Inspector: Add support for forcing color scheme appearance in DOM tree. https://bugs.webkit.org/show_bug.cgi?id=191820 rdar://problem/46153172 Reviewed by Devin Rousso. Test: inspector/css/force-page-appearance.html * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::defaultAppearanceDidChangeImpl): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::defaultAppearanceDidChange): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::enable): Fire defaultAppearanceDidChange() on macOS Majave. (WebCore::InspectorPageAgent::disable): Call setForcedAppearance() with empty string. (WebCore::InspectorPageAgent::defaultAppearanceDidChange): Added. (WebCore::InspectorPageAgent::setForcedAppearance): Added. * inspector/agents/InspectorPageAgent.h: * page/Page.cpp: (WebCore::Page::setUseDarkAppearance): Call InspectorInstrumentation::defaultAppearanceDidChange(). (WebCore::Page::useDarkAppearance const): Return override value if not nullopt. (WebCore::Page::setUseDarkAppearanceOverride): Added. * page/Page.h: (WebCore::Page::defaultUseDarkAppearance const): Added. 2018-11-27 Tim Horton Serialize and deserialize editable image strokes https://bugs.webkit.org/show_bug.cgi?id=192002 Reviewed by Dean Jackson. Test: editing/images/paste-editable-image.html * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::parseAttribute): (WebCore::HTMLImageElement::insertedIntoAncestor): (WebCore::HTMLImageElement::didFinishInsertingNode): (WebCore::HTMLImageElement::removedFromAncestor): (WebCore::HTMLImageElement::hasEditableImageAttribute const): (WebCore::HTMLImageElement::updateEditableImage): Call updateEditableImage() from didFinishInsertingNode instead of insertedIntoAncestor. This is helpful because it means we get the final, deduplicated attachment identifier instead of the original one when cloning or pasting. This also means that isConnected() is now always accurate when updateEditableImage() is called, so we can remove the argument that allowed us to lie from inside insertedIntoAncestor. * html/HTMLImageElement.h: * rendering/RenderImage.cpp: (WebCore::RenderImage::isEditableImage const): Make use of hasEditableImage instead of separately checking for the attribute. 2018-11-16 Jiewen Tan Disallow loading webarchives as iframes https://bugs.webkit.org/show_bug.cgi?id=191728 Reviewed by Youenn Fablet. Disallow loading webarchives as iframes. We don't allow loading remote webarchives. Now, this policy is hardened to disallow loading webarchives as iframes for local documents as well. To allow old tests still be able to run, a flag is added to always allow loading local webarchives in document. The flag can be set via window.internals. Tests: webarchive/loading/test-loading-archive-subresource.html webarchive/loading/test-loading-top-archive.html * dom/Document.h: (WebCore::Document::setAlwaysAllowLocalWebarchive): (WebCore::Document::alwaysAllowLocalWebarchive): * loader/DocumentLoader.cpp: (WebCore::disallowWebArchive): (WebCore::DocumentLoader::continueAfterContentPolicy): (WebCore::isRemoteWebArchive): Deleted. * testing/Internals.cpp: (WebCore::Internals::setAlwaysAllowLocalWebarchive const): * testing/Internals.h: * testing/Internals.idl: 2018-11-27 Jer Noble Unregister CDMSessionMediaSourceAVFObjC for error notifications during destruction. https://bugs.webkit.org/show_bug.cgi?id=191985 Reviewed by Eric Carlson. * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm: (WebCore::CDMSessionMediaSourceAVFObjC::~CDMSessionMediaSourceAVFObjC): 2018-11-27 Thibault Saunier [GStreamer][WebRTC] Use LibWebRTC provided vp8 decoders and encoders https://bugs.webkit.org/show_bug.cgi?id=191861 The GStreamer implementations are less feature full and less tested, now that Apple also use the LibWebRTC provided implementations it makes a lot of sense for us to do the same. Basically everything related to temporal scalability is not implemented in GStreamer. We should make sure to use GStreamer elements on low powered platforms and for accelerated encoders and decoders. Reviewed by Philippe Normand. This is mostly refactoring, no new test required. * platform/graphics/gstreamer/GStreamerCommon.h: Added GstMappedFrame similar to GstMappedBuffer but for video frames. (WebCore::GstMappedFrame::GstMappedFrame): (WebCore::GstMappedFrame::get): (WebCore::GstMappedFrame::ComponentData): (WebCore::GstMappedFrame::ComponentStride): (WebCore::GstMappedFrame::info): (WebCore::GstMappedFrame::width): (WebCore::GstMappedFrame::height): (WebCore::GstMappedFrame::format): (WebCore::GstMappedFrame::~GstMappedFrame): (WebCore::GstMappedFrame::operator bool const): * platform/graphics/gstreamer/GUniquePtrGStreamer.h: * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp: (WebCore::GStreamerVideoFrameLibWebRTC::ToI420): Implemented support for converting frame formats with the GstVideoConverter API * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp: (WebCore::GStreamerVideoDecoder::GstDecoderFactory): (WebCore::GStreamerVideoDecoder::HasGstDecoder): (WebCore::VP8Decoder::Create): Creates a `webrtc::LibvpxVp8Decoder()` if GStreamer decoder would be the LibVPX based one. (WebCore::GStreamerVideoDecoderFactory::CreateVideoDecoder): * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp: (gst_webrtc_video_encoder_class_init): * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: Stop using vp8enc and use LibWebRTC based implementation (WebCore::GStreamerH264Encoder::GStreamerH264Encoder): Renamed H264Encoder to GStreamerH264Encoder to be more coherent with what is done in LibVPX (WebCore::GStreamerVP8Encoder::GStreamerVP8Encoder): Renamed VP8Encoder to GStreamerVP8Encoder to be more coherent with what is done in LibVPX (WebCore::GStreamerVideoEncoderFactory::CreateVideoEncoder): (WebCore::GStreamerVideoEncoderFactory::GetSupportedFormats const): 2018-11-27 Javier Fernandez [css-grid] align-self center and position sticky don't work together https://bugs.webkit.org/show_bug.cgi?id=191963 Reviewed by Manuel Rego Casasnovas. This is a fix for a regression introduced in r515391, where we landed the implementation of alignment for positioned objects in a Grid Layout container. We assumed that items with non-static positions shouldn't honor the CSS Box Alignment properties. This is only true for out-of-flow items, absolute or fixed positioned elements. However, sticky positioned elements are treated as relative positioned items, but they indeed use non-static position to define their behavior. No new tests, this change is covered by current tests and make several cases to pass now. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): 2018-11-26 Daniel Bates REGRESSION (r238078): Do not draw caps lock indicator when Strong Password button is shown https://bugs.webkit.org/show_bug.cgi?id=191969 Reviewed by Dean Jackson. Following r238078 we now support drawing the caps lock indicator in password fields on iOS. However it is not meaningful to show the caps lock indicator when the Strong Password button is visible because the password field is not editable. We should not paint the caps lock indicator when the Strong Password button is visible. Tests: fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-after-hiding-auto-fill-strong-password-button.html fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible.html * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const): Do not draw the caps lock indicator when the password field has the Strong Password button. (WebCore::TextFieldInputType::updateAutoFillButton): Call capsLockStateMayHaveChanged() to update the visibility of the caps lock indicator when the auto fill button has changed. 2018-11-26 Ryan Haddad Unreviewed, rolling out r238357. One of the layout tests added with this change is failing on Mojave. Reverted changeset: "REGRESSION (r238078): Do not draw caps lock indicator when Strong Password button is shown" https://bugs.webkit.org/show_bug.cgi?id=191969 https://trac.webkit.org/changeset/238513 2018-11-26 Tim Horton Insert elements under editable images to make their backing data accessible https://bugs.webkit.org/show_bug.cgi?id=191844 Reviewed by Simon Fraser. Test: editing/images/editable-image-creates-attachment.html * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::parseAttribute): (WebCore::HTMLImageElement::insertedIntoAncestor): (WebCore::HTMLImageElement::removedFromAncestor): When the x-apple-editable-image attribute changes, or the element is moved into or out of a document, call updateEditableImage. (WebCore::HTMLImageElement::editableImageViewID const): Adopt EditableImageReference. (WebCore::HTMLImageElement::updateEditableImage): When the image element moves into a document, the setting is on, and the appropriate attribute is applied, add an into the shadow DOM, and inform the UI process both of the editable image's creation and that it should be associated with the new attachment. Use an EditableImageReference to extend the lifetime of the corresponding editable image in the UI process, and to communicate the attachment association. If the element was cloned from another editable image element, use the EditableImageReference and attachmentID from the original; the embedded view will be re-parented under this element's layer, and the attachment will be cloned (with a new ID) by editing code if the element is parented. (WebCore::HTMLImageElement::attachmentIdentifier const): (WebCore::HTMLImageElement::copyNonAttributePropertiesFromElement): Store the aforementioned bits of information when cloned so that we can reconstitute the appropriate attachment data and embedded view. * html/HTMLImageElement.h: * page/ChromeClient.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * page/EditableImageReference.cpp: Added. (WebCore::EditableImageReference::EditableImageReference): (WebCore::EditableImageReference::~EditableImageReference): (WebCore::EditableImageReference::associateWithAttachment): * page/EditableImageReference.h: Added. (WebCore::EditableImageReference::create): (WebCore::EditableImageReference::embeddedViewID const): Add EditableImageReference, which manages the lifetime of the UI-side EditableImage and helps clients communicate about it. It is refcounted so that cloned elements can potentially borrow the UI-side state (in the case where they end up getting parented). * page/NavigatorBase.cpp: Fix an unrelated unified build failure that I exposed. 2018-11-26 Jer Noble Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI https://bugs.webkit.org/show_bug.cgi?id=190951 Reviewed by Alex Christensen. Request the correct route policy and context from the VideoFullscreenModel. * platform/cocoa/VideoFullscreenModel.h: (WebCore::VideoFullscreenModel::requestRouteSharingPolicyAndContextUID): * platform/cocoa/VideoFullscreenModelVideoElement.h: * platform/cocoa/VideoFullscreenModelVideoElement.mm: (WebCore::VideoFullscreenModelVideoElement::requestRouteSharingPolicyAndContextUID): * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]): (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel): (VideoFullscreenInterfaceAVKit::doSetup): 2018-11-24 Ryosuke Niwa SVG use element inside a shadow tree cannot reference an element in the same tree https://bugs.webkit.org/show_bug.cgi?id=174977 Reviewed by Zalan Bujtas. Make fragment URL references used by SVGelements within a shadow tree to refer to other elements in the same shadow tree. To do this, this patch makes targetElementFromIRIString take a TreeScope instead of a Document, and updates its call sites. This patch updates the most uses of targetElementFromIRIString except CSS cursor image, altGraph, and glyphRef since the cursor image isn't really a SVG feature, and there aren't really real world use cases in which altGraph and glyphRef are used within shadow trees. Tests: fast/shadow-dom/svg-animate-href-change-in-shadow-tree.html fast/shadow-dom/svg-animate-href-in-shadow-tree.html fast/shadow-dom/svg-feimage-href-in-shadow-tree.html fast/shadow-dom/svg-linear-gradient-href-in-shadow-tree.html fast/shadow-dom/svg-mpath-href-change-in-shadow-tree.html fast/shadow-dom/svg-mpath-href-in-shadow-tree.html fast/shadow-dom/svg-radial-gradient-href-in-shadow-tree.html fast/shadow-dom/svg-text-path-href-change-in-shadow-tree.html fast/shadow-dom/svg-text-path-href-in-shadow-tree.html fast/shadow-dom/svg-thref-href-change-in-shadow-tree.html fast/shadow-dom/svg-thref-href-in-shadow-tree.html fast/shadow-dom/svg-use-href-change-in-shadow-tree.html fast/shadow-dom/svg-use-href-in-shadow-tree.html * accessibility/AccessibilitySVGElement.cpp: (WebCore::AccessibilitySVGElement::targetForUseElement const): * css/CSSCursorImageValue.cpp: * rendering/svg/RenderSVGTextPath.cpp: (WebCore::RenderSVGTextPath::layoutPath const): * svg/SVGAltGlyphElement.cpp: (WebCore::SVGAltGlyphElement::hasValidGlyphElements const): * svg/SVGFEImageElement.cpp: (WebCore::SVGFEImageElement::buildPendingResource): (WebCore::SVGFEImageElement::build): * svg/SVGGlyphRefElement.cpp: (WebCore::SVGGlyphRefElement::hasValidGlyphElement const): * svg/SVGLinearGradientElement.cpp: (WebCore::SVGLinearGradientElement::collectGradientAttributes): * svg/SVGMPathElement.cpp: (WebCore::SVGMPathElement::buildPendingResource): (WebCore::SVGMPathElement::pathElement): * svg/SVGRadialGradientElement.cpp: (WebCore::SVGRadialGradientElement::collectGradientAttributes): * svg/SVGTRefElement.cpp: (WebCore::SVGTRefElement::buildPendingResource): * svg/SVGTextPathElement.cpp: (WebCore::SVGTextPathElement::buildPendingResource): * svg/SVGURIReference.cpp: (WebCore::SVGURIReference::targetElementFromIRIString): * svg/SVGURIReference.h: * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::updateShadowTree): (WebCore::SVGUseElement::findTarget const): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::buildPendingResource): (WebCore::SVGSMILElement::insertedIntoAncestor): * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::FEImage): (WebCore::FEImage::createWithIRIReference): (WebCore::FEImage::referencedRenderer const): * svg/graphics/filters/SVGFEImage.h: 2018-11-26 Truitt Savell Unreviewed, rolling out r238357. Casued three css tests to fail and crash on ios sim Reverted changeset: "Avoid triggering compositing updates when only the root layer is composited" https://bugs.webkit.org/show_bug.cgi?id=191813 https://trac.webkit.org/changeset/238357 2018-11-26 Daniel Bates Caret disappears at end of password field when caps lock indicator is shown; password field not scrolled when caps lock indicator is shown https://bugs.webkit.org/show_bug.cgi?id=191164 Reviewed by Dean Jackson. Fixes an issue where the caret may be occluded by- or paint on top of- the caps lock indicator on Mac and iOS, respectively. If there has not been a previous selection in a focused password field, including a caret selection made by pressing the arrow keys, then we never scroll the password field to reveal the current selection when the caps lock indicator is made visible. When the caps lock indicator is made visible or hidden the size of the inner text renderer changes as it shrinks or expands to make space for the caps lock indicator or to fill the void of the now hidden caps lock indicator, respectively. We should detect such size changes and schedule an update and reveal of the current selection after layout. Test: fast/forms/password-scrolled-after-caps-lock-toggled.html * editing/FrameSelection.cpp: (WebCore::FrameSelection::setNeedsSelectionUpdate): Modified to take an enum to override the current selection reveal mode for the next update. * editing/FrameSelection.h: * rendering/RenderTextControlSingleLine.cpp: (WebCore::RenderTextControlSingleLine::layout): Schedule post-layout a selection update that reveals the current selection. We pass FrameSelection::RevealSelectionAfterUpdate::Forced to ensure that the scheduled selection update scrolls to the reveal the current selection regardless of selection reveal mode. This is necessary because typing into a password field does not change the current selection reveal mode. 2018-11-26 Daniel Bates Placeholder text is not repainted after caps lock indicator is hidden https://bugs.webkit.org/show_bug.cgi?id=191968 Reviewed by Zalan Bujtas. Fixes an issue where the placeholder text in a password field is not repainted when the caps lock indicator is hidden. The placeholder renderer is special. It is an excluded child renderer and does not take part in normal flow layout. It is also created and destroyed as needed. The caps lock indicator is also special in that it is implemented as a RenderImage and we do not know its dimensions before it is loaded and the load happens asynchronously. As a result we detect when the inner text size changes and mark the placeholder as dirty as a way to keep the dimensions of the placeholder in sync with the dimensions of the inner text. Test: fast/repaint/placeholder-after-caps-lock-hidden.html * rendering/RenderTextControlSingleLine.cpp: (WebCore::RenderTextControlSingleLine::layout): Mark the placeholder as needing layout the size of the inner text changes. 2018-11-26 Jeremy Jones Picture-in-picture window size changes unnecesarily when URL changes. https://bugs.webkit.org/show_bug.cgi?id=191787 Reviewed by Jer Noble. When loading a new URL, the video dimensions are temporarily 0,0. Instead of defaulting back to 4:3 sized pip window temporarily, keep the old dimensions until there is a new valid size. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::videoDimensionsChanged): 2018-11-26 Andy Estes [Cocoa] Make it easier to encode NSObjects https://bugs.webkit.org/show_bug.cgi?id=191948 Reviewed by Dean Jackson. * Modules/applepay/Payment.h: Changed the PKPayment * constructor to take a RetainPtr&& instead. * Modules/applepay/PaymentContact.h: Ditto for PKContact. * Modules/applepay/PaymentMerchantSession.h: Ditto for PKPaymentMerchantSession. * Modules/applepay/PaymentMethod.h: Ditto for PKPaymentMethod. * Modules/applepay/cocoa/PaymentCocoa.mm: (WebCore::Payment::Payment): Moved definition out-of-line. (WebCore::Payment::pkPayment const): Ditto. * Modules/applepay/cocoa/PaymentContactCocoa.mm: (WebCore::PaymentContact::PaymentContact): Ditto. (WebCore::PaymentContact::pkContact const): Ditto. * Modules/applepay/cocoa/PaymentMethodCocoa.mm: (WebCore::PaymentMethod::PaymentMethod): Ditto. (WebCore::PaymentMethod::pkPaymentMethod const): Ditto. 2018-11-26 Daniel Bates REGRESSION (r238078): Do not draw caps lock indicator when Strong Password button is shown https://bugs.webkit.org/show_bug.cgi?id=191969 Reviewed by Dean Jackson. Following r238078 we now support drawing the caps lock indicator in password fields on iOS. However it is not meaningful to show the caps lock indicator when the Strong Password button is visible because the password field is not editable. We should not paint the caps lock indicator when the Strong Password button is visible. Tests: fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-when-after-hiding-auto-fill-strong-password-button.html fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible.html * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const): Do not draw the caps lock indicator when the password field has the Strong Password button. (WebCore::TextFieldInputType::updateAutoFillButton): Call capsLockStateMayHaveChanged() to update the visibility of the caps lock indicator when the auto fill button has changed. 2018-11-26 Sam Weinig Streamline ListHashSet use in floating object code https://bugs.webkit.org/show_bug.cgi?id=191957 Reviewed by Alex Christensen. Simplify use of ListHashSet by using new raw pointer overloads and making use of reversed order of template arguments in the find() and contains() overloads that take hash translators. * rendering/FloatingObjects.cpp: (WebCore::FloatingObjects::remove): Use raw pointer overloads of contains and remove. Remove seperate call to find / check agains end() which is unnecessary as remove() already does that. * rendering/FloatingObjects.h: (WebCore::FloatingObjectHashFunctions::hash): (WebCore::FloatingObjectHashFunctions::equal): (WebCore::FloatingObjectHashTranslator::hash): (WebCore::FloatingObjectHashTranslator::equal): Add hash()/equal() overloads for the raw pointer cases. As the FIXME notes, this could be simplified by changing PtrHashBase to use designated bottleneck functions for hash() and equal(). * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::containsFloat const): (WebCore::RenderBlockFlow::insertFloatingObject): (WebCore::RenderBlockFlow::removeFloatingObject): (WebCore::RenderBlockFlow::hasOverhangingFloat): (WebCore::RenderBlockFlow::addIntrudingFloats): Use simplified calls. * rendering/RenderBlockLineLayout.cpp: (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange): (WebCore::RenderBlockFlow::linkToEndLineIfNeeded): Use simplified calls. 2018-11-26 Jeremy Jones Use Full Screen consistently in localizable strings. https://bugs.webkit.org/show_bug.cgi?id=190363 rdar://problem/43882333 Reviewed by Jon Lee. No new tests because only change is to localizable strings. Rename "Fullscreen" to "Full Screen" in localizable strings for consistency. * English.lproj/Localizable.strings: * platform/LocalizedStrings.cpp: (WebCore::contextMenuItemTagEnterVideoFullscreen): (WebCore::contextMenuItemTagExitVideoFullscreen): (WebCore::localizedMediaControlElementHelpText): 2018-11-26 Brent Fulgham [Win] Reduce the use of WKSI library calls: CoreAnimation https://bugs.webkit.org/show_bug.cgi?id=191777 Reviewed by Zalan Bujtas. Update the Windows build of WebKit to refer to the SPI headers, rather than WebKitSystemInterface. Move a small amount of glue code from WKSI to WebCore, and remove any includes or link directives for WebKitSystemInterface.lib. No new tests. No change in behavior. * platform/graphics/BitmapImage.cpp: * platform/graphics/ca/win/CACFLayerTreeHost.h: * platform/graphics/ca/win/PlatformCALayerWin.cpp: (layerTreeHostForLayer): * platform/graphics/cg/GraphicsContextCG.cpp: * platform/graphics/cg/PathCG.cpp: * platform/graphics/cg/PatternCG.cpp: * platform/graphics/win/WKCAImageQueue.cpp: 2018-11-25 Zalan Bujtas [LFC][IFC] Use float box's margin box to adjust the line constraints. https://bugs.webkit.org/show_bug.cgi?id=191961 Reviewed by Antti Koivisto. Test: fast/inline/inline-content-with-float-and-margin.html (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded): (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): 2018-11-26 Carlos Garcia Campos [GTK] Accessing default web context before gtk_init results in drawing failure (Gtk-WARNING **: drawing failure for widget 'WebKitWebView': invalid value for an input Visual*) https://bugs.webkit.org/show_bug.cgi?id=150303 Reviewed by Michael Catanzaro. Ensure gtk has been initialized before trying to get the default display. * platform/graphics/PlatformDisplay.cpp: (WebCore::PlatformDisplay::createPlatformDisplay): 2018-11-26 Javier Fernandez [css-grid] absolute positioned child is sized wrongly when using auto-fit, generating spurious collapsed tracks https://bugs.webkit.org/show_bug.cgi?id=191938 Reviewed by Manuel Rego Casasnovas. The guttersSize function has a complex logic to compute the gaps in a specific GridSpan, considering different scenarios of collapsed tracks for such span. The first case is avoiding the duplicated gap because of trailing collapsed tracks. The second case considered is looking for non-empty tracks before the GridSpan end, if it points to an empty track, so we must add this gap. The last case is to consider the gap of non-empty tracks after the GridSpan end line, if it points to an empty track. There are several cases that are not considered or incorrectly computed. This patch addresses those cases; basically, we should only consider gaps when there are non-empty tracks before and after the collapsed tracks. Additionally, we should avoid duplicating the gaps size adding both, before and after non-empty track's gap. No new tests, this change is covered by current tests and make several cases to pass now. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::guttersSize const): 2018-11-26 Manuel Rego Casasnovas [css-grid] Fix grid container sizing under min-content height https://bugs.webkit.org/show_bug.cgi?id=191889 Reviewed by Javier Fernandez. The spec is quite clear (https://drafts.csswg.org/css-sizing/#valdef-width-min-content): "min-content If specified for the inline axis, use the min-content inline size; otherwise behaves as the property’s initial value." So if a grid container has "height: min-content" it should behave the same than with "height: auto". The patch removes computeIntrinsicLogicalContentHeightUsing() in RenderGrid as we don't need a custom one anymore. We can also get rid of m_minContentHeight and m_maxContentHeight attributes that were only used for this logic. Test: fast/css-grid-layout/grid-track-sizing-with-orthogonal-flows.html fast/css-grid-layout/maximize-tracks-definite-indefinite-height.html imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-sizing-constraints-001.html * rendering/RenderGrid.cpp: (WebCore::RenderGrid::layoutBlock): (WebCore::RenderGrid::computeIntrinsicLogicalWidths const): (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize const): * rendering/RenderGrid.h: 2018-11-25 Zalan Bujtas [LFC] Remove PointInContainingBlock and PositionInContainingBlock https://bugs.webkit.org/show_bug.cgi?id=191954 Reviewed by Antti Koivisto. Use Point and Position instead. Points and positions are by default in the containing block's coordinate system. * layout/FormattingContextGeometry.cpp: (WebCore::Layout::contentHeightForFormattingContextRoot): * layout/LayoutUnits.h: (WebCore::Layout::Position::operator LayoutUnit const): (WebCore::Layout::operator<): (WebCore::Layout::operator==): * layout/floats/FloatAvoider.cpp: (WebCore::Layout::FloatAvoider::FloatAvoider): (WebCore::Layout::FloatAvoider::setHorizontalConstraints): (WebCore::Layout::FloatAvoider::horizontalPositionCandidate): (WebCore::Layout::FloatAvoider::initialHorizontalPosition const): * layout/floats/FloatBox.cpp: (WebCore::Layout::FloatBox::horizontalPositionCandidate): (WebCore::Layout::FloatBox::verticalPositionCandidate): (WebCore::Layout::FloatBox::initialVerticalPosition const): * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::positionForFloatAvoiding const): (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): (WebCore::Layout::FloatingContext::floatingPosition const): (WebCore::Layout::FloatingPair::horizontalConstraints const): (WebCore::Layout::FloatingPair::bottom const): * layout/floats/FloatingContext.h: * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::constraints const): (WebCore::Layout::FloatingState::bottom const): * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::FloatItem::bottom const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::initializeNewLine const): 2018-11-25 Zalan Bujtas [LFC] Rename Layout::Position to Layout::Point https://bugs.webkit.org/show_bug.cgi?id=191950 Reviewed by Antti Koivisto. It actually represents a point. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::mapTopLeftToAncestor): (WebCore::Layout::FormattingContext::mapCoordinateToAncestor): * layout/FormattingContext.h: * layout/LayoutUnits.h: (WebCore::Layout::Point::Point): (WebCore::Layout::Point::moveBy): (WebCore::Layout::Position::operator LayoutPoint const): Deleted. (WebCore::Layout::Position::Position): Deleted. (WebCore::Layout::Position::moveBy): Deleted. * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition): * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::constraints const): 2018-11-25 Zalan Bujtas [LFC] Floating code should use typed positions (PositionInContextRoot). https://bugs.webkit.org/show_bug.cgi?id=191949 Reviewed by Antti Koivisto. Use PositionInContextRoot instead of LayoutUnit. * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::constraints const): (WebCore::Layout::FloatingState::bottom const): * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::leftBottom const): (WebCore::Layout::FloatingState::rightBottom const): (WebCore::Layout::FloatingState::bottom const): 2018-11-25 Zalan Bujtas Fix build after r238472. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::runWidth): * layout/inlineformatting/InlineLineBreaker.cpp: (WebCore::Layout::InlineLineBreaker::textWidth const): 2018-11-25 Tim Horton Make it possible to insert editable images with a gesture https://bugs.webkit.org/show_bug.cgi?id=191937 Reviewed by Wenson Hsieh. Tests: editing/images/redo-insert-editable-image-maintains-strokes.html, editing/images/undo-insert-editable-image.html, editing/images/basic-editable-image-from-execCommand.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * Source/WebCore/editing/EditorCommand.cpp: * Source/WebCore/en.lproj/Localizable.strings: * editing/EditAction.h: * editing/Editor.cpp: (WebCore::Editor::insertEditableImage): * editing/Editor.h: * editing/InsertEditableImageCommand.cpp: Added. (WebCore::InsertEditableImageCommand::InsertEditableImageCommand): (WebCore::InsertEditableImageCommand::doApply): * editing/InsertEditableImageCommand.h: Added. (WebCore::InsertEditableImageCommand::create): * editing/VisibleSelection.cpp: Add an editor command that inserts an editable image. It will likely get a bit more complicated, but for now it just inserts a 100% by 300px editable image. 2018-11-24 Wenson Hsieh [Cocoa] Fix a few localizable string descriptions in WebEditCommandProxy.cpp and WebEditorClient.mm https://bugs.webkit.org/show_bug.cgi?id=191945 Reviewed by Anders Carlsson. Run `update-webkit-localizable-strings`. * en.lproj/Localizable.strings: 2018-11-24 Sam Weinig Remove now unnecessary specialized ListHashSet from InlineItem.h https://bugs.webkit.org/show_bug.cgi?id=191946 Reviewed by Zalan Bujtas. Now that ListHashSet supports raw pointer overloads for smart pointers, we can fix the FIXME in InlineItem.h and remove the specialized ListHashSet and ListHashSet::find calls. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::runWidth): * layout/inlineformatting/InlineItem.h: (WebCore::Layout::InlineItemHashFunctions::hash): Deleted. (WebCore::Layout::InlineItemHashFunctions::equal): Deleted. (WebCore::Layout::InlineItemHashTranslator::hash): Deleted. (WebCore::Layout::InlineItemHashTranslator::equal): Deleted. * layout/inlineformatting/InlineLineBreaker.cpp: (WebCore::Layout::InlineLineBreaker::textWidth const): 2018-11-24 Wenson Hsieh [Cocoa] Add WKWebView SPI to trigger and remove data detection https://bugs.webkit.org/show_bug.cgi?id=191918 Reviewed by Tim Horton. Add a helper method on DataDetection to remove all data detected links in the given document. See WebKit changes for more detail. * editing/cocoa/DataDetection.h: * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::removeDataDetectedLinksInDocument): 2018-11-24 Andy Estes [Cocoa] SOFT_LINK_CLASS_FOR_{HEADER,SOURCE} should generate a more concise getter function https://bugs.webkit.org/show_bug.cgi?id=191899 Reviewed by Dean Jackson. * editing/cocoa/DataDetection.mm: * editing/cocoa/FontAttributesCocoa.mm: * editing/cocoa/FontShadowCocoa.mm: * platform/cocoa/DataDetectorsCoreSoftLink.h: * platform/graphics/cocoa/ColorCocoa.mm: * platform/ios/PlatformScreenIOS.mm: 2018-11-23 Jiewen Tan [WebAuthN] Enable Web Authentication as an experimental feature for macOS https://bugs.webkit.org/show_bug.cgi?id=191932 rdar://problem/46225210 Reviewed by Brent Fulgham. Add myself to the contact of Web Authentication. * features.json: 2018-11-23 Ryosuke Niwa REGRESSION (r236785): Nullptr crash in StyledMarkupAccumulator::traverseNodesForSerialization https://bugs.webkit.org/show_bug.cgi?id=191921 Reviewed by Dean Jackson. The bug was caused by traverseNodesForSerialization not being able to traverse past the end of shadow root when skipping children of a node for which enterNode returns false because it was using NodeTraversal's nextSkippingChildren instead of a member function which supports traversing the composed tree. Fixed the crash by using variant of nextSkippingChildren which knows how to traverse past the last node in a shadow tree. Also added more assertions to help debug issues like this in the future. Test: editing/pasteboard/copy-paste-across-shadow-boundaries-5.html * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization): 2018-11-22 Ryosuke Niwa Updating href on textPath doesn't update its rendering https://bugs.webkit.org/show_bug.cgi?id=191920 Reviewed by Dean Jackson. Fixed the bug by invalidating the RenderSVGResource in SVGTextPathElement::svgAttributeChanged in addition to updating the pending resources. Test: svg/text/textpath-reference-update.html * svg/SVGTextPathElement.cpp: (WebCore::SVGTextPathElement::svgAttributeChanged): 2018-11-23 Ross Kirsling Introduce user-defined literal for LayoutUnit https://bugs.webkit.org/show_bug.cgi?id=191915 Reviewed by Dean Jackson. * platform/LayoutUnit.h: Introduce a user-defined literal for LayoutUnit, _lu, replacing the existing "fromPixel" factory function. * layout/FormattingContextGeometry.cpp: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: * layout/inlineformatting/InlineLineBreaker.cpp: * page/FrameView.cpp: * page/FrameViewLayoutContext.h: * page/Page.cpp: * page/SpatialNavigation.h: * platform/ScrollableArea.cpp: * rendering/EllipsisBox.cpp: * rendering/FlexibleBoxAlgorithm.cpp: * rendering/FloatingObjects.cpp: * rendering/GridLayoutFunctions.cpp: * rendering/GridTrackSizingAlgorithm.cpp: * rendering/InlineFlowBox.cpp: * rendering/InlineTextBox.cpp: * rendering/LayoutState.h: * rendering/LogicalSelectionOffsetCaches.h: * rendering/RenderBlock.cpp: * rendering/RenderBlock.h: * rendering/RenderBlockFlow.cpp: * rendering/RenderBlockFlow.h: * rendering/RenderBlockLineLayout.cpp: * rendering/RenderBox.cpp: * rendering/RenderBoxModelObject.cpp: * rendering/RenderDeprecatedFlexibleBox.cpp: * rendering/RenderDeprecatedFlexibleBox.h: * rendering/RenderElement.cpp: * rendering/RenderFlexibleBox.cpp: * rendering/RenderFlexibleBox.h: * rendering/RenderFragmentContainer.cpp: * rendering/RenderFragmentedFlow.cpp: * rendering/RenderGrid.cpp: * rendering/RenderGrid.h: * rendering/RenderImage.cpp: * rendering/RenderLayer.cpp: * rendering/RenderListMarker.cpp: * rendering/RenderMultiColumnFlow.cpp: * rendering/RenderMultiColumnSet.cpp: * rendering/RenderReplaced.cpp: * rendering/RenderReplaced.h: * rendering/RenderRubyRun.h: * rendering/RenderTable.cpp: * rendering/RenderTable.h: * rendering/RenderTableSection.cpp: * rendering/RenderTheme.cpp: * rendering/RenderTreeAsText.cpp: * rendering/RenderView.cpp: * rendering/RootInlineBox.h: * rendering/SimpleLineLayout.cpp: * rendering/SimpleLineLayoutPagination.cpp: * rendering/TableLayout.h: * rendering/line/BreakingContext.h: * rendering/line/LineLayoutState.h: * rendering/line/LineWidth.h: * rendering/mathml/MathOperator.cpp: * rendering/mathml/MathOperator.h: * rendering/mathml/RenderMathMLBlock.h: * rendering/mathml/RenderMathMLFraction.cpp: * rendering/mathml/RenderMathMLFraction.h: * rendering/mathml/RenderMathMLMath.cpp: * rendering/mathml/RenderMathMLMath.h: * rendering/mathml/RenderMathMLMenclose.h: * rendering/mathml/RenderMathMLOperator.cpp: * rendering/mathml/RenderMathMLOperator.h: * rendering/mathml/RenderMathMLPadded.h: * rendering/mathml/RenderMathMLRoot.cpp: * rendering/mathml/RenderMathMLRoot.h: * rendering/mathml/RenderMathMLRow.h: * rendering/mathml/RenderMathMLScripts.cpp: * rendering/mathml/RenderMathMLScripts.h: * rendering/mathml/RenderMathMLSpace.h: * rendering/mathml/RenderMathMLToken.cpp: * rendering/mathml/RenderMathMLToken.h: * rendering/mathml/RenderMathMLUnderOver.h: * rendering/shapes/ShapeOutsideInfo.cpp: * rendering/style/CollapsedBorderValue.h: Update all instances of LayoutUnit(), LayoutUnit(0), LayoutUnit { 0 }, etc. and add any other literal conversions that will be needed when making non-int LayoutUnit constructors explicit. For good measure, also mark all default values for LayoutUnit parameters. 2018-11-23 Jim Mason [GTK] Scrollbars not following gtk-primary-button-warps-slider setting https://bugs.webkit.org/show_bug.cgi?id=191067 Updated code per the style guide, removed unreachable break (non-semantic change) Reviewed by Michael Catanzaro. * platform/gtk/ScrollbarThemeGtk.cpp: (WebCore::ScrollbarThemeGtk::handleMousePressEvent): 2018-11-23 Wenson Hsieh Enable drag and drop support for iOSMac https://bugs.webkit.org/show_bug.cgi?id=191818 Reviewed by Dean Jackson. Enables drag and drop by default on iOSMac by switching on ENABLE_DATA_INTERACTION and ENABLE_DRAG_SUPPORT. This enables support for dragging links, text selections, and images, though many advanced features (e.g. custom pasteboard data) will require additional support from the platform. * Configurations/FeatureDefines.xcconfig: * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::informationForItemAtIndex): (WebCore::registerItemToPasteboard): (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): * platform/ios/WebItemProviderPasteboard.mm: (-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]): (-[WebItemProviderPasteboard numberOfFiles]): Disable codepaths which attempt to access or set `teamData` or `preferredPresentationStyle` on `NSItemProvider` in iOSMac, since these are currently unimplemented. 2018-11-23 Zalan Butjas [LFC][IFC] Add support for variable height runs. https://bugs.webkit.org/show_bug.cgi?id=191925 Reviewed by Antti Koivisto. https://www.w3.org/TR/CSS22/visudet.html#inline-box-height 10.8 Line height calculations: the 'line-height' and 'vertical-align' properties The height of each inline-level box in the line box is calculated. For replaced elements, inline-block elements, and inline-table elements, this is the height of their margin box; for inline boxes, this is their 'line-height'. The line box height is the distance between the uppermost box top and the lowermost box bottom. The minimum height consists of a minimum height above the baseline and a minimum depth below it, exactly as if each line box starts with a zero-width inline box with the element's font and line height properties. We call that imaginary box a "strut." (The name is inspired by TeX.). Test: fast/inline/inline-content-with-image-simple.html * layout/Verification.cpp: (WebCore::Layout::checkForMatchingNonTextRuns): (WebCore::Layout::checkForMatchingTextRuns): (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::initializeNewLine const): (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): (WebCore::Layout::InlineFormattingContext::createFinalRuns const): (WebCore::Layout::InlineFormattingContext::appendContentToLine const): (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): * layout/inlineformatting/InlineFormattingContext.h: (WebCore::Layout::InlineFormattingContext::Line::logicalHeight const): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns): * layout/inlineformatting/InlineRun.h: (WebCore::Layout::InlineRun::logicalWidth const): (WebCore::Layout::InlineRun::logicalHeight const): (WebCore::Layout::InlineRun::setLogicalWidth): (WebCore::Layout::InlineRun::width const): Deleted. (WebCore::Layout::InlineRun::height const): Deleted. (WebCore::Layout::InlineRun::setWidth): Deleted. * layout/inlineformatting/Line.cpp: (WebCore::Layout::InlineFormattingContext::Line::init): (WebCore::Layout::InlineFormattingContext::Line::appendContent): (WebCore::Layout::InlineFormattingContext::Line::close): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputInlineRuns): 2018-11-23 Antti Koivisto UI side compositing doesn't paint on Mac https://bugs.webkit.org/show_bug.cgi?id=191908 Reviewed by Tim Horton. For clarity put RGB10 and RGB10A8 formats behind PLATFORM(IOS_FAMILY). They are not supported on Mac. * platform/graphics/cocoa/IOSurface.h: * platform/graphics/cocoa/IOSurface.mm: (WebCore::IOSurface::IOSurface): (WebCore::IOSurface::ensurePlatformContext): (WebCore::IOSurface::format const): (WebCore::operator<<): 2018-11-23 Javier Fernandez [css-grid] Implement Baseline Alignment for grid items https://bugs.webkit.org/show_bug.cgi?id=145566 Reviewed by Manuel Rego Casasnovas. This patch impements the Baseline Self-Alignment feature for grid items according to the CSS Box Alignment specification [1]. This new layout logic is handled by the Self-Alignment (justify-self and align-self) and Default-Alignment (justify-items and align-items) CSS properties. This feature allows users to align the grid items sharing a Baseline Alignment Context, either row or column contexts, based on their respective baselines. [1] https://drafts.csswg.org/css-align-3/#baseline-align-self Tests: fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash.html fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash.html fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash.html fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash.html fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash.html fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash.html * Sources.txt: * rendering/GridBaselineAlignment.cpp: Added. (WebCore::GridBaselineAlignment::marginOverForChild const): (WebCore::GridBaselineAlignment::marginUnderForChild const): (WebCore::GridBaselineAlignment::logicalAscentForChild const): (WebCore::GridBaselineAlignment::ascentForChild const): (WebCore::GridBaselineAlignment::descentForChild const): (WebCore::GridBaselineAlignment::isDescentBaselineForChild const): (WebCore::GridBaselineAlignment::isHorizontalBaselineAxis const): (WebCore::GridBaselineAlignment::isOrthogonalChildForBaseline const): (WebCore::GridBaselineAlignment::isParallelToBaselineAxisForChild const): (WebCore::GridBaselineAlignment::baselineGroupForChild const): (WebCore::GridBaselineAlignment::updateBaselineAlignmentContext): (WebCore::GridBaselineAlignment::baselineOffsetForChild const): (WebCore::GridBaselineAlignment::clear): (WebCore::BaselineGroup::BaselineGroup): (WebCore::BaselineGroup::update): (WebCore::BaselineGroup::isOppositeBlockFlow const): (WebCore::BaselineGroup::isOrthogonalBlockFlow const): (WebCore::BaselineGroup::isCompatible const): (WebCore::BaselineContext::BaselineContext): (WebCore::BaselineContext::sharedGroup const): (WebCore::BaselineContext::updateSharedGroup): (WebCore::BaselineContext::findCompatibleSharedGroup): * rendering/GridBaselineAlignment.h: Added. (WebCore::BaselineGroup::maxAscent const): (WebCore::BaselineGroup::maxDescent const): (WebCore::BaselineGroup::size const): (WebCore::isBaselinePosition): (WebCore::GridBaselineAlignment::setBlockFlow): * rendering/GridLayoutFunctions.h: * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::gridAxisForDirection): (WebCore::gridDirectionForAxis): (WebCore::GridTrackSizingAlgorithm::availableSpace const): (WebCore::GridTrackSizingAlgorithm::isIntrinsicSizedGridArea const): (WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const): (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const): (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const): (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const): (WebCore::GridTrackSizingAlgorithm::canParticipateInBaselineAlignment const): (WebCore::GridTrackSizingAlgorithm::participateInBaselineAlignment const): (WebCore::GridTrackSizingAlgorithm::updateBaselineAlignmentContext): (WebCore::GridTrackSizingAlgorithm::baselineOffsetForChild const): (WebCore::GridTrackSizingAlgorithm::clearBaselineItemsCache): (WebCore::GridTrackSizingAlgorithm::cacheBaselineAlignedItem): (WebCore::GridTrackSizingAlgorithm::copyBaselineItemsCache): (WebCore::GridTrackSizingAlgorithm::setup): (WebCore::GridTrackSizingAlgorithm::computeBaselineAlignmentContext): * rendering/GridTrackSizingAlgorithm.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::firstLineBaseline const): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::layoutBlock): (WebCore::RenderGrid::computeIntrinsicLogicalWidths const): (WebCore::RenderGrid::placeItemsOnGrid const): (WebCore::RenderGrid::performGridItemsPreLayout const): (WebCore::synthesizedBaselineFromMarginBox): (WebCore::RenderGrid::isBaselineAlignmentForChild const): (WebCore::RenderGrid::baselinePosition const): (WebCore::RenderGrid::firstLineBaseline const): (WebCore::RenderGrid::inlineBlockBaseline const): (WebCore::RenderGrid::columnAxisBaselineOffsetForChild const): (WebCore::RenderGrid::rowAxisBaselineOffsetForChild const): (WebCore::RenderGrid::columnAxisOffsetForChild const): (WebCore::RenderGrid::rowAxisOffsetForChild const): * rendering/RenderGrid.h: 2018-11-22 Wenson Hsieh Address post-review feedback after r238438 https://bugs.webkit.org/show_bug.cgi?id=191913 Reviewed by Ryosuke Niwa. Replace `bool` arguments to `FrameSelection::setSelectedRange`, `Editor::replaceSelectionWithText`, and `Editor::replaceSelectionWithFragment` with `enum class`es instead. In particular, introduce the following: FrameSelection::ShouldCloseTyping { No, Yes } Editor::SelectReplacement { No, Yes } Editor::SmartReplace { No, Yes } Editor::MatchStyle { No, Yes } * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::selectText): * editing/Editor.cpp: (WebCore::Editor::handleTextEvent): (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::replaceSelectionWithText): (WebCore::Editor::setComposition): (WebCore::Editor::markMisspellingsAfterTypingToWord): (WebCore::Editor::changeBackToReplacedString): (WebCore::Editor::transpose): (WebCore::Editor::insertAttachment): At various call sites, replace boolean arguments with named enums. * editing/Editor.h: * editing/EditorCommand.cpp: (WebCore::expandSelectionToGranularity): (WebCore::executeDeleteToMark): (WebCore::executeSelectToMark): * editing/FrameSelection.cpp: (WebCore::FrameSelection::setSelectedRange): * editing/FrameSelection.h: * page/Page.cpp: (WebCore::replaceRanges): Avoid a bit of ref-count churn, and adjust a few functions to take `const Vector&`s instead of `Vector&&`s. (WebCore::Page::replaceRangesWithText): (WebCore::Page::replaceSelectionWithText): * page/Page.h: 2018-11-21 Ryosuke Niwa Modernize SVGURIReference::targetElementFromIRIString https://bugs.webkit.org/show_bug.cgi?id=191898 Reviewed by Daniel Bates. Made targetElementFromIRIString return an element and the fragment identifier, and merged urlFromIRIStringWithFragmentIdentifier into it. Also replaced the code computing the full URL using the base URL after removing the fragment identifier and rejoining it later with a single call to completeURL. No new tests since there should be no observable behavior change. * accessibility/AccessibilitySVGElement.cpp: (WebCore::AccessibilitySVGElement::targetForUseElement const): * css/CSSCursorImageValue.cpp: (WebCore::CSSCursorImageValue::updateCursorElement): * rendering/svg/RenderSVGTextPath.cpp: (WebCore::RenderSVGTextPath::layoutPath const): * svg/SVGAltGlyphElement.cpp: (WebCore::SVGAltGlyphElement::hasValidGlyphElements const): * svg/SVGFEImageElement.cpp: (WebCore::SVGFEImageElement::buildPendingResource): * svg/SVGGlyphRefElement.cpp: (WebCore::SVGGlyphRefElement::hasValidGlyphElement const): * svg/SVGLinearGradientElement.cpp: (WebCore::SVGLinearGradientElement::collectGradientAttributes): * svg/SVGMPathElement.cpp: (WebCore::SVGMPathElement::buildPendingResource): (WebCore::SVGMPathElement::pathElement): * svg/SVGRadialGradientElement.cpp: (WebCore::SVGRadialGradientElement::collectGradientAttributes): * svg/SVGTRefElement.cpp: (WebCore::SVGTRefElement::detachTarget): (WebCore::SVGTRefElement::buildPendingResource): * svg/SVGTextPathElement.cpp: (WebCore::SVGTextPathElement::buildPendingResource): * svg/SVGURIReference.cpp: (WebCore::SVGURIReference::targetElementFromIRIString): (WebCore::urlFromIRIStringWithFragmentIdentifier): Deleted. * svg/SVGURIReference.h: * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::findTarget const): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::buildPendingResource): * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::referencedRenderer const): 2018-11-22 Dean Jackson Implement WebGPUQueue and device.getQueue() https://bugs.webkit.org/show_bug.cgi?id=191911 Reviewed by Antoine Quint. Implement WebGPUDevice::getQueue(), which creates a WebGPUQueue instance if necessary. Also link WebGPUQueue to the existing GPUQueue object, and expose the label IDL property. This patch is based on some work from Justin Fan. Test: webgpu/queue-creation.html * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: New files. * Modules/webgpu/WebGPUCommandBuffer.h: (WebCore::WebGPUCommandBuffer::commandBuffer const): Expose a GPUCommandBuffer getter, used when submitting (even though the actual GPU submission isn't implemented yet). * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::getQueue): * Modules/webgpu/WebGPUDevice.h: * Modules/webgpu/WebGPUDevice.idl: Implement getQueue(). * Modules/webgpu/WebGPUQueue.cpp: (WebCore::WebGPUQueue::create): (WebCore::WebGPUQueue::WebGPUQueue): (WebCore::WebGPUQueue::submit): * Modules/webgpu/WebGPUQueue.h: (WebCore::WebGPUQueue::label const): (WebCore::WebGPUQueue::setLabel): * Modules/webgpu/WebGPUQueue.idl: New class. Mostly sends stuff onto GPUQueue. * bindings/js/WebCoreBuiltinNames.h: Add WebGPUQueue. * platform/graphics/gpu/GPUQueue.h: * platform/graphics/gpu/cocoa/GPUQueueMetal.mm: (WebCore::GPUQueue::create): (WebCore::GPUQueue::submit): (WebCore::GPUQueue::label const): (WebCore::GPUQueue::setLabel const): "label" getter/setter that uses the underlying MTLCommandQueue label property, but prefixes it with a WebKit identifier, so it can be correctly identified in system crash logs as coming from WebGPU. 2018-11-22 Zalan Bujtas [LFC][IFC] Merge addNonBreakableStart/NonBreakableEnd calls. https://bugs.webkit.org/show_bug.cgi?id=191903 Reviewed by Antti Koivisto. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): 2018-11-22 Zalan Bujtas [LFC][IFC] Offset formatting context root runs with horizontal margins. https://bugs.webkit.org/show_bug.cgi?id=191900 Reviewed by Antti Koivisto. Inline runs generated by formatting roots (inline-block) need to be adjusted with the horizontal margins. (The test case has padding and border as well, but they are _inside_ the formatting context.) Test: fast/inline/inline-content-and-nested-formatting-root-with-margin-left-right.html * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): 2018-11-22 Simon Fraser Extremely small monospace text size when SVG is included as an img https://bugs.webkit.org/show_bug.cgi?id=191834 Reviewed by Myles C. Maxfield. Give defaultFixedFontSize a reasonable default value in Settings, so that clients who omit to set it (like SVGImages) don't get broken rendering. Test: svg/text/monospace-text-size-in-img.html * page/Settings.yaml: 2018-11-22 Javier Fernandez Tables with vertical-lr writing-mode doesn't apply correctly vertical-align: baseline https://bugs.webkit.org/show_bug.cgi?id=191881 Reviewed by Manuel Rego Casasnovas. We should use the font's descent value when wriring-mode flips line flow (vertical-lr). This change also fixes bug 170175, since Flexbox use the same code to determine the first line baseline of a flex item. Test: fast/writing-mode/vertical-align-table-baseline-latin.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::firstLineBaseline const): 2018-11-21 Ryosuke Niwa Phantom focus/blur events fire on clicking between text input fields when listening with addEventListener https://bugs.webkit.org/show_bug.cgi?id=179990 Reviewed by Tim Horton. The bug was caused by TemporarySelectionChange which is used by TextIndicator::createWithRange to set and restore the selection putting the focus on the newly mouse-down'ed input element and restoring the focus back to the input element which originally had the focus immediately. Fixed the bug by avoiding to set the focus since only selection highlights need to be updated here. Also made TemporarySelectionOption an enum class. Unfortunately, no new tests since force click testing is broken :( See . * editing/Editor.cpp: (WebCore::TemporarySelectionChange::TemporarySelectionChange): (WebCore::TemporarySelectionChange::~TemporarySelectionChange): (WebCore::TemporarySelectionChange::setSelection): Extracted. Fixed the bug by adding FrameSelection::DoNotSetFocus to the option when TemporarySelectionOption::DoNotSetFocus is set. * editing/Editor.h: * page/DragController.cpp: (WebCore::DragController::performDragOperation): * page/TextIndicator.cpp: (WebCore::TextIndicator::createWithRange): Set TemporarySelectionOption::DoNotSetFocus. 2018-11-21 Wenson Hsieh [Cocoa] [WebKit2] Add support for replacing find-in-page text matches https://bugs.webkit.org/show_bug.cgi?id=191786 Reviewed by Ryosuke Niwa. Add support for replacing Find-in-Page matches. See below for details. Covered by new layout tests as well as a new API test. Tests: editing/find/find-and-replace-adjacent-words.html editing/find/find-and-replace-at-editing-boundary.html editing/find/find-and-replace-basic.html editing/find/find-and-replace-in-subframes.html editing/find/find-and-replace-no-matches.html editing/find/find-and-replace-noneditable-matches.html editing/find/find-and-replace-replacement-text-input-events.html API test: WebKit.FindAndReplace * page/Page.cpp: (WebCore::replaceRanges): (WebCore::Page::replaceRangesWithText): Add a helper that, given a list of Ranges, replaces each range with the given text. To do this, we first map each Range to editing offsets within the topmost editable root for each Range. This results in a map of editable root to list of editing offsets we need to replace. To apply the replacements, for each editable root in the map, we iterate over each replacement range (i.e. an offset and length), set the current selection to contain that replacement range, and use `Editor::replaceSelectionWithText`. To prevent prior text replacements from clobbering the offsets of latter text replacement ranges, we also iterate backwards through text replacement ranges when performing each replacement. Likewise, we also apply text replacement to each editing container in backwards order: for nodes in the same frame, we compare their position in the document, and for nodes in different frames, we instead compare their frames in frame tree traversal order. We map Ranges to editing offsets and back when performing text replacement because each text replacement may split or merge text nodes, which causes adjacent Ranges to shrink or extend while replacing text. In an earlier attempt to implement this, I simply iterated over each Range to replace and carried out text replacement for each Range. This led to incorrect behavior in some cases, such as replacing adjacent matches. Thus, by computing the set of text replacement offsets prior to replacing any text, we're able to target the correct ranges for replacement. (WebCore::Page::replaceSelectionWithText): Add a helper method on Page to replace the current selection with some text. This simply calls out to `Editor::replaceSelectionWithText`. * page/Page.h: 2018-11-21 Andy Estes [Cocoa] Create a soft-linking file for PassKit https://bugs.webkit.org/show_bug.cgi?id=191875 Reviewed by Myles Maxfield. * Modules/applepay/cocoa/PaymentContactCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead. * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm: Ditto. * SourcesCocoa.txt: Removed @no-unify from PaymentMerchantSessionCocoa.mm. * WebCore.xcodeproj/project.pbxproj: Removed PaymentMerchantSessionCocoa.mm from the WebCore target. * rendering/RenderThemeCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead. 2018-11-21 Zalan Bujtas [LFC] LayoutState should always be initialized with the initial containing block. https://bugs.webkit.org/show_bug.cgi?id=191896 Reviewed by Antti Koivisto. There should always be only one LayoutState per layout tree (it does not mean that layout always starts at the ICB). The ICB is a special formatting context root because it does not have a parent formatting context. All the other formatting contexts first need to be laid out (partially at least e.g margin) in their parent formatting context. Having a non-null parent formatting context as root could lead to undefined behaviour. * layout/LayoutFormattingState.cpp: (WebCore::Layout::LayoutState::LayoutState): (WebCore::Layout::LayoutState::initializeRoot): Deleted. * layout/LayoutFormattingState.h: * layout/Verification.cpp: (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): 2018-11-21 Zalan Bujtas [LFC][IFC] Horizontal margins should be considered as non-breakable space https://bugs.webkit.org/show_bug.cgi?id=191894 Reviewed by Antti Koivisto. Like padding and border, horizontal margins also force run breaks and offset them. Test: fast/inline/inline-content-with-margin-left-right.html * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): 2018-11-20 Ryosuke Niwa Mutation observers doesn't get notified of character data mutation made by the parser https://bugs.webkit.org/show_bug.cgi?id=191874 Reviewed by Antti Koivisto. Fixed the bug that CharacterData::parserAppendData was never notifying MutationObserver. Test: fast/dom/MutationObserver/observe-parser-character-data-change.html * dom/CharacterData.cpp: (WebCore::CharacterData::parserAppendData): 2018-11-21 Claudio Saavedra [SOUP] Follow-up robustness improvements to the certificate decoder https://bugs.webkit.org/show_bug.cgi?id=191892 Reviewed by Michael Catanzaro. If at any point the certificate fails to be constructed from the DER data, bail out. Likewise, if the certificate returned is NULL, return false from the decoder to notify the failure to decode it. * platform/network/soup/CertificateInfo.h: (WTF::Persistence::certificateFromCertificatesDataList): (WTF::Persistence::Coder::decode): 2018-11-21 Zalan Bujtas [LFC][IFC] Border should be considered as non-breakable space https://bugs.webkit.org/show_bug.cgi?id=191891 Reviewed by Antti Koivisto. Like padding, border also forces run breaks and offsets them. Test: fast/inline/inline-content-with-border-left-right.html * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): 2018-11-21 Zalan Bujtas [LFC][IFC] Use contains and containsAll in InlineFormattingContext::splitInlineRunIfNeeded consistently https://bugs.webkit.org/show_bug.cgi?id=191890 Rearrange the comment numbers to match the logic below. Reviewed by Antti Koivisto. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): 2018-11-20 Dean Jackson Move WebGPU platform code to platform/graphics/gpu https://bugs.webkit.org/show_bug.cgi?id=191867 Reviewed by Antoine Quint. The underlying implementation of WebGPU doesn't need to live in Modules, since it technically could be used by other parts of the system. It makes more sense for it to be in platform/graphics/gpu. Move... - Modules/webgpu/GPU* -> platform/graphics/gpu - Modules/webgpu/cocoa -> platform/graphics/gpu/cocoa - platform/graphics/gpu/GPULegacy* -> platform/graphics/gpu/legacy/ - platform/graphics/gpu/cocoa/GPULegacy* -> platform/graphics/gpu/legacy/cocoa * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/gpu/GPUCommandBuffer.h: Renamed from Source/WebCore/Modules/webgpu/GPUCommandBuffer.h. * platform/graphics/gpu/GPUDevice.cpp: Renamed from Source/WebCore/Modules/webgpu/GPUDevice.cpp. (WebCore::GPUDevice::createShaderModule const): (WebCore::GPUDevice::createRenderPipeline const): (WebCore::GPUDevice::createCommandBuffer): (WebCore::GPUDevice::getQueue): * platform/graphics/gpu/GPUDevice.h: Renamed from Source/WebCore/Modules/webgpu/GPUDevice.h. (WebCore::GPUDevice::platformDevice const): * platform/graphics/gpu/GPUPipelineDescriptorBase.h: Renamed from Source/WebCore/Modules/webgpu/GPUPipelineDescriptorBase.h. * platform/graphics/gpu/GPUPipelineStageDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPUPipelineStageDescriptor.h. * platform/graphics/gpu/GPUQueue.h: Renamed from Source/WebCore/Modules/webgpu/GPUQueue.h. (WebCore::GPUQueue::platformQueue const): * platform/graphics/gpu/GPURenderPipeline.h: Renamed from Source/WebCore/Modules/webgpu/GPURenderPipeline.h. (WebCore::GPURenderPipeline::platformRenderPipeline const): * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPURenderPipelineDescriptor.h. * platform/graphics/gpu/GPUShaderModule.h: Renamed from Source/WebCore/Modules/webgpu/GPUShaderModule.h. (WebCore::GPUShaderModule::platformShaderModule const): * platform/graphics/gpu/GPUShaderModuleDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPUShaderModuleDescriptor.h. * platform/graphics/gpu/GPUSwapChain.h: Renamed from Source/WebCore/Modules/webgpu/GPUSwapChain.h. (WebCore::GPUSwapChain::platformLayer const): * platform/graphics/gpu/GPUTexture.h: Renamed from Source/WebCore/Modules/webgpu/GPUTexture.h. * platform/graphics/gpu/GPUTextureFormatEnum.h: Renamed from Source/WebCore/Modules/webgpu/GPUTextureFormatEnum.h. * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUCommandBufferMetal.mm. (WebCore::GPUCommandBuffer::create): (WebCore::GPUCommandBuffer::GPUCommandBuffer): * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUDeviceMetal.mm. (WebCore::GPUDevice::create): (WebCore::GPUDevice::GPUDevice): * platform/graphics/gpu/cocoa/GPUQueueMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUQueueMetal.mm. (WebCore::GPUQueue::create): (WebCore::GPUQueue::GPUQueue): * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPURenderPipelineMetal.mm. (WebCore::setFunctionsForPipelineDescriptor): (WebCore::GPURenderPipeline::create): (WebCore::GPURenderPipeline::GPURenderPipeline): * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUShaderModuleMetal.mm. (WebCore::GPUShaderModule::create): (WebCore::GPUShaderModule::GPUShaderModule): * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUSwapChainMetal.mm. (WebCore::GPUSwapChain::create): (WebCore::GPUSwapChain::GPUSwapChain): (WebCore::GPUSwapChain::setDevice): (WebCore::platformTextureFormatForGPUTextureFormat): (WebCore::GPUSwapChain::setFormat): (WebCore::GPUSwapChain::reshape): (WebCore::GPUSwapChain::getNextTexture): (WebCore::GPUSwapChain::present): * platform/graphics/gpu/cocoa/GPUTextureMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUTextureMetal.mm. (WebCore::GPUTexture::create): (WebCore::GPUTexture::GPUTexture): (WebCore::GPUTexture::createDefaultTextureView): * platform/graphics/gpu/legacy/GPULegacyBuffer.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyBuffer.cpp. (WebCore::GPULegacyBuffer::~GPULegacyBuffer): (WebCore::GPULegacyBuffer::length const): * platform/graphics/gpu/legacy/GPULegacyBuffer.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyBuffer.h. (WebCore::GPULegacyBuffer::contents const): (WebCore::GPULegacyBuffer::metal const): * platform/graphics/gpu/legacy/GPULegacyCommandBuffer.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandBuffer.cpp. (WebCore::GPULegacyCommandBuffer::~GPULegacyCommandBuffer): * platform/graphics/gpu/legacy/GPULegacyCommandBuffer.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandBuffer.h. (WebCore::GPULegacyCommandBuffer::metal const): * platform/graphics/gpu/legacy/GPULegacyCommandQueue.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandQueue.cpp. (WebCore::GPULegacyCommandQueue::~GPULegacyCommandQueue): * platform/graphics/gpu/legacy/GPULegacyCommandQueue.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandQueue.h. (WebCore::GPULegacyCommandQueue::metal const): * platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputeCommandEncoder.cpp. (WebCore::GPULegacyComputeCommandEncoder::~GPULegacyComputeCommandEncoder): * platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputeCommandEncoder.h. * platform/graphics/gpu/legacy/GPULegacyComputePipelineState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputePipelineState.cpp. (WebCore::GPULegacyComputePipelineState::~GPULegacyComputePipelineState): * platform/graphics/gpu/legacy/GPULegacyComputePipelineState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputePipelineState.h. (WebCore::GPULegacyComputePipelineState::metal const): * platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilDescriptor.cpp. (WebCore::GPULegacyDepthStencilDescriptor::~GPULegacyDepthStencilDescriptor): * platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilDescriptor.h. (WebCore::GPULegacyDepthStencilDescriptor::metal const): * platform/graphics/gpu/legacy/GPULegacyDepthStencilState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilState.cpp. (WebCore::GPULegacyDepthStencilState::~GPULegacyDepthStencilState): * platform/graphics/gpu/legacy/GPULegacyDepthStencilState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilState.h. (WebCore::GPULegacyDepthStencilState::metal const): * platform/graphics/gpu/legacy/GPULegacyDevice.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDevice.cpp. (WebCore::GPULegacyDevice::~GPULegacyDevice): * platform/graphics/gpu/legacy/GPULegacyDevice.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDevice.h. (WebCore::GPULegacyDevice::layer const): (WebCore::GPULegacyDevice::metal const): (WebCore::GPULegacyDevice::markLayerComposited const): * platform/graphics/gpu/legacy/GPULegacyDrawable.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDrawable.cpp. (WebCore::GPULegacyDrawable::~GPULegacyDrawable): * platform/graphics/gpu/legacy/GPULegacyDrawable.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDrawable.h. * platform/graphics/gpu/legacy/GPULegacyEnums.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyEnums.h. * platform/graphics/gpu/legacy/GPULegacyFunction.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyFunction.cpp. (WebCore::GPULegacyFunction::~GPULegacyFunction): * platform/graphics/gpu/legacy/GPULegacyFunction.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyFunction.h. (WebCore::GPULegacyFunction::metal const): * platform/graphics/gpu/legacy/GPULegacyLibrary.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyLibrary.cpp. (WebCore::GPULegacyLibrary::~GPULegacyLibrary): * platform/graphics/gpu/legacy/GPULegacyLibrary.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyLibrary.h. (WebCore::GPULegacyLibrary::metal const): * platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderCommandEncoder.cpp. (WebCore::GPULegacyRenderCommandEncoder::~GPULegacyRenderCommandEncoder): * platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderCommandEncoder.h. * platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassAttachmentDescriptor.cpp. (WebCore::GPULegacyRenderPassAttachmentDescriptor::~GPULegacyRenderPassAttachmentDescriptor): * platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassAttachmentDescriptor.h. * platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassColorAttachmentDescriptor.cpp. (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::~GPULegacyRenderPassColorAttachmentDescriptor): * platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassColorAttachmentDescriptor.h. * platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDepthAttachmentDescriptor.cpp. (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::~GPULegacyRenderPassDepthAttachmentDescriptor): * platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDepthAttachmentDescriptor.h. * platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDescriptor.cpp. (WebCore::GPULegacyRenderPassDescriptor::~GPULegacyRenderPassDescriptor): * platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDescriptor.h. * platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineColorAttachmentDescriptor.cpp. (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::~GPULegacyRenderPipelineColorAttachmentDescriptor): * platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineColorAttachmentDescriptor.h. * platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineDescriptor.cpp. (WebCore::GPULegacyRenderPipelineDescriptor::~GPULegacyRenderPipelineDescriptor): * platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineDescriptor.h. * platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineState.cpp. (WebCore::GPULegacyRenderPipelineState::~GPULegacyRenderPipelineState): * platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineState.h. * platform/graphics/gpu/legacy/GPULegacySize.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacySize.h. * platform/graphics/gpu/legacy/GPULegacyTexture.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTexture.cpp. (WebCore::GPULegacyTexture::~GPULegacyTexture): * platform/graphics/gpu/legacy/GPULegacyTexture.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTexture.h. * platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTextureDescriptor.cpp. (WebCore::GPULegacyTextureDescriptor::~GPULegacyTextureDescriptor): * platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTextureDescriptor.h. * platform/graphics/gpu/legacy/cocoa/GPULegacyBufferMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyBufferMetal.mm. (WebCore::GPULegacyBuffer::GPULegacyBuffer): * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandBufferMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyCommandBufferMetal.mm. (WebCore::GPULegacyCommandBuffer::GPULegacyCommandBuffer): (WebCore::GPULegacyCommandBuffer::presentDrawable const): (WebCore::GPULegacyCommandBuffer::commit const): * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandQueueMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyCommandQueueMetal.mm. (WebCore::GPULegacyCommandQueue::GPULegacyCommandQueue): (WebCore::GPULegacyCommandQueue::label const): (WebCore::GPULegacyCommandQueue::setLabel const): * platform/graphics/gpu/legacy/cocoa/GPULegacyComputeCommandEncoderMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyComputeCommandEncoderMetal.mm. (WebCore::MTLSizeMake): (WebCore::GPULegacyComputeCommandEncoder::GPULegacyComputeCommandEncoder): (WebCore::GPULegacyComputeCommandEncoder::setComputePipelineState const): (WebCore::GPULegacyComputeCommandEncoder::setBuffer const): (WebCore::GPULegacyComputeCommandEncoder::dispatch const): (WebCore::GPULegacyComputeCommandEncoder::endEncoding const): * platform/graphics/gpu/legacy/cocoa/GPULegacyComputePipelineStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyComputePipelineStateMetal.mm. (WebCore::GPULegacyComputePipelineState::GPULegacyComputePipelineState): * platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDepthStencilDescriptorMetal.mm. (WebCore::GPULegacyDepthStencilDescriptor::GPULegacyDepthStencilDescriptor): (WebCore::GPULegacyDepthStencilDescriptor::depthWriteEnabled const): (WebCore::GPULegacyDepthStencilDescriptor::setDepthWriteEnabled const): (WebCore::GPULegacyDepthStencilDescriptor::depthCompareFunction const): (WebCore::GPULegacyDepthStencilDescriptor::setDepthCompareFunction const): * platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDepthStencilStateMetal.mm. (WebCore::GPULegacyDepthStencilState::GPULegacyDepthStencilState): (WebCore::GPULegacyDepthStencilState::label const): (WebCore::GPULegacyDepthStencilState::setLabel const): * platform/graphics/gpu/legacy/cocoa/GPULegacyDeviceMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDeviceMetal.mm. (WebCore::GPULegacyDevice::GPULegacyDevice): (WebCore::GPULegacyDevice::disconnect): (WebCore::GPULegacyDevice::reshape const): (WebCore::GPULegacyDevice::platformLayer const): (WebCore::GPULegacyDevice::operator! const): * platform/graphics/gpu/legacy/cocoa/GPULegacyDrawableMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDrawableMetal.mm. (WebCore::GPULegacyDrawable::GPULegacyDrawable): (WebCore::GPULegacyDrawable::release): (WebCore::GPULegacyDrawable::metal const): (WebCore::GPULegacyDrawable::texture const): * platform/graphics/gpu/legacy/cocoa/GPULegacyFunctionMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyFunctionMetal.mm. (WebCore::GPULegacyFunction::GPULegacyFunction): (WebCore::GPULegacyFunction::name const): (WebCore::GPULegacyFunction::operator! const): * platform/graphics/gpu/legacy/cocoa/GPULegacyLibraryMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyLibraryMetal.mm. (WebCore::GPULegacyLibrary::GPULegacyLibrary): (WebCore::GPULegacyLibrary::label const): (WebCore::GPULegacyLibrary::setLabel const): (WebCore::GPULegacyLibrary::functionNames const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderCommandEncoderMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderCommandEncoderMetal.mm. (WebCore::GPULegacyRenderCommandEncoder::GPULegacyRenderCommandEncoder): (WebCore::GPULegacyRenderCommandEncoder::setRenderPipelineState const): (WebCore::GPULegacyRenderCommandEncoder::setDepthStencilState const): (WebCore::GPULegacyRenderCommandEncoder::setVertexBuffer const): (WebCore::GPULegacyRenderCommandEncoder::setFragmentBuffer const): (WebCore::GPULegacyRenderCommandEncoder::drawPrimitives const): (WebCore::GPULegacyRenderCommandEncoder::endEncoding const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassAttachmentDescriptorMetal.mm. (WebCore::GPULegacyRenderPassAttachmentDescriptor::GPULegacyRenderPassAttachmentDescriptor): (WebCore::GPULegacyRenderPassAttachmentDescriptor::loadAction const): (WebCore::GPULegacyRenderPassAttachmentDescriptor::setLoadAction const): (WebCore::GPULegacyRenderPassAttachmentDescriptor::storeAction const): (WebCore::GPULegacyRenderPassAttachmentDescriptor::setStoreAction const): (WebCore::GPULegacyRenderPassAttachmentDescriptor::setTexture const): (WebCore::GPULegacyRenderPassAttachmentDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassColorAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassColorAttachmentDescriptorMetal.mm. (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::GPULegacyRenderPassColorAttachmentDescriptor): (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::clearColor const): (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::setClearColor const): (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm. (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::GPULegacyRenderPassDepthAttachmentDescriptor): (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::clearDepth const): (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::setClearDepth const): (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassDescriptorMetal.mm. (WebCore::GPULegacyRenderPassDescriptor::GPULegacyRenderPassDescriptor): (WebCore::GPULegacyRenderPassDescriptor::colorAttachments const): (WebCore::GPULegacyRenderPassDescriptor::depthAttachment const): (WebCore::GPULegacyRenderPassDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm. (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::GPULegacyRenderPipelineColorAttachmentDescriptor): (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::pixelFormat const): (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::setPixelFormat const): (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineDescriptorMetal.mm. (WebCore::GPULegacyRenderPipelineDescriptor::GPULegacyRenderPipelineDescriptor): (WebCore::GPULegacyRenderPipelineDescriptor::depthAttachmentPixelFormat const): (WebCore::GPULegacyRenderPipelineDescriptor::setDepthAttachmentPixelFormat const): (WebCore::GPULegacyRenderPipelineDescriptor::setVertexFunction const): (WebCore::GPULegacyRenderPipelineDescriptor::setFragmentFunction const): (WebCore::GPULegacyRenderPipelineDescriptor::colorAttachments const): (WebCore::GPULegacyRenderPipelineDescriptor::reset const): (WebCore::GPULegacyRenderPipelineDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineStateMetal.mm. (WebCore::GPULegacyRenderPipelineState::GPULegacyRenderPipelineState): (WebCore::GPULegacyRenderPipelineState::label const): (WebCore::GPULegacyRenderPipelineState::setLabel const): (WebCore::GPULegacyRenderPipelineState::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyTextureDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyTextureDescriptorMetal.mm. (WebCore::GPULegacyTextureDescriptor::GPULegacyTextureDescriptor): (WebCore::GPULegacyTextureDescriptor::width const): (WebCore::GPULegacyTextureDescriptor::setWidth const): (WebCore::GPULegacyTextureDescriptor::height const): (WebCore::GPULegacyTextureDescriptor::setHeight const): (WebCore::GPULegacyTextureDescriptor::sampleCount const): (WebCore::GPULegacyTextureDescriptor::setSampleCount const): (WebCore::GPULegacyTextureDescriptor::textureType const): (WebCore::GPULegacyTextureDescriptor::setTextureType const): (WebCore::GPULegacyTextureDescriptor::storageMode const): (WebCore::GPULegacyTextureDescriptor::setStorageMode const): (WebCore::GPULegacyTextureDescriptor::usage const): (WebCore::GPULegacyTextureDescriptor::setUsage const): (WebCore::GPULegacyTextureDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyTextureMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyTextureMetal.mm. (WebCore::GPULegacyTexture::GPULegacyTexture): (WebCore::GPULegacyTexture::width const): (WebCore::GPULegacyTexture::height const): (WebCore::GPULegacyTexture::metal const): 2018-11-21 Adrian Perez de Castro [SOUP] Certificate decoder always returns GByteArray with zero size https://bugs.webkit.org/show_bug.cgi?id=191888 Reviewed by Žan Doberšek. No new tests needed. * platform/network/soup/CertificateInfo.h: (WTF::Persistence::Coder>::decode): Add missing call to g_byte_array_set_size() to make sure byteArray->len has the correct value. 2018-11-21 Zalan Butjas [LFC][IFC] Take nonBreakableStart/End into use. https://bugs.webkit.org/show_bug.cgi?id=191873 Reviewed by Antti Koivisto. Offset the final inline runs with the nonBreakableStart/End values. (This patch also fixes relative positioned run verification.) Test: fast/inline/inline-content-with-padding-left-right.html * layout/Verification.cpp: (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): 2018-11-21 Carlos Garcia Campos REGRESSION(r237845): [cairo] Hyperlink underscore layout issue https://bugs.webkit.org/show_bug.cgi?id=191630 Reviewed by Michael Catanzaro. Only flip Y in GlyphToPathTranslator for ports using CG. * platform/graphics/FontCascade.cpp: (WebCore::GlyphToPathTranslator::GlyphToPathTranslator): 2018-11-21 Alicia Boya García [MSE][GStreamer] Refactor AppendPipeline deinitialization https://bugs.webkit.org/show_bug.cgi?id=191759 Reviewed by Xabier Rodriguez-Calvar. AppendPipeline currently has a method, clearPlayerPrivate(), that the client code uses to deinitialize most of the AppendPipeline... just before actually destructing it in the next line of code. Since at that point there should not be alive RefPtr's pointing to the AppendPipeline there is no need for this kind of pre-deinitialization in this usage pattern. Instead, we can just rely on C++ destructors, cleaning the code a bit and removing the potential for the question "what if `clearPlayerPrivate() has been called before?`": it has not. Assertions have been added to ensure that there is only one alive RefPtr pointing to AppendPipeline, therefore guaranteeing its immediate destruction. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::~AppendPipeline): (WebCore::AppendPipeline::deinitialize): (WebCore::AppendPipeline::clearPlayerPrivate): Deleted. * platform/graphics/gstreamer/mse/AppendPipeline.h: * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::~MediaPlayerPrivateGStreamerMSE): * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp: (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource): 2018-11-20 Dean Jackson Removing using namespace WebCore from WebLayer https://bugs.webkit.org/show_bug.cgi?id=191870 Rubber-stamped by Sam Weinig. Remove "using namespace WebCore" from WebLayer.mm because it will cause type clashes in unified source builds. * platform/graphics/mac/WebLayer.mm: (-[WebLayer drawInContext:]): (-[WebSimpleLayer setNeedsDisplay]): (-[WebSimpleLayer setNeedsDisplayInRect:]): (-[WebSimpleLayer display]): (-[WebSimpleLayer drawInContext:]): 2018-11-20 Ryosuke Niwa Input element gains focus when a selectstart event listener on document prevents the default action https://bugs.webkit.org/show_bug.cgi?id=191714 Reviewed by Antti Koivisto. The bug was caused by WebKit keep firing selectstart upon mousemove after the drag had already started when preventDefault had been called in the previous firings of selectstart event. Because input element has its own editable element and fires selectstart on the input element itself, which won't be prevented by selectstart on docuemnt, this allowed the selection to be set inside the input element even though the mouse cursor was simply passing over the input element after the drag had already started. Fixed the bug by not firing selectstart if the default action had been prevented by the initial firing of selectstart by setting m_mouseDownMayStartDrag to false. This also matches the behaviors of Chrome and Firefox. Test: fast/events/selectstart-prevent-default-should-not-focus-input.html * page/EventHandler.cpp: (WebCore::EventHandler::updateSelectionForMouseDownDispatchingSelectStart): (WebCore::EventHandler::updateSelectionForMouseDrag): 2018-11-20 Christopher Reid Remove the need for LocalizedStringsWPE.cpp https://bugs.webkit.org/show_bug.cgi?id=191854 Reviewed by Michael Catanzaro. No change in behavior. Consolidate "Search the Web" as the default search context menu text on non-COCOA ports. GTK, WPE, and non-CF WIN all had the same default localizedString function of String::fromUTF8. Move that to LocalizedString.cpp as the default implementation for all ports not using CF. * en.lproj/Localizable.strings: * platform/LocalizedStrings.cpp: * platform/gtk/LocalizedStringsGtk.cpp: * platform/win/LocalizedStringsWin.cpp: * platform/wpe/LocalizedStringsWPE.cpp: Removed. 2018-11-20 Zan Dobersek Segfaults on https://terminalizer.com/ https://bugs.webkit.org/show_bug.cgi?id=191805 Reviewed by Michael Catanzaro. In HarfBuzzFace, the CacheEntry's HashMap object that caches Unicode codepoints and their corresponding glyph indices should allow zero values as valid keys since zero is a valid Unicode codepoint. This change enables properly caching zero codepoints, avoiding repetitive additions to the HashMap cache that end up in a crash. * platform/graphics/harfbuzz/HarfBuzzFace.h: Move the elongated GlyphCache type alias to the public section of HarfBuzzFace class declaration, making it reusable in the helper HarfBuzzFontData struct. * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: 2018-11-20 Antti Koivisto Update hover state in composed tree https://bugs.webkit.org/show_bug.cgi?id=191860 Reviewed by Zalan Bujtas. The code was already mostly switched over from render tree to composed tree. This patch replaces the remaining common ancestor search code with a DOM based equivalent. * dom/Document.cpp: (WebCore::findNearestCommonComposedAncestor): (WebCore::Document::updateHoverActiveState): (WebCore::nearestCommonHoverAncestor): Deleted. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::hoverAncestor const): Deleted. * rendering/RenderBlock.h: * rendering/RenderElement.cpp: (WebCore::RenderElement::hoverAncestor const): Deleted. No longer needed. * rendering/RenderElement.h: 2018-11-20 Zalan Bujtas [LFC][IFC] Measure run with non-breakable start/end. https://bugs.webkit.org/show_bug.cgi?id=191850 Reviewed by Antti Koivisto. Line breaking needs to know the complete width of the run including padding etc. * layout/Verification.cpp: (WebCore::Layout::collectFlowBoxSubtree): (WebCore::Layout::collectInlineBoxes): (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::runWidth): * layout/inlineformatting/InlineLineBreaker.cpp: (WebCore::Layout::InlineLineBreaker::InlineLineBreaker): (WebCore::Layout::InlineLineBreaker::runWidth const): (WebCore::Layout::InlineLineBreaker::textWidth const): * layout/inlineformatting/InlineLineBreaker.h: * layout/inlineformatting/text/TextUtil.cpp: (WebCore::Layout::TextUtil::hyphenPositionBefore): (WebCore::Layout::TextUtil::width): (WebCore::Layout::TextUtil::fixedPitchWidth): (WebCore::Layout::TextUtil::TextUtil): Deleted. (WebCore::Layout::TextUtil::width const): Deleted. (WebCore::Layout::TextUtil::hyphenPositionBefore const): Deleted. (WebCore::Layout::TextUtil::textWidth const): Deleted. (WebCore::Layout::TextUtil::fixedPitchWidth const): Deleted. * layout/inlineformatting/text/TextUtil.h: 2018-11-20 Zalan Bujtas [LFC][IFC] InlineFormattingContext::Line should hold the list of runs for the current line. https://bugs.webkit.org/show_bug.cgi?id=191845 Reviewed by Antti Koivisto. Collect the runs in InlineFormattingContext::Line and transfer them to InlineFormattingState during line closing. (In the most common cases, this is only one extra vector::append() call.) * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): (WebCore::Layout::InlineFormattingContext::createFinalRuns const): (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const): (WebCore::Layout::InlineFormattingContext::closeLine const): (WebCore::Layout::InlineFormattingContext::appendContentToLine const): (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const): (WebCore::Layout::InlineFormattingContext::splitInlineRunsIfNeeded const): Deleted. * layout/inlineformatting/InlineFormattingContext.h: (WebCore::Layout::InlineFormattingContext::Line::hasContent const): (WebCore::Layout::InlineFormattingContext::Line::runs): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns): (WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities): (WebCore::Layout::InlineFormattingContext::Geometry::alignRuns): * layout/inlineformatting/Line.cpp: (WebCore::Layout::InlineFormattingContext::Line::init): (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft): (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const): (WebCore::Layout::InlineFormattingContext::Line::appendContent): (WebCore::Layout::InlineFormattingContext::Line::close): (WebCore::Layout::InlineFormattingContext::Line::Line): Deleted. 2018-11-20 Zalan Butjas [LFC][IFC] Introduce InlineItem::nonBreakableStart/End https://bugs.webkit.org/show_bug.cgi?id=191839 Reviewed by Antti Koivisto. Non-breakable start/end marks margin/padding/border space (even when it does not directly come from the associated layout box) nested content with padding parent <- inline run has 5px non-breakable start/end. 12 3 <1> <- inline run has 5px non-breakable start and 11px non-breakable end. <2> <- inline run has 0px non-breakable start and 5px non-breakable end. <3> <- no non-breakable values. This is what the runs look like (input to line breaking) < 1 2 > < > (whitespace) <3> The line breaking treats the paddding/border etc space as part of the run and as non-breaking opportunity. With the given runs the first position where we can break the line is at the whitespace. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): * layout/inlineformatting/InlineItem.h: (WebCore::Layout::InlineItem::nonBreakableStart const): (WebCore::Layout::InlineItem::nonBreakableEnd const): (WebCore::Layout::InlineItem::addNonBreakableStart): (WebCore::Layout::InlineItem::addNonBreakableEnd): 2018-11-20 Zalan Bujtas [LFC][IFC] Move detaching rules from InlineFormattingState to InlineItem https://bugs.webkit.org/show_bug.cgi?id=191838 Reviewed by Antti Koivisto. This is in preparation for adding more context to InlineItem. In addition to detaching rules it will also hold non-breakable start/end information. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): * layout/inlineformatting/InlineFormattingState.cpp: (WebCore::Layout::InlineFormattingState::addDetachingRule): Deleted. (WebCore::Layout::InlineFormattingState::detachingRules const): Deleted. * layout/inlineformatting/InlineFormattingState.h: (WebCore::Layout::InlineFormattingState::setDetachingRules): Deleted. * layout/inlineformatting/InlineItem.h: (WebCore::Layout::InlineItem::addDetachingRule): (WebCore::Layout::InlineItem::detachingRules const): 2018-11-20 Zalan Bujjtas [LFC][IFC] InlineRunProvider::append() should just take const InlineItem&. https://bugs.webkit.org/show_bug.cgi?id=191837 Reviewed by Antti Koivisto. This allows us to remove the InlineFormattingState dependency as well. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const): * layout/inlineformatting/InlineRunProvider.cpp: (WebCore::Layout::InlineRunProvider::InlineRunProvider): (WebCore::Layout::InlineRunProvider::append): * layout/inlineformatting/InlineRunProvider.h: 2018-11-20 Thibault Saunier [GStreamer] Enhance debugging by making sure to print the pipeline in MediaPlayerPrivateGStreamer https://bugs.webkit.org/show_bug.cgi?id=191586 Reviewed by Xabier Rodriguez-Calvar. This is minor changes that do not require tests. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties): (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): (WebCore::MediaPlayerPrivateGStreamer::loadFull): (WebCore::MediaPlayerPrivateGStreamer::commitLoad): (WebCore::MediaPlayerPrivateGStreamer::readyTimerFired): (WebCore::MediaPlayerPrivateGStreamer::changePipelineState): (WebCore::MediaPlayerPrivateGStreamer::prepareToPlay): (WebCore::MediaPlayerPrivateGStreamer::play): (WebCore::MediaPlayerPrivateGStreamer::pause): (WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const): (WebCore::MediaPlayerPrivateGStreamer::seek): (WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate): (WebCore::MediaPlayerPrivateGStreamer::paused const): (WebCore::MediaPlayerPrivateGStreamer::enableTrack): (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): (WebCore::MediaPlayerPrivateGStreamer::handleMessage): (WebCore::MediaPlayerPrivateGStreamer::processBufferingStats): (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired): (WebCore::MediaPlayerPrivateGStreamer::maxMediaTimeSeekable const): (WebCore::MediaPlayerPrivateGStreamer::totalBytes const): (WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback): (WebCore::MediaPlayerPrivateGStreamer::downloadBufferFileCreatedCallback): (WebCore::MediaPlayerPrivateGStreamer::sourceSetup): (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone): (WebCore::MediaPlayerPrivateGStreamer::updateStates): (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): (WebCore::MediaPlayerPrivateGStreamer::didEnd): (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering): (WebCore::MediaPlayerPrivateGStreamer::setPreload): (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): 2018-11-20 Manuel Rego Casasnovas [css-grid] Consider scrollbars in populateGridPositionsForDirection() https://bugs.webkit.org/show_bug.cgi?id=191656 Reviewed by Javier Fernandez. We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(), that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction) but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction). The patch modifies the method so it takes into account scrollbar size in order to compute the position of the columns/rows depending on the direction and the writing mode. Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html * rendering/RenderGrid.cpp: (WebCore::RenderGrid::populateGridPositionsForDirection): 2018-11-19 Ryosuke Niwa Click on node assigned to slot in button's shadow cause loss of button focus https://bugs.webkit.org/show_bug.cgi?id=191694 Reviewed by Wenson Hsieh. Fixed the bug by traversing the parent in the composed tree when looking for an element to focus. Test: fast/shadow-dom/focus-slot-parent.html * page/EventHandler.cpp: (WebCore::EventHandler::dispatchMouseEvent): Fixed the bug. Also use RefPtr instead of a raw pointer. 2018-11-19 Fujii Hironori REGRESSION(r238350) [curl] CertificateInfo.h: error: template specialization requires 'template<>' https://bugs.webkit.org/show_bug.cgi?id=191849 Unreviewed build fix for clang-cl builds. No new tests because there's no behaviour change. * platform/network/curl/CertificateInfo.h: (WTF::Persistence::Coder::encode): (WTF::Persistence::Coder::decode): 2018-11-19 Basuke Suzuki [Curl] Add API for CertificateInfo. https://bugs.webkit.org/show_bug.cgi?id=191647 Reviewed by Alex Christensen. Minor changes for WebKit API. Tests: TestWebKitAPI/Tests/WebKit/curl/Certificates.cpp * platform/network/curl/CertificateInfo.h: * platform/network/curl/CertificateInfoCurl.cpp: (WebCore::CertificateInfo::CertificateInfo): (WebCore::CertificateInfo::makeCertificate): * platform/network/curl/CurlSSLVerifier.cpp: (WebCore::BIOHolder::asCertificate): 2018-11-19 Justin Fan [WebGPU] Begin implementing WebGPUTexture, WebGPUTextureView, and WebGPUTextureFormatEnum, and WebGPUSwapChain::configure upgrades https://bugs.webkit.org/show_bug.cgi?id=191794 Reviewed by Dean Jackson. Test: webgpu/textures-textureviews.html Implement basic functionality for getting the next WebGPUTexture and TextureView from the WebGPURenderingContext to use as a render destination for the next draw call. Also introduce WebGPUTextureFormatEnum and the ability to configure the context with a chosen texture format. * CMakeLists.txt: * DerivedSources.make: * Modules/webgpu/GPUSwapChain.h: Texture/Pixel format can now be set. * Modules/webgpu/GPUTexture.h: Added. Interface to a MTLTexture. * Modules/webgpu/GPUTextureFormatEnum.h: Added. * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::createRenderPipeline const): Removed now-unnecessary enum class cast. * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Rather than duplicate GPURenderPipelineDescriptor::PrimitiveTopology, alias to it. * Modules/webgpu/WebGPUSwapChain.cpp: (WebCore::WebGPUSwapChain::configure): Can now specify a specific texture format for the underlying CAMetalLayer. (WebCore::WebGPUSwapChain::getNextTexture): Added. Request the next drawable texture. * Modules/webgpu/WebGPUSwapChain.h: Expose getNextTexture(). * Modules/webgpu/WebGPUSwapChain.idl: * Modules/webgpu/WebGPUTexture.cpp: Added. (WebCore::WebGPUTexture::create): (WebCore::WebGPUTexture::WebGPUTexture): (WebCore::WebGPUTexture::createDefaultTextureView): * Modules/webgpu/WebGPUTexture.h: Added. * Modules/webgpu/WebGPUTexture.idl: Added. * Modules/webgpu/WebGPUTextureFormatEnum.h: Added. Type alias for GPUTextureFormatEnum. * Modules/webgpu/WebGPUTextureFormatEnum.idl: Added. Used to represent any texture format used by WebGPU. * Modules/webgpu/WebGPUTextureView.cpp: Added. (WebCore::WebGPUTextureView::create): (WebCore::WebGPUTextureView::WebGPUTextureView): * Modules/webgpu/WebGPUTextureView.h: Added. * Modules/webgpu/WebGPUTextureView.idl: Added. * Modules/webgpu/cocoa/GPUSwapChainMetal.mm: (WebCore::GPUSwapChain::create): (WebCore::GPUSwapChain::setFormat): Called by WebGPUSwapChain::configure(). (WebCore::GPUSwapChain::getNextTexture): * Modules/webgpu/cocoa/GPUTextureFormatEnumMetal.mm: Added. (WebCore::convertAndValidate): Convert the WebGPUTextureFormatEnum to a MTLPixelFormat. * Modules/webgpu/cocoa/GPUTextureMetal.mm: Added. (WebCore::GPUTexture::create): (WebCore::GPUTexture::GPUTexture): (WebCore::GPUTexture::createDefaultTextureView): Uses the pixelFormat of the original texture. * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: 2018-11-19 Joseph Pecoraro Web Inspector: "Reload Web Inspector" button no longer partially works https://bugs.webkit.org/show_bug.cgi?id=191773 Reviewed by Devin Rousso. * inspector/InspectorFrontendClient.h: * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::reopen): * inspector/InspectorFrontendHost.h: * inspector/InspectorFrontendHost.idl: Provide a host call to reopen an inspector window to reload it. * testing/Internals.cpp: Stub implementation, this is not used in tests. 2018-11-19 Rob Buis Setting document.title should have no effect for non SVG/HTML documents https://bugs.webkit.org/show_bug.cgi?id=191643 Reviewed by Chris Dumez. Setting document.title should have no effect for non SVG/HTML documents, see https://html.spec.whatwg.org/multipage/dom.html#document.title. Behavior matches Firefox and Chrome. Test: imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-not-in-html-svg.html * dom/Document.cpp: (WebCore::Document::setTitle): 2018-11-19 Wenson Hsieh Dragging image with a border-image larger than the image element crashes https://bugs.webkit.org/show_bug.cgi?id=191817 Reviewed by Ryosuke Niwa. When dragging an image element, if the image element has: (1) box-sizing: border-box; (2) a border-image (3) a border-top-width that is at least as large as the height of the element and/or a border-left-width that is at least as large as the width of the element ...then upon drag, we will fail to create a suitable drag image using the bounding box of the image element since the size is empty, thereby causing a crash. To fix this, we bail out of this bounding-rect-dependent codepath for generating a drag image in the case where the bounding rect is empty, and instead fall back to an icon representation for the drag image. Test: fast/events/drag-image-with-border-image.html * page/DragController.cpp: (WebCore::DragController::doImageDrag): 2018-11-18 Zan Dobersek HarfBuzzFace::CacheEntry should use 32-bit values in its HashMap https://bugs.webkit.org/show_bug.cgi?id=191825 Reviewed by Michael Catanzaro. The HashMap-based glyph cache contained in HarfBuzzFace::CacheEntry objects is used to map given Unicode codepoints to corresponding glyph indices (which occurs in the harfBuzzGetGlyph() function that's invoked by HarfBuzz). The 16-bit unsigned integer as the map's value type is not enough here when the glyph index mapping is done through Freetype -- its API returns 32-bit glyph indices, and Cairo assigns this value to the 64-bit unsigned index variable in the cairo_glyph_t struct. The value type is thus bumped to 32 bits to match the unsigned type size of the index's origin. * platform/graphics/harfbuzz/HarfBuzzFace.h: * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: 2018-11-17 Wenson Hsieh [iOS] Remove all usages of UIItemProvider, UIItemProviderReading, and related classes https://bugs.webkit.org/show_bug.cgi?id=191819 Reviewed by Dan Bernstein. Replace UIItemProvider (and related classes) with NSItemProvider. * platform/ios/PlatformPasteboardIOS.mm: (WebCore::registerItemToPasteboard): * platform/ios/WebItemProviderPasteboard.h: * platform/ios/WebItemProviderPasteboard.mm: (-[WebItemProviderDataRegistrar registerItemProvider:]): (-[WebItemProviderWritableObjectRegistrar initWithObject:]): (-[WebItemProviderWritableObjectRegistrar representingObject]): (-[WebItemProviderWritableObjectRegistrar registerItemProvider:]): (-[WebItemProviderRegistrationInfoList addRepresentingObject:]): (-[WebItemProviderRegistrationInfoList itemProvider]): (-[WebItemProviderPasteboard pasteboardTypes]): (-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]): (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]): (allLoadableClasses): (classForTypeIdentifier): (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]): (-[WebItemProviderPasteboard numberOfFiles]): (-[WebItemProviderPasteboard itemProviderAtIndex:]): (-[WebItemProviderPasteboard enumerateItemProvidersWithBlock:]): * platform/mac/DragDataMac.mm: (WebCore::DragData::containsURL const): 2018-11-17 Ross Kirsling Remove superfluous LayoutUnit initializations https://bugs.webkit.org/show_bug.cgi?id=191791 Reviewed by Simon Fraser. First step toward making LayoutUnit constructors explicit: eliminate `= 0` when constructing LayoutUnit lvalues. * editing/Editor.cpp: (WebCore::Editor::firstRectForRange const): * editing/FrameSelection.cpp: (WebCore::FrameSelection::modify): (WebCore::FrameSelection::lineDirectionPointForBlockDirectionNavigation): * html/shadow/SliderThumbElement.cpp: (WebCore::RenderSliderContainer::computeLogicalHeight const): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns): * page/FrameView.cpp: (WebCore::FrameView::forceLayoutForPagination): * page/SpatialNavigation.cpp: (WebCore::scrollInDirection): (WebCore::distanceDataForNode): * rendering/AutoTableLayout.cpp: (WebCore::AutoTableLayout::layout): * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::marginIntrinsicLogicalWidthForChild): (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const): * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::placeBoxesInBlockDirection): (WebCore::InlineFlowBox::paintFillLayer): (WebCore::InlineFlowBox::paintBoxDecorations): (WebCore::InlineFlowBox::paintMask): (WebCore::InlineFlowBox::computeOverAnnotationAdjustment const): (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::marginIntrinsicLogicalWidthForChild const): (WebCore::RenderBlock::layoutPositionedObject): (WebCore::RenderBlock::selectionGapRectsForRepaint): (WebCore::RenderBlock::paintSelection): (WebCore::RenderBlock::textIndentOffset const): (WebCore::RenderBlock::computeBlockPreferredLogicalWidths const): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats): (WebCore::RenderBlockFlow::layoutBlock): (WebCore::RenderBlockFlow::layoutBlockChildren): (WebCore::RenderBlockFlow::marginValuesForChild const): (WebCore::RenderBlockFlow::estimateLogicalTopPosition): (WebCore::RenderBlockFlow::applyBeforeBreak): (WebCore::RenderBlockFlow::applyAfterBreak): (WebCore::RenderBlockFlow::adjustBlockChildForPagination): (WebCore::RenderBlockFlow::clearFloats): (WebCore::RenderBlockFlow::lowestFloatLogicalBottom const): (WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom const): (WebCore::RenderBlockFlow::addOverhangingFloats): (WebCore::RenderBlockFlow::getClearDelta): (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const): * rendering/RenderBlockLineLayout.cpp: (WebCore::setLogicalWidthForTextRun): (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange): (WebCore::RenderBlockFlow::determineStartPosition): * rendering/RenderBox.cpp: (WebCore::RenderBox::fillAvailableMeasure const): (WebCore::RenderBox::computeIntrinsicLogicalWidthUsing const): (WebCore::RenderBox::computeLogicalWidthInFragmentUsing const): (WebCore::RenderBox::computePercentageLogicalHeight const): (WebCore::RenderBox::computeReplacedLogicalWidthUsing const): (WebCore::RenderBox::computePositionedLogicalWidthUsing const): (WebCore::RenderBox::computePositionedLogicalHeightUsing const): (WebCore::RenderBox::computePositionedLogicalWidthReplaced const): (WebCore::RenderBox::computePositionedLogicalHeightReplaced const): * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::computedCSSPadding const): (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry const): * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::marginWidthForChild): (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox): (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox): * rendering/RenderFileUploadControl.cpp: (WebCore::RenderFileUploadControl::paintObject): * rendering/RenderFragmentedFlow.cpp: (WebCore::RenderFragmentedFlow::validateFragments): (WebCore::RenderFragmentedFlow::adjustedPositionRelativeToOffsetParent const): (WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect): * rendering/RenderFrameSet.cpp: (WebCore::RenderFrameSet::paint): * rendering/RenderListItem.cpp: (WebCore::RenderListItem::positionListMarker): * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::computePreferredLogicalWidths): (WebCore::RenderListMarker::updateMargins): * rendering/RenderMultiColumnSet.cpp: (WebCore::RenderMultiColumnSet::initialBlockOffsetForPainting const): * rendering/RenderRubyRun.cpp: (WebCore::RenderRubyRun::layoutBlock): * rendering/RenderTable.cpp: (WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth): (WebCore::RenderTable::layout): (WebCore::RenderTable::offsetWidthForColumn const): (WebCore::RenderTable::offsetHeightForColumn const): (WebCore::RenderTable::outerBorderBefore const): (WebCore::RenderTable::outerBorderAfter const): (WebCore::RenderTable::outerBorderStart const): (WebCore::RenderTable::outerBorderEnd const): * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::logicalWidthFromColumns const): (WebCore::RenderTableCell::computeIntrinsicPadding): * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::calcRowLogicalHeight): (WebCore::RenderTableSection::distributeExtraLogicalHeightToPercentRows): (WebCore::RenderTableSection::distributeExtraLogicalHeightToAutoRows): (WebCore::RenderTableSection::distributeRemainingExtraLogicalHeight): (WebCore::RenderTableSection::layoutRows): (WebCore::RenderTableSection::calcOuterBorderBefore const): (WebCore::RenderTableSection::calcOuterBorderAfter const): (WebCore::RenderTableSection::calcOuterBorderStart const): (WebCore::RenderTableSection::calcOuterBorderEnd const): * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::alignBoxesInBlockDirection): (WebCore::RootInlineBox::beforeAnnotationsAdjustment const): (WebCore::RootInlineBox::lineSnapAdjustment const): (WebCore::RootInlineBox::verticalPositionForBox): * rendering/line/BreakingContext.h: (WebCore::inlineLogicalWidth): * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::RenderMathMLBlock::layoutItems): * rendering/mathml/RenderMathMLFraction.cpp: (WebCore::RenderMathMLFraction::layoutBlock): * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): * rendering/mathml/RenderMathMLRoot.cpp: (WebCore::RenderMathMLRoot::computePreferredLogicalWidths): (WebCore::RenderMathMLRoot::paint): * rendering/mathml/RenderMathMLRow.cpp: (WebCore::RenderMathMLRow::computePreferredLogicalWidths): * rendering/mathml/RenderMathMLScripts.cpp: (WebCore::RenderMathMLScripts::layoutBlock): * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren): (WebCore::RenderMathMLUnderOver::layoutBlock): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::getShadowInsetExtent const): * rendering/svg/RenderSVGText.cpp: (WebCore::RenderSVGText::layout): 2018-11-17 Simon Fraser Avoid triggering compositing updates when only the root layer is composited https://bugs.webkit.org/show_bug.cgi?id=191813 Reviewed by Zalan Bujtas. If we know that the only composited layer is the root, we can avoid triggering deep compositing updates sometimes, for example when layout changes size or position, or when z-order lists change. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::addChild): (WebCore::RenderLayer::removeChild): (WebCore::RenderLayer::updateLayerPosition): (WebCore::RenderLayer::scrollTo): (WebCore::RenderLayer::updateCompositingLayersAfterScroll): (WebCore::outputPaintOrderTreeRecursive): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): Consult the layer.hasCompositingDescendant() flag to cut off descendants traversal when possible. (WebCore::RenderLayerCompositor::layerStyleChanged): 2018-11-17 Simon Fraser Fix an error in 238354 - !=, not ==. Fixes test failures. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::layerBecameNonComposited): 2018-11-17 Simon Fraser Clarify RenderLayerCompositor::hasAnyAdditionalCompositedLayers() and related code. https://bugs.webkit.org/show_bug.cgi?id=191810 Reviewed by Zalan Bujtas. Rename m_compositedLayerCount to m_contentLayersCount and have it track layers other than the RenderView's layer. hasAnyAdditionalCompositedLayers() is really about whether we can drop out of compositing because no content layer is composited, and overlays don't require compositing, so rename it. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateCompositingLayers): (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::needsCompositingForContentOrOverlays const): (WebCore::RenderLayerCompositor::layerBecameComposited): (WebCore::RenderLayerCompositor::layerBecameNonComposited): (WebCore::RenderLayerCompositor::layerTreeAsText): (WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers const): Deleted. * rendering/RenderLayerCompositor.h: 2018-11-17 Simon Fraser Rename RenderLayerCompositor::inCompositingMode() to usesCompositing() https://bugs.webkit.org/show_bug.cgi?id=191808 Reviewed by Zalan Bujtas. Other code uses "usesCompositing" so standardize on that (future changes will make "compositing mode" more ambiguous). Also remove a FrameView function that only had one caller. * page/FrameView.cpp: (WebCore::FrameView::clearBackingStores): (WebCore::FrameView::handleDeferredScrollbarsUpdateAfterDirectionChange): (WebCore::FrameView::delegatesScrollingDidChange): (WebCore::FrameView::hasCompositedContent const): Deleted. * page/FrameView.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::addChild): (WebCore::RenderLayer::removeChild): (WebCore::RenderLayer::rebuildZOrderLists): (WebCore::RenderLayer::updateLayerPosition): (WebCore::RenderLayer::scrollTo): (WebCore::RenderLayer::updateCompositingLayersAfterScroll): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateCompositingPolicy): (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::layerStyleChanged): (WebCore::RenderLayerCompositor::updateBacking): (WebCore::RenderLayerCompositor::parentFrameContentLayers): (WebCore::RenderLayerCompositor::setIsInWindow): (WebCore::RenderLayerCompositor::needsToBeComposited const): (WebCore::RenderLayerCompositor::reasonsForCompositing const): (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged): (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged): * rendering/RenderLayerCompositor.h: * rendering/RenderView.cpp: (WebCore::RenderView::repaintViewAndCompositedLayers): (WebCore::RenderView::usesCompositing const): 2018-11-17 Devin Rousso Web Inspector: Network: add button to show system certificate dialog https://bugs.webkit.org/show_bug.cgi?id=191458 Reviewed by Joseph Pecoraro. Test: http/tests/inspector/network/getSerializedCertificate.html * inspector/agents/InspectorNetworkAgent.h: * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::getSerializedCertificate): Added. * inspector/InspectorFrontendHost.idl: * inspector/InspectorFrontendHost.h: * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::supportsShowCertificate): Added. (WebCore::InspectorFrontendHost::showCertificate): Added. * inspector/InspectorFrontendClient.h: (InspectorFrontendClient::showCertificate): Added. * testing/Internals.cpp: (InspectorStubFrontend::showCertificate): Added. * platform/network/cf/CertificateInfo.h: (WTF::Persistence::encodeCFData): Added. (WTF::Persistence::decodeCFData): Added. (WTF::Persistence::encodeSecTrustRef): Added. (WTF::Persistence::decodeSecTrustRef): Added. (WTF::Persistence::encodeCertificateChain): Added. (WTF::Persistence::decodeCertificateChain): Added. (WTF::Persistence::Coder::encode): Added. (WTF::Persistence::Coder::decode): Added. * platform/network/cf/CertificateInfoCFNet.cpp: * platform/network/cocoa/CertificateInfoCocoa.mm: * platform/network/curl/CertificateInfo.h: (WTF::Persistence::Coder::encode): Added. (WTF::Persistence::Coder::decode): Added. * platform/network/soup/CertificateInfo.h: (WTF::Persistence::Coder>::encode): Added. (WTF::Persistence::Coder>::decode): Added. (WTF::Persistence::certificatesDataListFromCertificateInfo): Added. (WTF::Persistence::certificateFromCertificatesDataList): Added. (WTF::Persistence::Coder::encode): Added. (WTF::Persistence::Coder::decode): Added. 2018-11-17 Zalan Bujtas [LFC][IFC] InlineFormattingState::addDetachingRule should accumulate rules. https://bugs.webkit.org/show_bug.cgi?id=191801 Reviewed by Antti Koivisto. beforepositionedafter In the example above the inline box has both the BreakAtStart and the BreakAtEnd rules. While walking through the inline tree, we add BreakAtStart first and when we figure it's the last child too, we add BreakAtEnd as well. BreakAtEnd should not clear the BreakAtStart rule. Test: fast/inline/simple-inline-with-out-of-flow-descendant2.html * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): * layout/inlineformatting/InlineFormattingState.cpp: (WebCore::Layout::InlineFormattingState::addDetachingRule): * layout/inlineformatting/InlineFormattingState.h: (WebCore::Layout::InlineFormattingState::addDetachingRule): Deleted. 2018-11-17 Jonathan Hammer Caret stops blinking after context menu shown https://bugs.webkit.org/show_bug.cgi?id=191715 Reviewed by Ryosuke Niwa. Changed EventHandler::sendContextMenuEvent to un-suspend caret blinking so that the caret continues to blink even after the context menu is dismissed. The normal way of un-suspendeding caret blinking (in EventHandler::handleMouseReleaseEvent) does not apply in the case of context menus because handleMouseReleaseEvent is not called once the context menu is up. Test: fast/events/contextmenu-dismiss-blink-caret.html * page/EventHandler.cpp: (WebCore::EventHandler::sendContextMenuEvent): * testing/Internals.cpp: (WebCore::Internals::isCaretBlinkingSuspended): * testing/Internals.h: * testing/Internals.idl: 2018-11-16 Antoine Quint [Pointer Events] event.isPrimary doesn't always represent the oldest active touch https://bugs.webkit.org/show_bug.cgi?id=191752 Reviewed by Dean Jackson. Provide isPrimary to the constructor so its value can be determined at the call site. Test: pointerevents/ios/pointer-events-is-primary.html * dom/PointerEvent.h: * dom/ios/PointerEventIOS.cpp: (WebCore::PointerEvent::create): (WebCore::PointerEvent::PointerEvent): (WebCore::m_isPrimary): 2018-11-16 Alex Christensen Tweak _showSafeBrowsingWarningWithTitle SPI https://bugs.webkit.org/show_bug.cgi?id=191799 Reviewed by Wenson Hsieh. It turns out I needed to expose both sentinel values used in safe browsing for my application of this SPI in Mac Safari. Allowing the caller to make its own sentinel values is insufficient because the malware confirmation needs to be over the warning. The completion handler parameter should just be a bool indicating whether the user has chosen to continue after all warnings. Covered by updated API tests. * en.lproj/Localizable.strings: * platform/LocalizedStrings.cpp: (WebCore::formControlCancelButtonTitle): Make "Cancel"'s description a little more generic. 2018-11-16 Simon Fraser Optimize composited iframe layer hookup https://bugs.webkit.org/show_bug.cgi?id=191778 Reviewed by Zalan Bujtas. The change made in r238229 can be more targeted; we only need to hook up iframe content layers when the layer is already composited (otherwise the updateBacking() above would have triggered the work), and when it's a RenderWidget layer. Tested by existing tests. * rendering/RenderLayer.cpp: (WebCore::outputPaintOrderTreeRecursive): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::layerStyleChanged): 2018-11-16 Ross Kirsling Provide default implementation of Widget https://bugs.webkit.org/show_bug.cgi?id=191784 Reviewed by Michael Catanzaro. * SourcesWPE.txt: * platform/Widget.cpp: (WebCore::Widget::Widget): (WebCore::Widget::frameRect const): (WebCore::Widget::~Widget): (WebCore::Widget::setFrameRect): (WebCore::Widget::paint): (WebCore::Widget::setFocus): (WebCore::Widget::setCursor): (WebCore::Widget::show): (WebCore::Widget::hide): (WebCore::Widget::setIsSelected): * platform/gtk/WidgetGtk.cpp: (WebCore::Widget::Widget): Deleted. (WebCore::Widget::frameRect const): Deleted. * platform/win/WidgetWin.cpp: (WebCore::Widget::Widget): Deleted. (WebCore::Widget::frameRect const): Deleted. * platform/wpe/WidgetWPE.cpp: Removed. 2018-11-16 Chris Dumez [macOS] Label "prewarmed" WebContent processes in Activity Monitor https://bugs.webkit.org/show_bug.cgi?id=191765 Reviewed by Geoffrey Garen. * en.lproj/Localizable.strings: 2018-11-16 Jeremy Jones Enable external playback for video in element fullscreen. https://bugs.webkit.org/show_bug.cgi?id=190359 rdar://problem/42560085 Reviewed by Jer Noble. No new tests because we don't have a good way to test external playback. Any video that might be auto-pipped from element fullscreen should also enable external playback for video out. PiP and external playback are mutually exclusive. Instead of preventing PiP when external playback is active, allow PiP, but disable external playback while PiP is active. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::setVideoFullscreenStandby): * html/HTMLMediaElement.h: * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::setVideoFullscreenStandby): (WebCore::MediaPlayer::videoFullscreenStandby const): * platform/graphics/MediaPlayer.h: (WebCore::MediaPlayerClient::mediaPlayerVideoFullscreenStandby const): * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::setVideoFullscreenStandby): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenStandby): (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback): 2018-11-16 Jer Noble Regression(r233865): Causes synchronous IPC in the middle of layout https://bugs.webkit.org/show_bug.cgi?id=188307 Reviewed by Eric Carlson. Revert the changes added in r233865. Rather than make a syncronous call to the UIProcess to query whether the view has been backgrounded while (e.g.) JS has been spinning, perform the steps of the requestFullscreen() method on the next run loop, allowing messages from the UIProcess about page visibilty to be delivered first. * dom/Document.cpp: (WebCore::Document::requestFullScreenForElement): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::enterFullscreen): * html/HTMLMediaElement.h: * page/ChromeClient.h: 2018-11-16 Ross Kirsling Provide default implementation of Cursor https://bugs.webkit.org/show_bug.cgi?id=191772 Reviewed by Michael Catanzaro. * SourcesWPE.txt: * platform/Cursor.cpp: (WebCore::Cursor::ensurePlatformCursor const): * platform/wpe/CursorWPE.cpp: Removed. 2018-11-16 Don Olmstead EditorWPE should be EditorLibWPE https://bugs.webkit.org/show_bug.cgi?id=191774 Reviewed by Michael Catanzaro. The platform specific implementations of Editor are all around the platform's Pasteboard. Since the Pasteboard implementation is now based around USE(LIBWPE) EditorWPE should be renamed to EditorLibWPE. * SourcesWPE.txt: * editing/libwpe/EditorLibWPE.cpp: Renamed from Source/WebCore/editing/wpe/EditorWPE.cpp. 2018-11-16 Jeremy Jones Include AirPlay destination name in AirPlay placard. https://bugs.webkit.org/show_bug.cgi?id=191574 rdar://problem/45536144 Reviewed by Eric Carlson. Updated existing tests. Include the name of the AirPlay destination in the video element's AirPlay placard. * Modules/modern-media-controls/controls/airplay-placard.js: (AirplayPlacard): * Modules/modern-media-controls/controls/placard.js: * Modules/modern-media-controls/media/placard-support.js: (PlacardSupport.prototype._updatePlacard): (PlacardSupport.prototype._updateAirPlayPlacard): (PlacardSupport): * en.lproj/modern-media-controls-localized-strings.js: 2018-11-16 Zalan Bujtas Add DidFirstMeaningfulPaint milestone. https://bugs.webkit.org/show_bug.cgi?id=191754 Reviewed by Simon Fraser. This milestone fires sone after the paint triggered by the first visually non-empty layout. * page/FrameView.cpp: (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded): (WebCore::FrameView::firePaintRelatedMilestonesIfNeeded): * page/LayoutMilestone.h: 2018-11-16 Don Olmstead Provide default implementations of Image and Icon https://bugs.webkit.org/show_bug.cgi?id=191764 Reviewed by Michael Catanzaro. Makes IconWPE and ImageWPE implementations the default. * Sources.txt: * SourcesWPE.txt: * platform/graphics/Icon.cpp: Renamed from Source/WebCore/platform/graphics/wpe/IconWPE.cpp. * platform/graphics/Image.cpp: (WebCore::BitmapImage::invalidatePlatformData): Placed here for consistency with implementing ports. (WebCore::Image::loadPlatformResource): * platform/graphics/wpe/ImageWPE.cpp: Removed. 2018-11-16 Brent Fulgham [Win] Reduce the use of WKSI library calls: CFNetwork https://bugs.webkit.org/show_bug.cgi?id=191718 Reviewed by Alex Christensen. Remove custom WKSI CFNetwork calls, since the SPI is already documented in PAL. Just make the same calls on Windows, like we did for iOS and macOS back in 2017. Stop including WebKitSystemInterface.h for files that used to rely on it for font-related features. Tested by existing Windows regression tests. There should be no change in behavior. * platform/graphics/win/FontCacheWin.cpp: * platform/graphics/win/FontCustomPlatformData.cpp: * platform/graphics/win/FontPlatformDataCGWin.cpp: * platform/network/cf/CookieStorageCFNet.cpp: * platform/network/cf/CredentialStorageCFNet.cpp: * platform/network/cf/NetworkStorageSessionCFNet.cpp: (WebCore::createPrivateStorageSession): (WebCore::NetworkStorageSession::switchToNewTestingSession): (WebCore::NetworkStorageSession::ensureSession): * platform/network/cf/ResourceError.h: * platform/network/cf/ResourceErrorCF.cpp: (WebCore::getSSLPeerCertificateData): (WebCore::setSSLPeerCertificateData): (WebCore::ResourceError::getSSLPeerCertificateDataBytePtr): (WebCore::ResourceError::platformLazyInit): (WebCore::ResourceError::cfError const): * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::setClientCertificateInSSLProperties): (WebCore::ResourceHandle::createCFURLConnection): * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp: * platform/network/cf/ResourceRequestCFNet.cpp: * platform/network/cf/SocketStreamHandleImplCFNet.cpp: 2018-11-16 Timothy Hatcher Add html{color:text} to the simpleUserAgentStyleSheet on macOS. https://bugs.webkit.org/show_bug.cgi?id=191760 Reviewed by Antti Koivisto. * css/CSSDefaultStyleSheets.cpp: Added html{color:text} to simpleUserAgentStyleSheet inside a PLATFORM(MAC) copy of the string. 2018-11-16 Jer Noble An early return from updateSchedulingInfo can leave some variables uninitialized. https://bugs.webkit.org/show_bug.cgi?id=191755 Reviewed by Brent Fulgham. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::process): * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::updateSchedulingInfo): * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::process): 2018-11-16 Alicia Boya García [MSE][GStreamer] Ignore caps notifications when tearing down the pipeline https://bugs.webkit.org/show_bug.cgi?id=191578 Reviewed by Xabier Rodriguez-Calvar. Changing the demuxer to READY state (which is done only in the main thread) triggers the unlinking of its srcpads, which in turns emits a caps change notification in the previously linked element since they become unnegotiated again. We are not interested in caps notifications in these cases, so let's just ignore caps notifications emitted from the main thread. This fixes an assertion failure in the debug builds. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::AppendPipeline): 2018-11-16 Sihui Liu Storing blobs in IDB on iOS: "Error preparing blob/file" https://bugs.webkit.org/show_bug.cgi?id=188438 Reviewed by Alex Christensen. Grant sandbox extension of temp folder to network process, because we suggested network process had access to the folder on iOS device but it didn't. This makes some existing tests about IDB blob pass on iOS device. * Modules/indexeddb/server/IDBBackingStore.h: * Modules/indexeddb/server/SQLiteIDBTransaction.cpp: (WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary): (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary): (WebCore::IDBServer::SQLiteIDBTransaction::abort): * Modules/indexeddb/shared/InProcessIDBServer.h: 2018-11-16 Don Olmstead Add USE(LIBWPE) to WebCore https://bugs.webkit.org/show_bug.cgi?id=191401 Reviewed by Michael Catanzaro. No new tests. No change in behavior. Migrates all PLATFORM(WPE) code that calls into wpe_* APIs to USE(LIBWPE) instead. Renames classes and files to use the suffix LibWPE. * PlatformWPE.cmake: * SourcesWPE.txt: * platform/Pasteboard.h: * platform/PasteboardStrategy.h: * platform/PlatformKeyboardEvent.h: * platform/PlatformPasteboard.h: * platform/graphics/PlatformDisplay.cpp: (WebCore::PlatformDisplay::createPlatformDisplay): * platform/graphics/PlatformDisplay.h: * platform/graphics/egl/GLContextEGL.h: * platform/graphics/egl/GLContextEGLLibWPE.cpp: Renamed from Source/WebCore/platform/graphics/egl/GLContextEGLWPE.cpp. (WebCore::GLContextEGL::createWPEContext): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): * platform/graphics/libwpe/PlatformDisplayLibWPE.cpp: Renamed from Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.cpp. (WebCore::PlatformDisplayLibWPE::create): (WebCore::PlatformDisplayLibWPE::PlatformDisplayLibWPE): (WebCore::PlatformDisplayLibWPE::~PlatformDisplayLibWPE): (WebCore::PlatformDisplayLibWPE::initialize): * platform/graphics/libwpe/PlatformDisplayLibWPE.h: Renamed from Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.h. * platform/libwpe/PasteboardLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PasteboardWPE.cpp. * platform/libwpe/PlatformKeyboardEventLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PlatformKeyboardEventWPE.cpp. * platform/libwpe/PlatformPasteboardLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PlatformPasteboardWPE.cpp. 2018-11-16 Zalan Bujtas [iOS] 2 subsequent taps are required to trigger certain tasks on the desktop version of YouTube.com (hover vs click). https://bugs.webkit.org/show_bug.cgi?id=191712 Reviewed by Simon Fraser. In handleSyntheticClick() we use WKContentObservation to figure out whether the tap should be treated as a hover or a click. In general, if the mouse-move event triggers a visible content change, we assume we hit a hover-like drop down menu (or something similar) and no need to dispatch a click event. The idea here is that if the new content (result of the mouse-move event) does not respond to mouse click, it is most likely only for tooltip-like reasons and it's ok to proceed with the click event. Test: fast/events/touch/ios/click-instead-of-hover-simple.html * rendering/updating/RenderTreeUpdater.cpp: (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange): 2018-11-16 Zalan Bujtas [LFC][IFC] Add support for out-of-flow positioned boxes https://bugs.webkit.org/show_bug.cgi?id=191726 Reviewed by Antti Koivisto. While laying out formatting context roots (inline-block, floats) in an inline formatting context, we need to make sure that their out-of-flow descendants get laid out as well. Test: fast/inline/simple-inline-with-out-of-flow-descendant.html * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const): * layout/layouttree/LayoutTreeBuilder.cpp: This was returning the wrong context root when the container was also a context root. (WebCore::Layout::TreeBuilder::createSubTree): 2018-11-16 Thibault Saunier [GStreamer][WebRTC] Add API to enable/disable device mocks https://bugs.webkit.org/show_bug.cgi?id=191699 This basically us to test MediaStream/WebRTC support without requiring cameras or microphones and is quite useful. Also fix the GStreamerAudioMock by: - Stop setting `leaky-upstream` on the GStreamerCapturer queue, this was usefull when we were trying to bring the MediaStream sources inside the main pipeline, it is not the case anymore (and not doable with latest version of LibWebRTC). - Use a 'ticks' wave on the gstreamer audiotestsrc so the test stream is similar to what Apple port does. Reviewed by Xabier Rodriguez-Calvar. The mocks are already tested and the API is really simple. * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp: (WebCore::GStreamerAudioCapturer::createSource): * platform/mediastream/gstreamer/GStreamerAudioCapturer.h: * platform/mediastream/gstreamer/GStreamerCapturer.cpp: (WebCore::GStreamerCapturer::addSink): * platform/mediastream/gstreamer/GStreamerCapturer.h: 2018-11-16 Thibault Saunier [GStreamer][MediaStream] Handle track addition and removal https://bugs.webkit.org/show_bug.cgi?id=191599 Reviewed by Xabier Rodriguez-Calvar. Test: fast/mediastream/MediaStream-video-element-remove-track.html * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (WebCore::WebKitMediaStreamObserver::~WebKitMediaStreamObserver): (WebCore::WebKitMediaStreamObserver::WebKitMediaStreamObserver): (WebCore::webkitMediaStreamSrcFinalize): (WebCore::webkitMediaStreamSrcChangeState): (WebCore::webkit_media_stream_src_init): (WebCore::webkitMediaStreamSrcSetupSrc): (WebCore::webkitMediaStreamSrcAddTrack): (WebCore::webkitMediaStreamSrcRemoveTrackByType): (WebCore::webkitMediaStreamSrcSetStream): 2018-11-16 Zan Dobersek ScalableImageDecoder: don't forcefully decode image data when querying frame completeness, duration https://bugs.webkit.org/show_bug.cgi?id=191354 Reviewed by Michael Catanzaro. ScalableImageDecoder::frameIsCompleteAtIndex() should only check the index validity and, if the index is valid, check for completeness of the corresponding frame. ScalableImageDecoder::frameDurationAtIndex() should also only retrieve duration for already-complete frames. Both methods avoid calling ScalableImageDecoder::frameBufferAtIndex() as that method goes on and decodes image data to determine specific information. The ImageSource class that's querying this information doesn't anticipate this, and doesn't handle the increased memory consumption of the decoded data, leaving MemoryCache in the blind about the image resource's actual amount of consumed memory. ImageSource can instead gracefully handle any incomplete frame by marking the decoding status for this frame as only partial. * platform/image-decoders/ScalableImageDecoder.cpp: (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const): (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const): (WebCore::ScalableImageDecoder::frameDurationAtIndex const): 2018-11-16 Antoine Quint PointerEvents should not require touch event listeners to be registered https://bugs.webkit.org/show_bug.cgi?id=191333 Reviewed by Dean Jackson. Tests: pointerevents/ios/pointer-events-dispatch-on-touch.html pointerevents/ios/pointer-events-prevent-default.html * dom/EventNames.h: (WebCore::EventNames::isTouchEventType const): (WebCore::EventNames::touchAndPointerEventNames const): (WebCore::EventNames::touchEventNames const): Deleted. * dom/Node.cpp: (WebCore::Node::moveNodeToNewDocument): 2018-11-15 Zalan Bujtas [iOS] Do not get stuck in indeterminate content observation state. https://bugs.webkit.org/show_bug.cgi?id=191719 Reviewed by Simon Fraser. Reset the _WKContentChange flag to WKContentNoChange when the last observing timer is removed and we are in the "can't decide yet if it's a hover or click" state. This bug prevents us from firing click event when JS installs and removes the same set of timer(s) during mouse-move dispatch. Test: fast/events/touch/ios/stuck-with-hover-state.html * platform/ios/wak/WKContentObservation.cpp: (WebThreadRemoveObservedContentModifier): 2018-11-15 Simon Fraser REGRESSION (r238090) Composited iframes that resize from zero don't show https://bugs.webkit.org/show_bug.cgi?id=191733 rdar://problem/46107764 Reviewed by Zalan Bujtas. A zero-sized iframe whose contents are composited should not trigger compositing in the parent document (see code in requiresCompositingForFrame()), but when the