2019-01-31 Alexander Mikhaylenko [GTK] Momentum scrolling stops abruptly before websites end https://bugs.webkit.org/show_bug.cgi?id=193350 Reviewed by Carlos Garcia Campos. Don't immediately set velocity to 0 when position reaches upper or bottom limit. Instead, set it to the overshot distance, so that position exactly matches upper or lower limit on the next frame, and then clamp velocity to 0 using the existing mechanism. * platform/ScrollAnimationKinetic.cpp: (WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll): 2019-01-31 Michael Catanzaro Unreviewed, fix incorrect string format https://bugs.webkit.org/show_bug.cgi?id=193907 * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::commitTreeState): 2019-01-30 Simon Fraser [Mac] Implement basic hit testing in the scrolling tree https://bugs.webkit.org/show_bug.cgi?id=172917 Reviewed by Antti Koivisto. First steps to getting hit testing of scrolling nodes in the scrolling tree. Based on patch by Frédéric Wang. First we pipe the "async scrolling enabled" setting through to the ScrollingTree via the root node (like the other settings; weird, but that's how it's done). For now, we hit test in the scrolling tree if either async overflow or frame scrolling are enabled (it's hard to deal with one without the other). Nodes in the scrolling tree implement scrollingNodeForPoint() to implement hit testing. Two helper functions exist to simplify coordinate conversion: parentToLocalPoint() and localToContentsPoint(). Child nodes are hit-testing in reverse order to find nodes hightest in Z first. Only scrolling nodes are returned (not sure if we'll ever need to hit-test non-scrolling nodes). Nodes use parentRelativeScrollableRect and scroll positions to do these point mappings. handleWheelEvent() is changed to return a ScrollingEventResult. Latching is not correct with this change when async frame scrolling is enabled. That needs to be fixed separately. No tests yet; for ease of testing, I'd like to add an Internals API to hit-test the scrolling tree, rather than doing eventSender stuff everywhere. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): (WebCore::AsyncScrollingCoordinator::asyncFrameOrOverflowScrollingEnabled const): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingStateFrameScrollingNode.cpp: (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode): (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged): (WebCore::ScrollingStateFrameScrollingNode::setAsyncFrameOrOverflowScrollingEnabled): * page/scrolling/ScrollingStateFrameScrollingNode.h: * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously): (WebCore::ScrollingTree::handleWheelEvent): (WebCore::ScrollingTree::commitTreeState): (WebCore::ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled): * page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::asyncFrameOrOverflowScrollingEnabled const): * page/scrolling/ScrollingTreeFrameHostingNode.cpp: (WebCore::ScrollingTreeFrameHostingNode::parentToLocalPoint const): * page/scrolling/ScrollingTreeFrameHostingNode.h: * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: (WebCore::ScrollingTreeFrameScrollingNode::parentToLocalPoint const): (WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const): * page/scrolling/ScrollingTreeFrameScrollingNode.h: * page/scrolling/ScrollingTreeNode.cpp: (WebCore::ScrollingTreeNode::scrollingNodeForPoint const): * page/scrolling/ScrollingTreeNode.h: (WebCore::ScrollingTreeNode::children const): (WebCore::ScrollingTreeNode::parentToLocalPoint const): (WebCore::ScrollingTreeNode::localToContentsPoint const): * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::scrollLimitReached const): (WebCore::ScrollingTreeScrollingNode::parentToLocalPoint const): (WebCore::ScrollingTreeScrollingNode::localToContentsPoint const): (WebCore::ScrollingTreeScrollingNode::scrollingNodeForPoint const): * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::handleWheelEvent): * page/scrolling/ThreadedScrollingTree.h: * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: (WebCore::ScrollingTreeFrameScrollingNodeIOS::handleWheelEvent): * page/scrolling/ios/ScrollingTreeIOS.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h: 2019-01-31 Alicia Boya García [MSE][GStreamer] Remove unused GstFlowReturn in AppendPipeline methods https://bugs.webkit.org/show_bug.cgi?id=194067 Reviewed by Xabier Rodriguez-Calvar. A couple methods in AppendPipeline were returning GstFlowReturn despite there being no codepath (sans assertions) where values other than GST_FLOW_OK are returned. Therefore, it makes sense to just make these methods return void. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::pushNewBuffer): (WebCore::AppendPipeline::handleAppsinkNewSampleFromStreamingThread): * platform/graphics/gstreamer/mse/AppendPipeline.h: * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp: (WebCore::MediaSourceClientGStreamerMSE::append): * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h: * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::append): 2019-01-31 Alicia Boya García [MSE][GStreamer] Remove if (m_playerPrivate) from MediaSourceClientGStreamerMSE https://bugs.webkit.org/show_bug.cgi?id=194069 Reviewed by Xabier Rodriguez-Calvar. m_playerPrivate is non-NULL since MediaSourceClientGStreamerMSE creation well until its destruction. The only case that could make a NULL m_playerPrivate is clearPlayerPrivate() but that method is not used anymore. * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp: (WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer): (WebCore::MediaSourceClientGStreamerMSE::durationChanged): (WebCore::MediaSourceClientGStreamerMSE::abort): (WebCore::MediaSourceClientGStreamerMSE::resetParserState): (WebCore::MediaSourceClientGStreamerMSE::markEndOfStream): (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource): (WebCore::MediaSourceClientGStreamerMSE::flush): (WebCore::MediaSourceClientGStreamerMSE::enqueueSample): (WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued): (WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc): (WebCore::MediaSourceClientGStreamerMSE::clearPlayerPrivate): Deleted. * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h: 2019-01-31 Thibault Saunier [GStreamer][WebRTC] Avoid returning FLUSHING when it is not the case in GStreamerMediaStreamSource https://bugs.webkit.org/show_bug.cgi?id=194087 Basically GstFlowCombiner was mostly designed for element that have 1 sinkpad and several srcpad meaning that it makes sense that when any of the downstream pad is returning flushing, you should return FLUSHING upstream. But in our case we have several sinkpads and FLUSHING should be returned *only* if the internally linked srcpad is FLUSHING otherwise we might end up setting the upstream source element task to PAUSED (because downstream returned flushing) on a branch that was not flushing! Reviewed by Philippe Normand. This is a theorical race we can't really cover with tests. * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (WebCore::webkitMediaStreamSrcChain): 2019-01-31 Zalan Bujtas [LFC] Margin before/after/start/end initial value is 0 and not auto. https://bugs.webkit.org/show_bug.cgi?id=194090 Reviewed by Antti Koivisto. Don't treat it like auto. * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): 2019-01-31 Zalan Bujtas [LFC] Use the used margin values in outOfFlowReplacedHorizontalGeometry consistently https://bugs.webkit.org/show_bug.cgi?id=194074 Reviewed by Antti Koivisto. Check the used margin variables whether we already computed start/end values. Test: fast/block/block-only/absolute-position-with-margin-auto-simple2.html * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): 2019-01-31 Zalan Bujtas [LFC][BFC] Add support for block level replaced box. https://bugs.webkit.org/show_bug.cgi?id=194071 Reviewed by Antti Koivisto. * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::Box): * layout/layouttree/LayoutBox.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createSubTree): (WebCore::Layout::outputLayoutBox): 2019-01-31 Chris Fleizach ASSERTION FAILED: cache under WebCore::AXObjectCache::postTextStateChangePlatformNotification https://bugs.webkit.org/show_bug.cgi?id=189094 Reviewed by Zalan Bujtas. Protect against access to objects and cache's that can be removed while an object is still in memory. Unskipped flaky tests on mac-wk2. * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::postTextStateChangePlatformNotification): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (textMarkerForVisiblePosition): (textMarkerRangeFromVisiblePositions): 2019-01-30 Chris Dumez Regression(PSON) History navigations to twitter.com lead to a 403 HTTP error https://bugs.webkit.org/show_bug.cgi?id=194023 Reviewed by Geoffrey Garen. The issue was caused by the 'isTopSite' flag not getting properly set on the network request in case of a cross-site history navigation (with process-swap). As a result, twitter.com was not getting its same-site lax cookies. The 'isTopSite' flag normally gets set by FrameLoader::addExtraFieldsToRequest(), but we were bypassing this method entirely when continuing a load in a new process after a swap. This was intentional as the network request is normally already fully populated by the previous process and we do not want the new process to modify the request in any way (e.g. we would not want to add a Origin header back after it was removed by the previous process). However, in case of a History navigation, we do not actually pass a request along from one process to another. Instead, we pass a HistoryItem and then build a fresh new request from the HistoryItem in the new process. In this case, we *want* addExtraFieldsToRequest() to be called on the new request, even though we are technically continuing a load in a new process. We thus address the issue by bypassing FrameLoader::addExtraFieldsToRequest() only if we're continuing a load with a request and not when we're continuing a load with a HistoryItem. Test: http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php * loader/FrameLoader.cpp: (WebCore::FrameLoader::load): (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::addExtraFieldsToRequest): (WebCore::FrameLoader::loadDifferentDocumentItem): * loader/FrameLoader.h: (WebCore::FrameLoader::shouldTreatCurrentLoadAsContinuingLoad const): 2019-01-30 Justin Fan [WebGPU] Support GPUDepthStencilStateDescriptor https://bugs.webkit.org/show_bug.cgi?id=194048 Reviewed by Dean Jackson. Implement GPUDepthStencilStateDescriptor to specify a MTLDepthStencilState that is set on the command encoder. Existing tests cover changes to pipeline. Behavior does not change as DepthStencilState has no effect without a depth texture attached. New interface files added: * Modules/webgpu/GPUCompareFunction.idl: * Modules/webgpu/GPUDepthStencilStateDescriptor.idl: * platform/graphics/gpu/GPUCompareFunction.h: * platform/graphics/gpu/GPUDepthStencilStateDescriptor.h: Modifications: * Modules/webgpu/WebGPUDevice.cpp: Include depthStencilState when creating pipeline. (WebCore::WebGPUDevice::createRenderPipeline const): * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Add depthStencilState to the descriptor. * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Ditto. * platform/graphics/gpu/GPURenderPipeline.h: Ditto. (WebCore::GPURenderPipeline::depthStencilState const): Getter. (WebCore::GPURenderPipeline::platformRenderPipeline const): * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Update constructor to take depthStencilState. (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: Setting pipeline also sets the included depthStencilState. (WebCore::GPURenderPassEncoder::setPipeline): * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Convert DepthStencilStateDescriptor to MTLDepthStencilState. (WebCore::validateAndConvertDepthCompareFunctionToMtl): (WebCore::tryCreateMtlDepthStencilState): (WebCore::tryCreateMtlRenderPipelineState): Refactored logic out of GPURenderPipeline::create. (WebCore::GPURenderPipeline::create): (WebCore::GPURenderPipeline::GPURenderPipeline): Added symbols for CompareFunction, DepthStencilStateDescriptor to the project: * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * Modules/webgpu/WebGPUDevice.idl: Cleaned up IDL to match current version. 2019-01-30 Jer Noble [Cocoa][EME] persistent-usage-record data not issued after MediaKeySession.remove() https://bugs.webkit.org/show_bug.cgi?id=193984 Reviewed by Eric Carlson. MediaKeySession.sessionId is empty during the CDMInstance->requestLicense success callback handler. The KVO notification that AVContentKeySession.contentProtectionSessionIdentifier changed isn't called until after the -[AVContentKeyRequest makeStreamingContentKeyRequestDataForApp:contentIdentifier:options:completionHandler:] completion handler is called. Explicitly ask for the -contentProtectionSessionIdentifier inside that handler, and just in case the sessionID changes after that, add a new client callback method to notify the MediaKeySession that the ID has changed. * Modules/encryptedmedia/MediaKeySession.cpp: (WebCore::MediaKeySession::sessionIdChanged): * Modules/encryptedmedia/MediaKeySession.h: * platform/encryptedmedia/CDMInstanceSession.h: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest): 2019-01-30 Keith Rollin FloatWithRect has invalid and inaccessible default constructor https://bugs.webkit.org/show_bug.cgi?id=194057 Reviewed by Zalan Bujtas. FloatWithRect has a default constructor declared as 'default'. This constructor is invalid because FloatWithRect has a data member that's a reference that will not get initialized with this constructor. Since it's invalid, and since it's private and not accessed by anything, remove this constructor. No new tests since there should be no observable behavior difference. * rendering/line/LineLayoutState.h: 2019-01-30 Daniel Bates [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element https://bugs.webkit.org/show_bug.cgi?id=192824 Reviewed by Wenson Hsieh. When building with USE(UIKIT_KEYBOARD_ADDITIONS) enabled, normalize input strings for some more key codes now that hardware key events to non-editable elements use the same code path as for editable elements. * platform/ios/KeyEventIOS.mm: (WebCore::windowsKeyCodeForCharCode): Demarcate mappings that are only needed when building with !USE(UIKIT_KEYBOARD_ADDITIONS) in the hope that one day we can remove this code. (WebCore::isFunctionKey): Ditto. * platform/ios/WebEvent.mm: (normalizedStringWithAppKitCompatibilityMapping): Normalize some more input strings when building with USE(UIKIT_KEYBOARD_ADDITIONS) enabled. 2019-01-30 Jer Noble Ensure ENABLE_MEDIA_SOURCE is defined inside DerivedSources.make https://bugs.webkit.org/show_bug.cgi?id=194063 Reviewed by Jon Lee. * DerivedSources.make: 2019-01-30 Youenn Fablet Refactor ServiceWorkerJob management by ServiceWorkerContainer to make it more memory safe https://bugs.webkit.org/show_bug.cgi?id=193747 Reviewed by Chris Dumez. Make ServiceWorkerJob be no longer ref counted. Instead its lifetime is fully controlled by ServiceWorkerContainer. Make sure that a failing load will remove the job from ServiceWorkerContainer job map. This allows to ensure that these jobs do not stay forever. Before the patch, the jobs map was never cleared, which is creating a ref cycle whenever a job is not succesful. Before the patch, unsetPendingActivity was only called for successful jobs finishing. In case of failing loads, ServiceWorkerContainer would leak. Make sure that setPendingActivity/unsetPendingActivity is balanced by storing a pending activity in the job map next to the job. When ServiceWorkerContainer is stopped, notify that all jobs are cancelled to NetworkProcess. This makes these jobs in NetworkProcess-side to not stay until the corresponding WebProcess is gone. Simplify ServiceWorkerJob promise rejection handling so that it is clear when promise is rejected and when it is not. Update type of exception to be SecurityError when load fails due to AccessControl. Covered by existing tests. * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::addRegistration): (WebCore::ServiceWorkerContainer::removeRegistration): (WebCore::ServiceWorkerContainer::updateRegistration): (WebCore::ServiceWorkerContainer::scheduleJob): (WebCore::ServiceWorkerContainer::jobFailedWithException): (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration): (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult): (WebCore::ServiceWorkerContainer::jobFailedLoadingScript): (WebCore::ServiceWorkerContainer::jobDidFinish): (WebCore::ServiceWorkerContainer::stop): (WebCore::ServiceWorkerContainer::job): * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerJob.cpp: (WebCore::ServiceWorkerJob::failedWithException): (WebCore::ServiceWorkerJob::resolvedWithRegistration): (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult): (WebCore::ServiceWorkerJob::startScriptFetch): (WebCore::ServiceWorkerJob::didReceiveResponse): (WebCore::ServiceWorkerJob::notifyFinished): (WebCore::ServiceWorkerJob::cancelPendingLoad): * workers/service/ServiceWorkerJob.h: (WebCore::ServiceWorkerJob::hasPromise const): (WebCore::ServiceWorkerJob::takePromise): * workers/service/ServiceWorkerJobClient.h: * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::scriptFetchFinished): 2019-01-30 Dean Jackson PointerEvents - tiltX and tiltY are reversed https://bugs.webkit.org/show_bug.cgi?id=194032 Reviewed by Jon Lee. I got tiltX and tiltY the wrong way around. * dom/ios/PointerEventIOS.cpp: Flip the values. 2019-01-30 Zalan Bujtas [LFC][IFC] nextBreakablePosition returns the same position on hyphen characters https://bugs.webkit.org/show_bug.cgi?id=194001 Reviewed by Antti Koivisto. Skip to the next position manually. This is exactly what we do in simple line layout. * layout/inlineformatting/InlineRunProvider.cpp: (WebCore::Layout::InlineRunProvider::moveToNextBreakablePosition): 2019-01-30 Simon Fraser Add some basic geometry information to the scrolling tree https://bugs.webkit.org/show_bug.cgi?id=194002 rdar://problem/47656294 Reviewed by Antti Koivisto. To allow hit-testing in the scrolling tree, store a parent-relative scrollable rect in "scrolling" and "frame hosting" nodes. This is a rect whose size is the size of the scrollable area, and whose origin is relative to the parent scrolling tree node. Frame hosting nodes need this rect because they take care of the geometry offset between an iframe and its scrolling tree ancestor in the parent document. Based on a patch by Frédéric Wang in bug 172917. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry): * page/scrolling/ScrollingStateFrameHostingNode.cpp: (WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode): (WebCore::ScrollingStateFrameHostingNode::setAllPropertiesChanged): (WebCore::ScrollingStateFrameHostingNode::setParentRelativeScrollableRect): (WebCore::ScrollingStateFrameHostingNode::dumpProperties const): * page/scrolling/ScrollingStateFrameHostingNode.h: * page/scrolling/ScrollingTreeFrameHostingNode.cpp: (WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren): (WebCore::ScrollingTreeFrameHostingNode::dumpProperties const): * page/scrolling/ScrollingTreeFrameHostingNode.h: (WebCore::ScrollingTreeFrameHostingNode::parentRelativeScrollableRect const): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateScrollingLayers): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeFrameScrollingGeometry const): (WebCore::RenderLayerCompositor::computeFrameHostingGeometry const): (WebCore::RenderLayerCompositor::computeOverflowScrollingGeometry const): (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole): (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole): (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView const): (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView): Deleted. * rendering/RenderLayerCompositor.h: 2019-01-30 Zalan Bujtas [LFC] Use the used margin values in outOfFlowReplacedVerticalGeometry consistently https://bugs.webkit.org/show_bug.cgi?id=194020 Reviewed by Antti Koivisto. Check the used margin variables whether we already computed before/after values. Test: fast/block/block-only/absolute-position-with-margin-auto-simple.html * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): 2019-01-30 Chris Fleizach AX: Support color well on iOS https://bugs.webkit.org/show_bug.cgi?id=194010 Reviewed by Joanmarie Diggs. Test: accessibility/ios-simulator/color-well.html Add support for color well on iOS. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]): (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]): (-[WebAccessibilityObjectWrapper accessibilityRoleDescription]): (-[WebAccessibilityObjectWrapper accessibilityColorStringValue]): * en.lproj/Localizable.strings: * platform/LocalizedStrings.cpp: (WebCore::AXColorWellText): * platform/LocalizedStrings.h: 2019-01-30 Chris Fleizach AX: Role=switch not returning correct accessibilityValue https://bugs.webkit.org/show_bug.cgi?id=194006 Reviewed by Joanmarie Diggs. Return the toggle state of a role=switch element. Test: accessibility/ios-simulator/role-switch.html * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityValue]): 2019-01-29 Rob Buis Align with Fetch on data: URLs https://bugs.webkit.org/show_bug.cgi?id=182325 Reviewed by Alex Christensen. Implement most remaining steps for data: URL processing [1]. Serialization is still to be implemented. To make the code in DataURLDecoder::parseMediaType more efficient, refactor ParsedContentType so that validation and parsing is done in one pass. Test: web-platform-tests/fetch/data-urls/processing.any.js [1] https://fetch.spec.whatwg.org/#data-urls * Modules/encryptedmedia/CDM.cpp: (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType): * platform/network/DataURLDecoder.cpp: (WebCore::DataURLDecoder::parseMediaType): (WebCore::DataURLDecoder::DecodeTask::process): * platform/network/MIMEHeader.cpp: (WebCore::MIMEHeader::parseHeader): * platform/network/ParsedContentType.cpp: (WebCore::containsNewline): (WebCore::ParsedContentType::parseContentType): (WebCore::ParsedContentType::create): (WebCore::isValidContentType): (WebCore::ParsedContentType::ParsedContentType): (WebCore::DummyParsedContentType::setContentType const): Deleted. (WebCore::DummyParsedContentType::setContentTypeParameter const): Deleted. (WebCore::parseContentType): Deleted. * platform/network/ParsedContentType.h: 2019-01-29 Eric Carlson [MSE] add more source buffer logging https://bugs.webkit.org/show_bug.cgi?id=193995 Reviewed by Jon Lee. No new tests, no functional change. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::resetParserState): (WebCore::SourceBufferPrivateAVFObjC::setReadyState): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): (WebCore::SourceBufferPrivateAVFObjC::willSeek): (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession): 2019-01-29 Simon Fraser Add nodes to the scrolling tree in z-index order. https://bugs.webkit.org/show_bug.cgi?id=192529 Reviewed by Dean Jackson. We currently add nodes to the scrolling tree via RenderLayerBacking::updateGeometry() and some other places. This is sub-optimal, because we don't readily know the scrolling ancestor at these times, so have to do RenderLayer walks to find them. With this change we update the scrolling tree during the RenderLayerCompositor::updateBackingAndHierarchy() tree walk, storing state along the way so we always know our scrolling tree ancestor, and the sibling index (which makes it so that the scrolling tree correctly reflects layer z-order). The reattachSubframeScrollLayers() code path is removed, since we can now reliably parent frame nodes via FrameHosting nodes in their parent document. There is also some minor cleanup around RenderLayerBacking teardown; it used to be the case that cleanup in ~RenderLayerBacking was hard because the backing was already disconnected from its owning RenderLayer, so I added RenderLayerBacking::willBeDestroyed() to do work that requires that layer->backing() is still valid. This allows for fewer callsites for detachFromScrollingCoordinator(). updateScrollCoordinatedLayersAfterFlushIncludingSubframes() is now iOS-only because it's only relevant for iOS WK1, and m_scrollCoordinatedLayers can be moved to LegacyWebKitScrollingLayerCoordinator. Tests: scrollingcoordinator/scrolling-tree/overflow-in-fixed.html scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order.html * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::insertNode): * page/scrolling/ScrollingTreeNode.cpp: (WebCore::ScrollingTreeNode::~ScrollingTreeNode): * platform/Logging.cpp: (WebCore::initializeLogChannelsIfNecessary): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::setParent): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::~RenderLayerBacking): (WebCore::RenderLayerBacking::willBeDestroyed): (WebCore::RenderLayerBacking::updateGeometry): (WebCore::RenderLayerBacking::updateBackgroundLayer): (WebCore::RenderLayerBacking::coordinatedScrollingRoles const): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::flushPendingLayerChanges): (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush): (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer): (WebCore::frameHostingNodeForFrame): (WebCore::RenderLayerCompositor::updateCompositingLayers): (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): (WebCore::RenderLayerCompositor::updateBacking): (WebCore::RenderLayerCompositor::layerWillBeRemoved): (WebCore::RenderLayerCompositor::setIsInWindow): (WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants): (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const): (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers): (WebCore::RenderLayerCompositor::attachScrollingNode): (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole): (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer): (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole): (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole): (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole): (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking): (WebCore::RenderLayerCompositor::didAddScrollingLayer): (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers): (WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer): (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer): (WebCore::LegacyWebKitScrollingLayerCoordinator::removeLayer): (WebCore::LegacyWebKitScrollingLayerCoordinator::addViewportConstrainedLayer): (WebCore::LegacyWebKitScrollingLayerCoordinator::removeViewportConstrainedLayer): (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush): Deleted. (WebCore::RenderLayerCompositor::setCompositingParent): Deleted. This was always called with a null parentLayer, so was a no-op. (WebCore::RenderLayerCompositor::removeCompositedChildren): Deleted. (WebCore::RenderLayerCompositor::fixedRootBackgroundLayerChanged): Deleted. The work happens via didChangePlatformLayerForLayer() now. (WebCore::canCoordinateScrollingForLayer): Deleted. (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Deleted. (WebCore::enclosingScrollingNodeID): Deleted. (WebCore::scrollCoordinatedAncestorInParentOfFrame): Deleted. (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): Deleted. (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): Deleted. (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Deleted. * rendering/RenderLayerCompositor.h: 2019-01-29 Brent Fulgham Make sure we have a frame before trying to access its loader https://bugs.webkit.org/show_bug.cgi?id=193985 Reviewed by Ryosuke Niwa. * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): 2019-01-29 Andy Estes Try to fix the watchOS build. * dom/Element.cpp: 2019-01-29 Simon Fraser REGRESSION(r240553): [iOS] Crash in ScrollingTree::updateTreeFromStateNode when attempting to log in to icloud.com https://bugs.webkit.org/show_bug.cgi?id=193907 rdar://problem/47604080 Reviewed by Frédéric Wang. Recent scrolling tree changes can trigger unparenting and reparenting of subtrees in the state tree. If a subframe's state tree nodes are unparented, a scrolling tree commit would show these as nodes being destroyed, which destroyed the tree nodes. When re-parented, the commit would re-create the tree node, but the state node would only have a subset of the change flags set, so the new tree node would fail to get all of the state (for example, it would be missing layers and scrolling geometry). Fix by ensuring that when we reparent state node subtrees, we set all the change flags so that the full set of data is sent to the scrolling tree (the UI process, in the case of iOS WK2). Annoyingly, virtual setAllPropertiesChanged() functions are needed so each state node subclass can set the right change flags. This patch also gets rid of m_nodesRemovedSinceLastCommit in the state tree. We can gain the same information by using copying all of the nodeIDs in m_nodeMap into a HashSet, and removing nodes as we encounter them in the tree walk. Rename m_latchedNode to m_latchedNodeID in ScrollingTree, since it's a nodeID, not a node pointer. Test: compositing/geometry/composited-frame-contents.html * page/scrolling/ScrollingStateFixedNode.cpp: (WebCore::ScrollingStateFixedNode::setAllPropertiesChanged): * page/scrolling/ScrollingStateFixedNode.h: * page/scrolling/ScrollingStateFrameScrollingNode.cpp: (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged): * page/scrolling/ScrollingStateFrameScrollingNode.h: * page/scrolling/ScrollingStateNode.cpp: (WebCore::ScrollingStateNode::setPropertyChanged): (WebCore::ScrollingStateNode::setAllPropertiesChanged): * page/scrolling/ScrollingStateNode.h: (WebCore::ScrollingStateNode::setPropertyChangedBit): * page/scrolling/ScrollingStateScrollingNode.cpp: (WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged): * page/scrolling/ScrollingStateScrollingNode.h: * page/scrolling/ScrollingStateStickyNode.cpp: (WebCore::ScrollingStateStickyNode::setAllPropertiesChanged): * page/scrolling/ScrollingStateStickyNode.h: * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::insertNode): Add a RELEASE_ASSERT on the type of the node created if parentID == 0, since mistakes here can associate a ScrollingNodeType::MainFrame node with some other nodeID which can result in type confusion later. (WebCore::ScrollingStateTree::nodeWasReattachedRecursive): (WebCore::ScrollingStateTree::commit): (WebCore::ScrollingStateTree::willRemoveNode): (WebCore::ScrollingStateTree::setRemovedNodes): Deleted. * page/scrolling/ScrollingStateTree.h: (WebCore::ScrollingStateTree::removedNodes const): Deleted. * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously): (WebCore::ScrollingTree::commitTreeState): (WebCore::ScrollingTree::updateTreeFromStateNode): (WebCore::ScrollingTree::latchedNode): (WebCore::ScrollingTree::setLatchedNode): (WebCore::ScrollingTree::clearLatchedNode): (WebCore::ScrollingTree::scrollingTreeAsText): (WebCore::ScrollingTree::removeDestroyedNodes): Deleted. * page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::hasLatchedNode const): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::ensureRootLayer): The scroll layer needs a 0,0,0 anchor point so that setting its position doesn't offset it relative to the center. 2019-01-29 Justin Fan [WebGPU] Fix and add validation to WebGPURenderPipeline and MTLVertexDescriptor https://bugs.webkit.org/show_bug.cgi?id=193926 Reviewed by Myles C. Maxfield. Update vertex input to properly utilize inputSlot and shaderLocation fields, and add some validation. Test: webgpu/vertex-buffer-triangle-strip.html * Modules/webgpu/WebGPUVertexInputDescriptor.idl: * platform/graphics/gpu/GPUVertexInputDescriptor.h: * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: (WebCore::setInputStateForPipelineDescriptor): Properly retain Metal types. (WebCore::GPURenderPipeline::create): Provide error logging for MTLRenderPipelineState creation. 2019-01-29 Keith Rollin Add .xcfilelists to Run Script build phases https://bugs.webkit.org/show_bug.cgi?id=193792 Reviewed by Alex Christensen. As part of supporting XCBuild, update the necessary Run Script build phases in their Xcode projects to refer to their associated .xcfilelist files. Note that the addition of these files bumps the Xcode project version number to something that's Xcode 10 compatible. This change means that older versions of the Xcode IDE can't read these projects. Nor can it fully load workspaces that refer to these projects (the updated projects are shown as non-expandable placeholders). `xcodebuild` can still build these projects; it's just that the IDE can't open them. Make special accommodations for incorporating .xcfilelists from WebKitAdditions. No new tests since there should be no observable behavior difference. * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * WebCore.xcodeproj/project.pbxproj: 2019-01-29 John Wilander Add data abstraction and validation for Ad Click Attribution https://bugs.webkit.org/show_bug.cgi?id=193916 Reviewed by Daniel Bates, Brent Fulgham, and Alex Christensen. New API tests added. Ad click attribution has two steps. First, the storage of an ad campaign ID for a click that takes the user to a destination site. Second, a conversion on the destination site that can be attributed to the ad click. This patch adds a class that represents a request for ad click attribution. Validation makes sure that the bits of entropy reported through this mechanism is limited. This feature is experimental and off by default. * Sources.txt: Added loader/AdClickAttribution.cpp. * WebCore.xcodeproj/project.pbxproj: * loader/AdClickAttribution.cpp: Added. (WebCore::AdClickAttribution::isValid const): (WebCore::AdClickAttribution::setConversion): (WebCore::AdClickAttribution::url const): (WebCore::AdClickAttribution::referrer const): * loader/AdClickAttribution.h: Added. (WebCore::AdClickAttribution::Campaign::Campaign): (WebCore::AdClickAttribution::Campaign::isValid const): (WebCore::AdClickAttribution::Source::Source): (WebCore::AdClickAttribution::Destination::Destination): (WebCore::AdClickAttribution::Priority::Priority): (WebCore::AdClickAttribution::Conversion::Conversion): (WebCore::AdClickAttribution::Conversion::isValid const): (WebCore::AdClickAttribution::AdClickAttribution): (WebCore::AdClickAttribution::earliestTimeToSend const): * loader/DocumentLoader.cpp: Added missing #include "RuntimeEnabledFeatures.h". 2019-01-29 Zalan Bujtas [MathML] Move enum class ScriptType to MathMLScriptsElement. https://bugs.webkit.org/show_bug.cgi?id=193969 Reviewed by Antti Koivisto. * mathml/MathMLScriptsElement.cpp: (WebCore::scriptTypeOf): * mathml/MathMLScriptsElement.h: * rendering/mathml/RenderMathMLScripts.cpp: (WebCore::RenderMathMLScripts::scriptType const): (WebCore::RenderMathMLScripts::validateAndGetReferenceChildren): (WebCore::RenderMathMLScripts::computePreferredLogicalWidths): (WebCore::RenderMathMLScripts::verticalMetrics): (WebCore::RenderMathMLScripts::layoutBlock): * rendering/mathml/RenderMathMLScripts.h: * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::RenderMathMLUnderOver::isValid const): (WebCore::RenderMathMLUnderOver::under const): (WebCore::RenderMathMLUnderOver::over const): (WebCore::RenderMathMLUnderOver::computePreferredLogicalWidths): (WebCore::RenderMathMLUnderOver::hasAccent const): (WebCore::RenderMathMLUnderOver::layoutBlock): 2019-01-29 Chris Dumez Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated https://bugs.webkit.org/show_bug.cgi?id=193848 Reviewed by Youenn Fablet. * dom/Document.cpp: * dom/MessageChannel.cpp: (WebCore::MessageChannel::MessageChannel): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::contextIdentifier const): * history/HistoryItem.cpp: (WebCore::HistoryItem::HistoryItem): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient): * page/DOMWindow.cpp: (WebCore::DOMWindow::DOMWindow): * platform/Process.cpp: (WebCore::Process::identifier): * workers/service/ServiceWorkerJobData.cpp: (WebCore::ServiceWorkerJobData::ServiceWorkerJobData): * workers/service/server/RegistrationDatabase.cpp: (WebCore::RegistrationDatabase::importRecords): * workers/service/server/SWServer.cpp: (WebCore::SWServer::Connection::Connection): (WebCore::SWServer::updateWorker): * workers/service/server/SWServerRegistration.cpp: (WebCore::generateServiceWorkerRegistrationIdentifier): * workers/service/server/SWServerToContextConnection.cpp: (WebCore::generateServerToContextConnectionIdentifier): 2019-01-29 Alex Christensen Use lambdas instead of member pointer functions for TransactionOperationImpl https://bugs.webkit.org/show_bug.cgi?id=193933 Reviewed by Tim Horton. No change in behavior. This just makes it easier to add new parameters to these functions in a straightforward manner. * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::putOrAdd): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::internalAbort): (WebCore::IDBTransaction::commit): (WebCore::IDBTransaction::createObjectStore): (WebCore::IDBTransaction::renameObjectStore): (WebCore::IDBTransaction::createIndex): (WebCore::IDBTransaction::renameIndex): (WebCore::IDBTransaction::doRequestOpenCursor): (WebCore::IDBTransaction::iterateCursor): (WebCore::IDBTransaction::requestGetAllObjectStoreRecords): (WebCore::IDBTransaction::requestGetAllIndexRecords): (WebCore::IDBTransaction::requestGetRecord): (WebCore::IDBTransaction::requestIndexRecord): (WebCore::IDBTransaction::requestCount): (WebCore::IDBTransaction::requestDeleteRecord): (WebCore::IDBTransaction::requestClearObjectStore): (WebCore::IDBTransaction::requestPutOrAdd): (WebCore::IDBTransaction::deleteObjectStore): (WebCore::IDBTransaction::deleteIndex): * Modules/indexeddb/IDBTransaction.h: * Modules/indexeddb/client/TransactionOperation.h: (WebCore::IDBClient::TransactionOperation::doComplete): (WebCore::IDBClient::createTransactionOperation): Deleted. 2019-01-29 Zalan Bujtas [LFC][BFC][MarginCollapsing] Remove incorrect downcast https://bugs.webkit.org/show_bug.cgi?id=193964 Reviewed by Antti Koivisto. * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore): 2019-01-29 Zalan Bujtas [LFC][BFC] Do not ignore next sibling box while laying out BFC. https://bugs.webkit.org/show_bug.cgi?id=193954 Reviewed by Antti Koivisto. When a block box has no child (), we should not ignore the next sibling (move the container check to the function to keep layout logic simple) Also inFlowNonReplacedWidthAndMargin() is called through inFlowReplacedWidthAndMargin() to compute margins. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layout const): (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren const): * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): 2019-01-29 Zalan Bujtas [LFC][BFC][MarginCollapsing] Remove quirk from MarginCollapse::marginsCollapseThrough https://bugs.webkit.org/show_bug.cgi?id=193948 Reviewed by Antti Koivisto. This is now implemented in BlockFormattingContext::Quirks::stretchedInFlowHeight(). * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough): 2019-01-29 Zalan Bujtas [LFC][BFC][MarginCollapsing] Anonymous block container's margin before does not collapse with previous inflow sibling margin after. https://bugs.webkit.org/show_bug.cgi?id=193952 Reviewed by Antti Koivisto. * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter): 2019-01-29 Frederic Wang Allow scrolling tree nodes to exist in a detached state https://bugs.webkit.org/show_bug.cgi?id=193754 Unreviewed build warning fix. * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode): Remove unused variable. 2019-01-28 Ryosuke Niwa User agent string override for navigator.userAgent should be site specific quirks https://bugs.webkit.org/show_bug.cgi?id=193950 Reviewed by Brent Fulgham. In order to make it possible to toggle the UA string override just for navigator.userAgent via Web Inspector, we need to put this override behind the site specific quirks. Because WebInspector overrides Page's setting without updating WKPreferences, there is no way for WKWebView client's to know whether the site specific quirks had been disabled or not. * loader/DocumentLoader.h: (WebCore::DocumentLoader::setCustomJavaScriptUserAgentAsSiteSpecificQuirks): (WebCore::DocumentLoader::customJavaScriptUserAgentAsSiteSpecificQuirks const): (WebCore::DocumentLoader::setCustomJavaScriptUserAgent): Deleted. (WebCore::DocumentLoader::customJavaScriptUserAgent const): Deleted. * loader/FrameLoader.cpp: (WebCore::FrameLoader::userAgentForJavaScript const): 2019-01-28 Devin Rousso Web Inspector: provide a way to edit page WebRTC settings on a remote target https://bugs.webkit.org/show_bug.cgi?id=193863 Reviewed by Joseph Pecoraro. Test: inspector/page/overrideSetting-ICECandidateFilteringEnabled.html inspector/page/overrideSetting-MockCaptureDevicesEnabled.html * inspector/agents/InspectorPageAgent.cpp: * page/Settings.yaml: * page/SettingsBase.h: * page/SettingsBase.cpp: (SettingsBase::iceCandidateFilteringEnabledChanged): Added. (SettingsBase::mockCaptureDevicesEnabledChanged): Added. * Scripts/GenerateSettings.rb: * Scripts/SettingsTemplates/Settings.cpp.erb: Add page-level settings for WebRTC preferences. * Modules/mediastream/UserMediaController.cpp: (WebCore::UserMediaController::canCallGetUserMedia): * testing/InternalSettings.cpp: (WebCore::InternalSettings::setMediaCaptureRequiresSecureConnection): * testing/Internals.h: * testing/Internals.cpp: (WebCore::Internals::Internals): (WebCore::Internals::setMockMediaCaptureDevicesEnabled): (WebCore::Internals::setMediaCaptureRequiresSecureConnection): Added. * page/DeprecatedGlobalSettings.h: * page/DeprecatedGlobalSettings.cpp: (WebCore::DeprecatedGlobalSettings::mockCaptureDevicesEnabled): Deleted. (WebCore::DeprecatedGlobalSettings::setMockCaptureDevicesEnabled): Deleted. (WebCore::DeprecatedGlobalSettings::mediaCaptureRequiresSecureConnection): Deleted. (WebCore::DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection): Deleted. 2019-01-28 Jer Noble webkitcurrentplaybacktargetiswirelesschanged and webkitCurrentPlaybackIsWireless are non-deterministic. https://bugs.webkit.org/show_bug.cgi?id=193923 Reviewed by Eric Carlson. The value of webkitCurrentPlaybackTargetIsWireless can change in between when the event is scheduled and when it's actually dispatched. To make this more deterministic, use a GenericTaskQueue to enqueue setting m_isPlayingToWirelessTarget and dispatch the changed event in the same run-loop. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::clearMediaPlayer): (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): (WebCore::HTMLMediaElement::setIsPlayingToWirelessTarget): (WebCore::HTMLMediaElement::dispatchEvent): * html/HTMLMediaElement.h: 2019-01-28 Ross Kirsling Remove unnecessary `using namespace WTF`s (or at least restrict their scope). https://bugs.webkit.org/show_bug.cgi?id=193941 Reviewed by Alex Christensen. * css/CSSBasicShapes.cpp: * css/CSSPrimitiveValue.cpp: * css/parser/CSSParser.cpp: * css/parser/CSSParserSelector.cpp: * css/parser/CSSPropertyParser.cpp: * dom/Document.cpp: * dom/EventListenerMap.cpp: * dom/EventTarget.cpp: * editing/Editor.cpp: * html/HTMLElement.cpp: * html/HTMLFontElement.cpp: * html/parser/HTMLTokenizer.cpp: * html/track/TrackBase.cpp: * loader/FTPDirectoryParser.cpp: * loader/TextResourceDecoder.cpp: * loader/cache/CachedResource.cpp: * page/ContextMenuController.cpp: * page/Navigator.cpp: * platform/Length.cpp: * platform/cocoa/KeyEventCocoa.mm: * platform/graphics/FontCascade.cpp: * platform/graphics/WidthIterator.cpp: * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: * platform/ios/KeyEventIOS.mm: * platform/mac/KeyEventMac.mm: * platform/network/HTTPParsers.cpp: * platform/text/TextCodecUTF8.cpp: * platform/text/TextEncodingRegistry.cpp: * platform/win/KeyEventWin.cpp: * rendering/BidiRun.cpp: * rendering/FloatingObjects.cpp: * rendering/RenderBlock.cpp: * rendering/RenderListMarker.cpp: * rendering/RenderText.cpp: 2019-01-28 Fujii Hironori [Win] WebCore/platform/Process.h is conflicting with process.h https://bugs.webkit.org/show_bug.cgi?id=193944 Reviewed by Ross Kirsling. Windows has process.h. Rename Process.h to ProcessIdentifier.h. No new tests because there is no behavior change. * Sources.txt: * UnifiedSources-input.xcfilelist: * WebCore.xcodeproj/project.pbxproj: * dom/MessagePortIdentifier.h: * dom/messageports/MessagePortChannel.h: * dom/messageports/MessagePortChannelProvider.h: * dom/messageports/MessagePortChannelRegistry.h: * history/BackForwardItemIdentifier.h: * page/GlobalWindowIdentifier.h: * platform/ProcessIdentifier.cpp: Renamed from Source/WebCore/platform/Process.cpp. (WebCore::Process::setIdentifier): (WebCore::Process::identifier): * platform/ProcessIdentifier.h: Renamed from Source/WebCore/platform/Process.h. 2019-01-28 Antoine Quint Implement capture for Pointer Events on iOS https://bugs.webkit.org/show_bug.cgi?id=193917 Reviewed by Dean Jackson. We add a new PointerCaptureController object which gets notified upon dispatch of pointer events to implement implicit pointer capture, dispatch the gotpointercapture and lostpointercaptiure events, and implement the Element APIs for pointer capture: hasPointerCapture(), setPointerCapture() and releasePointerCapture(). Tests: pointerevents/ios/pointer-events-implicit-capture-has-pointer-capture-in-pointer-down.html pointerevents/ios/pointer-events-implicit-capture-release-exception.html pointerevents/ios/pointer-events-implicit-capture-release.html pointerevents/ios/pointer-events-implicit-capture.html pointerevents/ios/pointer-events-set-pointer-capture-exceptions.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * dom/Element.cpp: (WebCore::Element::setPointerCapture): (WebCore::Element::releasePointerCapture): (WebCore::Element::hasPointerCapture): * dom/Element.h: * dom/Element.idl: * dom/EventNames.h: * dom/PointerEvent.h: * page/Page.cpp: (WebCore::Page::Page): * page/Page.h: (WebCore::Page::pointerCaptureController const): * page/PointerCaptureController.cpp: Added. (WebCore::PointerCaptureController::PointerCaptureController): (WebCore::PointerCaptureController::setPointerCapture): (WebCore::PointerCaptureController::releasePointerCapture): (WebCore::PointerCaptureController::hasPointerCapture): (WebCore::PointerCaptureController::pointerLockWasApplied): (WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier): (WebCore::PointerCaptureController::pointerEventWillBeDispatched): (WebCore::PointerCaptureController::pointerEventWasDispatched): (WebCore::PointerCaptureController::processPendingPointerCapture): * page/PointerCaptureController.h: Added. * page/PointerLockController.cpp: (WebCore::PointerLockController::requestPointerLock): * page/PointerLockController.h: 2019-01-28 Andy Estes [watchOS] Enable Parental Controls content filtering https://bugs.webkit.org/show_bug.cgi?id=193939 Reviewed by Ryosuke Niwa. * Configurations/FeatureDefines.xcconfig: 2019-01-28 Dean Jackson Produce "pen" Pointer Events if using a stylus (e.g. Apple Pencil) https://bugs.webkit.org/show_bug.cgi?id=193945 Reviewed by Antoine Quint. Calculate the pressure, tiltX and tiltY values for incoming Pointer Events, which have values when the PlatformTouchEvent originated from a stylus. Test: pointerevents/ios/pointer-events-dispatch-on-stylus.html * dom/PointerEvent.h: Default to "mouse". * dom/ios/PointerEventIOS.cpp: Calculate the values. 2019-01-28 Timothy Hatcher Make it easier for non-Apple ports to enable dark mode CSS support. https://bugs.webkit.org/show_bug.cgi?id=193882 Reviewed by Megan Gardner. * page/FrameView.cpp: (WebCore::FrameView::updateBackgroundRecursively): Limit use of system background color to the Mac platform. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::purgeCaches): Purge m_darkColorCache. (WebCore::RenderTheme::platformColorsDidChange): Reset m_darkColorCache. (WebCore::RenderTheme::colorCache const): Added m_darkColorCache. * rendering/RenderTheme.h: (WebCore::RenderTheme::colorCache const): Deleted. * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::purgeCaches): Removed m_darkColorCache. (WebCore::RenderThemeMac::platformColorsDidChange): Deleted. (WebCore::RenderThemeMac::colorCache const): Deleted. 2019-01-28 Simon Fraser svg/text/select-text-inside-non-static-position.html crashes under ScrollingStateTree::unparentChildrenAndDestroyNode() https://bugs.webkit.org/show_bug.cgi?id=193930 Reviewed by Tim Horton. ScrollingStateTree::unparentChildrenAndDestroyNode() should make a copy of the 'children' vector before iterating, since iteration mutates the array. Tested by ASan tests. * page/scrolling/ScrollingStateNode.h: (WebCore::ScrollingStateNode::takeChildren): * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode): 2019-01-28 Simon Fraser css3/filters/blur-filter-page-scroll-self.html crashes under WebCore::ScrollingStateNode::ScrollingStateNode https://bugs.webkit.org/show_bug.cgi?id=193925 Reviewed by Tim Horton. Some css3/filters/ tests disable accelerated compositing (which is crazy). Make these tests not crash by ensuring that unparentNode() and unparentChildrenAndDestroyNode() clears the root node if it's the node being unparented or destroyed. Tested by existing tests. * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::unparentNode): (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode): 2019-01-28 Daniel Bates [iOS] Make Window virtual key code computation match Mac https://bugs.webkit.org/show_bug.cgi?id=193452 Reviewed by Ryosuke Niwa. Use the same approach for computing the Windows virtual key code on iOS as we do on Mac for web compatibility. On Mac, we prefer to compute the Windows virtual key code from the input strings of the key event and use the key event's keycode as a last resort. Test: fast/events/ios/key-events-meta-alt-combinations.html * platform/ios/PlatformEventFactoryIOS.h: * platform/ios/PlatformEventFactoryIOS.mm: (WebCore::isKeypadEvent): Added. (WebCore::windowsKeyCodeForKeyEvent): Added. (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): Modified to call WebCore::windowsKeyCodeForKeyEvent() to compute the Windows virtual key code. 2019-01-28 Antoine Quint Limit user-agent interactions based on the touch-action property on iOS https://bugs.webkit.org/show_bug.cgi?id=193447 Unreviewed build fix. * dom/Element.cpp: (WebCore::parentCrossingFrameBoundaries): 2019-01-28 Eric Carlson AVStreamSession isn't always available, make a HAVE compile flag for it https://bugs.webkit.org/show_bug.cgi?id=193889 Reviewed by Jer Noble. No new tests, no functional change. * page/Settings.yaml: * page/SettingsBase.cpp: (WebCore::SettingsBase::platformDefaultMediaSourceEnabled): * page/SettingsBase.h: * page/cocoa/SettingsBaseCocoa.mm: (WebCore::SettingsBase::platformDefaultMediaSourceEnabled): * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm: (WebCore::CDMPrivateMediaSourceAVFObjC::createSession): * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h: * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged): Fix logging. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: Use a HashMap to associate CMSampleBuffer with SourceBufferPrivateAVFObjC. (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): isEqualTo -> isEqualToString. (WebCore::sourceBufferMap): (WebCore::nextMapID): (WebCore::bufferWasConsumedCallback): (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::append): (WebCore::SourceBufferPrivateAVFObjC::destroyParser): (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError): (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed): (-[WebBufferConsumedContext initWithParent:]): Deleted. (-[WebBufferConsumedContext parent]): Deleted. 2019-01-28 Rob Buis Update MIME type parser https://bugs.webkit.org/show_bug.cgi?id=180526 Reviewed by Frédéric Wang. I overlooked step 11.9.3 [1], for Mimesniff we should not bail out on missing subtype, but keep trying. Note that Rfc2045 does require bailing out, as before. Test: ParsedContentType unittest [1] https://mimesniff.spec.whatwg.org/#parse-a-mime-type * platform/network/ParsedContentType.cpp: (WebCore::parseToken): (WebCore::parseContentType): 2019-01-28 Michael Catanzaro Unreviewed follow-up to r240557, restore a call to makeString https://bugs.webkit.org/show_bug.cgi?id=192742 It works if we add this #include that was missing. I got confused by the error messages and missed that there were two similarly-named headers. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::logLayerInfo): 2019-01-28 Oriol Brufau [css-logical] Reject unitless length quirk in 'inset' shorthand https://bugs.webkit.org/show_bug.cgi?id=193773 Reviewed by Manuel Rego Casasnovas. Even though its longhands ('top', 'right', 'bottom', 'left') accept the unitless length quirk, the 'inset' shorthand is a new CSS property and should reject it. This was resolved by the CSS WG in https://github.com/w3c/csswg-drafts/issues/3525#issuecomment-456902648 Tests: imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-001.html imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-002.html imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-003.html imported/w3c/web-platform-tests/quirks/unitless-length/limited-quirks.html imported/w3c/web-platform-tests/quirks/unitless-length/no-quirks.html imported/w3c/web-platform-tests/quirks/unitless-length/quirks.html * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): 2019-01-28 Zalan Bujtas [LFC][MarginCollapsing][Quirks] Quirk margin values get propagated through margin collapsing https://bugs.webkit.org/show_bug.cgi?id=193896 Reviewed by Antti Koivisto. This patch implements quirk margin value collapsing. There are a few "quirk" rules when it comes to margin collapsing. 1. Collapsed quirk margin values are ignored on quirk containers

p elements have 1em vertical (top/bottom) quirk margin In quirk mode,

and (quirk container) collapses their vertical margins but

's quirk values(1qem -> 16px) are ignored. Used vertical margin values on the are top: 8px bottom: 8px. 2. Quirk margin values are turned into non-quirk values when collapsed with non-zero, non-quirk margins.

p elements have 1em vertical (top/bottom) quirk margin

When

's vertical margin collapses with the parent

, - the collapsed before value becomes 16px (max(1qem, 1px)) and this collapsed value is now considered as a non-quirk value - the collapsed after value stays 1qem quirk value. When
collapses with - the collapsed before value becomes 16px (max(16px, 8px)) - the
's quirk after value gets ignored and the collapsed after value stays 8px. Used vertical margin values on the are top: 16px (1em) bottom: 8px. * layout/MarginTypes.h: (WebCore::Layout::PositiveAndNegativeVerticalMargin::Values::isNonZero const): * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreCollapsedQuirkMargin): (WebCore::Layout::hasMarginBeforeQuirkValue): Deleted. (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore): Deleted. (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginAfter): Deleted. * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter): (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore): (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter): (WebCore::Layout::computedPositiveAndNegativeMargin): (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore): (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter): 2019-01-28 Zalan Bujtas [LFC][BFC] Remove redundant vertical positioning in BlockFormattingContext::computeFloatingPosition https://bugs.webkit.org/show_bug.cgi?id=193872 Reviewed by Antti Koivisto. This is taken care of by verticalPositionWithMargin() in BlockFormattingContext::computeHeightAndMargin(). * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const): 2019-01-28 cathie chen Add missing #include in ScrollingTreeFrameScrollingNode.cpp https://bugs.webkit.org/show_bug.cgi?id=193905 Reviewed by Frédéric Wang. * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: Add #include "ScrollingStateFrameScrollingNode.h" 2019-01-28 Zalan Bujtas [LFC][BFC][Quirk] Ignore collapsed(through) margin after when stretching body height. https://bugs.webkit.org/show_bug.cgi?id=193894 Reviewed by Antti Koivisto. * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight): 2019-01-28 Antoine Quint Limit user-agent interactions based on the touch-action property on iOS https://bugs.webkit.org/show_bug.cgi?id=193447 Reviewed by Antti Koivisto and Simon Fraser. We now compile a list of elements with a non-auto touch-action property that is updated whenever an element has its style changed or is removed from its document. When the content of that list changes, we inform the scrolling coordinator such that it can compile a list of TouchActionData structures which hold the touch-action value, the ID of the nearest scroll node and the Region containing the bounds of each of those elements to send it up to the UI process along with touch regions. Computing the list of allowed touch actions for a given element accounts for not only the value specified directly on that element's style, but also in its hierarchy, crossing any frame boundary towards the top-level document's root node. Tests: pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html pointerevents/ios/touch-action-none-on-iframe.html pointerevents/ios/touch-action-none-on-parent.html pointerevents/ios/touch-action-none.html pointerevents/ios/touch-action-pan-x-pan-y.html pointerevents/ios/touch-action-pan-x.html pointerevents/ios/touch-action-pan-y.html pointerevents/ios/touch-action-pinch-zoom-allows-zooming.html pointerevents/ios/touch-action-pinch-zoom-prevents-scrolling.html * WebCore.xcodeproj/project.pbxproj: Update how certain headers are exposed such that they can be used from WebKit. * dom/Document.cpp: (WebCore::Document::invalidateRenderingDependentRegions): (WebCore::Document::nodeWillBeRemoved): Ensure a node that is being removed from this document is no longer listed in its list of elements with a non-auto touch-action property. (WebCore::Document::absoluteEventRegionForNode): (WebCore::Document::absoluteRegionForEventTargets): (WebCore::Document::updateTouchActionElements): Create a list of elements with a non-auto touch-action property if one doesn't exist yet and update it to add the given element if it contains a non-auto touch-action, or remove it if it doesn't. If the contents of that list changed as a result, the scrolling coordinator is informed. * dom/Document.h: (WebCore::Document:: const): * dom/Element.cpp: (WebCore::parentCrossingFrameBoundaries): (WebCore::Element::computedTouchActions const): Provide the list of allowed touch actions accounting for the "touch-action" property specified on this element and all of its hierarchy, crossing frame boundary. (WebCore::Element::nearestScrollingNodeIDUsingTouchOverflowScrolling const): Provide the ScrollingNodeID, if any, for the nearest scrolling node for that element. This will allow the UI process to identify which scroll view's behavior to customize to reflect the element's allowed touch actions. * dom/Element.h: * page/scrolling/ScrollingCoordinator.cpp: (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const): Compute the region for all elements with a non-auto touch-action property throughout the provided frame and all of its subframes. * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollableAreaParameters::operator== const): Deleted. * page/scrolling/ScrollingCoordinatorTypes.h: Added. (WebCore::ScrollableAreaParameters::operator== const): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::touchActionDataAtPoint const): Query the list of TouchActionData objects for a match based on the provided point. Right now the logic is pretty crude, stopping at the first TouchActionData for which the region contains the provided point, but future patches will account for overlap and nesting. * page/scrolling/ScrollingTree.h: * page/scrolling/ScrollingTreeNode.h: * platform/EventTrackingRegions.cpp: (WebCore::operator==): * platform/EventTrackingRegions.h: (WebCore::operator!=): * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolveElement): Update the list of elements with a non-auto touch-action property when an element's style changes. 2019-01-27 Michael Catanzaro Unreviewed, fix WPE/GTK debug builds after r240557 https://bugs.webkit.org/show_bug.cgi?id=192742 Also fix an improper format string that was recently added in a different commit. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::logLayerInfo): (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): 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. 2019-01-27 Wenson Hsieh Remove a couple of PLATFORM defines intended for watchOS https://bugs.webkit.org/show_bug.cgi?id=193888 Reviewed by Alexey Proskuryakov. Remove the use of !PLATFORM(WATCH), since this is true on every platform. * editing/cocoa/DictionaryLookup.mm: 2019-01-27 Jiewen Tan Use a load optimizer for some sites https://bugs.webkit.org/show_bug.cgi?id=193881 Reviewed by Brent Fulgham. Expose FormData::flatten to be used by the load optimizer. * WebCore.xcodeproj/project.pbxproj: * platform/network/FormData.h: 2019-01-26 Simon Fraser Have composited RenderIFrame layers make FrameHosting scrolling tree nodes to parent the iframe's scrolling node https://bugs.webkit.org/show_bug.cgi?id=193879 Reviewed by Antti Koivisto. Currently we parent iframe scrolling tree nodes by finding the closest ancestor layer with a scrolling tree node. This results in scrolling tree nodes being connected across iframe boundaries in some arbitrary ancestor. This makes updating scrolling tree geometry very error-prone, since changes in the parent document will need to trigger updates of the scrolling tree node in an iframe. To address this, I already added a new "FrameHosting" scrolling node type. This patch actually instantiates these nodes, which are owned by the RenderIFrame's composited layer. Connecting across frame boundaries is theforefore simply a case of getting the FrameHosting node from the ownerElement's renderer; this is very similar to how we connect GraphicsLayers together. RenderLayerBacking gains another scrolling role for FrameHosting and ScrollingNodeID. Tested by existing tests. * page/FrameView.h: * rendering/RenderLayer.cpp: (WebCore::outputPaintOrderTreeRecursive): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateConfiguration): (WebCore::RenderLayerBacking::detachFromScrollingCoordinator): * rendering/RenderLayerCompositor.cpp: (WebCore::frameContentsRenderView): (WebCore::RenderLayerCompositor::frameContentsCompositor): (WebCore::RenderLayerCompositor::parentFrameContentLayers): (WebCore::RenderLayerCompositor::isLayerForIFrameWithScrollCoordinatedContents const): (WebCore::RenderLayerCompositor::detachRootLayer): (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers): (WebCore::scrollCoordinatedAncestorInParentOfFrame): (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): (WebCore::RenderLayerCompositor::attachScrollingNode): (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): * rendering/RenderLayerCompositor.h: * testing/Internals.cpp: (WebCore::Internals::scrollingStateTreeAsText const): 2019-01-27 Chris Fleizach AX: Introduce a static accessibility tree https://bugs.webkit.org/show_bug.cgi?id=193348 Reviewed by Ryosuke Niwa. In order to improve performance when requesting the accessibility hierarchy, we introduce the idea of a "static accessibility tree" which could be accessed on a different thread by assistive technologies. That is accomplished by storing all the data needed to answer accessibility attribute queries in a static object that mirrors the "live" AccessibilityObjects (which interact with both DOM and Render trees). These static objects are generally created after layout is done and final tasks are being performed. They are then stored in the static tree representation and able to be read from anywhere. Tactically this is done with AXIsolatedTreeNodes inside of an AXIsolatedTree. The TreeNodes implement an AccessibilityObjectInterface shared with AccessibilityObject. This allows the wrappers to access either one depending on conditions and platforms without significant code duplication or re-organization. * CMakeLists.txt: * Configurations/FeatureDefines.xcconfig: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::remove): (WebCore::AXObjectCache::createIsolatedAccessibilityTree): (WebCore::AXObjectCache::generateStaticAccessibilityTreeIfNeeded): * accessibility/AXObjectCache.h: * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: Added. * accessibility/isolatedtree: Added. * accessibility/isolatedtree/AXIsolatedTree.cpp: Added. (WebCore::AXIsolatedTree::treeCache): (WebCore::AXIsolatedTree::AXIsolatedTree): (WebCore::AXIsolatedTree::create): (WebCore::AXIsolatedTree::treeForID): (WebCore::AXIsolatedTree::treeForPageID): (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::removeNode): (WebCore::AXIsolatedTree::appendNodeChanges): (WebCore::AXIsolatedTree::applyPendingChanges): * accessibility/isolatedtree/AXIsolatedTree.h: Added. (WebCore::AXIsolatedTree::treeIdentifier const): * accessibility/isolatedtree/AXIsolatedTreeNode.cpp: Added. To note: we don't mark the attribute map const because even though attributes don't change after initial creation, we may copy an existing node and replace specific values. (WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode): (WebCore::AXIsolatedTreeNode::create): (WebCore::AXIsolatedTreeNode::initializeAttributeData): (WebCore::AXIsolatedTreeNode::setProperty): (WebCore::AXIsolatedTreeNode::doubleAttributeValue const): (WebCore::AXIsolatedTreeNode::unsignedAttributeValue const): (WebCore::AXIsolatedTreeNode::boolAttributeValue const): (WebCore::AXIsolatedTreeNode::stringAttributeValue const): (WebCore::AXIsolatedTreeNode::intAttributeValue const): * accessibility/isolatedtree/AXIsolatedTreeNode.h: Added. * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::associateIsolatedTreeNode): * accessibility/mac/WebAccessibilityObjectWrapperBase.h: * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase initWithAccessibilityObject:]): (-[WebAccessibilityObjectWrapperBase isolatedTreeNode]): (-[WebAccessibilityObjectWrapperBase detach]): (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]): (-[WebAccessibilityObjectWrapperBase axBackingObject]): (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper role]): (-[WebAccessibilityObjectWrapper subrole]): (-[WebAccessibilityObjectWrapper roleDescription]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): * dom/Document.cpp: (WebCore::Document::pageID const): * dom/Document.h: 2019-01-26 Simon Fraser Allow scrolling tree nodes to exist in a detached state https://bugs.webkit.org/show_bug.cgi?id=193754 Reviewed by Zalan Bujtas. One of the (questionable?) design decisions of the scrolling tree is that the tree implementation is hidden behind the ScrollingCoordinator interface. That interface only allowed nodes to exist in a connected state; attachToStateTree() required a non-zero parent for any node that was not the root. This makes it impossible to coordinate the hookup of the scrolling tree across frame boundaries; the scrolling tree has to have been fully constructed in ancestor frames before subframe nodes can be attached. This is a significant difference from compositing, where a subframe can create GraphicsLayers which don't have to be parented right away, and actually get parented later via a compositing update in the parent frame. We want to be able to hook up the scrolling tree via the same code paths as GraphicsLayer connection (anything else is too confusing). So we need to be able to instantiate scrolling tree nodes in a disconnected state, and attach them later. To achieve this, add the notion of "unparented" nodes to ScrollingCoordinator and the ScrollingStateTree. Allow clients to create unparented nodes, which can be attached later. ScrollingCoordinator stores the roots of unparented subtrees in an owning HashMap. Nodes in unparented trees are still referenced by m_stateNodeMap, so it's possible to find them and set state on them. Clean up the ScrollingCoordinator interface to remove "state tree" terminology; the state vs. scrolling tree is really an implementation detail. This also removes the special-casing of ScrollingNodeType::Subframe nodes which ScrollingStateTree stored in m_orphanedSubframeNodes; now the unparenting is controlled by the client. Currently no code creates unparented nodes so there is no behavior change. * dom/Document.cpp: (WebCore::Document::setPageCacheState): * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::createNode): (WebCore::AsyncScrollingCoordinator::insertNode): (WebCore::AsyncScrollingCoordinator::unparentNode): (WebCore::AsyncScrollingCoordinator::unparentChildrenAndDestroyNode): (WebCore::AsyncScrollingCoordinator::detachAndDestroySubtree): (WebCore::AsyncScrollingCoordinator::clearAllNodes): (WebCore::AsyncScrollingCoordinator::parentOfNode const): (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView): (WebCore::AsyncScrollingCoordinator::attachToStateTree): Deleted. (WebCore::AsyncScrollingCoordinator::detachFromStateTree): Deleted. (WebCore::AsyncScrollingCoordinator::clearStateTree): Deleted. * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::handleWheelEvent): (WebCore::ScrollingCoordinator::createNode): (WebCore::ScrollingCoordinator::insertNode): (WebCore::ScrollingCoordinator::unparentNode): (WebCore::ScrollingCoordinator::unparentChildrenAndDestroyNode): (WebCore::ScrollingCoordinator::detachAndDestroySubtree): (WebCore::ScrollingCoordinator::clearAllNodes): (WebCore::ScrollingCoordinator::parentOfNode const): (WebCore::ScrollingCoordinator::childrenOfNode const): (WebCore::ScrollingCoordinator::attachToStateTree): Deleted. (WebCore::ScrollingCoordinator::detachFromStateTree): Deleted. (WebCore::ScrollingCoordinator::clearStateTree): Deleted. * page/scrolling/ScrollingStateNode.cpp: (WebCore::ScrollingStateNode::removeFromParent): (WebCore::ScrollingStateNode::removeChild): * page/scrolling/ScrollingStateNode.h: * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::ScrollingStateTree): (WebCore::ScrollingStateTree::createUnparentedNode): (WebCore::ScrollingStateTree::insertNode): (WebCore::ScrollingStateTree::unparentNode): (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode): (WebCore::ScrollingStateTree::detachAndDestroySubtree): (WebCore::ScrollingStateTree::clear): (WebCore::ScrollingStateTree::commit): (WebCore::ScrollingStateTree::removeNodeAndAllDescendants): (WebCore::ScrollingStateTree::recursiveNodeWillBeRemoved): (showScrollingStateTree): (WebCore::ScrollingStateTree::attachNode): Deleted. (WebCore::ScrollingStateTree::detachNode): Deleted. * page/scrolling/ScrollingStateTree.h: (WebCore::ScrollingStateTree::nodeCount const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::detachFromScrollingCoordinator): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): (WebCore::RenderLayerCompositor::attachScrollingNode): 2019-01-26 Devin Rousso Web Inspector: provide a way to edit the user agent of a remote target https://bugs.webkit.org/show_bug.cgi?id=193862 Reviewed by Joseph Pecoraro. Test: inspector/page/overrideUserAgent.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::userAgent const): (WebCore::FrameLoader::userAgentForJavaScript const): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::applyUserAgentOverride): Added. * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::applyUserAgentOverrideImpl): Added. * inspector/agents/InspectorPageAgent.h: * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::disable): (WebCore::InspectorPageAgent::overrideUserAgent): Added. (WebCore::InspectorPageAgent::applyUserAgentOverride): Added. 2019-01-26 Zalan Bujtas [LFC] The initial values for top/bottom in contentHeightForFormattingContextRoot should not be 0. https://bugs.webkit.org/show_bug.cgi?id=193867 Reviewed by Antti Koivisto. The initial content top/bottom value is the border top + padding top. This is only a problem when the box has float children only. While computing the height using the bottom-most float, we call "top = std::min(floatTop, top)". With 0 initial top value, this returns an incorrect result when the box has (top)border/padding. Test: fast/block/block-only/abs-pos-with-border-padding-and-float-child.html * layout/FormattingContextGeometry.cpp: (WebCore::Layout::contentHeightForFormattingContextRoot): 2019-01-26 Zalan Bujtas [LFC][BFC] Ignore last inflow child's collapsed through margin after when computing containing block's height. https://bugs.webkit.org/show_bug.cgi?id=193865 Reviewed by Antti Koivisto. Height computation -> // 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible' // ...the bottom edge of the bottom (possibly collapsed) margin of its last in-flow child, if the child's bottom // margin does not collapse with the element's bottom margin
When the child vertical margins collapse through (margin-top = margin-bottom = 100px), the bottom edge of the bottom margin is the same as the bottom edge of the top margin which is alredy taken into use while positioning so technically the bottom margin value should be ignored. Test: fast/block/margin-collapse/collapsed-through-child-simple.html * layout/MarginTypes.h: (WebCore::Layout::UsedVerticalMargin::isCollapsedThrough const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::hasCollapsedThroughMargin const): 2019-01-26 Zalan Bujtas [LFC][BFC][MarginCollapsing] marginAfterCollapsesWithParentMarginAfter/marginAfterCollapsesWithLastInFlowChildMarginAfter should check for border/padding after values. https://bugs.webkit.org/show_bug.cgi?id=193864 Reviewed by Antti Koivisto. * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter): (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter): 2019-01-26 Zalan Bujtas [LFC] Box::nextInFlowOrFloatingSibling() should always return sibling floats as well. https://bugs.webkit.org/show_bug.cgi?id=193855 Reviewed by Antti Koivisto. Use iterative algorithm to find next/previous siblings. * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::nextInFlowOrFloatingSibling const): 2019-01-25 Ryosuke Niwa Need a mechanism to override navigator.userAgent https://bugs.webkit.org/show_bug.cgi?id=193762 Reviewed by Brent Fulgham. Added the ability to specify user agent string just for navigator.userAgent via DocumentLoader. * loader/DocumentLoader.h: (WebCore::DocumentLoader::setCustomJavaScriptUserAgent): (WebCore::DocumentLoader::customJavaScriptUserAgent const): * loader/FrameLoader.cpp: (WebCore::FrameLoader::userAgentForJavaScript const): * loader/FrameLoader.h: * page/Navigator.cpp: (WebCore::Navigator::userAgent const): 2019-01-25 Devin Rousso Web Inspector: provide a way to edit page settings on a remote target https://bugs.webkit.org/show_bug.cgi?id=193813 Reviewed by Joseph Pecoraro. Test: inspector/page/overrideSetting.html * page/Settings.yaml: * Scripts/GenerateSettings.rb: * Scripts/SettingsTemplates/Settings.cpp.erb: * Scripts/SettingsTemplates/Settings.h.erb: Add support for an `inspectorOverride` boolean value for each setting that will take precedence over the actual `Setting`'s value when set. * inspector/agents/InspectorPageAgent.h: * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::disable): (WebCore::InspectorPageAgent::overrideSetting): Added. * inspector/InspectorFrontendHost.idl: * inspector/InspectorFrontendHost.h: * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::isRemote const): Added. * inspector/InspectorFrontendClient.h: (WebCore::InspectorFrontendClient::isRemote const): Added. * inspector/InspectorFrontendClientLocal.h: (WebCore::InspectorFrontendClientLocal::isRemote const): Added. 2019-01-25 Wenson Hsieh Document::updateMainArticleElementAfterLayout() should be a no-op when no client depends on knowing the main article element https://bugs.webkit.org/show_bug.cgi?id=193843 Reviewed by Zalan Bujtas. * dom/Document.cpp: (WebCore::Document::updateMainArticleElementAfterLayout): This function currently does a bit of wasted work after every layout, on clients that don't listen to the "significant rendered text" layout milestone and therefore don't need to guess the main article element. Simply don't bother keeping the main article element up to date in this scenario by bailing from FrameView::updateHasReachedSignificantRenderedTextThreshold if the client doesn't care about the significant rendered text milestone. * page/FrameView.cpp: (WebCore::FrameView::updateHasReachedSignificantRenderedTextThreshold): 2019-01-25 Jer Noble