2017-05-11 Chris Dumez Drop custom bindings code for HTMLFormControlsCollection's named property getter https://bugs.webkit.org/show_bug.cgi?id=171964 Reviewed by Sam Weinig. Drop custom bindings code for HTMLFormControlsCollection's named property getter as we are able to generate it. No new tests, no expected Web-facing behavior change. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/JSHTMLFormControlsCollectionCustom.cpp: Removed. * bindings/scripts/CodeGeneratorJS.pm: (GenerateNamedGetter): * html/HTMLFormControlsCollection.cpp: (WebCore::HTMLFormControlsCollection::namedItemOrItems): * html/HTMLFormControlsCollection.h: * html/HTMLFormControlsCollection.idl: 2017-05-10 Eric Carlson [MediaStream] CoreAudioCaptureSource claims to never be muted https://bugs.webkit.org/show_bug.cgi?id=171946 Reviewed by Jer Noble. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::stopProducingData): Set m_muted to true. 2017-05-10 Jer Noble RELEASE_ASSERT at WebAudioSourceProviderAVFObjC::provideInput() https://bugs.webkit.org/show_bug.cgi?id=171711 Reviewed by Youenn Fablet. Before iterating over the channels in either the WebAudioBufferList or the AudioBus, ensure we don't walk over the end of either by only iterating over the minimum length of either. Also, when the internal format of WebAudioSourceProviderAVFObjC changes, notify the MediaStreamAudioSourceNode that the number of channels and sample rate have changed. * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm: (WebCore::WebAudioSourceProviderAVFObjC::provideInput): (WebCore::WebAudioSourceProviderAVFObjC::prepare): 2017-05-10 Andy Estes REGRESSION (r167845): ASSERT(!m_renderView.needsLayout()) in svg/custom/bug79798.html https://bugs.webkit.org/show_bug.cgi?id=132297 Reviewed by Simon Fraser. We don't know why m_renderView needs layout in this case, but we know that we don't need to assert if the client hasn't set the ScrollableInnerFrameTrigger compositing trigger. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame): 2017-05-10 Ryan Haddad Unreviewed, rolling out r216630. This change caused assertion failures with webrtc LayoutTests. Reverted changeset: "RELEASE_ASSERT at WebAudioSourceProviderAVFObjC::provideInput()" https://bugs.webkit.org/show_bug.cgi?id=171711 http://trac.webkit.org/changeset/216630 2017-05-09 Sam Weinig Remove support for legacy Notifications https://bugs.webkit.org/show_bug.cgi?id=171487 Reviewed by Jon Lee. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: Remove files. * Configurations/FeatureDefines.xcconfig: Remove definition of ENABLE_LEGACY_NOTIFICATIONS. * DerivedSources.make: Remove IDL files. * Modules/notifications/DOMWindowNotifications.cpp: Removed. * Modules/notifications/DOMWindowNotifications.h: Removed. * Modules/notifications/DOMWindowNotifications.idl: Removed. * Modules/notifications/NotificationCenter.cpp: Removed. * Modules/notifications/NotificationCenter.h: Removed. * Modules/notifications/NotificationCenter.idl: Removed. * Modules/notifications/NotificationClient.h: * Modules/notifications/NotificationController.cpp: * Modules/notifications/NotificationController.h: * Modules/notifications/WorkerGlobalScopeNotifications.cpp: Removed. * Modules/notifications/WorkerGlobalScopeNotifications.h: Removed. * Modules/notifications/WorkerGlobalScopeNotifications.idl: Removed. * Modules/notifications/Notification.idl: * Modules/notifications/Notification.cpp: * Modules/notifications/Notification.h: * dom/EventTargetFactory.in: * page/DOMWindow.cpp: * workers/WorkerThread.h: Remove code legacy Notification code. Replace use of NotificationCenter with direct calls to the NotificationClient. 2017-05-10 Commit Queue Unreviewed, rolling out r216635. https://bugs.webkit.org/show_bug.cgi?id=171953 "Some worker tests are failing". (Requested by mlam on #webkit). Reverted changeset: "WorkerThread::stop() should call scheduleExecutionTermination() last." https://bugs.webkit.org/show_bug.cgi?id=171775 http://trac.webkit.org/changeset/216635 2017-05-10 Mark Lam WorkerThread::stop() should call scheduleExecutionTermination() last. https://bugs.webkit.org/show_bug.cgi?id=171775 Reviewed by Geoffrey Garen. Currently, WorkerThread::stop() calls scheduleExecutionTermination() to terminate JS execution first, followed by posting a cleanup task to the worker, and lastly, it invokes terminate() on the WorkerRunLoop. As a result, before run loop is terminate, the worker thread may observe the TerminatedExecutionException in JS code, bail out, see another JS task to run, re-enters the VM to run said JS code, and fails with an assertion due to the TerminatedExecutionException still being pending on VM entry. WorkerRunLoop::Task::performTask() already has a check to only allow a task to run if and only if !runLoop.terminated() and the task is not a clean up task. We'll fix the above race by ensuring that having WorkerThread::stop() terminate the run loop before it scheduleExecutionTermination() which throws the TerminatedExecutionException. This way, by the time JS code unwinds out of the VM due to the TerminatedExecutionException, runLoop.terminated() is guaranteed to be true and thereby prevents re-entry into the VM. This issue is covered by an existing test that I just unskipped in TestExpectations. * bindings/js/JSDOMPromiseDeferred.cpp: (WebCore::DeferredPromise::callFunction): * workers/WorkerThread.cpp: (WebCore::WorkerThread::stop): 2017-05-10 Tim Horton Add an experimental feature flag for viewport-fit https://bugs.webkit.org/show_bug.cgi?id=171948 Reviewed by Simon Fraser. * dom/ViewportArguments.cpp: (WebCore::setViewportFeature): * page/Settings.in: Disable parsing of viewport-fit if the experimental feature is disabled. 2017-05-10 Chris Dumez Simplify relationship between Attr and Element now that Attr is childless https://bugs.webkit.org/show_bug.cgi?id=171909 Reviewed by Ryosuke Niwa. Simplify relationship between Attr and Element now that Attr is childless after r216259. No new tests, no Web facing behavior change. * dom/Attr.cpp: (WebCore::Attr::setValue): Attr::setValue() was only called by Element::setAttributeInternal() to make sure we updated the Attr node's Text child. However, now that Attr has no Text child, Element no longer needs to update the Attr node's value. Attr::setValueForBindings() was thus renamed to setValue(). Its implementation was also simplified by calling Element::setAttribute() on its ownerElement, if it has one, instead of duplicating a bunch of code from Element::setAttributeInternal(). (WebCore::Attr::setNodeValue): Call setValue() instead of setValueForBindings() now that it has been renamed. * dom/Attr.h: * dom/Attr.idl: Rename valueForBindings / setValueForBindings to value / setValue. * dom/Document.h: Split shouldInvalidateNodeListAndCollectionCaches() into 2 methods, one taking an Attr name and another that does not. There are now 2 calls sites instead of one, so we no longer need to branch in this function. * dom/Element.cpp: (WebCore::Element::setAttributeInternal): Drop code calling Attr::setValue() on the Attr node since Attr::setValue() was only duplicating logic from Element::setAttributeInternal() after r216259. There is nothing on Attr that needs updating when an element attribute gets updated. (WebCore::Element::attributeChanged): Call the new invalidateNodeListAndCollectionCachesInAncestorsForAttribute(). This is the only call site that passes an attribute name. * dom/Node.cpp: (WebCore::Document::shouldInvalidateNodeListAndCollectionCaches): (WebCore::Document::shouldInvalidateNodeListAndCollectionCachesForAttribute): Split into 2 to avoid branching, as explained above. (WebCore::Node::invalidateNodeListAndCollectionCachesInAncestors): (WebCore::Node::invalidateNodeListAndCollectionCachesInAncestorsForAttribute): - invalidateNodeListAndCollectionCachesInAncestors() used to invalidate childNodeLists if the Node was an attribute node. Drop this as this is no longer needed as of r216259. - After the change to Attr::setValue(), call sites for invalidateNodeListAndCollectionCachesInAncestors() either had no parameters, or both parameters present and non-null. There is therefore no longer any need to handle having an attrName but no attributeOwnerElement. To make this obvious, I split this into 2 methods: invalidateNodeListAndCollectionCachesInAncestors() and invalidateNodeListAndCollectionCachesInAncestorsForAttribute(attrName). We no longer need the attributeOwnerElement parameter as it was only used to exit early. * dom/Node.h: 2017-05-10 Antti Koivisto REGRESSION (r207372) Visibility property is not inherited when used in an animation https://bugs.webkit.org/show_bug.cgi?id=171883 Reviewed by Simon Fraser. The problem here is that our animation code is tied to renderers. We don't have renderers during the initial style resolution so animations are not applied yet. When constructing renderers we set their style to the initial animated style but this step can't implement inheritance. Normally this is invisible as the first animation frame will immediately inherit the style correctly. However in this case the animation is discrete and the first frame is the same as the initial state. With r207372 we optimize the descendant style change away. This patch fixes the problem by tracking that the renderer has initial animated style and inheriting it to descendants during next style resolution even if it doesn't change. Test: animations/animation-initial-inheritance.html * rendering/RenderElement.cpp: (WebCore::RenderElement::RenderElement): * rendering/RenderElement.h: (WebCore::RenderElement::hasInitialAnimatedStyle): (WebCore::RenderElement::setHasInitialAnimatedStyle): * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::createRenderer): Set a bit on renderer indicating it has initial animated style. * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::createAnimatedElementUpdate): Return at least 'Inherit' for style change when updating renderer with initial animated style. 2017-05-10 Jer Noble RELEASE_ASSERT at WebAudioSourceProviderAVFObjC::provideInput() https://bugs.webkit.org/show_bug.cgi?id=171711 Reviewed by Youenn Fablet. Before iterating over the channels in either the WebAudioBufferList or the AudioBus, ensure we don't walk over the end of either by only iterating over the minimum length of either. Also, when the internal format of WebAudioSourceProviderAVFObjC changes, notify the MediaStreamAudioSourceNode that the number of channels and sample rate have changed. * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm: (WebCore::WebAudioSourceProviderAVFObjC::provideInput): (WebCore::WebAudioSourceProviderAVFObjC::prepare): 2017-05-04 Filip Pizlo GCController.cpp's collect() should be Async https://bugs.webkit.org/show_bug.cgi?id=171708 Reviewed by Saam Barati and Geoffrey Garen. No new tests because no change in behavior. This is one step towards not requesting sync GCs in WebCore. I'm landing this incrementally to make bisecting super easy. This is a ~7% JetStream iOS "regression", because JetStream has a bug where it allows trunk to sneakily hide GC work between when JetStream measures time. After this change, we are no longer trying to be sneaky. * bindings/js/GCController.cpp: (WebCore::collect): 2017-05-10 Jer Noble CoreAudioCaptureSource reports 3 or 5 channel audio output; actually only mono https://bugs.webkit.org/show_bug.cgi?id=171940 Reviewed by Eric Carlson. Asking for the Input VPIO stream format will return the internal mic format, before processing. Instead ask for the input bus's output format, which is post processing, which will return the correct number of channels (one). * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioSharedUnit::configureMicrophoneProc): 2017-05-10 Ryan Haddad Unreviewed, rolling out r216591. This change broke an internal build. Reverted changeset: "REGRESSION (r207372) Visibility property is not inherited when used in an animation" https://bugs.webkit.org/show_bug.cgi?id=171883 http://trac.webkit.org/changeset/216591 2017-05-10 Chris Dumez Drop custom bindings code now window.open() https://bugs.webkit.org/show_bug.cgi?id=171933 Reviewed by Geoffrey Garen. Drop custom bindings code now window.open() as it is not doing anything special. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::open): Deleted. * page/DOMWindow.cpp: (WebCore::DOMWindow::open): * page/DOMWindow.h: * page/DOMWindow.idl: * testing/Internals.cpp: (WebCore::Internals::openDummyInspectorFrontend): 2017-05-10 Tim Horton Add an experimental feature flag for constant properties https://bugs.webkit.org/show_bug.cgi?id=171913 Reviewed by Ryosuke Niwa. * css/parser/CSSParser.cpp: (WebCore::CSSParserContext::CSSParserContext): (WebCore::operator==): * css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::consumeCustomPropertyValue): * css/parser/CSSParserMode.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseValueStart): * css/parser/CSSVariableParser.cpp: (WebCore::classifyBlock): (WebCore::isValidVariableReference): (WebCore::isValidConstantReference): (WebCore::classifyVariableRange): (WebCore::CSSVariableParser::containsValidVariableReferences): (WebCore::CSSVariableParser::parseDeclarationValue): * css/parser/CSSVariableParser.h: Plumb the experimental feature flag down into CSSVariableParser by way of CSSParserContext. * page/Settings.in: 2017-05-10 Chris Dumez REGRESSION (r206960): Possible null pointer dereference under DOMSelection::getRangeAt() https://bugs.webkit.org/show_bug.cgi?id=171925 Reviewed by Wenson Hsieh. We have evidence that selection().firstRange() can return null in DOMSelection::getRangeAt(). When this happens, we now throw an INDEX_SIZE_ERR instead of dereferencing it. I believe this can happen if the VisibleSelection is orphaned but not none, because rangeCount() only checks for isNone() but VisibleSelection::firstRange() can return null if isNoneOrOrphaned(). No new tests, I do not know how to reproduce. * page/DOMSelection.cpp: (WebCore::DOMSelection::getRangeAt): 2017-05-10 Matt Rajca DumpRenderTree crashed in com.apple.WebCore: std::optional::operator-> + 71 :: CRASHING TEST: fullscreen/video-controls-timeline.html https://bugs.webkit.org/show_bug.cgi?id=171932 Reviewed by Eric Carlson. Explicitly initialize m_playbackWithoutUserGesture to "None". * html/HTMLMediaElement.h: 2017-05-10 Andy Estes Keyboard input suppression should extend to subframes https://bugs.webkit.org/show_bug.cgi?id=171880 Reviewed by Ryosuke Niwa. Test: http/tests/navigation/keyboard-events-during-provisional-subframe-navigation.html * dom/EventDispatcher.cpp: (WebCore::shouldSuppressEventDispatchInDOM): Changed to call shouldSuppressKeyboardInput() on the main frame's loader. * editing/Editor.cpp: (WebCore::Editor::shouldInsertText): Ditto. 2017-05-10 Matt Lewis Unreviewed, rolling out r216563. Revision caused 2 api failures Reverted changeset: "[MediaStream] deviceId constraint doesn't work with getUserMedia" https://bugs.webkit.org/show_bug.cgi?id=171877 http://trac.webkit.org/changeset/216563 2017-05-10 Frederic Wang Refactor ScrollingCoordinator::setSynchronousScrollingReasons to accept a FrameView https://bugs.webkit.org/show_bug.cgi?id=171923 Reviewed by Simon Fraser. Currently ScrollingCoordinator::setSynchronousScrollingReasons implementations assumes SynchronousScrollingReasons apply to the main frame. This commit allows to specify a FrameView in order to prepare support for fast scrolling of frames. No new tests, no behavior changes. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons): Use the FrameView to find the state node. (WebCore::AsyncScrollingCoordinator::updateScrollLayerPosition): Rename this function updateMainFrameScrollLayerPosition and use the specified FrameView. * page/scrolling/AsyncScrollingCoordinator.h: Add FrameView parameter. * page/scrolling/ScrollingCoordinator.cpp: (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons): Remove the const since AsyncScrollingCoordinator uses scrollLayerForFrameView. Pass the frameView to setSynchronousScrollingReasons. * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::setSynchronousScrollingReasons): Add FrameView parameter. 2017-05-10 Antti Koivisto REGRESSION (r207372) Visibility property is not inherited when used in an animation https://bugs.webkit.org/show_bug.cgi?id=171883 Reviewed by Simon Fraser. The problem here is that our animation code is tied to renderers. We don't have renderers during the initial style resolution so animations are not applied yet. When constructing renderers we set their style to the initial animated style but this step can't implement inheritance. Normally this is invisible as the first animation frame will immediately inherit the style correctly. However in this case the animation is discrete and the first frame is the same as the initial state. With r207372 we optimize the descendant style change away. This patch fixes the problem by tracking that the renderer has initial animated style and inheriting it to descendants during next style resolution even if it doesn't change. Test: animations/animation-initial-inheritance.html * rendering/RenderElement.cpp: (WebCore::RenderElement::RenderElement): * rendering/RenderElement.h: (WebCore::RenderElement::hasInitialAnimatedStyle): (WebCore::RenderElement::setHasInitialAnimatedStyle): * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::createRenderer): Set a bit on renderer indicating it has initial animated style. * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::createAnimatedElementUpdate): Return at least 'Inherit' for style change when updating renderer with initial animated style. 2017-05-10 Myles C. Maxfield Tiny cleanup in Font::DerivedFonts https://bugs.webkit.org/show_bug.cgi?id=171893 Reviewed by Jon Lee. This variable was written to but never read. No new tests because there is no behavior change. * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::font): * platform/graphics/Font.cpp: (WebCore::Font::verticalRightOrientationFont): (WebCore::Font::uprightOrientationFont): (WebCore::Font::smallCapsFont): (WebCore::Font::noSynthesizableFeaturesFont): (WebCore::Font::emphasisMarkFont): (WebCore::Font::brokenIdeographFont): (WebCore::Font::DerivedFonts::~DerivedFonts): Deleted. * platform/graphics/Font.h: (WebCore::Font::DerivedFonts::DerivedFonts): Deleted. 2017-05-10 Michael Catanzaro Remove user agent quirk for Slack https://bugs.webkit.org/show_bug.cgi?id=171869 Reviewed by Carlos Garcia Campos. The user agent quirk for Slack does not seem to be necessary anymore. I am able to use Slack without difficulty using our default user agent. * platform/UserAgentQuirks.cpp: (WebCore::urlRequiresChromeBrowser): 2017-05-10 Hyungwook Lee [GTK] Fix compile warnings in CryptoKeyECGCrypt.cpp https://bugs.webkit.org/show_bug.cgi?id=171851 Reviewed by Alex Christensen. * crypto/gcrypt/CryptoKeyECGCrypt.cpp: (WebCore::curveSize): (WebCore::curveName): (WebCore::uncompressedPointSizeForCurve): (WebCore::uncompressedFieldElementSizeForCurve): 2017-05-08 Sergio Villar Senin [css-grid] Remove Blink-specific code for handling orthogonal grid items https://bugs.webkit.org/show_bug.cgi?id=171807 Reviewed by Darin Adler. This code was added in r203252 as part of a patch improving the handling of {min|max}-content with orthogonal flows. The original code came from Blink which performs a pre-layout of orthogonal boxes in FrameView. That is not true in the case of WebKit so we do not need this code at all. Actually it was causing incorrect renderings in some tests. I'm also removing an invalid return statement just after another return. * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild): (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild): 2017-05-09 Zan Dobersek Unreviewed build fix. * platform/wpe/WidgetWPE.cpp: (WebCore::Widget::paint): Add the missing SecurityOriginPaintPolicy parameter. 2017-05-09 Eric Carlson [MediaStream] deviceId constraint doesn't work with getUserMedia https://bugs.webkit.org/show_bug.cgi?id=171877 Reviewed by Jer Noble. Test: fast/mediastream/get-user-media-device-id.html * Modules/mediastream/MediaConstraintsImpl.h: (WebCore::MediaConstraintsData::MediaConstraintsData): Add a constructor that takes a const MediaConstraints&. * Modules/mediastream/MediaDevicesEnumerationRequest.cpp: (WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin): Don't return NULL for the main frame so the origin matches that returned for a UserMediaRequest. * Modules/mediastream/UserMediaController.h: (WebCore::UserMediaController::setDeviceIDHashSalt): Deleted, not used. (WebCore::UserMediaController::deviceIDHashSalt): Deleted, not used. * Modules/mediastream/UserMediaRequest.cpp: (WebCore::UserMediaRequest::allow): Add device ID hash salt parameter, set it on constraints. * Modules/mediastream/UserMediaRequest.h: * platform/mediastream/MediaConstraints.h: * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::fitnessDistance): ASSERT if called for DeviceId. (WebCore::RealtimeMediaSource::selectSettings): Special case DeviceId because it we have to hash the device ID before comparing, and because the DeviceId can't be changed so it should never be added to the flattened constraints. * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp: (WebCore::RealtimeMediaSourceSupportedConstraints::nameForConstraint): Deleted, unused. (WebCore::RealtimeMediaSourceSupportedConstraints::constraintFromName): Deleted, unused. * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: (WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints): Pass device id, not empty string. 2017-05-09 Jeremy Jones Video fullscreen window level should be below status bar. https://bugs.webkit.org/show_bug.cgi?id=171892 rdar://problem/31771707 Reviewed by Jer Noble. No new tests because it only affects platform window level. Move the fullscreen window below the status bar, but above the input field window level. * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: (WebVideoFullscreenInterfaceAVKit::setupFullscreen): 2017-05-09 Sam Weinig Implement Subresource Integrity (SRI) [Part 2 - Fetch] https://bugs.webkit.org/show_bug.cgi?id=148363 Reviewed by Youenn Fablet. Tests: http/tests/subresource-integrity/sri-fetch-worker.html http/tests/subresource-integrity/sri-fetch.html * loader/FetchOptions.h: * loader/ThreadableLoader.cpp: (WebCore::ThreadableLoaderOptions::isolatedCopy): * loader/ThreadableLoader.h: * loader/WorkerThreadableLoader.cpp: (WebCore::LoaderTaskOptions::LoaderTaskOptions): Add integrity metadata to the fetch options, and fix the implementation of ThreadableLoaderOptions::isolatedCopy to work correctly (it was missing isolated copy derivedCachedDataTypesToRetrieve). * Modules/fetch/FetchRequest.cpp: (WebCore::buildOptions): (WebCore::FetchRequest::initializeOptions): * Modules/fetch/FetchRequest.h: Switch to using the integrity metadata on the fetchOptions, removing the need to store them directly on the internal request. * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): (WebCore::DocumentThreadableLoader::didReceiveResponse): (WebCore::DocumentThreadableLoader::didReceiveData): (WebCore::DocumentThreadableLoader::didFinishLoading): (WebCore::DocumentThreadableLoader::loadRequest): (WebCore::DocumentThreadableLoader::reportIntegrityMetadataError): * loader/DocumentThreadableLoader.h: Add a new flag, m_delayCallbacksForIntegrityCheck, which is used when integrity metadata is present, so we can implement the 'wait' concept from the fetch spec, and delay informing the clients until we have validated the integrity metadata. 2017-05-09 Commit Queue Unreviewed, rolling out r216545. https://bugs.webkit.org/show_bug.cgi?id=171889 Caused a test failure (Requested by eric_carlson on #webkit). Reverted changeset: "[MediaStream] deviceId constraint doesn't work with getUserMedia" https://bugs.webkit.org/show_bug.cgi?id=171877 http://trac.webkit.org/changeset/216545 2017-05-09 Zalan Bujtas resetFlowThreadContainingBlockAndChildInfoIncludingDescendants should not ignore RenderElement subtrees. https://bugs.webkit.org/show_bug.cgi?id=171873 Reviewed by Simon Fraser. Normally a RenderBlock's parent is another RenderBlock, but In some cases (e.g. tables) a RenderBlock can have a non-RenderBlock(RenderBox) ancestor. While updating the flow thread state on a subtree, we should descent into subtrees with RenderElement roots and not just RenderBlocks so that we clear the state on the entire subtree. Test: fast/multicol/crash-when-column-inside-table.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::resetFlowThreadContainingBlockAndChildInfoIncludingDescendants): * rendering/RenderBlock.h: * rendering/RenderElement.cpp: (WebCore::RenderElement::resetFlowThreadContainingBlockAndChildInfoIncludingDescendants): * rendering/RenderElement.h: 2017-05-09 Eric Carlson [MediaStream] deviceId constraint doesn't work with getUserMedia https://bugs.webkit.org/show_bug.cgi?id=171877 Reviewed by Jer Noble. Test: fast/mediastream/get-user-media-device-id.html * Modules/mediastream/MediaConstraintsImpl.h: (WebCore::MediaConstraintsData::MediaConstraintsData): Add a constructor that takes a const MediaConstraints&. * Modules/mediastream/MediaDevicesEnumerationRequest.cpp: (WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin): Don't return NULL for the main frame so the origin matches that returned for a UserMediaRequest. * Modules/mediastream/UserMediaController.h: (WebCore::UserMediaController::setDeviceIDHashSalt): Deleted, not used. (WebCore::UserMediaController::deviceIDHashSalt): Deleted, not used. * Modules/mediastream/UserMediaRequest.cpp: (WebCore::UserMediaRequest::allow): Add device ID hash salt parameter, set it on constraints. * Modules/mediastream/UserMediaRequest.h: * platform/mediastream/MediaConstraints.h: * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::fitnessDistance): ASSERT if called for DeviceId. (WebCore::RealtimeMediaSource::selectSettings): Special case DeviceId because it we have to hash the device ID before comparing, and because the DeviceId can't be changed so it should never be added to the flattened constraints. * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp: (WebCore::RealtimeMediaSourceSupportedConstraints::nameForConstraint): Deleted, unused. (WebCore::RealtimeMediaSourceSupportedConstraints::constraintFromName): Deleted, unused. * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: (WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints): Pass device id, not empty string. 2017-05-09 Antoine Quint [Modern Media Controls] Localized strings aren't loaded https://bugs.webkit.org/show_bug.cgi?id=171884 Reviewed by Dean Jackson. Remove the extraneous file extension in the file name. * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::mediaControlsScript): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::mediaControlsScript): 2017-05-09 Chris Dumez Introduce DocumentAndElementEventHandlers IDL interface https://bugs.webkit.org/show_bug.cgi?id=171879 Reviewed by Simon Fraser and Ryosuke Niwa. Introduce DocumentAndElementEventHandlers IDL interface: - https://html.spec.whatwg.org/#documentandelementeventhandlers This avoids duplication between Document.idl and Element.idl. Also mark oncopy / oncut / onpaste EventHandlers as enumerable to match the specification. Test: fast/events/DocumentAndElementEventHandlers.html * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * dom/Document.idl: * dom/DocumentAndElementEventHandlers.idl: Added. * dom/Element.idl: 2017-05-10 Dean Jackson Restrict SVG filters to accessible security origins https://bugs.webkit.org/show_bug.cgi?id=118689 Reviewed by Brent Fulgham. Certain SVG filters should only be allowed to operate on content that is has SecurityOrigin access to. Implement this by including a flag in PaintInfo and LayerPaintingInfo, and have RenderWidget make sure the documents have acceptable SecurityOrigins as it goes to paint. This could be used as the first step in a "safe painting" strategy, allowing some content to be rendered into a canvas or via the element() CSS function... but it is only a small first step. Test: http/tests/css/filters-on-iframes.html * page/FrameView.cpp: (WebCore::FrameView::paintContents): * page/FrameView.h: * platform/ScrollView.cpp: (WebCore::ScrollView::paint): * platform/ScrollView.h: * platform/Scrollbar.cpp: (WebCore::Scrollbar::paint): * platform/Scrollbar.h: * platform/Widget.h: * platform/graphics/filters/FilterOperation.h: (WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin): * platform/graphics/filters/FilterOperations.cpp: (WebCore::FilterOperations::hasFilterThatShouldBeRestrictedBySecurityOrigin): * platform/graphics/filters/FilterOperations.h: * platform/mac/WidgetMac.mm: (WebCore::Widget::paint): * rendering/FilterEffectRenderer.cpp: (WebCore::FilterEffectRenderer::build): * rendering/FilterEffectRenderer.h: * rendering/PaintInfo.h: (WebCore::PaintInfo::PaintInfo): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paint): (WebCore::RenderLayer::setupFilters): (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase): * rendering/RenderLayer.h: * rendering/RenderScrollbar.cpp: (WebCore::RenderScrollbar::paint): * rendering/RenderScrollbar.h: * rendering/RenderWidget.cpp: (WebCore::RenderWidget::paintContents): 2017-05-09 Chris Dumez Move onanimation* EventHandlers to GlobalEventHandlers https://bugs.webkit.org/show_bug.cgi?id=171874 Reviewed by Simon Fraser. Move onanimation* EventHandlers to GlobalEventHandlers to match the specification: - https://drafts.csswg.org/css-animations/#interface-globaleventhandlers-idl We previously have those on Window and Element only. Firefox complies with the specification. Test: fast/css/onanimation-eventhandlers.html * dom/Element.idl: * dom/GlobalEventHandlers.idl: * page/DOMWindow.idl: 2017-05-09 Youenn Fablet Refresh webrtc WPT tests https://bugs.webkit.org/show_bug.cgi?id=171878 Reviewed by Eric Carlson. Tests: imported/w3c/web-platform-tests/webrtc/RTCConfiguration-iceCandidatePoolSize.html imported/w3c/web-platform-tests/webrtc/RTCDataChannel-id.html imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates.html imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-constructor.html imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-idl.html imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription.html imported/w3c/web-platform-tests/webrtc/datachannel-idlharness.html imported/w3c/web-platform-tests/webrtc/getstats.html imported/w3c/web-platform-tests/webrtc/interfaces.html * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::createDataChannel): exiting early if libwebrtc is not creating a data channel. 2017-05-09 Javier Fernandez space-evenly misbehaves with flexbox https://bugs.webkit.org/show_bug.cgi?id=170445 Reviewed by David Hyatt. The CSS Box Alignment specification defines the set as some of the allowed values for the Content Distribution properties, align-content and justify-content. The 'space-evenly' value is not among the ones allowed for these properties according to the CSS Flexible Box specification. The CSS Flexbible box specification states that it must follow the CSS Box Alignment specification, so this new value must be considered as part of an upgraded level of the spec, which should be implemented eventually. Since we have already shipped an implementation of the new CSS Box Alignment values for CSS Grid Layout, we need to implement it for Flexbox as well. No new tests, but several new test cases added. * rendering/RenderFlexibleBox.cpp: (WebCore::initialJustifyContentOffset): (WebCore::justifyContentSpaceBetweenChildren): (WebCore::initialAlignContentOffset): (WebCore::alignContentSpaceBetweenChildren): 2017-05-09 Michael Catanzaro Avoid -Wformat warnings in RenderLayerCompositor.cpp and RenderLayerBacking.cpp https://bugs.webkit.org/show_bug.cgi?id=171875 Reviewed by Simon Fraser. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::detachFromScrollingCoordinator): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::logLayerInfo): (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): 2017-05-09 Chris Dumez Drop custom bindings code for Window.location setter https://bugs.webkit.org/show_bug.cgi?id=171846 Reviewed by Sam Weinig. Drop custom bindings code for Window.location setter as the custom code was merely needed to address a very old Mac widget that has long been fixed (rdar://problem/5695330). No new tests, no Web-facing behavior change. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::setLocation): Deleted. Drop custom code. * page/DOMWindow.idl: Align Window.location with https://html.spec.whatwg.org/#the-window-object: - Mark property as readonly. - Add [PutsForward=href] IDL extended attribute. Also, we need to mark the atribute as nullable as this reflects our current implementation. We currently return null if the associated Window does not have a frame. This does not match the specification and we should update our implementation in the future to never return null. 2017-05-09 Matt Lewis Unreviewed, rolling out r216508. The layout test enabled in this change is failing on Sierra. Reverted changeset: "Invalid MediaSource duration value should throw TyperError instead of InvalidStateError" https://bugs.webkit.org/show_bug.cgi?id=171653 http://trac.webkit.org/changeset/216508 2017-05-09 Michael Catanzaro Update Chrome and Firefox versions in user agent quirks https://bugs.webkit.org/show_bug.cgi?id=171823 Reviewed by Carlos Alberto Lopez Perez. * platform/UserAgentQuirks.cpp: (WebCore::UserAgentQuirks::stringForQuirk): (WebCore::UserAgentQuirks::firefoxRevisionString): 2017-05-09 Youenn Fablet RealtimeOutgoingAudioSource is crashing when given data with more than two channels https://bugs.webkit.org/show_bug.cgi?id=171868 Reviewed by Eric Carlson. Manual testing. * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::libwebrtcAudioFormat): Capping the number of channels to 2. (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable): 2017-05-09 Myles C. Maxfield font-stretch: normal selects expanded fonts instead of condensed fonts https://bugs.webkit.org/show_bug.cgi?id=171838 Reviewed by Jon Lee. CSS Fonts level 3 says: "If the value of ‘font-stretch’ is ‘normal’ or one of the condensed values, narrower width values are checked first, then wider values." CSS Fonts level 4 erroneously was incompatible with this, but was updated in https://github.com/w3c/csswg-drafts/commit/4559389d183bbaaf3321af5ba1c924caa7c488bb to be consistent with this. Now, CSS Fonts level 4 states: "If the desired stretch value is less than or equal to100, stretch values below the desired stretch value are checked in descending order followed by stretch values above the desired stretch value in ascending order" Test: fast/text/font-width-100.html * platform/graphics/FontSelectionAlgorithm.cpp: 2017-05-09 Romain Bellessort [Readable Streams API] Enable creation of ReadableStreamBYOBReader https://bugs.webkit.org/show_bug.cgi?id=171665 Reviewed by Youenn Fablet. Enabled the creation of ReadableStreamBYOBReader. Test: streams/readable-stream-byob-reader.html * CMakeLists.txt: Updated to support ReadableStreamBYOBReader. * DerivedSources.cpp: Updated to support ReadableStreamBYOBReader. * DerivedSources.make: Updated to support ReadableStreamBYOBReader. * Modules/streams/ReadableByteStreamInternals.js: Updated to support ReadableStreamBYOBReader. (privateInitializeReadableStreamBYOBReader): (isReadableStreamBYOBReader): * Modules/streams/ReadableStream.js: Updated to support ReadableStreamBYOBReader. (getReader): * Modules/streams/ReadableStreamBYOBReader.idl: Added. * Modules/streams/ReadableStreamBYOBReader.js: Added. (cancel): To be implemented. (read): To be implemented. (releaseLock): To be implemented. (closed): To be implemented. * WebCore.xcodeproj/project.pbxproj: Updated to support ReadableStreamBYOBReader. * bindings/js/JSDOMGlobalObject.cpp: Updated to support ReadableStreamBYOBReader. (WebCore::JSDOMGlobalObject::addBuiltinGlobals): * bindings/js/JSReadableStreamPrivateConstructors.cpp: Updated to support ReadableStreamBYOBReader. (WebCore::constructJSReadableStreamReaderGeneric): (WebCore::constructJSReadableStreamDefaultReader): (WebCore::constructJSReadableStreamBYOBReader): (WebCore::JSBuiltinReadableStreamBYOBReaderPrivateConstructor::initializeExecutable): (WebCore::createReadableStreamBYOBReaderPrivateConstructor): * bindings/js/JSReadableStreamPrivateConstructors.h: Updated to support ReadableStreamBYOBReader. * bindings/js/WebCoreBuiltinNames.h: Updated to support ReadableStreamBYOBReader. 2017-05-09 Frederic Wang Print more properties in the output of scrolling trees https://bugs.webkit.org/show_bug.cgi?id=171858 Reviewed by Simon Fraser. No new tests, no behavior changes. * page/scrolling/ScrollingCoordinator.cpp: Implement << operator to print ScrollableAreaParameters. (WebCore::operator<<): * page/scrolling/ScrollingCoordinator.h: Declare new << operator. * page/scrolling/ScrollingStateFrameScrollingNode.cpp: Print new properties. (WebCore::ScrollingStateFrameScrollingNode::dumpProperties): * page/scrolling/ScrollingStateScrollingNode.cpp: ditto. (WebCore::ScrollingStateScrollingNode::dumpProperties): * page/scrolling/ScrollingTreeScrollingNode.cpp: ditto. (WebCore::ScrollingTreeScrollingNode::dumpProperties): 2017-05-09 Chris Dumez ontransitionend eventHandler should be in GlobalEventHandlers https://bugs.webkit.org/show_bug.cgi?id=171836 Reviewed by Ryosuke Niwa. ontransitionend eventHandler should be in GlobalEventHandlers: - https://drafts.csswg.org/css-transitions/#interface-globaleventhandlers-idl WebKit currently has in on Window and Element only. Firefox matches the specification. Test: fast/css/ontransitionend-eventhandler.html * dom/Element.idl: * dom/GlobalEventHandlers.idl: * page/DOMWindow.idl: 2017-05-09 Nael Ouedraogo MediaSource.readyState should use an IDL enum https://bugs.webkit.org/show_bug.cgi?id=171672 Reviewed by Eric Carlson and Chris Dumez. MediaSource.readyState should use an IDL enum as per specification (https://www.w3.org/TR/2016/CR-media-source-20160503/#idl-def-ReadyState). No new tests required since no behavior change. * Modules/mediasource/MediaSource.cpp: (WebCore::toString): (WebCore::MediaSource::MediaSource): (WebCore::MediaSource::setPrivateAndOpen): (WebCore::MediaSource::buffered): (WebCore::MediaSource::setReadyState): (WebCore::MediaSource::streamEndedWithError): (WebCore::MediaSource::isOpen): (WebCore::MediaSource::isClosed): (WebCore::MediaSource::isEnded): (WebCore::MediaSource::detachFromElement): (WebCore::MediaSource::openIfInEndedState): (WebCore::MediaSource::stop): (WebCore::MediaSource::onReadyStateChange): * Modules/mediasource/MediaSource.h: * Modules/mediasource/MediaSource.idl: 2017-05-09 Nael Ouedraogo Invalid MediaSource duration value should throw TyperError instead of InvalidStateError https://bugs.webkit.org/show_bug.cgi?id=171653 Reviewed by Youenn Fablet. Modify MediaSource::setDuration to throw a TypeError when duration value is invalid as per MSE specification (https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-mediasource-duration). Update expectation of corresponding WPT test. * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::setDuration): (WebCore::MediaSource::setDurationInternal): 2017-05-09 Yusuke Suzuki Unreviewed, update binding-tests results https://bugs.webkit.org/show_bug.cgi?id=166752 * bindings/scripts/test/JS/JSTestNode.cpp: * bindings/scripts/test/JS/JSTestObj.cpp: 2017-05-09 Chris Dumez Update DocumentOrShadowRoot.idl to match specifications https://bugs.webkit.org/show_bug.cgi?id=171845 Reviewed by Ryosuke Niwa. Update DocumentOrShadowRoot.idl to match specifications: - https://dom.spec.whatwg.org/#mixin-documentorshadowroot - https://w3c.github.io/webcomponents/spec/shadow/#extensions-to-the-documentorshadowroot-mixin - https://w3c.github.io/pointerlock/#extensions-to-the-documentorshadowroot-mixin No Web-facing behavior change. Things that do not match the specification were merely annotated with FIXME comments. * dom/Document.idl: * dom/DocumentOrShadowRoot.idl: 2017-05-09 Yusuke Suzuki Unreviewed, attempt to fix macOS ports using ApplePay https://bugs.webkit.org/show_bug.cgi?id=166752 * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): 2017-05-09 Yoshiaki Jitsukawa [Coordinated Graphics] Debug Visuals don't hide https://bugs.webkit.org/show_bug.cgi?id=162704 Reviewed by Žan Doberšek. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::setShowDebugBorder): (WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter): (WebCore::CoordinatedGraphicsLayer::syncLayerState): (WebCore::CoordinatedGraphicsLayer::setDebugBorder): showDebugBorders() and showRepaintCounter() of CoordinatedGraphicsLayer should reflect the "show" argument to the layer state. * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h: (WebCore::DebugVisuals::DebugVisuals): (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState): To set the debug visuals of a layer, the visibility flags of the borders and the repaint counters as well as the border width and color are needed. Thus a new bundle struct DebugVisuals and its change flag debugVisualsChanged have been introduced in order to send the information at once. 2017-05-09 Yusuke Suzuki Handle IDLPromise<> properly https://bugs.webkit.org/show_bug.cgi?id=166752 Reviewed by Youenn Fablet. This patch implements WebIDL Promise type conversion. According to the spec, Promise takes a value and convert it to Promise by using Promise.resolve function. We implement JSPromise::resolve in JSC and use it in JSDOMConvertPromise. In conversion phase, we just convert the value to JSC::JSPromise* and hold it in PromiseRejectionEvent. On the other hand, In this patch, we newly introduce a new type DOMPromise and use it in RejectedPromiseTracker. And we also rename the previous DOMPromise to DOMPromiseDeferred since it is corresponding to JSPromiseDeferred. DOMPromise is DOMGuarded object. So it is strongly referenced from ScriptExecutionContext and it is weakly referenced from the object itself. This is important since Strong reference in C++ object that has a wrapper (in this case, PromiseRejectionEvent) easily causes cyclic reference. We hold it as DOMPromise instead of Strong in RejectedPromiseTracker to break the cyclic reference edge with weak reference. In the meantime, we still use JSC::Strong<> in PromiseRejectionEvent. It leaks memory if promise refers the wrapper object of PromiseRejectionEvent. CustomEvent also has the same problem. This is a general problem that `attribute any` can create cyclic reference. And they should be fixed in a different patch. Currently, we do not take the following approach. e.g. There is C++ object that represents Promise. And its wrapper object is JSPromise thing. When exposing the C++ object, it will be converted to a wrapper object. We do not take this approach because PromiseRejectionEvent can take user-provided promise. For example, users can create PromiseRejectionEvent in a form `new PromiseRejectionEvent("...", { promise: promise })`. In this case, `event.promise === promise` is required. And this is not suitable for the above C++ object model. Large part of this patch is mechanical one to replace DOMPromise with DOMPromiseDeferred. * CMakeLists.txt: * Modules/applepay/ApplePaySession.cpp: * Modules/encryptedmedia/MediaKeySession.h: * Modules/encryptedmedia/MediaKeySystemAccess.h: * Modules/encryptedmedia/MediaKeys.h: * Modules/encryptedmedia/NavigatorEME.h: * Modules/fetch/DOMWindowFetch.h: * Modules/fetch/FetchBody.h: * Modules/fetch/FetchBodyConsumer.h: * Modules/fetch/FetchResponse.h: * Modules/fetch/WorkerGlobalScopeFetch.h: * Modules/mediastream/MediaDevices.h: * Modules/mediastream/MediaEndpointPeerConnection.cpp: (WebCore::MediaEndpointPeerConnection::replaceTrack): (WebCore::MediaEndpointPeerConnection::replaceTrackTask): * Modules/mediastream/MediaEndpointPeerConnection.h: * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::applyConstraints): * Modules/mediastream/MediaStreamTrack.h: * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::setLocalDescription): (WebCore::PeerConnectionBackend::setRemoteDescription): (WebCore::PeerConnectionBackend::addIceCandidate): * Modules/mediastream/PeerConnectionBackend.h: (WebCore::PeerConnectionBackend::endOfIceCandidates): * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::queuedSetLocalDescription): (WebCore::RTCPeerConnection::queuedSetRemoteDescription): (WebCore::RTCPeerConnection::queuedAddIceCandidate): (WebCore::RTCPeerConnection::enqueueReplaceTrackTask): (WebCore::RTCPeerConnection::replaceTrack): * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::replaceTrack): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/UserMediaRequest.cpp: (WebCore::UserMediaRequest::start): (WebCore::UserMediaRequest::UserMediaRequest): * Modules/mediastream/UserMediaRequest.h: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * Modules/streams/ReadableStreamSource.h: (WebCore::ReadableStreamSource::start): (WebCore::ReadableStreamSource::pull): * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::addReaction): (WebCore::AudioContext::setState): (WebCore::AudioContext::suspend): (WebCore::AudioContext::resume): (WebCore::AudioContext::close): * Modules/webaudio/AudioContext.h: * WebCore.xcodeproj/project.pbxproj: * bindings/IDLTypes.h: * bindings/js/CachedModuleScriptLoaderClient.h: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/JSCustomElementRegistryCustom.cpp: * bindings/js/JSDOMConvertPromise.h: (WebCore::Converter>::convert): (WebCore::JSConverter>::convert): * bindings/js/JSDOMExceptionHandling.cpp: * bindings/js/JSDOMGlobalObject.cpp: * bindings/js/JSDOMGuardedObject.h: * bindings/js/JSDOMPromise.h: (WebCore::DOMPromise::create): (WebCore::DOMPromise::promise): (WebCore::DOMPromise::DOMPromise): (WebCore::DeferredPromise::create): Deleted. (WebCore::DeferredPromise::resolve): Deleted. (WebCore::DeferredPromise::resolveWithNewlyCreated): Deleted. (WebCore::DeferredPromise::reject): Deleted. (WebCore::DeferredPromise::resolveWithCallback): Deleted. (WebCore::DeferredPromise::rejectWithCallback): Deleted. (WebCore::DeferredPromise::DeferredPromise): Deleted. (WebCore::DeferredPromise::deferred): Deleted. (WebCore::DOMPromiseBase::DOMPromiseBase): Deleted. (WebCore::DOMPromiseBase::operator=): Deleted. (WebCore::DOMPromiseBase::reject): Deleted. (WebCore::DOMPromiseBase::rejectType): Deleted. (WebCore::DOMPromiseBase::promise): Deleted. (WebCore::DOMPromise::resolve): Deleted. (WebCore::DOMPromise::resolve): Deleted. (WebCore::callPromiseFunction): Deleted. (WebCore::bindingPromiseFunctionAdapter): Deleted. * bindings/js/JSDOMPromiseDeferred.cpp: Renamed from Source/WebCore/bindings/js/JSDOMPromise.cpp. (WebCore::DeferredPromise::promise): (WebCore::DeferredPromise::callFunction): (WebCore::DeferredPromise::reject): (WebCore::rejectPromiseWithExceptionIfAny): (WebCore::createDeferredPromise): (WebCore::createRejectedPromiseWithTypeError): (WebCore::parseAsJSON): (WebCore::fulfillPromiseWithJSON): (WebCore::fulfillPromiseWithArrayBuffer): * bindings/js/JSDOMPromiseDeferred.h: Copied from Source/WebCore/bindings/js/JSDOMPromise.h. (WebCore::DeferredPromise::create): (WebCore::DeferredPromise::resolve): (WebCore::DeferredPromise::resolveWithNewlyCreated): (WebCore::DeferredPromise::reject): (WebCore::DeferredPromise::resolveWithCallback): (WebCore::DeferredPromise::rejectWithCallback): (WebCore::DeferredPromise::DeferredPromise): (WebCore::DeferredPromise::deferred): (WebCore::DOMPromiseDeferredBase::DOMPromiseDeferredBase): (WebCore::DOMPromiseDeferredBase::operator=): (WebCore::DOMPromiseDeferredBase::reject): (WebCore::DOMPromiseDeferredBase::rejectType): (WebCore::DOMPromiseDeferredBase::promise): (WebCore::DOMPromiseDeferred::resolve): (WebCore::DOMPromiseDeferred::resolve): (WebCore::callPromiseFunction): (WebCore::bindingPromiseFunctionAdapter): * bindings/js/JSSubtleCryptoCustom.cpp: * bindings/js/JSWebGPUCommandBufferCustom.cpp: * bindings/js/JSWebKitSubtleCryptoCustom.cpp: * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: Added. (WebCore::convertDictionary): (WebCore::JSTestPromiseRejectionEventPrototype::create): (WebCore::JSTestPromiseRejectionEventPrototype::createStructure): (WebCore::JSTestPromiseRejectionEventPrototype::JSTestPromiseRejectionEventPrototype): (WebCore::JSTestPromiseRejectionEventConstructor::construct): (WebCore::JSTestPromiseRejectionEventConstructor::prototypeForStructure): (WebCore::JSTestPromiseRejectionEventConstructor::initializeProperties): (WebCore::JSTestPromiseRejectionEventPrototype::finishCreation): (WebCore::JSTestPromiseRejectionEvent::JSTestPromiseRejectionEvent): (WebCore::JSTestPromiseRejectionEvent::finishCreation): (WebCore::JSTestPromiseRejectionEvent::createPrototype): (WebCore::JSTestPromiseRejectionEvent::prototype): (WebCore::BindingCaller::castForAttribute): (WebCore::jsTestPromiseRejectionEventPromise): (WebCore::jsTestPromiseRejectionEventPromiseGetter): (WebCore::jsTestPromiseRejectionEventReason): (WebCore::jsTestPromiseRejectionEventReasonGetter): (WebCore::jsTestPromiseRejectionEventConstructor): (WebCore::setJSTestPromiseRejectionEventConstructor): (WebCore::JSTestPromiseRejectionEvent::getConstructor): (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h: Added. (WebCore::JSTestPromiseRejectionEvent::create): (WebCore::JSTestPromiseRejectionEvent::createStructure): (WebCore::JSTestPromiseRejectionEvent::wrapped): (WebCore::toJS): (WebCore::toJSNewlyCreated): * bindings/scripts/test/TestPromiseRejectionEvent.idl: Copied from Source/WebCore/bindings/js/CachedModuleScriptLoaderClient.h. * css/FontFace.h: * css/FontFaceSet.h: * dom/CustomElementRegistry.h: * dom/PromiseRejectionEvent.h: * dom/RejectedPromiseTracker.cpp: (WebCore::UnhandledPromise::UnhandledPromise): (WebCore::UnhandledPromise::callStack): (WebCore::UnhandledPromise::promise): (WebCore::RejectedPromiseTracker::promiseRejected): (WebCore::RejectedPromiseTracker::promiseHandled): (WebCore::RejectedPromiseTracker::reportUnhandledRejections): (WebCore::RejectedPromiseTracker::reportRejectionHandled): (WebCore::RejectedPromise::RejectedPromise): Deleted. (WebCore::RejectedPromise::globalObject): Deleted. (WebCore::RejectedPromise::promise): Deleted. * dom/RejectedPromiseTracker.h: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::rejectPendingPlayPromises): (WebCore::HTMLMediaElement::resolvePendingPlayPromises): (WebCore::HTMLMediaElement::play): * html/HTMLMediaElement.h: * platform/graphics/gpu/GPUCommandBuffer.h: * testing/Internals.h: 2017-05-09 Zan Dobersek Upstream the WPE port https://bugs.webkit.org/show_bug.cgi?id=171110 Reviewed by Alex Christensen. webkit-dev thread: https://lists.webkit.org/pipermail/webkit-dev/2017-April/028923.html Existing files mostly changed to properly use PLATFORM(WPE) build guards. In-file changes removed from this ChangeLog entry for brevity. * CMakeLists.txt: * PlatformWPE.cmake: Added. * accessibility/AccessibilityObject.h: * accessibility/wpe/AXObjectCacheWPE.cpp: Added. * accessibility/wpe/AccessibilityObjectWPE.cpp: Copied from Source/WebCore/platform/audio/glib/AudioBusGLib.cpp. * config.h: * crypto/keys/CryptoKeyEC.h: * crypto/keys/CryptoKeyRSA.h: * editing/Editor.cpp: * editing/Editor.h: * editing/wpe/EditorWPE.cpp: Added. * page/EventHandler.cpp: * page/wpe/EventHandlerWPE.cpp: Added. * platform/Cursor.h: * platform/DragData.h: * platform/DragImage.h: * platform/FileSystem.h: * platform/MainThreadSharedTimer.cpp: * platform/MainThreadSharedTimer.h: * platform/Pasteboard.h: * platform/PasteboardStrategy.h: * platform/PlatformPasteboard.h: * platform/SchemeRegistry.cpp: * platform/Widget.h: * platform/audio/glib/AudioBusGLib.cpp: * platform/glib/FileSystemGlib.cpp: * platform/graphics/ANGLEWebKitBridge.h: * platform/graphics/GLContext.cpp: * platform/graphics/GLContext.h: * platform/graphics/GraphicsContext3D.h: * platform/graphics/OpenGLESShims.h: * platform/graphics/PlatformDisplay.cpp: * platform/graphics/PlatformDisplay.h: * platform/graphics/egl/GLContextEGL.cpp: * platform/graphics/egl/GLContextEGL.h: * platform/graphics/egl/GLContextEGLWPE.cpp: Copied from Source/WebCore/platform/audio/glib/AudioBusGLib.cpp. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: * platform/graphics/wpe/IconWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * platform/graphics/wpe/ImageWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * platform/graphics/wpe/PlatformDisplayWPE.cpp: Added. * platform/graphics/wpe/PlatformDisplayWPE.h: Added. * platform/wpe/CursorWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * platform/wpe/LocalizedStringsWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * platform/wpe/PasteboardWPE.cpp: Added. * platform/wpe/PlatformKeyboardEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * platform/wpe/PlatformPasteboardWPE.cpp: Added. * platform/wpe/PlatformScreenWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * platform/wpe/RenderThemeWPE.cpp: Copied from Source/WebKit2/Shared/NativeWebWheelEvent.h. * platform/wpe/RenderThemeWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * platform/wpe/ScrollbarThemeWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * platform/wpe/ScrollbarThemeWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * platform/wpe/SoundWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * platform/wpe/ThemeWPE.cpp: Added. * platform/wpe/ThemeWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * platform/wpe/WidgetWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. 2017-05-09 Frederic Wang Fix property names in ScrollingTreeScrollingNode::dumpProperties https://bugs.webkit.org/show_bug.cgi?id=171848 Reviewed by Gyuyoung Kim. No new tests, this function is only used for debugging purpose. * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::dumpProperties): 2017-05-09 Carlos Garcia Campos [GTK] Building Webkit2Gtk without OpenGL fails. https://bugs.webkit.org/show_bug.cgi?id=170959 Reviewed by Žan Doberšek. * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp: * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h: * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h: 2017-05-09 Fujii Hironori [AppleWin] CaptureDeviceManager.cpp: error C2813: #import is not supported with /MP https://bugs.webkit.org/show_bug.cgi?id=171849 Reviewed by Per Arne Vollan. * platform/mediastream/CaptureDeviceManager.cpp: Replaced #import with #include. 2017-05-08 Chris Dumez Refactor / Clean up DOMWindow.idl https://bugs.webkit.org/show_bug.cgi?id=171843 Reviewed by Ryosuke Niwa. Refactor / Clean up DOMWindow.idl to match the specification more closely: - https://html.spec.whatwg.org/#the-window-object No expected Web-facing change. Things that do not match the specification have been annotated with FIXME comments. * page/DOMWindow.idl: 2017-05-08 Frederic Wang Simplify ScrollingStateNode::scrollingStateTreeAsText https://bugs.webkit.org/show_bug.cgi?id=171802 Reviewed by Simon Fraser. The following simplifications are performed: - Rely on TextStream's internal value to manage indentation. - Use TextStream::dumpProperty and << to print simple properties. - Try and use TextStream::GroupScope for groups. No new tests, only minor format changes in the dumped tree. * page/scrolling/ScrollingStateFixedNode.cpp: (WebCore::ScrollingStateFixedNode::dumpProperties): * page/scrolling/ScrollingStateFixedNode.h: * page/scrolling/ScrollingStateFrameScrollingNode.cpp: (WebCore::ScrollingStateFrameScrollingNode::dumpProperties): * page/scrolling/ScrollingStateFrameScrollingNode.h: * page/scrolling/ScrollingStateNode.cpp: (WebCore::ScrollingStateNode::dumpProperties): (WebCore::ScrollingStateNode::dump): (WebCore::ScrollingStateNode::scrollingStateTreeAsText): * page/scrolling/ScrollingStateNode.h: * page/scrolling/ScrollingStateOverflowScrollingNode.cpp: (WebCore::ScrollingStateOverflowScrollingNode::dumpProperties): * page/scrolling/ScrollingStateOverflowScrollingNode.h: * page/scrolling/ScrollingStateScrollingNode.cpp: (WebCore::ScrollingStateScrollingNode::dumpProperties): * page/scrolling/ScrollingStateScrollingNode.h: * page/scrolling/ScrollingStateStickyNode.cpp: (WebCore::ScrollingStateStickyNode::dumpProperties): * page/scrolling/ScrollingStateStickyNode.h: 2017-05-08 Youenn Fablet Follow-up to bug 171710: use more references and reject if either audio or video source creation is failing https://bugs.webkit.org/show_bug.cgi?id=171824 Reviewed by Alex Christensen. Refactoring to use more references. Only behavioral change is the rejection of the getUserMedia promise if either audio or video source creation is failing. Previously, if audio source creation was failing, the promise would still resolve if video source was sucessfully created. * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::audioFactory): (WebCore::RealtimeMediaSourceCenter::videoFactory): (WebCore::RealtimeMediaSourceCenter::audioCaptureDeviceManager): (WebCore::RealtimeMediaSourceCenter::videoCaptureDeviceManager): * platform/mediastream/RealtimeMediaSourceCenter.h: (WebCore::RealtimeMediaSourceCenter::defaultAudioFactory): Deleted. (WebCore::RealtimeMediaSourceCenter::defaultVideoFactory): Deleted. (WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureDeviceManager): Deleted. (WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureDeviceManager): Deleted. * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: (WebCore::RealtimeMediaSourceCenterMac::createMediaStream): (WebCore::RealtimeMediaSourceCenterMac::getMediaStreamDevices): (WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints): (WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory): (WebCore::RealtimeMediaSourceCenterMac::defaultVideoFactory): (WebCore::RealtimeMediaSourceCenterMac::defaultAudioCaptureDeviceManager): (WebCore::RealtimeMediaSourceCenterMac::defaultVideoCaptureDeviceManager): * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h: * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h: * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::MockRealtimeMediaSourceCenter::defaultAudioFactory): (WebCore::MockRealtimeMediaSourceCenter::defaultVideoFactory): (WebCore::MockRealtimeMediaSourceCenter::defaultAudioCaptureDeviceManager): (WebCore::MockRealtimeMediaSourceCenter::defaultVideoCaptureDeviceManager): * platform/mock/MockRealtimeMediaSourceCenter.h: 2017-05-08 Chris Dumez Drop [CEReactions] from CharacterData operations https://bugs.webkit.org/show_bug.cgi?id=171813 Reviewed by Ryosuke Niwa. Drop [CEReactions] from CharacterData operations to match the DOM specification: - https://dom.spec.whatwg.org/#interface-characterdata I believe WebKit had this because Attr used to have Text child nodes. Therefore, modifying those Text child nodes via the CharacterData API could modify the value of an attribute, requiring us to run attributeChangedCallback for Custom Elements. However, as of , Attr can no longer have Text child nodes. I have also verified that Blink does not have [CEReactions] for those methods. No new tests, no expected Web-facing behavior change. * dom/CharacterData.idl: 2017-05-08 Jeremy Jones Remove black background from video layer while in fullscreen. https://bugs.webkit.org/show_bug.cgi?id=171816 Reviewed by Eric Carlson. No new tests because no new behavior in DOM. This changes the background of the video layer to clear when it goes into fullscreen and back to black when it returns to inline to better facilitate fullsceen animations. * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm: (WebCore::VideoFullscreenLayerManager::setVideoLayer): (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer): 2017-05-08 Said Abou-Hallawa The Incomplete asynchronously decoded image frame should be decoded every time it's drawn https://bugs.webkit.org/show_bug.cgi?id=170836 Reviewed by Tim Horton. The asynchronously decoded image frames has to be cached to prevent flickering, but we have to keep requesting new decoding for the incomplete frame every time it's drawn. This is to avoid drawing an incomplete image frame even after all its encoded data is received. * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::draw): * platform/graphics/ImageFrameCache.cpp: (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): 2017-05-08 Wenson Hsieh Guard DragController::cleanupAfterSystemDrag to only clear drag state on Mac https://bugs.webkit.org/show_bug.cgi?id=171771 Reviewed by Tim Horton. The call to dragEnded here seems to have been added because a client could override Mac WK1 WebUIDelegate methods to cause this cleanup to never be performed. Since this limitation only applies to Mac, guard it as such. * page/mac/DragControllerMac.mm: (WebCore::DragController::cleanupAfterSystemDrag): 2017-05-08 Commit Queue Unreviewed, rolling out r216262. https://bugs.webkit.org/show_bug.cgi?id=171842 "It regressed JetStream on iOS by 7%" (Requested by saamyjoon on #webkit). Reverted changeset: "GCController.cpp's collect() should be Async" https://bugs.webkit.org/show_bug.cgi?id=171708 http://trac.webkit.org/changeset/216262 2017-05-08 Chris Dumez Move offsetParent / offsetLeft / offsetTop / offsetWidth / offsetHeight from Element to HTMLElement https://bugs.webkit.org/show_bug.cgi?id=171829 Reviewed by Simon Fraser. Move offsetParent / offsetLeft / offsetTop / offsetWidth / offsetHeight from Element to HTMLElement, as per the specification: - https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlelement-interface Both Firefox and Chrome match the specification and also do not have the corresponding API on SVGElement. Bug tracking the similar move in Blink (completed over 1 year ago): - https://bugs.chromium.org/p/chromium/issues/detail?id=463116 Note that for the inner SVG elements like and these attributes were returning 0, because those aren't part of the CSS box model. They did return correct values for the element itself, however. Test: fast/css/htmlelement-offset-properties.html * dom/Element.idl: - Drop offset* attributes, now that they are on HTMLElement. * html/HTMLElement.idl: - Resync HTMLElement.idl with the specification: https://html.spec.whatwg.org/#htmlelement No behavior change besides what's indicated in the Changelog above. Things that do not match the spec have been annotated with FIXME comments. - Add offset* attributes that used to be on Element. 2017-05-08 Youenn Fablet Add support for reading and writing settings from UIProcess audio capture https://bugs.webkit.org/show_bug.cgi?id=171633 Reviewed by Eric Carlson. Covered by manual testing and existing test sets. Moving success/failure callbacks for applyConstraints. Making main RealtimeMediaSource::applyConstraints virtual so that WebProcess source proxies can implement it by doing an IPC call directly. Doing so for UIProcess CoreAudioCaptureSource. Adding support for volume to CoreAudioCaptureSource by applying gain post-capturing. Adding support for toggling echo cancellation in CoreAudioCaptureSource. Adding support to change echo cancellation and sample rate by scheduling a reconfiguration of the audio unit. To do so, we stop producing data, delete the audio unit and restart producing data. Removing CoreAudioCaptureSource::supportedConstraints as it is redundant with RealtimeMediaSourceSettings::supportedConstraints. Setting sample rate only to the following values: 8000, 16000, 32000, 44100, 48000. * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::applyConstraints): * platform/mediastream/MediaStreamTrackPrivate.cpp: (WebCore::MediaStreamTrackPrivate::applyConstraints): * platform/mediastream/MediaStreamTrackPrivate.h: * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::applyConstraints): * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeMediaSourceSettings.h: (WebCore::RealtimeMediaSourceSettings::supportedConstraints): * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::processMicrophoneSamples): (WebCore::CoreAudioCaptureSource::cleanupAudioUnit): (WebCore::CoreAudioCaptureSource::createAudioUnit): (WebCore::CoreAudioCaptureSource::configureAudioUnit): (WebCore::CoreAudioCaptureSource::startProducingData): (WebCore::CoreAudioCaptureSource::capabilities): (WebCore::CoreAudioCaptureSource::settings): (WebCore::CoreAudioCaptureSource::applySampleRate): (WebCore::CoreAudioCaptureSource::applyEchoCancellation): (WebCore::CoreAudioCaptureSource::scheduleReconfiguration): (WebCore::CoreAudioCaptureSource::cleanupAudioUnits): Deleted. (WebCore::CoreAudioCaptureSource::setupAudioUnits): Deleted. * platform/mediastream/mac/CoreAudioCaptureSource.h: 2017-05-08 Chris Dumez Drop non-standard document.implementation.createCSSStyleSheet() API https://bugs.webkit.org/show_bug.cgi?id=171825 Reviewed by Simon Fraser. Drop non-standard document.implementation.createCSSStyleSheet() API. This was never-implemented by Firefox and they actually rejected implementing it: - Drop non-standard document.implementation.createCSSStyleSheet() API Blink dropped this API back in 2014 after getting UseCounter data showing this was not used: - https://bugs.chromium.org/p/chromium/issues/detail?id=363561 - https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/uDjkuGA9gQs/zytnzJ6WryYJ The API is not useful in its current state because even though document.implementation.createCSSStyleSheet() allows you to create a stylesheet, there is currently no way to associate it with the document. Test: fast/css/DOMImplementation.createCSSStyleSheet-obsolete.html * dom/DOMImplementation.idl: 2017-05-08 Joanmarie Diggs AX: don't expose empty roledescription https://bugs.webkit.org/show_bug.cgi?id=163647 Reviewed by Chris Fleizach. If the value of aria-roledescription is empty or contains only whitespace characters, ignore the value. Also strip out leading or trailing whitespace characters in the value. No new tests: We already had coverage for an empty aria-roledescription value. That test was updated to reflect the new behavior. New test cases were added to cover a value that contains only whitespace characters, and a value with leading and trailing whitespace characters. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::roleDescription): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper roleDescription]): 2017-05-08 Chris Dumez Drop non-standard Element.scrollByLines() / scrollByPages() https://bugs.webkit.org/show_bug.cgi?id=171820 Reviewed by Simon Fraser. Drop non-standard Element.scrollByLines() / scrollByPages(). Those were added a very long time ago (https://trac.webkit.org/changeset/7901/webkit) for Safari RSS but does not seem to be used anymore. Blink has already dropped it without issue back in 2014: - https://bugs.chromium.org/p/chromium/issues/detail?id=398356 Their UseCounter data showed no usage: - https://www.chromestatus.com/metrics/feature/timeline/popularity/390 Test: fast/css/element-scrollByLines-scrollByPages-obsolete.html * dom/Element.idl: 2017-05-08 Youenn Fablet CoreAudioSharedUnit should own its configuration parameters https://bugs.webkit.org/show_bug.cgi?id=171812 Reviewed by Eric Carlson. Covered by manual tests. Add sampleRate, volume and echoCancellation parameters to the shared audio unit. Set default values when creating the shared audio unit and use those for the creation of new sources. Add support for volume. Add support for disabling echo cancellation. Check valid sample rates when trying to apply a sample rate. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioSharedUnit::volume): (WebCore::CoreAudioSharedUnit::sampleRate): (WebCore::CoreAudioSharedUnit::enableEchoCancellation): (WebCore::CoreAudioSharedUnit::setVolume): (WebCore::CoreAudioSharedUnit::setSampleRate): (WebCore::CoreAudioSharedUnit::setEnableEchoCancellation): (WebCore::CoreAudioSharedUnit::CoreAudioSharedUnit): (WebCore::CoreAudioSharedUnit::setupAudioUnits): (WebCore::CoreAudioSharedUnit::configureMicrophoneProc): (WebCore::CoreAudioSharedUnit::configureSpeakerProc): (WebCore::CoreAudioSharedUnit::processMicrophoneSamples): (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::applySampleRate): (WebCore::CoreAudioCaptureSource::applyEchoCancellation): * platform/mediastream/mac/CoreAudioCaptureSource.h: 2017-05-08 Joanmarie Diggs AX: Setting aria-orientation="horizontal" on a listbox is being overridden on the Mac https://bugs.webkit.org/show_bug.cgi?id=171821 Reviewed by Chris Fleizach. The Mac's AccessibilityObject wrapper was unconditionally returning vertical as the orientation of listbox. Removing this override causes the author-specified value to be exposed, with the default/implicit orientation continuing to be vertical. No new tests. We already have coverage for the default/implicit orientation on a listbox. A new test case was added to aria-orientation.html so that we would have coverage for aria-orientation="horizontal" on a listbox. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): 2017-05-08 Said Abou-Hallawa [CG] To decode an image frame asynchronously, pass the native size of the image to CGImageSourceCreateThumbnailAtIndex() if it's smaller than the sizeForDrawing https://bugs.webkit.org/show_bug.cgi?id=170864 Reviewed by Simon Fraser. Tests: Existing tests were modified to test this patch. The maxPixelSize was omitted when calling CGImageSourceCreateThumbnailAtIndex() for the nativeSize image or when areaOf(nativeSize) < areaOf(sizeForDrawing). The assumption was if we don't pass maxPixelSize, CG will create an image with the nativeSize regardless how big this size is. It turns out this is wrong. CG has an optimization to return a scaled down image if areaOf(nativeSize) is greater than some maximum value. This is not what we want for asynchronously image decoding. We want the decoded frame to have the size we ask for, not some scaled down frame. The fix is to pass always maxPixelSize to CGImageSourceCreateThumbnailAtIndex(). maxPixelSize will be equal to maxDimension(sizeForDrawing) if sizeForDrawing is valid it is less than maxDimension(nativeSize). Otherwise it will be equal to maxDimension(nativeSize). * platform/graphics/DecodingOptions.h: * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::appendImageSourceOption): (WebCore::appendImageSourceOptions): (WebCore::imageSourceAsyncOptions): (WebCore::ImageDecoder::createFrameImageAtIndex): 2017-05-08 Beth Dakin WebKit should default to using sRGB with NSColor conversion instead of device color space https://bugs.webkit.org/show_bug.cgi?id=171745 -and corresponding- rdar://problem/28314183 Reviewed by Tim Horton. * platform/graphics/mac/ColorMac.mm: (WebCore::makeRGBAFromNSColor): (WebCore::nsColor): 2017-05-08 Alex Christensen Reduce PassRefPtr use https://bugs.webkit.org/show_bug.cgi?id=171809 Reviewed by Chris Dumez. * platform/graphics/ca/PlatformCALayer.cpp: (WebCore::PlatformCALayer::createCompatibleLayerOrTakeFromPool): * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/TileCoverageMap.cpp: (WebCore::TileCoverageMap::TileCoverageMap): * platform/graphics/ca/TileGrid.cpp: (WebCore::TileGrid::TileGrid): * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (PlatformCALayerCocoa::create): (PlatformCALayerCocoa::clone): (PlatformCALayerCocoa::animationForKey): (PlatformCALayerCocoa::createCompatibleLayer): 2017-05-08 Jer Noble [Mac] Audio capture fails when shouldCaptureAudioInUIProcess is set. https://bugs.webkit.org/show_bug.cgi?id=171710 Reviewed by Eric Carlson. Both the shouldCaptureAudioInUIProcess setting and useAVFoundationAudioCapture setting were trying to set the audio factory for RealtimeMediaSourceCenter, and were stomping on each others' changes. Change the way the useAVFoundationAudioCapture works so that it only affects the defaultAudioFactory, allowing that default to be overridden by the shuoldCaptureAudioInUIProcess setting when it calls setAudioFactory(). * page/Settings.cpp: (WebCore::Settings::setUseAVFoundationAudioCapture): * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::audioFactory): (WebCore::RealtimeMediaSourceCenter::videoFactory): (WebCore::RealtimeMediaSourceCenter::audioCaptureDeviceManager): (WebCore::RealtimeMediaSourceCenter::videoCaptureDeviceManager): * platform/mediastream/RealtimeMediaSourceCenter.h: (WebCore::RealtimeMediaSourceCenter::audioFactory): Deleted. (WebCore::RealtimeMediaSourceCenter::videoFactory): Deleted. (WebCore::RealtimeMediaSourceCenter::audioCaptureDeviceManager): Deleted. (WebCore::RealtimeMediaSourceCenter::videoCaptureDeviceManager): Deleted. * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: (WebCore::RealtimeMediaSourceCenterMac::setUseAVFoundationAudioCapture): (WebCore::RealtimeMediaSourceCenterMac::singleton): (WebCore::RealtimeMediaSourceCenter::platformCenter): (WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory): (WebCore::RealtimeMediaSourceCenterMac::defaultAudioCaptureDeviceManager): * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h: 2017-05-04 Jiewen Tan Search events should not fire synchronously for search type input elements with incremental attribute set https://bugs.webkit.org/show_bug.cgi?id=171376 Reviewed by Chris Dumez. For some reasons, we fire search events immediately for search type input elements with incremental attribute set only when the length of the input equals to zero. This behaviour should be prevented as event listeners in the middle might perform unexpectedly. Test: fast/forms/search/search-incremental-crash.html * html/SearchInputType.cpp: (WebCore::SearchInputType::startSearchEventTimer): 2017-05-08 Zalan Bujtas Text overlaps on http://www.duden.de/rechtschreibung/Acre https://bugs.webkit.org/show_bug.cgi?id=171796 Reviewed by Simon Fraser. Simple line layout pre-measures space using the primary font, even if the space glyph requires a fallback font (and even if the string does not have a space in it at all). When this width gets cached (see WidthCache) we might end up using it later during normal line layout and it could produce incorrect layout. This patch removes the space width caching from Simple line layout, since Font already caches it. Test: fast/text/simple-line-layout-fallback-space-glyph.html * rendering/SimpleLineLayout.cpp: (WebCore::SimpleLineLayout::createLineRuns): * rendering/SimpleLineLayoutTextFragmentIterator.cpp: (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style): (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition): (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth): * rendering/SimpleLineLayoutTextFragmentIterator.h: 2017-05-08 Chris Dumez Refactor ImageInputType::width() / height() for clarity https://bugs.webkit.org/show_bug.cgi?id=171810 Reviewed by Zalan Bujtas. Refactor ImageInputType::width() / height() for clarity. * html/ImageInputType.cpp: (WebCore::ImageInputType::height): (WebCore::ImageInputType::width): 2017-05-08 Zalan Bujtas Bail out of simple line layout when hyphen needs a fallback font. https://bugs.webkit.org/show_bug.cgi?id=171811 Reviewed by Antti Koivisto. With hyphen: auto is set, we don't know if the hypen string is going to be used, until after we started laying out the content and figured that the text overflows the line. However it's too late to bail out of simple line layout at this point, so let's just pre-check if the hyphen string needs a fallback font. * rendering/SimpleLineLayout.cpp: (WebCore::SimpleLineLayout::canUseForStyle): 2017-05-08 Youenn Fablet TURNS gathering is not working properly https://bugs.webkit.org/show_bug.cgi?id=171747 Reviewed by Eric Carlson. Covered by manual tests. * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::configurationFromMediaEndpointConfiguration): Reveting TURNS ice server skipping. 2017-05-08 Michael Catanzaro Unreviewed, rolling out r216419. Broke 70 layout tests on GTK bot Reverted changeset: "Ensure clean tree before AX cache update." https://bugs.webkit.org/show_bug.cgi?id=171546 http://trac.webkit.org/changeset/216419 2017-05-08 Youenn Fablet CoreAudioCaptureSource should not modify its shared unit if already started/stopped https://bugs.webkit.org/show_bug.cgi?id=171804 Reviewed by Jer Noble. Manual testing only since CoreAudioSharedUnit is not mocked. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::startProducingData): Exit early if source is already started. (WebCore::CoreAudioCaptureSource::stopProducingData): Exit early if source is already stopped. 2017-05-08 Antti Koivisto ComposedTreeIterator does not traverse all slotted children if the traversal root is a slot element. https://bugs.webkit.org/show_bug.cgi?id=171375 Reviewed by Zalan Bujtas. We were hitting an assert when using details element with a flow thread. The root cause for this turned out to be that we only traversed the first slotted child if the traversal root was a slot element. Test: fast/html/details-flow-thread.html * dom/ComposedTreeIterator.cpp: (WebCore::ComposedTreeIterator::traverseNextLeavingContext): Try to traverse to the next slotted child before testing if we at the end of the current context. 2017-05-08 Mark Lam Introduce ExceptionScope::assertNoException() and releaseAssertNoException(). https://bugs.webkit.org/show_bug.cgi?id=171776 Reviewed by Keith Miller. No new tests because there's no behavior change in functionality. We're only refactoring the code to use the new assertion utility function. * Modules/plugins/QuickTimePluginReplacement.mm: (WebCore::QuickTimePluginReplacement::installReplacement): * bindings/js/JSCryptoKeySerializationJWK.cpp: (WebCore::getJSArrayFromJSON): (WebCore::getStringFromJSON): (WebCore::getBooleanFromJSON): * bindings/js/JSCustomElementRegistryCustom.cpp: (WebCore::JSCustomElementRegistry::whenDefined): * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::propagateExceptionSlowPath): (WebCore::throwNotSupportedError): (WebCore::throwInvalidStateError): (WebCore::throwSecurityError): (WebCore::throwDOMSyntaxError): (WebCore::throwDataCloneError): (WebCore::throwIndexSizeError): (WebCore::throwTypeMismatchError): * bindings/js/JSDOMGlobalObject.cpp: (WebCore::makeThisTypeErrorForBuiltins): (WebCore::makeGetterTypeErrorForBuiltins): * bindings/js/JSDOMGlobalObjectTask.cpp: * bindings/js/JSDOMPromise.h: (WebCore::callPromiseFunction): * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowMicrotaskCallback::call): * bindings/js/JSMainThreadExecState.h: (WebCore::JSMainThreadExecState::~JSMainThreadExecState): * bindings/js/ReadableStreamDefaultController.cpp: (WebCore::ReadableStreamDefaultController::isControlledReadableStreamLocked): * bindings/js/ReadableStreamDefaultController.h: (WebCore::ReadableStreamDefaultController::enqueue): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readTerminal): * bindings/scripts/CodeGeneratorJS.pm: (GenerateSerializerFunction): * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::JSTestNode::serialize): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObj::serialize): * bindings/scripts/test/JS/JSTestSerialization.cpp: (WebCore::JSTestSerialization::serialize): * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: (WebCore::JSTestSerializationInherit::serialize): * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: (WebCore::JSTestSerializationInheritFinal::serialize): * contentextensions/ContentExtensionParser.cpp: (WebCore::ContentExtensions::getTypeFlags): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot): (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange): (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus): * html/HTMLPlugInImageElement.cpp: (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): 2017-05-08 Chris Dumez Move 'style' from Element to HTMLElement / SVGElement and make it settable https://bugs.webkit.org/show_bug.cgi?id=171795 Reviewed by Alex Christensen. Move 'style' from Element to HTMLElement / SVGElement and make it settable as per: - https://drafts.csswg.org/cssom/#the-elementcssinlinestyle-interface Both Firefox and Chrome already match the specification (both for the property location and having it settable). Test: fast/css/Element-style.html * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * css/ElementCSSInlineStyle.idl: Added. * css/PropertySetCSSStyleDeclaration.h: * css/StyleProperties.cpp: (WebCore::MutableStyleProperties::ensureCSSStyleDeclaration): (WebCore::MutableStyleProperties::ensureInlineCSSStyleDeclaration): * css/StyleProperties.h: * dom/Attr.cpp: (WebCore::Attr::style): * dom/Document.cpp: (WebCore::Document::createCSSStyleDeclaration): * dom/Element.cpp: * dom/Element.h: * dom/Element.idl: * dom/StyledElement.cpp: (WebCore::StyledElement::cssomStyle): * dom/StyledElement.h: * editing/Editor.cpp: (WebCore::Editor::applyEditingStyleToElement): * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline): * html/HTMLElement.idl: * html/ImageInputType.cpp: (WebCore::ImageInputType::height): (WebCore::ImageInputType::width): Fix bug that was found by fast/forms/input-width-height-attributes-without-renderer-loaded-image.html. That test relied on setting HTMLElement.style which did not work until now. Call updateLayout() *before* doing the renderer check. * inspector/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::getMatchedStylesForNode): (WebCore::InspectorCSSAgent::getInlineStylesForNode): (WebCore::InspectorCSSAgent::getComputedStyleForNode): (WebCore::InspectorCSSAgent::asInspectorStyleSheet): (WebCore::InspectorCSSAgent::buildObjectForAttributesStyle): * inspector/InspectorCSSAgent.h: * inspector/InspectorStyleSheet.cpp: (WebCore::InspectorStyle::create): (WebCore::InspectorStyle::InspectorStyle): (WebCore::InspectorStyle::extractSourceData): (WebCore::InspectorStyle::setText): (WebCore::InspectorStyleSheet::inspectorStyleForId): (WebCore::InspectorStyleSheetForInlineStyle::create): (WebCore::InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle): (WebCore::InspectorStyleSheetForInlineStyle::didModifyElementAttribute): (WebCore::InspectorStyleSheetForInlineStyle::setStyleText): (WebCore::InspectorStyleSheetForInlineStyle::ensureParsedDataReady): (WebCore::InspectorStyleSheetForInlineStyle::inlineStyle): * inspector/InspectorStyleSheet.h: * svg/SVGElement.idl: 2017-05-08 Joanmarie Diggs AX: Propagate aria-readonly to grid descendants https://bugs.webkit.org/show_bug.cgi?id=171189 Reviewed by Chris Fleizach. Propagate aria-readonly to grid descendants if the property is not explicitly set on the descendant. Test: accessibility/gtk/aria-readonly-propagated.html Additional test cases also added to accessibility/aria-readonly.html * accessibility/AccessibilityARIAGridCell.cpp: (WebCore::AccessibilityARIAGridCell::ariaReadOnlyValue): * accessibility/AccessibilityARIAGridCell.h: * accessibility/AccessibilityObject.h: 2017-05-06 Zalan Bujtas Ensure clean tree before AX cache update. https://bugs.webkit.org/show_bug.cgi?id=171546 While updating an accessibility object state, we might perform unintentional style updates. This style update could end up destroying renderes that are still referenced by function calls on the callstack. To avoid that, AXObjectCache should operate on a clean tree only. Reviewed by Chris Fleizach. Test: accessibility/crash-when-render-tree-is-not-clean.html * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::checkedStateChanged): (WebCore::AXObjectCache::selectedChildrenChanged): (WebCore::AXObjectCache::handleAriaExpandedChange): (WebCore::AXObjectCache::handleActiveDescendantChanged): (WebCore::AXObjectCache::handleAriaRoleChanged): (WebCore::AXObjectCache::handleAttributeChanged): (WebCore::AXObjectCache::handleAriaModalChange): (WebCore::AXObjectCache::labelChanged): * accessibility/AXObjectCache.h: (WebCore::AXObjectCache::checkedStateChanged): (WebCore::AXObjectCache::handleActiveDescendantChanged): (WebCore::AXObjectCache::handleAriaExpandedChange): (WebCore::AXObjectCache::handleAriaRoleChanged): (WebCore::AXObjectCache::handleAriaModalChange): (WebCore::AXObjectCache::handleAttributeChanged): (WebCore::AXObjectCache::selectedChildrenChanged): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::handleAriaExpandedChanged): * dom/Element.cpp: (WebCore::Element::attributeChanged): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::setChecked): 2017-05-08 Myles C. Maxfield Unprefix unicode-bidi CSS values https://bugs.webkit.org/show_bug.cgi?id=171761 Reviewed by Simon Fraser. Create new values which parse to the same internal state as the prefixed values. Tests: fast/text/bidi-unprefix.html imported/w3c/i18n/bidi/bidi-embed-001.html imported/w3c/i18n/bidi/bidi-embed-002.html imported/w3c/i18n/bidi/bidi-embed-003.html imported/w3c/i18n/bidi/bidi-embed-004.html imported/w3c/i18n/bidi/bidi-embed-005.html imported/w3c/i18n/bidi/bidi-embed-006.html imported/w3c/i18n/bidi/bidi-embed-007.html imported/w3c/i18n/bidi/bidi-embed-008.html imported/w3c/i18n/bidi/bidi-embed-009.html imported/w3c/i18n/bidi/bidi-embed-010.html imported/w3c/i18n/bidi/bidi-embed-011.html imported/w3c/i18n/bidi/bidi-isolate-001.html imported/w3c/i18n/bidi/bidi-isolate-002.html imported/w3c/i18n/bidi/bidi-isolate-003.html imported/w3c/i18n/bidi/bidi-isolate-004.html imported/w3c/i18n/bidi/bidi-isolate-005.html imported/w3c/i18n/bidi/bidi-isolate-006.html imported/w3c/i18n/bidi/bidi-isolate-007.html imported/w3c/i18n/bidi/bidi-isolate-008.html imported/w3c/i18n/bidi/bidi-isolate-009.html imported/w3c/i18n/bidi/bidi-isolate-010.html imported/w3c/i18n/bidi/bidi-isolate-011.html imported/w3c/i18n/bidi/bidi-isolate-override-001.html imported/w3c/i18n/bidi/bidi-isolate-override-002.html imported/w3c/i18n/bidi/bidi-isolate-override-003.html imported/w3c/i18n/bidi/bidi-isolate-override-004.html imported/w3c/i18n/bidi/bidi-isolate-override-005.html imported/w3c/i18n/bidi/bidi-isolate-override-006.html imported/w3c/i18n/bidi/bidi-isolate-override-007.html imported/w3c/i18n/bidi/bidi-isolate-override-008.html imported/w3c/i18n/bidi/bidi-isolate-override-009.html imported/w3c/i18n/bidi/bidi-isolate-override-010.html imported/w3c/i18n/bidi/bidi-isolate-override-011.html imported/w3c/i18n/bidi/bidi-isolate-override-012.html imported/w3c/i18n/bidi/bidi-normal-001.html imported/w3c/i18n/bidi/bidi-normal-002.html imported/w3c/i18n/bidi/bidi-normal-003.html imported/w3c/i18n/bidi/bidi-normal-004.html imported/w3c/i18n/bidi/bidi-normal-005.html imported/w3c/i18n/bidi/bidi-normal-006.html imported/w3c/i18n/bidi/bidi-normal-007.html imported/w3c/i18n/bidi/bidi-normal-008.html imported/w3c/i18n/bidi/bidi-normal-009.html imported/w3c/i18n/bidi/bidi-normal-010.html imported/w3c/i18n/bidi/bidi-normal-011.html imported/w3c/i18n/bidi/bidi-override-001.html imported/w3c/i18n/bidi/bidi-override-002.html imported/w3c/i18n/bidi/bidi-override-003.html imported/w3c/i18n/bidi/bidi-override-004.html imported/w3c/i18n/bidi/bidi-override-005.html imported/w3c/i18n/bidi/bidi-override-006.html imported/w3c/i18n/bidi/bidi-override-007.html imported/w3c/i18n/bidi/bidi-override-008.html imported/w3c/i18n/bidi/bidi-override-009.html imported/w3c/i18n/bidi/bidi-override-010.html imported/w3c/i18n/bidi/bidi-override-011.html imported/w3c/i18n/bidi/bidi-override-012.html imported/w3c/i18n/bidi/bidi-plaintext-001.html imported/w3c/i18n/bidi/bidi-plaintext-003.html imported/w3c/i18n/bidi/bidi-plaintext-005.html imported/w3c/i18n/bidi/bidi-plaintext-006.html imported/w3c/i18n/bidi/bidi-plaintext-007.html imported/w3c/i18n/bidi/bidi-plaintext-008.html imported/w3c/i18n/bidi/bidi-plaintext-009.html imported/w3c/i18n/bidi/bidi-plaintext-010.html imported/w3c/i18n/bidi/bidi-plaintext-011.html imported/w3c/i18n/bidi/bidi-table-001.html imported/w3c/i18n/bidi/bidi-unset-001.html imported/w3c/i18n/bidi/bidi-unset-002.html imported/w3c/i18n/bidi/bidi-unset-003.html imported/w3c/i18n/bidi/bidi-unset-004.html imported/w3c/i18n/bidi/bidi-unset-005.html imported/w3c/i18n/bidi/bidi-unset-006.html imported/w3c/i18n/bidi/bidi-unset-007.html imported/w3c/i18n/bidi/bidi-unset-008.html imported/w3c/i18n/bidi/bidi-unset-009.html imported/w3c/i18n/bidi/bidi-unset-010.html imported/w3c/i18n/bidi/block-embed-001.html imported/w3c/i18n/bidi/block-embed-002.html imported/w3c/i18n/bidi/block-embed-003.html imported/w3c/i18n/bidi/block-override-001.html imported/w3c/i18n/bidi/block-override-002.html imported/w3c/i18n/bidi/block-override-003.html imported/w3c/i18n/bidi/block-override-004.html imported/w3c/i18n/bidi/block-override-isolate-001.html imported/w3c/i18n/bidi/block-override-isolate-002.html imported/w3c/i18n/bidi/block-override-isolate-003.html imported/w3c/i18n/bidi/block-override-isolate-004.html imported/w3c/i18n/bidi/block-plaintext-001.html imported/w3c/i18n/bidi/block-plaintext-002.html imported/w3c/i18n/bidi/block-plaintext-003.html imported/w3c/i18n/bidi/block-plaintext-004.html imported/w3c/i18n/bidi/block-plaintext-005.html imported/w3c/i18n/bidi/block-plaintext-006.html * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator EUnicodeBidi): * css/CSSProperties.json: * css/CSSValueKeywords.in: * css/html.css: (bdi, output): * css/parser/CSSParserFastPaths.cpp: (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): * html/HTMLElement.cpp: (WebCore::unicodeBidiAttributeForDirAuto): * html/track/TextTrackCueGeneric.cpp: (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties): * html/track/VTTCue.cpp: (WebCore::VTTCueBox::applyCSSProperties): 2017-05-07 Ben Kelly Set the Response.blob() type based on the content-type header value. https://bugs.webkit.org/show_bug.cgi?id=170849 Reviewed by Youenn Fablet. There are two problems to fix here: 1. Currently the FetchResponse class only called updateContentType() when first created even though all the headers were not available. This patch calls updateContentType() again after the headers are populated. 2. The fetch design requires propagating the normalized blob type to FetchBodyConsumer as well. Currently this is only done if Response.blob() is called after the body is completely loaded. If we hit the consumeOnceLoadingFinished() path, then the type is not passed. This is similar to what was happening in bug 171489 with ReadableStream bodies. This patch sets the type on the FetchBodyConsumer in consumeOnceLoadingFinished() as well. Theses changes allow WebKit to pass the "Consume response's body: from fetch to blob" case in the WPT response-consume.html test. Test: http://w3c-test.org/fetch/api/response/response-consume.html * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::BodyLoader::didReceiveResponse): Modified to call FetchBodyOwner::updateContentType() after filling m_headers. (WebCore::FetchBody::consumeOnceLoadingFinished): Call FetchBodyConsumer::setContentType() when being consumed as a blob. * Modules/fetch/FetchBody.h: Modify consumeOnceLoadingFinished() to take the content type string. * Modules/fetch/FetchBodyOwner.cpp: (WebCore::FetchBodyOwner::consumeOnceLoadingFinished): Pass the content type string down to FetchBody so it can be propagated to the FetchBodyConsumer. 2017-05-07 Simon Fraser [iOS] REGRESSION (r209409): getBoundingClientRect is wrong for fixed-position elements in resize/orientationchange https://bugs.webkit.org/show_bug.cgi?id=171140 Reviewed by Sam Weinig. WebPage::dynamicViewportSizeUpdate() is called during rotation, and does a layout which needs to have an up-to-date layout viewport, since the layout viewport state is detectable in orientationchange and resize events via fetching the client rect of fixed elements. Normally we send in the layout viewport from the UI process, but in this case we need to compute one in the web process. So factor code into FrameView to do the computation, called from both places. Tests: fast/events/ios/rotation/layout-viewport-during-rotation.html fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html * page/FrameView.cpp: (WebCore::FrameView::computeUpdatedLayoutViewportRect): * page/FrameView.h: 2017-05-07 Chris Dumez Drop remaining uses of PassRefPtr in editing code https://bugs.webkit.org/show_bug.cgi?id=171787 Reviewed by Darin Adler. Drop remaining uses of PassRefPtr in editing code. * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::timerFired): * editing/ApplyStyleCommand.cpp: (WebCore::toIdentifier): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::didApplyCommand): (WebCore::CompositeEditCommand::moveParagraphs): * editing/CompositeEditCommand.h: * editing/Editor.cpp: (WebCore::Editor::shouldInsertFragment): (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::appliedEditing): (WebCore::Editor::performCutOrCopy): (WebCore::Editor::willWriteSelectionToPasteboard): (WebCore::Editor::advanceToNextMisspelling): (WebCore::Editor::isSelectionUngrammatical): (WebCore::Editor::guessesForMisspelledOrUngrammatical): (WebCore::Editor::markMisspellingsOrBadGrammar): (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): (WebCore::correctSpellcheckingPreservingTextCheckingParagraph): (WebCore::Editor::markAndReplaceFor): (WebCore::Editor::changeBackToReplacedString): * editing/Editor.h: * editing/EditorCommand.cpp: (WebCore::executeInsertFragment): (WebCore::Editor::command): (WebCore::Editor::Command::Command): * editing/FormatBlockCommand.cpp: (WebCore::FormatBlockCommand::formatRange): * editing/IndentOutdentCommand.cpp: (WebCore::IndentOutdentCommand::indentIntoBlockquote): (WebCore::IndentOutdentCommand::outdentParagraph): * editing/InsertListCommand.cpp: (WebCore::InsertListCommand::fixOrphanedListChild): (WebCore::InsertListCommand::mergeWithNeighboringLists): (WebCore::InsertListCommand::doApplyForSingleParagraph): (WebCore::InsertListCommand::unlistifyParagraph): (WebCore::InsertListCommand::listifyParagraph): * editing/InsertListCommand.h: * editing/InsertParagraphSeparatorCommand.cpp: (WebCore::InsertParagraphSeparatorCommand::doApply): * editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::InsertTextCommand): * editing/InsertTextCommand.h: (WebCore::InsertTextCommand::createWithMarkerSupplier): * editing/MoveSelectionCommand.cpp: (WebCore::MoveSelectionCommand::MoveSelectionCommand): * editing/MoveSelectionCommand.h: (WebCore::MoveSelectionCommand::create): * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplacementFragment::removeNodePreservingChildren): (WebCore::ReplacementFragment::removeNode): (WebCore::ReplacementFragment::insertNodeBefore): (WebCore::ReplacementFragment::restoreAndRemoveTestRenderingNodesToFragment): (WebCore::ReplacementFragment::removeUnrenderedNodes): (WebCore::ReplacementFragment::removeInterchangeNodes): (WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder): (WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor): (WebCore::removeHeadContents): (WebCore::ReplaceSelectionCommand::doApply): (WebCore::ReplaceSelectionCommand::insertAsListItems): * editing/ReplaceSelectionCommand.h: * editing/SpellChecker.cpp: (WebCore::SpellCheckRequest::SpellCheckRequest): (WebCore::SpellCheckRequest::create): (WebCore::SpellChecker::canCheckAsynchronously): (WebCore::SpellChecker::isCheckable): (WebCore::SpellChecker::requestCheckingFor): (WebCore::SpellChecker::invokeRequest): (WebCore::SpellChecker::enqueueRequest): (WebCore::SpellChecker::didCheck): * editing/SpellChecker.h: (WebCore::SpellCheckRequest::checkingRange): (WebCore::SpellCheckRequest::paragraphRange): * editing/TextCheckingHelper.cpp: (WebCore::expandToParagraphBoundary): (WebCore::TextCheckingParagraph::TextCheckingParagraph): (WebCore::TextCheckingParagraph::expandRangeToNextEnd): (WebCore::TextCheckingParagraph::rangeLength): (WebCore::TextCheckingParagraph::paragraphRange): (WebCore::TextCheckingParagraph::subrange): (WebCore::TextCheckingParagraph::offsetTo): (WebCore::TextCheckingParagraph::offsetAsRange): (WebCore::TextCheckingParagraph::text): (WebCore::TextCheckingParagraph::checkingStart): (WebCore::TextCheckingParagraph::checkingEnd): (WebCore::TextCheckingParagraph::checkingLength): (WebCore::TextCheckingHelper::TextCheckingHelper): (WebCore::TextCheckingHelper::findFirstMisspelling): (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): (WebCore::TextCheckingHelper::findFirstGrammarDetail): (WebCore::TextCheckingHelper::findFirstBadGrammar): (WebCore::TextCheckingHelper::isUngrammatical): (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange): (WebCore::TextCheckingHelper::unifiedTextCheckerEnabled): * editing/TextCheckingHelper.h: * editing/TypingCommand.cpp: (WebCore::TypingCommand::typingAddedToOpenCommand): * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::replaceSelectionWithAttributedString): * editing/gtk/EditorGtk.cpp: (WebCore::Editor::pasteWithPasteboard): * editing/ios/EditorIOS.mm: (WebCore::Editor::pasteWithPasteboard): * editing/mac/EditorMac.mm: (WebCore::Editor::pasteWithPasteboard): (WebCore::Editor::replaceNodeFromPasteboard): * editing/win/EditorWin.cpp: (WebCore::Editor::pasteWithPasteboard): (WebCore::createFragmentFromPlatformData): * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): (WebCore::DragController::startDrag): 2017-05-07 Youenn Fablet [MediaStream] r216197 caused some webrtc tests to fail https://bugs.webkit.org/show_bug.cgi?id=171728 Reviewed by Eric Carlson. Covered by existing tests. Rename MediaStream::endStream to MediaStream::endCaptureTracks and only stopping capture tracks. Using it when Document is asked to stop media capture. Adding the ability to have only one active capture source at a time in a WebProcess. This is done by keeping in its related factory the active capture source. When a new source is created and started, it replaces the active capture source which becomes muted. Using that mechanism for iOS. * Modules/mediastream/MediaStream.cpp: (WebCore::MediaStream::endCaptureTracks): (WebCore::MediaStream::endStream): Deleted. * Modules/mediastream/MediaStream.h: * Modules/mediastream/MediaStreamTrack.h: (WebCore::MediaStreamTrack::isCaptureTrack): * dom/Document.cpp: (WebCore::Document::stopMediaCapture): * platform/mediastream/mac/AVAudioCaptureSource.mm: (WebCore::AVAudioCaptureSourceFactory::setActiveSource): (WebCore::AVAudioCaptureSource::setupCaptureSession): * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSourceFactory::setActiveSource): (WebCore::AVVideoCaptureSource::setupCaptureSession): * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSourceFactory::setActiveSource): (WebCore::CoreAudioSharedUnit::startProducingData): 2017-05-07 Tim Horton Clean up some WebProcessProxy, WebPage, and message handler includes https://bugs.webkit.org/show_bug.cgi?id=171791 Reviewed by Sam Weinig. * WebCore.xcodeproj/project.pbxproj: * editing/CompositionUnderline.h: Added. (WebCore::CompositionUnderline::CompositionUnderline): * editing/Editor.h: (WebCore::CompositionUnderline::CompositionUnderline): Deleted. Move CompositionUnderline out of Editor.h, so that other files can include that without Editor.h (which is quite large). Also, modernize it slightly. 2017-05-07 Sam Weinig Implement Subresource Integrity (SRI) https://bugs.webkit.org/show_bug.cgi?id=148363 Reviewed by Daniel Bates. Tests: http/tests/subresource-integrity/sri-disabled-with-setting.html http/tests/subresource-integrity/sri-enabled-with-setting.html http/tests/subresource-integrity/sri-script-cors.html http/tests/subresource-integrity/sri-style-cors.html * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: Add new files. * dom/LoadableClassicScript.cpp: (WebCore::LoadableClassicScript::create): (WebCore::LoadableClassicScript::notifyFinished): * dom/LoadableClassicScript.h: * dom/LoadableScript.h: * dom/ScriptElement.cpp: (WebCore::ScriptElement::requestClassicScript): Store integrity metadata in the script fetcher so it can be passed to the checked when script load finishes. * html/HTMLAttributeNames.in: Add 'integrity'. * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::process): When requesting a stylesheet, cache the integrity metadata so it can be used when the load completes (accessing the attribute at load completion time is incorrect, as a script might have changed the attributes value since the request was made). (WebCore::HTMLLinkElement::setCSSStyleSheet): Add an integrity check using the cached integrity metadata when a load finishes. * html/HTMLLinkElement.h: Add cached integrity metadata member. * html/HTMLLinkElement.idl: * html/HTMLScriptElement.idl: Add integrity property. * html/parser/HTMLParserIdioms.h: (WebCore::isNotHTMLSpace): Templatize isNotHTMLSpace so it can work for both UChar and LChar. * loader/ResourceCryptographicDigest.cpp: (WebCore::parseCryptographicDigestImpl): (WebCore::parseEncodedCryptographicDigestImpl): (WebCore::parseEncodedCryptographicDigest): (WebCore::decodeEncodedResourceCryptographicDigest): * loader/ResourceCryptographicDigest.h: Add concept of an encoded digest to more closely model the spec so that hashes that match the grammar but are invalid (say, mixing base64 and base64URL) make it through the algorithm longer, and don't cause us to load something that should be blocked. * loader/SubresourceIntegrity.cpp: Added. * loader/SubresourceIntegrity.h: Added. Add implementation of Subresource Integrity metadata validation allowing for a CachedResource and integrity metadata to be passed for validation. * page/Settings.in: Add setting for Subresource Integrity, defaulted to enabled. 2017-05-07 Michael Catanzaro [GTK] Cannot sign in with new Google sign-in page https://bugs.webkit.org/show_bug.cgi?id=171770 Reviewed by Carlos Garcia Campos. Google's new authentication page does not work with the Firefox user agent that's required to make various Google websites work. Special-case accounts.google.com so that it receives our standard user agent. * platform/UserAgentQuirks.cpp: (WebCore::isGoogle): (WebCore::urlRequiresFirefoxBrowser): 2017-05-06 Myles C. Maxfield [Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive https://bugs.webkit.org/show_bug.cgi?id=171636 Reviewed by Dean Jackson. LastResort is the only name which needs to be looked up case-sensitively. We can handle this in our existing function which handles special font names (like -apple-system) to make sure that we always do the right thing. Test: fast/text/lastResort.html * platform/graphics/ios/FontCacheIOS.mm: (WebCore::platformFontWithFamilySpecialCase): * platform/graphics/mac/FontCacheMac.mm: (WebCore::platformFontWithFamilySpecialCase): * platform/spi/cocoa/CoreTextSPI.h: 2017-05-06 Chris Dumez Implement the concept of cookie-averse document https://bugs.webkit.org/show_bug.cgi?id=171746 Reviewed by Sam Weinig. Implement the concept of cookie-averse document: - https://html.spec.whatwg.org/#cookie-averse-document-object Test: fast/cookies/cookie-averse-document.html * dom/Document.cpp: (WebCore::Document::isCookieAverse): (WebCore::Document::cookie): (WebCore::Document::setCookie): * dom/Document.h: 2017-05-06 Chris Dumez Unreviewed build fix after r216339. * dom/Document.h: (WebCore::Document::readyState): 2017-05-06 Chris Dumez Align our IDL files with the latest DOM specification https://bugs.webkit.org/show_bug.cgi?id=171777 Reviewed by Sam Weinig. Align our IDL files with the latest DOM specification: - https://dom.spec.whatwg.org No Web-facing behavior change. Things that do not match the specification have been annotated with FIXME comments. * dom/CharacterData.idl: * dom/Comment.idl: * dom/CustomEvent.idl: * dom/DOMImplementation.idl: * dom/Document.cpp: * dom/Document.h: (WebCore::Document::readyState): * dom/Document.idl: * dom/MutationObserver.idl: * dom/NamedNodeMap.idl: * dom/NodeFilter.idl: * dom/NodeIterator.idl: * dom/NodeList.idl: * dom/NonDocumentTypeChildNode.idl: * dom/ParentNode.idl: * dom/ProcessingInstruction.idl: * dom/Range.idl: * dom/ShadowRoot.idl: * dom/Text.idl: * dom/TreeWalker.idl: * html/DOMTokenList.idl: 2017-05-06 Tim Horton Reduce the number of includes in WebPage.h and WebProcess.h https://bugs.webkit.org/show_bug.cgi?id=171779 Reviewed by Sam Weinig. * page/TextIndicator.h: 2017-05-06 Alexey Proskuryakov REGRESSION (r216294): The new test fails on WebKit1 https://bugs.webkit.org/show_bug.cgi?id=171780 Rolling back https://trac.webkit.org/r216294, https://trac.webkit.org/r216296, https://trac.webkit.org/216299, https://trac.webkit.org/216330 * page/FrameView.cpp: (WebCore::FrameView::paintContents): * page/FrameView.h: * platform/ScrollView.cpp: (WebCore::ScrollView::paint): * platform/ScrollView.h: * platform/Scrollbar.cpp: (WebCore::Scrollbar::paint): * platform/Scrollbar.h: * platform/Widget.h: * platform/graphics/filters/FilterOperation.h: (WebCore::FilterOperation::movesPixels): (WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin): Deleted. * platform/graphics/filters/FilterOperations.cpp: (WebCore::FilterOperations::hasFilterThatShouldBeRestrictedBySecurityOrigin): Deleted. * platform/graphics/filters/FilterOperations.h: * platform/gtk/WidgetGtk.cpp: (WebCore::Widget::paint): * platform/ios/WidgetIOS.mm: (WebCore::Widget::paint): * platform/mac/WidgetMac.mm: (WebCore::Widget::paint): * platform/win/WidgetWin.cpp: (WebCore::Widget::paint): * rendering/FilterEffectRenderer.cpp: (WebCore::FilterEffectRenderer::build): * rendering/FilterEffectRenderer.h: * rendering/PaintInfo.h: (WebCore::PaintInfo::PaintInfo): (): Deleted. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paint): (WebCore::RenderLayer::setupFilters): (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase): * rendering/RenderLayer.h: * rendering/RenderScrollbar.cpp: (WebCore::RenderScrollbar::paint): * rendering/RenderScrollbar.h: * rendering/RenderWidget.cpp: (WebCore::RenderWidget::paintContents): 2017-05-06 Chris Dumez Unreviewed, rolling out r216333. Caused layout test failures Reverted changeset: "Implement the concept of cookie-averse document" https://bugs.webkit.org/show_bug.cgi?id=171746 http://trac.webkit.org/changeset/216333 2017-05-06 Chris Dumez Implement the concept of cookie-averse document https://bugs.webkit.org/show_bug.cgi?id=171746 Reviewed by Sam Weinig. Implement the concept of cookie-averse document: - https://html.spec.whatwg.org/#cookie-averse-document-object Test: fast/cookies/cookie-averse-document.html * dom/Document.cpp: (WebCore::Document::isCookieAverse): (WebCore::Document::cookie): (WebCore::Document::setCookie): * dom/Document.h: 2017-05-06 Myles C. Maxfield REGERSSION(r213499): Emoji with Fitzpatrick modifiers are drawn as two separate glyphs https://bugs.webkit.org/show_bug.cgi?id=171750 Reviewed by Zalan Bujtas. Emoji with Fitzpatrick modifiers need to take our complex text codepath. When looking through the string to determine which code path to use, we ask if a particular codepoint is an emoji group candidate. r213499 expanded the set of these candidates to include Fitzpatrick modifiers, which means the next "if" statement would never be hit. Instead, we should check that "if" statement first (because order is not important here). The next checks do not intersect with any emoji group candidates. Test: fast/text/fitzpatrick-combination.html * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::characterRangeCodePath): 2017-05-06 Youenn Fablet RealtimeMediaSourceCenter callbacks should be passed as r-values https://bugs.webkit.org/show_bug.cgi?id=171407 Reviewed by Eric Carlson. No change of behavior, this is mostly style here. * platform/mediastream/RealtimeMediaSourceCenter.h: * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints): (WebCore::RealtimeMediaSourceCenterMac::createMediaStream): * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h: * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp: (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints): * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h: * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints): (WebCore::MockRealtimeMediaSourceCenter::createMediaStream): * platform/mock/MockRealtimeMediaSourceCenter.h: 2017-05-05 Zalan Bujtas Renderers being destroyed should not be added to AX's deferred list. https://bugs.webkit.org/show_bug.cgi?id=171768 Reviewed by Simon Fraser. In certain cases, when custom scrollbars are present, while destroying the scrollbars' block parent, we - first remove the block from the AX's deferred list (AXObjectCache::remove) - destroy the render layer that owns the custom scrollbars (RenderLayer::destroyLayer) - detach the scrollbars from the parent (block) (RenderObject::removeFromParent) - clean up the block's lines (RenderBlock::deleteLines) - push the block back to the AX's deferred list (AXObjectCache::recomputeDeferredIsIgnored) At this point no one will remove the current block from AX's deferred list. Test: accessibility/crash-when-renderers-are-added-back-to-deferred-list.html * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::recomputeDeferredIsIgnored): (WebCore::AXObjectCache::deferTextChanged): 2017-05-05 Said Abou-Hallawa Crash in ImageFrameCache::decodedSizeChanged() after image load cancellation https://bugs.webkit.org/show_bug.cgi?id=171736 Reviewed by Tim Horton. Tests: Covered by run-webkit-tests fast/images/image-formats-support.html --guard-malloc. Because an image format is not supported, the ImageObserver of the Image is deleted then the Image itself is deleted. In BitmapImage destructor, we make a call which ends up accessing the deleted ImageObserver. To fix this, we need to change the BitImage destructor to avoid calling ImageFrameCache::decodedSizeChanged() since it is not really needed. * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::~BitmapImage): 2017-05-05 Timothy Horton [Mac] Adjust cursor position for dragged link (and stop it from moving based on how fast you are dragging) https://bugs.webkit.org/show_bug.cgi?id=171764 Reviewed by Simon Fraser. * page/DragController.cpp: (WebCore::DragController::startDrag): Compute dragImageAnchorPoint only if it is needed. Don't compute a random unused imageRect. Factor link drag image offset computation out into DragImage functions for platforms to override. Pass dragOrigin (the mouseDown point), not mouseDraggedPoint, to doSystemDrag, just like all the other drag types. This plus the WebKit2 change makes the link stable vs. the cursor, instead of positioned based on how fast you move after the mouse down. * page/DragController.h: * page/gtk/DragControllerGtk.cpp: * page/mac/DragControllerMac.mm: * page/win/DragControllerWin.cpp: Move LinkDragBorderInset into DragImage, and share between the non-Mac platforms. * platform/DragImage.cpp: (WebCore::dragOffsetForLinkDragImage): (WebCore::anchorPointForLinkDragImage): * platform/DragImage.h: As previously mentioned, move the computation of drag image offset here. * platform/mac/DragImageMac.mm: (WebCore::dragOffsetForLinkDragImage): (WebCore::anchorPointForLinkDragImage): Put the new drag image to the bottom right of the cursor. 2017-05-05 Dean Jackson ...and now the GTK and Windows builds. * platform/gtk/WidgetGtk.cpp: (WebCore::Widget::paint): * platform/win/WidgetWin.cpp: (WebCore::Widget::paint): 2017-05-05 Brady Eidson API test WebKit2.WebsiteDataStoreCustomPaths is failing on ios-simulator. and https://bugs.webkit.org/show_bug.cgi?id=171513 Reviewed by Andy Estes. Covered by API test. * platform/spi/cf/CFNetworkSPI.h: 2017-05-05 Dean Jackson Try to fix iOS build. * platform/ios/WidgetIOS.mm: (WebCore::Widget::paint): 2017-05-05 Dean Jackson Restrict SVG filters to accessible security origins https://bugs.webkit.org/show_bug.cgi?id=118689 Reviewed by Brent Fulgham. Certain SVG filters should only be allowed to operate on content that is has SecurityOrigin access to. Implement this by including a flag in PaintInfo and LayerPaintingInfo, and have RenderWidget make sure the documents have acceptable SecurityOrigins as it goes to paint. This could be used as the first step in a "safe painting" strategy, allowing some content to be rendered into a canvas or via the element() CSS function... but it is only a small first step. Test: http/tests/css/filters-on-iframes.html * page/FrameView.cpp: (WebCore::FrameView::paintContents): * page/FrameView.h: * platform/ScrollView.cpp: (WebCore::ScrollView::paint): * platform/ScrollView.h: * platform/Scrollbar.cpp: (WebCore::Scrollbar::paint): * platform/Scrollbar.h: * platform/Widget.h: * platform/graphics/filters/FilterOperation.h: (WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin): * platform/graphics/filters/FilterOperations.cpp: (WebCore::FilterOperations::hasFilterThatShouldBeRestrictedBySecurityOrigin): * platform/graphics/filters/FilterOperations.h: * platform/mac/WidgetMac.mm: (WebCore::Widget::paint): * rendering/FilterEffectRenderer.cpp: (WebCore::FilterEffectRenderer::build): * rendering/FilterEffectRenderer.h: * rendering/PaintInfo.h: (WebCore::PaintInfo::PaintInfo): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paint): (WebCore::RenderLayer::setupFilters): (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase): * rendering/RenderLayer.h: * rendering/RenderScrollbar.cpp: (WebCore::RenderScrollbar::paint): * rendering/RenderScrollbar.h: * rendering/RenderWidget.cpp: (WebCore::RenderWidget::paintContents): 2017-05-05 Ryan Haddad Unreviewed, rolling out r216273. This change caused an assertion failure on WK1. Reverted changeset: "Crash in ImageFrameCache::decodedSizeChanged() after image load cancellation" https://bugs.webkit.org/show_bug.cgi?id=171736 http://trac.webkit.org/changeset/216273 2017-05-05 Brian Burg [Cocoa] Converting from WebCore::Cookie to NSHTTPCookie always marks cookies as session cookies https://bugs.webkit.org/show_bug.cgi?id=171748 Reviewed by Michael Catanzaro. The function that we use to convert from WebCore::Cookie to NSHTTPCookie was also misusing the NSHTTPCookieDiscard property. If any value is provided for this key, even @NO, CFNetwork interprets that to mean that the cookie has the "session" flag. This is known to affect cookies set via WebCookieManager, WKHTTPCookieStore, and WebAutomationSession. This is covered by existing test WebKit2.WKHTTPCookieStore. * platform/network/cocoa/CookieCocoa.mm: (WebCore::Cookie::operator NSHTTPCookie *): Don't include the property if the cookie is not a session cookie. 2017-05-05 Youenn Fablet TURNS gathering is not working properly https://bugs.webkit.org/show_bug.cgi?id=171747 Reviewed by Eric Carlson. Did manual testing on real TURNS servers. * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::configurationFromMediaEndpointConfiguration): Disabling TURNS servers gathering. 2017-05-05 Ryan Haddad Unreviewed, rolling out r216275. This change broke internal builds. Reverted changeset: "[Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive" https://bugs.webkit.org/show_bug.cgi?id=171636 http://trac.webkit.org/changeset/216275 2017-05-05 Myles C. Maxfield [Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive https://bugs.webkit.org/show_bug.cgi?id=171636 Reviewed by Dean Jackson. LastResort is the only name which needs to be looked up case-sensitively. We can handle this in our existing function which handles special font names (like -apple-system) to make sure that we always do the right thing. Test: fast/text/lastResort.html * platform/spi/cocoa/CoreTextSPI.h: * platform/graphics/ios/FontCacheIOS.mm: (WebCore::platformFontWithFamilySpecialCase): * platform/graphics/mac/FontCacheMac.mm: (WebCore::platformFontWithFamilySpecialCase): 2017-05-05 Said Abou-Hallawa Crash in ImageFrameCache::decodedSizeChanged() after image load cancellation https://bugs.webkit.org/show_bug.cgi?id=171736 Reviewed by Tim Horton. Tests: Covered by run-webkit-tests fast/images/image-formats-support.html --guard-malloc. Because an image format is not supported, the ImageObserver of the Image is deleted then the Image itself is deleted. In BitmapImage destructor, we make a call which ends up accessing the deleted ImageObserver. To fix this, we need to setImageObsever of the Image to-be-deleted to nullptr. So the Image can avoid accessing its ImageObserver, while it is being deleted. Also we can change the BitImage destructor to avoid calling ImageFrameCache::decodedSizeChanged() since it is not really needed. * loader/cache/CachedImage.cpp: (WebCore::CachedImage::clearImage): * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::~BitmapImage): 2017-05-05 Brian Burg CrashTracer: [USER] com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::commonVMSlow + 57 https://bugs.webkit.org/show_bug.cgi?id=171669 Reviewed by Mark Lam. * bindings/js/CommonVM.h: (WebCore::commonVMOrNull): Add an inline accessor function to expose the global variable. 2017-05-05 Filip Pizlo GCController.cpp's collect() should be Async https://bugs.webkit.org/show_bug.cgi?id=171708 Reviewed by Saam Barati. No new tests because no change in behavior. This is one step towards not requesting sync GCs in WebCore. I'm landing this incrementally to make bisecting super easy. * bindings/js/GCController.cpp: (WebCore::collect): 2017-05-05 Chris Dumez Attr Nodes should not have children https://bugs.webkit.org/show_bug.cgi?id=171688 Reviewed by Andreas Kling. Attr Nodes should not have children as per the latest DOM specification: - https://dom.spec.whatwg.org/#interface-attr - https://dom.spec.whatwg.org/#dom-attr-value - https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity (Step 1) Firefox and Chrome both have been matching the DOM specification for a while so I think we should do the same. This aligns us with other browsers, simplifies the code, is more efficient and the code being removed has been prone to security bugs. Test: fast/dom/Attr/cannot-have-children.html * dom/Attr.cpp: (WebCore::Attr::Attr): (WebCore::Attr::create): (WebCore::Attr::setValue): (WebCore::Attr::cloneNodeInternal): * dom/Attr.h: - Have Attr subclass Node instead of ContainerNode as it can no longer have children. - Drop logic to dealing with children / creating a Text child. * dom/CharacterData.cpp: (WebCore::CharacterData::notifyParentAfterChange): Drop useless check found by the compiler. parentNode() can no longer be an Attr node. * dom/Node.cpp: (WebCore::appendTextContent): appendTextContent() is called by Node.TextContent(). For Attr Nodes, we should no longer traverse its subtree to gather Text Nodes. Instead, we now return Attr.value, as per the specification: - https://dom.spec.whatwg.org/#dom-node-textcontent * dom/Range.cpp: (WebCore::lengthOfContentsInNode): As per https://dom.spec.whatwg.org/#concept-node-length, we should return the number of children for Attr Nodes, which will always be 0. * xml/XPathUtil.cpp: (WebCore::XPath::isValidContextNode): Always return true for TEXT_NODE as the !(node->parentNode() && node->parentNode()->isAttributeNode()) check will also with true now. This is because a parentNode() cannot be an Attribute Node. 2017-05-05 Brian Burg [Cocoa] Converting from WebCore::Cookie to NSHTTPCookie always marks cookies as secure https://bugs.webkit.org/show_bug.cgi?id=171700 Reviewed by Brady Eidson. The function that we use to convert from WebCore::Cookie to NSHTTPCookie was misusing the NSHTTPCookieSecure property. If any value is provided for this key, even @NO, CFNetwork interprets that to mean that the cookie has the "secure" flag. Thus, in some cases we would store an "insecure" cookie on a site that uses the http:// protocol, and be unable to later retrieve the cookie. This is known to affect cookies set via WebCookieManager, WKHTTPCookieStore, and WebAutomationSession. This is covered by existing test WebKit2.WKHTTPCookieStore. The test had a bug that masked this problem. * platform/network/cocoa/CookieCocoa.mm: (WebCore::Cookie::operator NSHTTPCookie *): Don't include the property if the cookie is not secure. 2017-05-05 Wenson Hsieh Add SPI to WebItemProviderPasteboard to synchronously load data with a given timeout https://bugs.webkit.org/show_bug.cgi?id=171725 Reviewed by Beth Dakin. Adds a synchronousTimeout: argument to doAfterLoadingProvidedContentIntoFileURLs:. If a positive timeout interval is specified by the client, then we will block the main thread for at most that amount of time after beginning to load from the item providers. To do this, we introduce another `dispatch_group_t` in parallel to the `fileLoadingGroup` that is entered and left in the same places. However, instead of attaching a handler block, we simply perform a synchronous wait for either the time limit to be reached, or the item providers to finish loading. No new tests -- no change in behavior yet. * platform/ios/WebItemProviderPasteboard.h: * platform/ios/WebItemProviderPasteboard.mm: (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]): (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]): 2017-05-05 Chris Dumez Clean up Attr.idl https://bugs.webkit.org/show_bug.cgi?id=171691 Reviewed by Andreas Kling. Clean up Attr.idl to match the spec: - https://dom.spec.whatwg.org/#interface-attr No Web-facing behavior change except for Attr properties being enumerated in a slightly different order. * dom/Attr.idl: 2017-05-05 Antti Koivisto ASSERTION FAILED: !frame().document()->inRenderTreeUpdate() in WebCore::FrameView::layout(bool) https://bugs.webkit.org/show_bug.cgi?id=171717 Reviewed by Brent Fulgham. * loader/FrameLoader.cpp: (WebCore::FrameLoader::checkCompleted): Don't allow frame load to complete in the middle of a render tree update. Instead delay the check. 2017-05-05 Chris Dumez Refactor / Clean up Element.idl https://bugs.webkit.org/show_bug.cgi?id=171734 Reviewed by Sam Weinig. Refactor / Clean up Element.idl to match the latest specification: - https://dom.spec.whatwg.org/#interface-element There is no Web-facing behavior change in this patch besides the Element properties being enumerated in a slightly different order. Things that do not match the specification have merely been annotated with FIXME comments for now. This makes it much more obvious what's standard, what's not and what needs fixing. * dom/Element.idl: 2017-05-05 Tim Horton Link drag images for apple.com front page links have a lot of spurious whitespace https://bugs.webkit.org/show_bug.cgi?id=171719 Reviewed by Wenson Hsieh. * page/DragController.cpp: (WebCore::DragController::startDrag): Use the white-space-simplified string that we put on the pasteboard for the drag image, too! 2017-05-04 Mark Lam DRT's setAudioResultCallback() and IDBRequest::setResult() need to acquire the JSLock. https://bugs.webkit.org/show_bug.cgi?id=171716 Reviewed by Saam Barati. No new tests. This issue was caught by existing tests. IDBRequest::setResult() needs to acquire the JSLock before calling toJS() (which does JS conversion and therefore, potentially JS allocations). * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::setResult): (WebCore::IDBRequest::setResultToStructuredClone): 2017-05-05 Carlos Garcia Campos [GStreamer] Do not report more errors after the first one https://bugs.webkit.org/show_bug.cgi?id=171722 Reviewed by Xabier Rodriguez-Calvar. We can receive several error messages for the same error from different elements. That's not expected by the media source selection algorithm implementation. I don't know if didn't happen with previous versions of GST, but since the upgrade to 1.10.4 several tests are failing because of this. Fixes: media/video-error-does-not-exist.html media/video-load-networkState.html media/video-source-error.html media/video-source-none-supported.html media/video-source-moved.html * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Return early also when an error already occured. 2017-05-05 Carlos Garcia Campos [GStreamer] Fix handling of gst errors in MediaPlayerPrivateGStreamer::handleMessage https://bugs.webkit.org/show_bug.cgi?id=171721 Reviewed by Xabier Rodriguez-Calvar. We are checking the GError only comparing the code, and ignoring the domain in some cases. Use g_error_matches() in those cases instead of only checking the code. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::handleMessage): 2017-05-04 Commit Queue Unreviewed, rolling out r216206. https://bugs.webkit.org/show_bug.cgi?id=171714 Multiple LayoutTests crashing in Document::page() (Requested by ap on #webkit). Reverted changeset: "Remove support for legacy Notifications" https://bugs.webkit.org/show_bug.cgi?id=171487 http://trac.webkit.org/changeset/216206 2017-05-04 Chris Dumez Drop remaining uses of PassRefPtr from CompositeEditCommand https://bugs.webkit.org/show_bug.cgi?id=171645 Reviewed by Darin Adler. Drop remaining uses of PassRefPtr from CompositeEditCommand. * editing/ApplyBlockElementCommand.cpp: (WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded): (WebCore::ApplyBlockElementCommand::endOfNextParagraphSplittingTextNodesIfNeeded): * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): (WebCore::ApplyStyleCommand::cleanupUnstyledAppleStyleSpans): (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi): (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock): (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange): (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): (WebCore::ApplyStyleCommand::replaceWithSpanOrRemoveIfWithoutAttributes): (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement): (WebCore::ApplyStyleCommand::removeCSSStyle): (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown): (WebCore::ApplyStyleCommand::splitTextAtStart): (WebCore::ApplyStyleCommand::splitTextAtEnd): (WebCore::ApplyStyleCommand::splitTextElementAtStart): (WebCore::ApplyStyleCommand::splitTextElementAtEnd): (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement): (WebCore::ApplyStyleCommand::addBlockStyle): (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded): (WebCore::ApplyStyleCommand::applyInlineStyleChange): (WebCore::ApplyStyleCommand::joinChildTextNodes): * editing/BreakBlockquoteCommand.cpp: (WebCore::BreakBlockquoteCommand::doApply): * editing/CompositeEditCommand.cpp: (WebCore::applyCommand): (WebCore::CompositeEditCommand::insertNodeAt): (WebCore::CompositeEditCommand::removeChildrenInRange): (WebCore::CompositeEditCommand::removeNode): (WebCore::CompositeEditCommand::removeNodePreservingChildren): (WebCore::CompositeEditCommand::removeNodeAndPruneAncestors): (WebCore::CompositeEditCommand::moveRemainingSiblingsToNewParent): (WebCore::CompositeEditCommand::replaceElementWithSpanPreservingChildrenAndAttributes): (WebCore::CompositeEditCommand::prune): (WebCore::CompositeEditCommand::splitTextNode): (WebCore::CompositeEditCommand::splitElement): (WebCore::CompositeEditCommand::mergeIdenticalElements): (WebCore::CompositeEditCommand::splitTextNodeContainingElement): (WebCore::CompositeEditCommand::positionOutsideTabSpan): (WebCore::CompositeEditCommand::removeNodeAttribute): (WebCore::CompositeEditCommand::setNodeAttribute): (WebCore::CompositeEditCommand::deleteInsignificantText): (WebCore::CompositeEditCommand::removePlaceholderAt): (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): (WebCore::CompositeEditCommand::pushAnchorElementDown): (WebCore::CompositeEditCommand::cleanupAfterDeletion): (WebCore::CompositeEditCommand::moveParagraphs): * editing/CompositeEditCommand.h: * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::handleSpecialCaseBRDelete): (WebCore::DeleteSelectionCommand::removeNodeUpdatingStates): (WebCore::DeleteSelectionCommand::removeNode): (WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss): (WebCore::DeleteSelectionCommand::handleGeneralDelete): (WebCore::DeleteSelectionCommand::mergeParagraphs): (WebCore::DeleteSelectionCommand::removePreviouslySelectedEmptyTableRows): (WebCore::DeleteSelectionCommand::removeRedundantBlocks): * editing/DeleteSelectionCommand.h: * editing/Editor.cpp: (WebCore::ClearTextCommand::CreateAndApply): (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::handleAcceptedCandidate): * editing/EditorCommand.cpp: (WebCore::executeFormatBlock): * editing/IndentOutdentCommand.cpp: (WebCore::IndentOutdentCommand::outdentParagraph): * editing/InsertLineBreakCommand.cpp: (WebCore::InsertLineBreakCommand::doApply): * editing/InsertListCommand.cpp: (WebCore::InsertListCommand::fixOrphanedListChild): (WebCore::InsertListCommand::doApplyForSingleParagraph): (WebCore::InsertListCommand::unlistifyParagraph): * editing/InsertParagraphSeparatorCommand.cpp: (WebCore::InsertParagraphSeparatorCommand::doApply): * editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::insertTab): * editing/ModifySelectionListLevel.cpp: (WebCore::ModifySelectionListLevelCommand::insertSiblingNodeRangeBefore): (WebCore::ModifySelectionListLevelCommand::insertSiblingNodeRangeAfter): (WebCore::ModifySelectionListLevelCommand::appendSiblingNodeRange): (WebCore::DecreaseSelectionListLevelCommand::doApply): * editing/RemoveNodePreservingChildrenCommand.cpp: (WebCore::RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand): (WebCore::RemoveNodePreservingChildrenCommand::doApply): * editing/RemoveNodePreservingChildrenCommand.h: (WebCore::RemoveNodePreservingChildrenCommand::create): * editing/ReplaceNodeWithSpanCommand.cpp: (WebCore::ReplaceNodeWithSpanCommand::ReplaceNodeWithSpanCommand): (WebCore::ReplaceNodeWithSpanCommand::doApply): (WebCore::ReplaceNodeWithSpanCommand::doUnapply): (WebCore::ReplaceNodeWithSpanCommand::getNodesInCommand): * editing/ReplaceNodeWithSpanCommand.h: (WebCore::ReplaceNodeWithSpanCommand::create): * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplacementFragment::removeNodePreservingChildren): (WebCore::ReplacementFragment::removeInterchangeNodes): (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline): (WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder): (WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor): (WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds): (WebCore::handleStyleSpansBeforeInsertion): (WebCore::ReplaceSelectionCommand::handleStyleSpans): (WebCore::ReplaceSelectionCommand::doApply): (WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition): (WebCore::ReplaceSelectionCommand::insertAsListItems): (WebCore::ReplaceSelectionCommand::performTrivialReplace): * editing/SetNodeAttributeCommand.cpp: (WebCore::SetNodeAttributeCommand::SetNodeAttributeCommand): (WebCore::SetNodeAttributeCommand::getNodesInCommand): * editing/SetNodeAttributeCommand.h: (WebCore::SetNodeAttributeCommand::create): * editing/SimplifyMarkupCommand.cpp: (WebCore::SimplifyMarkupCommand::doApply): (WebCore::SimplifyMarkupCommand::pruneSubsequentAncestorsToRemove): * editing/SimplifyMarkupCommand.h: * editing/SplitElementCommand.cpp: (WebCore::SplitElementCommand::SplitElementCommand): (WebCore::SplitElementCommand::executeApply): (WebCore::SplitElementCommand::getNodesInCommand): * editing/SplitElementCommand.h: (WebCore::SplitElementCommand::create): * editing/SplitTextNodeCommand.cpp: (WebCore::SplitTextNodeCommand::SplitTextNodeCommand): (WebCore::SplitTextNodeCommand::doApply): (WebCore::SplitTextNodeCommand::doUnapply): (WebCore::SplitTextNodeCommand::doReapply): (WebCore::SplitTextNodeCommand::insertText1AndTrimText2): * editing/SplitTextNodeCommand.h: (WebCore::SplitTextNodeCommand::create): * editing/SplitTextNodeContainingElementCommand.cpp: (WebCore::SplitTextNodeContainingElementCommand::SplitTextNodeContainingElementCommand): (WebCore::SplitTextNodeContainingElementCommand::doApply): * editing/SplitTextNodeContainingElementCommand.h: (WebCore::SplitTextNodeContainingElementCommand::create): * editing/TextInsertionBaseCommand.cpp: (WebCore::TextInsertionBaseCommand::applyTextInsertionCommand): * editing/TypingCommand.cpp: (WebCore::TypingCommand::makeEditableRootEmpty): * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): 2017-05-04 Daniel Bates Fix misspelled word "interrupt" as pointed out by Darin Adler in . * loader/FrameLoader.cpp: (WebCore::FrameLoader::transitionToCommitted): 2017-05-04 Jeremy Jones UIColor +whiteColor and +clearColor are ambiguous and need to be casted when soft linked. https://bugs.webkit.org/show_bug.cgi?id=171704 Reviewed by Jer Noble. No new tests because no behavior change. Fix build by casting result of +clearColor to UIColor. * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: (clearUIColor): (WebVideoFullscreenInterfaceAVKit::setupFullscreen): (WebVideoFullscreenInterfaceAVKit::exitFullscreen): (WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture): 2017-05-04 Chris Dumez Element.slot should be marked as [Unscopable] https://bugs.webkit.org/show_bug.cgi?id=171683 Reviewed by Darin Adler. Element.slot should be marked as [Unscopable]: - https://dom.spec.whatwg.org/#interface-element - https://heycam.github.io/webidl/#Unscopable Test: fast/shadow-dom/Element-slot-unscopable.html * dom/Element.idl: 2017-05-04 Don Olmstead [Win] Remove redundant macros that are set in the CMake config https://bugs.webkit.org/show_bug.cgi?id=171571 Reviewed by Brent Fulgham. No new tests. No change in behavior. * WebCorePrefix.h: * config.h: * platform/win/COMPtr.h: * platform/win/WindowsTouch.h: * testing/js/WebCoreTestSupportPrefix.h: 2017-05-04 Tim Horton [Mac] Modernize image for dragged link https://bugs.webkit.org/show_bug.cgi?id=171701 Reviewed by Simon Fraser. * WebCore.xcodeproj/project.pbxproj: * page/mac/DragControllerMac.mm: * platform/mac/DragImageMac.mm: (WebCore::dragImageSize): (WebCore::scaleDragImage): (WebCore::dissolveDragImageToFraction): (WebCore::createDragImageFromImage): (WebCore::LinkImageLayout::LinkImageLayout): (WebCore::LinkImageLayout::layOutText): (WebCore::LinkImageLayout::addLine): (WebCore::createDragImageForLink): (WebCore::fontFromNSFont): Deleted. (WebCore::canUseFastRenderer): Deleted. (WebCore::widthWithFont): Deleted. (WebCore::drawAtPoint): Deleted. (WebCore::drawDoubledAtPoint): Deleted. * platform/spi/cocoa/LinkPresentationSPI.h: Added. Improve the design of URL drag images. The margins are increased, the background is now white, the text is not drawn doubled-up, the title will now wrap to two lines, and the domain name will appear simplified and de-punycoded. Much of the implementation of text painting is borrowed from for now, but we should figure out how to generalize it for UI-like parts of WebKit in the future. 2017-05-04 Commit Queue Unreviewed, rolling out r216223. https://bugs.webkit.org/show_bug.cgi?id=171706 not quite ready (Requested by thorton on #webkit). Reverted changeset: "[Mac] Modernize image for dragged link" https://bugs.webkit.org/show_bug.cgi?id=171701 http://trac.webkit.org/changeset/216223 2017-05-04 Tim Horton [Mac] Modernize image for dragged link https://bugs.webkit.org/show_bug.cgi?id=171701 Reviewed by Simon Fraser. * page/mac/DragControllerMac.mm: * platform/mac/DragImageMac.mm: (WebCore::dragImageSize): (WebCore::scaleDragImage): (WebCore::dissolveDragImageToFraction): (WebCore::createDragImageFromImage): (WebCore::LinkImageLayout::LinkImageLayout): (WebCore::LinkImageLayout::addLine): (WebCore::createDragImageForLink): (WebCore::fontFromNSFont): Deleted. (WebCore::canUseFastRenderer): Deleted. (WebCore::widthWithFont): Deleted. (WebCore::drawAtPoint): Deleted. (WebCore::drawDoubledAtPoint): Deleted. Improve the design of URL drag images. The margins are increased, the background is now white, the text is not drawn doubled-up, the title will now wrap to two lines, and the domain name will appear simplified and de-punycoded. Much of the implementation of text painting is borrowed from for now, but we should figure out how to generalize it for UI-like parts of WebKit in the future. 2017-05-04 Jeremy Jones Use if instead of return early for 13 places in WebAVPlayerController https://bugs.webkit.org/show_bug.cgi?id=171692 Reviewed by Jer Noble. No new tests because no behavior change. * platform/ios/WebAVPlayerController.mm: (-[WebAVPlayerController play:]): (-[WebAVPlayerController pause:]): (-[WebAVPlayerController togglePlayback:]): (-[WebAVPlayerController beginScrubbing:]): (-[WebAVPlayerController endScrubbing:]): (-[WebAVPlayerController seekToTime:]): (-[WebAVPlayerController beginScanningForward:]): (-[WebAVPlayerController endScanningForward:]): (-[WebAVPlayerController beginScanningBackward:]): (-[WebAVPlayerController endScanningBackward:]): (-[WebAVPlayerController seekToBeginning:]): (-[WebAVPlayerController seekToEnd:]): (-[WebAVPlayerController toggleMuted:]): 2017-05-04 Filip Pizlo JSC::Heap should expose a richer API for requesting GCs https://bugs.webkit.org/show_bug.cgi?id=171690 Reviewed by Geoffrey Garen. No new tests because this is just a refactoring. Change some function calls now that some JSC::Heap APIs got renamed. * bindings/js/GCController.cpp: (WebCore::collect): (WebCore::GCController::garbageCollectNow): (WebCore::GCController::garbageCollectNowIfNotDoneRecently): 2017-05-04 Mark Lam NeverDestroyed(ASCIILiteral(...)) is not thread safe. https://bugs.webkit.org/show_bug.cgi?id=171586 Reviewed by Yusuke Suzuki. No new tests because we're just converting uses of ASCIILiteral (in the instantiation of NeverDestroyed and NeverDestroyed) to MAKE_STATIC_STRING_IMPL. The correctness of using MAKE_STATIC_STRING_IMPL is tested in the newly added API test in this patch. Also changed "static NeverDestroyed" instances in SQLiteIDBBackingStore.cpp to "static const char* const" because they are only ever used to get the underlying const char*. * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords): * Modules/mediastream/MediaEndpointSessionDescription.cpp: * Modules/mediastream/RTCRtpTransceiver.cpp: * Modules/mediastream/SDPProcessor.cpp: * Modules/navigatorcontentutils/NavigatorContentUtils.cpp: (WebCore::customHandlersStateString): (WebCore::NavigatorContentUtils::isProtocolHandlerRegistered): * Modules/speech/SpeechSynthesis.cpp: (WebCore::SpeechSynthesis::boundaryEventOccurred): * accessibility/AccessibilityMediaControls.cpp: (WebCore::AccessibilityMediaControl::controlTypeName): (WebCore::AccessibilityMediaControl::title): (WebCore::AccessibilityMediaControlsContainer::elementTypeName): (WebCore::AccessibilityMediaTimeline::helpText): (WebCore::AccessibilityMediaTimeDisplay::accessibilityDescription): * bindings/js/JSLazyEventListener.cpp: (WebCore::eventParameterName): * contentextensions/ContentExtensionsBackend.cpp: (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule): * css/CSSDefaultStyleSheets.cpp: (WebCore::screenEval): (WebCore::printEval): * css/MediaList.cpp: (WebCore::addResolutionWarningMessageToConsole): * css/StyleSheetContents.cpp: (WebCore::StyleSheetContents::parseAuthorStyleSheet): * dom/Document.cpp: (WebCore::Document::readyState): * dom/LoadableClassicScript.cpp: (WebCore::LoadableClassicScript::notifyFinished): * dom/PseudoElement.cpp: (WebCore::PseudoElement::pseudoElementNameForEvents): * editing/MarkupAccumulator.cpp: (WebCore::MarkupAccumulator::shouldAddNamespaceElement): * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::dataDetectorURLProtocol): * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::styleNodeCloseTag): (WebCore::createMarkupInternal): * html/FormController.cpp: (WebCore::formStateSignature): * html/ImageInputType.cpp: (WebCore::ImageInputType::appendFormData): * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::realizeSaves): (WebCore::CanvasRenderingContext2D::getImageData): * html/parser/XSSAuditor.cpp: (WebCore::XSSAuditor::init): (WebCore::XSSAuditor::eraseDangerousAttributesIfInjected): * html/track/VTTCue.cpp: (WebCore::startKeyword): (WebCore::middleKeyword): (WebCore::endKeyword): (WebCore::leftKeyword): (WebCore::rightKeyword): (WebCore::verticalGrowingLeftKeyword): (WebCore::verticalGrowingRightKeyword): (WebCore::VTTCue::determineTextDirection): (WebCore::VTTCue::markFutureAndPastNodes): * inspector/InspectorCSSAgent.cpp: (WebCore::computePseudoClassMask): * inspector/InspectorIndexedDBAgent.cpp: * inspector/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::sourceMapURLForResource): * inspector/PageDebuggerAgent.cpp: (WebCore::PageDebuggerAgent::sourceMapURLForScript): * loader/ImageLoader.cpp: (WebCore::ImageLoader::notifyFinished): * loader/TextTrackLoader.cpp: (WebCore::TextTrackLoader::corsPolicyPreventedLoad): * loader/icon/IconDatabase.cpp: (WebCore::IconDatabase::defaultDatabaseFilename): * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS): * page/SecurityOrigin.cpp: (WebCore::SecurityOrigin::urlWithUniqueSecurityOrigin): * page/UserContentURLPattern.cpp: (WebCore::UserContentURLPattern::parse): * platform/MIMETypeRegistry.cpp: (WebCore::defaultMIMEType): * platform/animation/Animation.cpp: (WebCore::Animation::initialName): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::engineDescription): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::engineDescription): * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontCache::similarFont): * platform/gtk/UserAgentGtk.cpp: (WebCore::platformVersionForUAString): * platform/mock/mediasource/MockBox.cpp: (WebCore::MockTrackBox::type): (WebCore::MockInitializationBox::type): (WebCore::MockSampleBox::type): * platform/network/HTTPHeaderValues.cpp: (WebCore::HTTPHeaderValues::textPlainContentType): (WebCore::HTTPHeaderValues::formURLEncodedContentType): (WebCore::HTTPHeaderValues::noCache): (WebCore::HTTPHeaderValues::maxAge0): * platform/network/HTTPParsers.cpp: (WebCore::parseXSSProtectionHeader): * replay/MemoizedDOMResult.cpp: (JSC::InputTraits::type): * svg/SVGTransformValue.cpp: (WebCore::SVGTransformValue::transformTypePrefixForParsing): 2017-05-04 Jeremy Jones Add muted to WebPlaybackSessionModel. https://bugs.webkit.org/show_bug.cgi?id=171592 rdar://problem/31814074 Reviewed by Jer Noble. No behavior change. This just adds the ability for UI to mute. * platform/cocoa/WebPlaybackSessionModel.h: (WebCore::WebPlaybackSessionModelClient::mutedChanged): * platform/cocoa/WebPlaybackSessionModelMediaElement.h: * platform/cocoa/WebPlaybackSessionModelMediaElement.mm: (WebCore::WebPlaybackSessionModelMediaElement::updateForEventName): (WebCore::WebPlaybackSessionModelMediaElement::toggleMuted): (WebCore::WebPlaybackSessionModelMediaElement::observedEventNames): (WebCore::WebPlaybackSessionModelMediaElement::isMuted): * platform/ios/WebAVPlayerController.h: * platform/ios/WebAVPlayerController.mm: (-[WebAVPlayerController toggleMuted:]): * platform/ios/WebPlaybackSessionInterfaceAVKit.h: * platform/ios/WebPlaybackSessionInterfaceAVKit.mm: (WebCore::WebPlaybackSessionInterfaceAVKit::mutedChanged): * platform/ios/WebVideoFullscreenControllerAVKit.mm: (WebVideoFullscreenControllerContext::mutedChanged): (WebVideoFullscreenControllerContext::isMuted): (WebVideoFullscreenControllerContext::toggleMuted): * platform/spi/ios/MediaPlayerSPI.h: 2017-05-04 Joseph Pecoraro REGRESSION(r216138): Web Inspector: ASSERT(!content.isNull()) when checking for source map url opening inspector https://bugs.webkit.org/show_bug.cgi?id=171697 Reviewed by Matt Baker. * inspector/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::cachedResourceContent): Always set base64Encoded when returning true. Return the empty string instead of a null string matching previous behavior. 2017-05-04 Wenson Hsieh [WK2] Add support for keeping the selection in a focused editable element when dragging begins https://bugs.webkit.org/show_bug.cgi?id=171585 Reviewed by Beth Dakin and Zalan Bujtas. Covered by 4 API tests. * dom/DocumentMarker.h: Introduces the DraggedContent DocumentMarker type, which applies to the Range in the DOM that is being used as a drag source. Also adds DraggedContentData, which contains nodes found by the TextIterator in the process of finding Ranges to mark. (WebCore::DocumentMarker::AllMarkers::AllMarkers): * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::addDraggedContentMarker): (WebCore::shouldInsertAsSeparateMarker): (WebCore::DocumentMarkerController::addMarker): When adding DocumentMarkers of type DraggedContent, keep adjacent RenderReplaced elements separate, rather than merging them into existing RenderedDocumentMarkers. This is because the data for each of these (i.e. the target node) needs to be preserved. (WebCore::DocumentMarkerController::markersFor): Bail and return an empty list if the map of document markers cannot possibly contain a dragged content marker. * dom/DocumentMarkerController.h: * page/DragController.h: * page/DragState.h: Add draggedContentRange to DragState. This tracks the Range that is being dragged; it is created when the drag session has begun, and ends when drag session finishes (either via WebPage::dragEnded or WebPage::dragCancelled). * page/EventHandler.cpp: (WebCore::repaintContentsOfRange): (WebCore::EventHandler::dragCancelled): Called when a drag is cancelled in the UI process without a session ever getting a chance to begin. We use this as a hook to remove all DraggedContent document markers from the document of the dragged content range. (WebCore::EventHandler::didStartDrag): Called when a drag session has begun in the UI process. We use this as a hook to set up document markers for the Range of content being dragged. (WebCore::EventHandler::dragSourceEndedAt): Called when a drag session ends. We use this as a hook to remove all DraggedContent document markers from the document of the dragged content range. (WebCore::EventHandler::draggedElement): * page/EventHandler.h: * page/FocusController.cpp: (WebCore::shouldClearSelectionWhenChangingFocusedElement): Prevent the selection from clearing when the previously focused element is editable and also contains the drag source element. Ideally, we should experiment with clearing out the selection whenever the element is blurred (and not have additional restrictions on editability and containing the drag source), but this change is much riskier. (WebCore::FocusController::setFocusedElement): * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): Use RenderText::draggedContentStartEnd to find the range of text (if any) that is dragged content, and paint these ranges of text at a lower alpha using TextPainter::paintTextInRange. * rendering/RenderReplaced.cpp: (WebCore::draggedContentContainsReplacedElement): Determines whether or not the element being rendered is contained within a dragged content range. Assuming that the DraggedContent type flag is set in DocumentMarkerController, we first look to see whether or not the container node is in the document marker map. If so, instead of consulting node offset ranges (since this is, in the worst-case, linear in the number of sibling nodes per RenderReplaced) we simply check the DraggedContentData to see if the current element being rendered matches one of the target nodes. (WebCore::RenderReplaced::paint): If the element rendered by this RenderReplaced is dragged content, then render it at a low alpha. * rendering/RenderText.cpp: (WebCore::RenderText::draggedContentRangesBetweenOffsets): Determines what range of text, if any, contains dragged content by consulting the Document's DocumentMarkers. * rendering/RenderText.h: * rendering/TextPainter.cpp: (WebCore::TextPainter::paintTextInRange): Teach TextPainter to only paint a given range in a TextRun. * rendering/TextPainter.h: Add TextPainter support for specifying special text offset ranges when rendering a TextRun, such that each special range in text is rendered after applying some modification to the GraphicsContext. 2017-05-04 Jeremy Jones Crash when pointer lock element is removed before pointer lock allowed arrives. https://bugs.webkit.org/show_bug.cgi?id=171642 Reviewed by Jer Noble. Make sure there a pending lock before attempting to complete pointer lock. * page/PointerLockController.cpp: (WebCore::PointerLockController::didAcquirePointerLock): 2017-05-04 Chris Dumez Reformat / Clean up Node.idl to match the specification https://bugs.webkit.org/show_bug.cgi?id=171686 Reviewed by Sam Weinig. Reformat / Clean up Node.idl to match the specification: - https://dom.spec.whatwg.org/#node There should be no Web-facing behavior change, except for Node properties being enumerated in a slightly different order. * dom/Node.idl: 2017-05-04 Sam Weinig Remove support for legacy Notifications https://bugs.webkit.org/show_bug.cgi?id=171487 Reviewed by Jon Lee. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: Remove files. * Configurations/FeatureDefines.xcconfig: Remove definition of ENABLE_LEGACY_NOTIFICATIONS. * DerivedSources.make: Remove IDL files. * Modules/notifications/DOMWindowNotifications.cpp: Removed. * Modules/notifications/DOMWindowNotifications.h: Removed. * Modules/notifications/DOMWindowNotifications.idl: Removed. * Modules/notifications/NotificationCenter.cpp: Removed. * Modules/notifications/NotificationCenter.h: Removed. * Modules/notifications/NotificationCenter.idl: Removed. * Modules/notifications/NotificationClient.h: * Modules/notifications/NotificationController.cpp: * Modules/notifications/NotificationController.h: * Modules/notifications/WorkerGlobalScopeNotifications.cpp: Removed. * Modules/notifications/WorkerGlobalScopeNotifications.h: Removed. * Modules/notifications/WorkerGlobalScopeNotifications.idl: Removed. * Modules/notifications/Notification.idl: * Modules/notifications/Notification.cpp: * Modules/notifications/Notification.h: * dom/EventTargetFactory.in: * page/DOMWindow.cpp: * workers/WorkerThread.h: Remove code legacy Notification code. Replace use of NotificationCenter with direct calls to the NotificationClient. 2017-05-04 Antti Koivisto REGRESSION (Safari 10.1): When 'transition' contains -ms-transform, transform-origin is also transitioned https://bugs.webkit.org/show_bug.cgi?id=171250 Reviewed by Geoffrey Garen. We were mapping unknown properties to 'all' animation. With this patch we ignore them instead. The patch also implements roundtripping of unknown properties via CSSOM, matching Blink and Gecko. Test: transitions/transition-unknown-property-ignore.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::createTransitionPropertyValue): Return the correct name for unknown properties. * css/CSSToStyleMap.cpp: (WebCore::CSSToStyleMap::mapAnimationProperty): Map any unknown property to AnimateUnknownProperty mode instead of falling back to the default of AnimateAll. Save the unknown property name so we can roundtrip it properly. * page/animation/CompositeAnimation.cpp: (WebCore::CompositeAnimation::updateTransitions): Ignore AnimateUnknownProperty like AnimateNone. * platform/animation/Animation.h: (WebCore::Animation::unknownProperty): (WebCore::Animation::setUnknownProperty): 2017-05-04 Chris Dumez Clean up MutationRecord.idl https://bugs.webkit.org/show_bug.cgi?id=171685 Reviewed by Sam Weinig. Clean up MutationRecord.idl to match the specification: - https://dom.spec.whatwg.org/#mutationrecord There is no Web-facing behavior change. * dom/MutationRecord.idl: 2017-05-04 Chris Dumez Reformat / clean up Event.idl https://bugs.webkit.org/show_bug.cgi?id=171675 Reviewed by Sam Weinig. Reformat / clean up Event.idl to match the latest spec more closely: - https://dom.spec.whatwg.org/#interface-event There is no web-facing behavior change, except for properties being enumerated in a slightly different order. * dom/Event.idl: 2017-05-04 Daniel Bates Cleanup: Extract CachedScript::mimeTypeAllowedByNosniff() into a common function https://bugs.webkit.org/show_bug.cgi?id=171678 Reviewed by Andy Estes. Extract CachedScript::mimeTypeAllowedByNosniff() into a common function that can be shared by LoadableClassicScript and WorkerScriptLoader. No functionality was changed. So, no new tests. * dom/LoadableClassicScript.cpp: (WebCore::LoadableClassicScript::notifyFinished): Modified to use WebCore::isScriptAllowedByNosniff(). * loader/cache/CachedScript.cpp: (WebCore::CachedScript::mimeType): Deleted; incorporated into WebCore::isScriptAllowedByNosniff(). (WebCore::CachedScript::mimeTypeAllowedByNosniff): Deleted; incorporated into WebCore::isScriptAllowedByNosniff(). * loader/cache/CachedScript.h: * platform/network/ResourceResponseBase.cpp: (WebCore::isScriptAllowedByNosniff): Added. Note that it is sufficient to extract the MIME type as-is and query the MIME type registry because the MIME type registry performs look ups case-insensitively. * platform/network/ResourceResponseBase.h: * workers/WorkerScriptLoader.cpp: (WebCore::WorkerScriptLoader::didReceiveResponse): Modified to use WebCore::isScriptAllowedByNosniff(). (WebCore::mimeTypeAllowedByNosniff): Deleted. 2017-05-04 Sam Weinig Make the [EnabledBySetting] extended attribute work for any attribute or operation on a prototype https://bugs.webkit.org/show_bug.cgi?id=171588 Reviewed by Dean Jackson. * bindings/js/JSDOMIterator.h: (WebCore::JSDOMIterator::createPrototype): * bindings/js/JSDOMWindowShell.cpp: (WebCore::JSDOMWindowShell::setWindow): * bindings/js/JSDOMWrapperCache.h: (WebCore::getDOMStructure): (WebCore::getDOMPrototype): * bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::initScript): Update to account for createPrototype and prototype taking the global object by reference. * bindings/scripts/CodeGeneratorJS.pm: (NeedsSettingsCheckForPrototypeProperty): Add predicate to determine if an interface has any settings enabled properties on the prototype, needed to determine if we should pass the global object to finishCreation. (GenerateHeader): Update signature of both createPrototype and prototype to take JSDOMGlobalObject& rather than a JSC::JSGlobalObject*, this allows us to pass the more specific type to the prototype constructor, and access the ScriptExecutionContext for the Settings. (GeneratePropertiesHashTable): Update to return, via out parameter, arrays with the attributes and operations that specify EnabledBySetting. This mimics the model used for RuntimeEnabledFeatures. (GenerateImplementation): In {Class}Prototype::finishCreation, add code to check settings to see if an attribute or operation should be enabled, and if it shouldn't remove it from the object. This, again, is modeled on RuntimeEnabledFeatures. (GeneratePrototypeDeclaration): Update signatures to take JSDOMGlobalObject& and specialize finishCreation to take one if there are any properties that require settings to enable. (GenerateConstructorHelperMethods): Update for new signature of prototype(...). * bindings/scripts/test/JS/JSInterfaceName.cpp: * bindings/scripts/test/JS/JSInterfaceName.h: * bindings/scripts/test/JS/JSMapLike.cpp: * bindings/scripts/test/JS/JSMapLike.h: * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: * bindings/scripts/test/JS/JSReadOnlyMapLike.h: * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: * bindings/scripts/test/JS/JSTestActiveDOMObject.h: * bindings/scripts/test/JS/JSTestCEReactions.cpp: * bindings/scripts/test/JS/JSTestCEReactions.h: * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h: * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp: * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h: * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: * bindings/scripts/test/JS/JSTestCustomNamedGetter.h: * bindings/scripts/test/JS/JSTestDOMJIT.cpp: * bindings/scripts/test/JS/JSTestDOMJIT.h: * bindings/scripts/test/JS/JSTestEventConstructor.cpp: * bindings/scripts/test/JS/JSTestEventConstructor.h: * bindings/scripts/test/JS/JSTestEventTarget.cpp: * bindings/scripts/test/JS/JSTestEventTarget.h: * bindings/scripts/test/JS/JSTestException.cpp: * bindings/scripts/test/JS/JSTestException.h: * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: * bindings/scripts/test/JS/JSTestGenerateIsReachable.h: * bindings/scripts/test/JS/JSTestGlobalObject.h: * bindings/scripts/test/JS/JSTestInterface.cpp: * bindings/scripts/test/JS/JSTestInterface.h: * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h: * bindings/scripts/test/JS/JSTestIterable.cpp: * bindings/scripts/test/JS/JSTestIterable.h: * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp: * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h: * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: * bindings/scripts/test/JS/JSTestMediaQueryListListener.h: * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: * bindings/scripts/test/JS/JSTestNamedConstructor.h: * bindings/scripts/test/JS/JSTestNode.cpp: * bindings/scripts/test/JS/JSTestNode.h: * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestObj.h: * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: * bindings/scripts/test/JS/JSTestOverloadedConstructors.h: * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h: * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: * bindings/scripts/test/JS/JSTestOverrideBuiltins.h: * bindings/scripts/test/JS/JSTestSerialization.cpp: * bindings/scripts/test/JS/JSTestSerialization.h: * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: * bindings/scripts/test/JS/JSTestSerializationInherit.h: * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h: * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h: * bindings/scripts/test/JS/JSTestTypedefs.cpp: * bindings/scripts/test/JS/JSTestTypedefs.h: Update test results for new test values and changes in signatures to pass JSDOMGlobalObject. * bindings/scripts/test/TestObj.idl: Add tests for [EnableBySetting] for attributes and operations. * bridge/objc/objc_runtime.h: * bridge/runtime_array.h: * bridge/runtime_method.h: * bridge/runtime_object.h: * inspector/CommandLineAPIHost.cpp: Update createPrototype function to take the global object by reference. 2017-05-04 Eric Carlson [MediaStream] Allow host application to enable/disable media capture https://bugs.webkit.org/show_bug.cgi?id=171292 Reviewed by Jer Noble. No new layout tests, added an API test instead. * Modules/mediastream/MediaStream.cpp: (WebCore::MediaStream::endStream): New, stop all tracks. * Modules/mediastream/MediaStream.h: * Modules/mediastream/MediaStreamRegistry.cpp: (WebCore::MediaStreamRegistry::unregisterStream): Minor cleanup. (WebCore::MediaStreamRegistry::forEach): New, call the lambda with each stream. (WebCore::MediaStreamRegistry::MediaStreamRegistry): Deleted, unused. * Modules/mediastream/MediaStreamRegistry.h: * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::stopTrack): Add parameter so caller can specify if an 'ended' event should be sent or not. (WebCore::MediaStreamTrack::trackMutedChanged): Don't post an event if the track has ended. * Modules/mediastream/MediaStreamTrack.h: * dom/Document.cpp: (WebCore::Document::stopMediaCapture): Stop all streams in the document. * dom/Document.h: * page/Page.cpp: (WebCore::Page::stopMediaCapture): Stop all streams. * page/Page.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Display a black frame when the stream ends. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::activeStatusChanged): Signal a characteristics change to HTMLMediaElement refresh state. * platform/mediastream/MediaStreamPrivate.h: * platform/mediastream/mac/AVMediaCaptureSource.mm: (WebCore::AVMediaCaptureSource::stopProducingData): Don't return early if the session isn't running, we always need to clear m_session on iOS. 2017-05-04 Zalan Bujtas Should never hit layout while updating the render tree. https://bugs.webkit.org/show_bug.cgi?id=171643 Reviewed by Antti Koivisto. Laying out a half-baked render tree is not a great idea. Especially considering that layout (sadly) can mutate the render tree. * page/FrameView.cpp: (WebCore::FrameView::layout): 2017-05-04 Daniel Bates importScripts() should respect X-Content-Type-Options: nosniff https://bugs.webkit.org/show_bug.cgi?id=171248 Reviewed by Andy Estes. Do not load a worker script if it has the HTTP response header "X-Content-Type-Options: nosniff" and its Content-type header is not an allowed JavaScript script mime type. This behavior follows from (3 May 2017), (2 May 2017), and . * workers/WorkerScriptLoader.cpp: (WebCore::mimeTypeAllowedByNosniff): Added. (WebCore::WorkerScriptLoader::didReceiveResponse): Mark the load as failed if the response is not allowed by X-Content-Type-Options: nosniff. 2017-05-04 Dave Hyatt REGRESSION(STP): rgb() with calc() containing variables doesn't work https://bugs.webkit.org/show_bug.cgi?id=169939 Reviewed by Zalan Bujtas. Added new test in fast/css/variables. * css/CSSCalculationValue.cpp: (WebCore::CSSCalcExpressionNodeParser::parseValue): Treat floats in calcs as integers when we can. 2017-05-04 Commit Queue Unreviewed, rolling out r216172. https://bugs.webkit.org/show_bug.cgi?id=171654 FTBFS for iOS due to missing WebPageProxy::stopMediaCapture() implementation. (Requested by ddkilzer on #webkit). Reverted changeset: "[MediaStream] Allow host application to enable/disable media capture" https://bugs.webkit.org/show_bug.cgi?id=171292 http://trac.webkit.org/changeset/216172 2017-05-03 Carlos Garcia Campos REGRESSION(r215686): Incremental reads from SharedBuffer are wrong after r215686 https://bugs.webkit.org/show_bug.cgi?id=171602 Reviewed by Michael Catanzaro. In TextTrackLoader::processNewCueData() and PNGImageReader::decode() we changed the patter to read data from a SharedBuffer at a given offset. The new pattern is not correct, because it assumes the whole segment is always read, and the new offset is not correct when that's not the case. This has broken the rendering of png images in the GTK+ port, only the first bytes are correctly decoded and drawn, but not the rest of the image. Fixes: editing/pasteboard/paste-image-using-image-data.html * loader/TextTrackLoader.cpp: (WebCore::TextTrackLoader::processNewCueData): * platform/image-decoders/png/PNGImageDecoder.cpp: (WebCore::PNGImageReader::decode): 2017-05-03 Eric Carlson [MediaStream] Allow host application to enable/disable media capture https://bugs.webkit.org/show_bug.cgi?id=171292 Reviewed by Jer Noble. No new layout tests, added an API test instead. * Modules/mediastream/MediaStream.cpp: (WebCore::MediaStream::endStream): New, stop all tracks. * Modules/mediastream/MediaStream.h: * Modules/mediastream/MediaStreamRegistry.cpp: (WebCore::MediaStreamRegistry::unregisterStream): Minor cleanup. (WebCore::MediaStreamRegistry::forEach): New, call the lambda with each stream. (WebCore::MediaStreamRegistry::MediaStreamRegistry): Deleted, unused. * Modules/mediastream/MediaStreamRegistry.h: * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::stopTrack): Add parameter so caller can specify if an 'ended' event should be sent or not. (WebCore::MediaStreamTrack::trackMutedChanged): Don't post an event if the track has ended. * Modules/mediastream/MediaStreamTrack.h: * dom/Document.cpp: (WebCore::Document::stopMediaCapture): Stop all streams in the document. * dom/Document.h: * page/Page.cpp: (WebCore::Page::stopMediaCapture): Stop all streams. * page/Page.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Display a black frame when the stream ends. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::activeStatusChanged): Signal a characteristics change to HTMLMediaElement refresh state. * platform/mediastream/MediaStreamPrivate.h: * platform/mediastream/mac/AVMediaCaptureSource.mm: (WebCore::AVMediaCaptureSource::stopProducingData): Don't return early if the session isn't running, we always need to clear m_session on iOS. 2017-05-03 John Wilander Resource Load Statistics: Remove all statistics for modifiedSince website data removals https://bugs.webkit.org/show_bug.cgi?id=171584 Reviewed by Brent Fulgham. Test: http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore): Now clears all regardless of the modifiedSince parameter's value. 2017-05-03 Andy Estes Try to fix the macOS Public SDK build https://bugs.webkit.org/show_bug.cgi?id=171635 Unreviewed because the commit queue told me to say this. * platform/spi/cocoa/AVKitSPI.h: 2017-05-03 Joanmarie Diggs AX: aria-rowspan value should be ignored if td/th rowspan value is provided https://bugs.webkit.org/show_bug.cgi?id=171214 Reviewed by Chris Fleizach. Return -1 in AccessibilityTableCell::ariaColumnSpan() and ariaRowSpan() if the cell element has an explicit value for the native host language's span attribute. Add checks to AccessibilityTableCell::columnIndexRange() and rowIndexRange() so that we prefer an author-provided ARIA span value over an implicit host-language span value. Similarly, add checks to AccessibilityARIAGridCell::columnIndexRange() and rowIndexRange() so that we fall back on implicit host-language span values when there is no author-provided ARIA span value and the ARIA cell is associated with a cell element. Test: accessibility/aria-cellspans-with-native-cellspans.html * accessibility/AccessibilityARIAGridCell.cpp: (WebCore::AccessibilityARIAGridCell::ariaRowSpanWithRowIndex): (WebCore::AccessibilityARIAGridCell::columnIndexRange): * accessibility/AccessibilityTableCell.cpp: (WebCore::AccessibilityTableCell::rowIndexRange): (WebCore::AccessibilityTableCell::columnIndexRange): (WebCore::AccessibilityTableCell::ariaColumnSpan): (WebCore::AccessibilityTableCell::ariaRowSpan): 2017-05-03 Commit Queue Unreviewed, rolling out r216160 and r216161. https://bugs.webkit.org/show_bug.cgi?id=171640 These changes broke the iOS build. (Requested by mlewis13 on #webkit). Reverted changesets: "[MediaStream] Allow host application to enable/disable media capture" https://bugs.webkit.org/show_bug.cgi?id=171292 http://trac.webkit.org/changeset/216160 "[MediaStream] Allow host application to enable/disable media capture" https://bugs.webkit.org/show_bug.cgi?id=171292 http://trac.webkit.org/changeset/216161 2017-05-03 Eric Carlson [MediaStream] Allow host application to enable/disable media capture https://bugs.webkit.org/show_bug.cgi?id=171292 Reviewed by Jer Noble. No new layout tests, added an API test instead. * Modules/mediastream/MediaStream.cpp: (WebCore::MediaStream::endStream): New, stop all tracks. * Modules/mediastream/MediaStream.h: * Modules/mediastream/MediaStreamRegistry.cpp: (WebCore::MediaStreamRegistry::unregisterStream): Minor cleanup. (WebCore::MediaStreamRegistry::forEach): New, call the lambda with each stream. (WebCore::MediaStreamRegistry::MediaStreamRegistry): Deleted, unused. * Modules/mediastream/MediaStreamRegistry.h: * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::stopTrack): Add parameter so caller can specify if an 'ended' event should be sent or not. (WebCore::MediaStreamTrack::trackMutedChanged): Don't post an event if the track has ended. * Modules/mediastream/MediaStreamTrack.h: * dom/Document.cpp: (WebCore::Document::stopMediaCapture): Stop all streams in the document. * dom/Document.h: * page/Page.cpp: (WebCore::Page::stopMediaCapture): Stop all streams. * page/Page.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Display a black frame when the stream ends. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::activeStatusChanged): Signal a characteristics change to HTMLMediaElement refresh state. * platform/mediastream/MediaStreamPrivate.h: * platform/mediastream/mac/AVMediaCaptureSource.mm: (WebCore::AVMediaCaptureSource::stopProducingData): Don't return early if the session isn't running, we always need to clear m_session on iOS. 2017-05-03 Zalan Bujtas SearchInputType could end up with a mismatched renderer. https://bugs.webkit.org/show_bug.cgi?id=171547 Reviewed by Antti Koivisto. Normally we've got the correct renderer by the time we call into SearchInputType. However, since HTMLInputElement::updateType() eagerly updates the type while the associated renderers are done lazily (so we don't get them updated until after the next tree update), we could actually end up with a mismatched renderer (e.g. through form submission). Test: fast/forms/change-input-type-and-submit-form-crash.html * html/SearchInputType.cpp: (WebCore::SearchInputType::addSearchResult): (WebCore::SearchInputType::didSetValueByUserEdit): 2017-05-03 Jer Noble Make the VPIO audio unit a singleton, shared between multiple CaptureSources https://bugs.webkit.org/show_bug.cgi?id=171622 Reviewed by Eric Carlson. Move the implemnetation of CoreAudioCaptureSource into a shared singleton class, CoreAudioSharedUnit, which will send audio to each of it's client CoreAudioCaptureSources. The first registered client will define the settings used by the shared unit. Drive-by fixes: Fix up setUseAVFoundationAudioCapture() to always accept the first value set. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioSharedUnit::isProducingData): (WebCore::CoreAudioSharedUnit::microphoneFormat): (WebCore::CoreAudioSharedUnit::singleton): (WebCore::CoreAudioSharedUnit::addClient): (WebCore::CoreAudioSharedUnit::removeClient): (WebCore::CoreAudioSharedUnit::addEchoCancellationSource): (WebCore::CoreAudioSharedUnit::removeEchoCancellationSource): (WebCore::CoreAudioSharedUnit::preferredIOBufferSize): (WebCore::CoreAudioSharedUnit::setupAudioUnits): (WebCore::CoreAudioSharedUnit::configureMicrophoneProc): (WebCore::CoreAudioSharedUnit::configureSpeakerProc): (WebCore::CoreAudioSharedUnit::checkTimestamps): (WebCore::CoreAudioSharedUnit::provideSpeakerData): (WebCore::CoreAudioSharedUnit::speakerCallback): (WebCore::CoreAudioSharedUnit::processMicrophoneSamples): (WebCore::CoreAudioSharedUnit::microphoneCallback): (WebCore::CoreAudioSharedUnit::cleanupAudioUnits): (WebCore::CoreAudioSharedUnit::startProducingData): (WebCore::CoreAudioSharedUnit::stopProducingData): (WebCore::CoreAudioSharedUnit::suspend): (WebCore::CoreAudioSharedUnit::defaultInputDevice): (WebCore::CoreAudioCaptureSource::create): (WebCore::CoreAudioCaptureSource::factory): (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::addEchoCancellationSource): (WebCore::CoreAudioCaptureSource::removeEchoCancellationSource): (WebCore::CoreAudioCaptureSource::startProducingData): (WebCore::CoreAudioCaptureSource::stopProducingData): (WebCore::CoreAudioCaptureSource::audioSourceProvider): (WebCore::CoreAudioCaptureSource::preferredSampleRate): Deleted. (WebCore::CoreAudioCaptureSource::preferredIOBufferSize): Deleted. (WebCore::CoreAudioCaptureSource::configureMicrophoneProc): Deleted. (WebCore::CoreAudioCaptureSource::configureSpeakerProc): Deleted. (WebCore::CoreAudioCaptureSource::checkTimestamps): Deleted. (WebCore::CoreAudioCaptureSource::provideSpeakerData): Deleted. (WebCore::CoreAudioCaptureSource::speakerCallback): Deleted. (WebCore::CoreAudioCaptureSource::processMicrophoneSamples): Deleted. (WebCore::CoreAudioCaptureSource::microphoneCallback): Deleted. (WebCore::CoreAudioCaptureSource::cleanupAudioUnits): Deleted. (WebCore::CoreAudioCaptureSource::defaultInputDevice): Deleted. (WebCore::CoreAudioCaptureSource::setupAudioUnits): Deleted. (WebCore::CoreAudioCaptureSource::suspend): Deleted. (WebCore::CoreAudioCaptureSource::resume): Deleted. * platform/mediastream/mac/CoreAudioCaptureSource.h: * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: (WebCore::RealtimeMediaSourceCenterMac::setUseAVFoundationAudioCapture): 2017-05-03 Jer Noble getUserMedia() fails because devices list is empty / inactive https://bugs.webkit.org/show_bug.cgi?id=171626 Reviewed by Eric Carlson. When creating a AVAudioSessionCaptureDevice, set the device's enabled state to true if the port description has any items in its dataSources property (which is the best analogue to "isActive" we have in AVAudioSession). Also, when creating the generic list of CaptureDevices, use the copy constructor to ensure the enabled state gets copied to the new generic device. * platform/mediastream/ios/AVAudioSessionCaptureDevice.mm: (WebCore::AVAudioSessionCaptureDevice::create): * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm: (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices): 2017-05-03 Said Abou-Hallawa Implement the imageready event to reliably test the async image decoding https://bugs.webkit.org/show_bug.cgi?id=171016 Reviewed by Simon Fraser. The event will be fired for each client of the image. Firing the event will happen after finishing the decoding and repainting the client. Existing tests will be modified in a separate patch to use this event. * dom/Element.cpp: (WebCore::Element::dispatchWebKitImageReadyEventForTesting): * dom/Element.h: * page/Settings.in: * rendering/RenderElement.cpp: (WebCore::RenderElement::imageFrameAvailable): 2017-05-03 Tim Horton Maintain interaction information URL as a URL, not a string https://bugs.webkit.org/show_bug.cgi?id=171623 Reviewed by Simon Fraser. No new tests, not a behavior change. * platform/URL.h: 2017-05-03 Yoav Weiss Link preload HTMLPreloadScanner support https://bugs.webkit.org/show_bug.cgi?id=170747 Reviewed by Youenn Fablet. Test: http/tests/preload/preloadscanner_download_resources.html * html/parser/HTMLPreloadScanner.cpp: (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner): Initialize link preload flag. (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest): Create a request only if the type is known (so ignore preloads with unknown type). (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Add handling for link preload and the `as` attribute. (WebCore::TokenPreloadScanner::StartTagScanner::relAttributeIsStyleSheet): Get LinkRelAttribute as input. (WebCore::TokenPreloadScanner::StartTagScanner::resourceType): Return an std::optional, in case the preload type is unknown. (WebCore::TokenPreloadScanner::StartTagScanner::shouldPreload): Return true for the link preload case. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::preload): Return the resource rather than a nullptr if it's already in m_preloads. 2017-05-03 Michael Catanzaro YouTube user agent quirk breaks new YouTube https://bugs.webkit.org/show_bug.cgi?id=171603 Reviewed by Carlos Garcia Campos. Our user agent quirk to make YouTube 360 work breaks the new YouTube UI, causing it to attempt to use the obsolete custom elements v0 API. WebKit only supports the v1 API. We have to remove this quirk. Note this does not affect Safari as Apple ports don't use our user agent quirks. * platform/UserAgentQuirks.cpp: (WebCore::urlRequiresChromeBrowser): 2017-05-03 Joseph Pecoraro Web Inspector: 404 Image Load does not appear as a failure in Web Inspector https://bugs.webkit.org/show_bug.cgi?id=171587 Reviewed by Matt Baker. * inspector/InspectorPageAgent.h: * inspector/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::cachedResourceContent): (WebCore::prepareCachedResourceBuffer): Deleted. Inline the function to make this less confusing. (WebCore::InspectorPageAgent::buildObjectForFrameTree): Treat a DecodeError as a failure. 2017-05-03 Said Abou-Hallawa Async image decoding should be disabled for snapshots, printing and preview https://bugs.webkit.org/show_bug.cgi?id=171467 Reviewed by Simon Fraser. Asynchronous image decoding should only be used for window display where RenderElements can be repainted and painted. For cases where there is only one chance to draw the image, synchronous decoding should be used. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintFillLayerExtended): * rendering/RenderImage.cpp: (WebCore::RenderImage::paintIntoRect): 2017-05-03 Nan Wang AX: VO skips cells after cell with aria-colspan https://bugs.webkit.org/show_bug.cgi?id=171579 Reviewed by Chris Fleizach. We should consider the previous cells' column span value when calculating the column index. Test: accessibility/mac/aria-grid-column-span.html * accessibility/AccessibilityARIAGridCell.cpp: (WebCore::AccessibilityARIAGridCell::columnIndexRange): 2017-05-03 Jiewen Tan ASSERTION FAILED: m_scriptExecutionContext->isContextThread() seen with LayoutTest crypto/workers/crypto-random-values-limits-worker.html https://bugs.webkit.org/show_bug.cgi?id=171462 Reviewed by Brent Fulgham. Covered by existing tests. * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::~WorkerGlobalScope): Clear Crypto early in destruction since its ContextDestructionObserver destruction makes checks about the WorkerThread. 2017-05-03 Zalan Bujtas RenderSearchField should not use isTextField() in SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT https://bugs.webkit.org/show_bug.cgi?id=171608 Reviewed by Simon Fraser. isTextField() is true for any generic single line text control. * rendering/RenderObject.h: (WebCore::RenderObject::isSearchField): * rendering/RenderSearchField.h: 2017-05-03 Frederic Wang Remove ScrollingCoordinator::supportsFixedPositionLayers() https://bugs.webkit.org/show_bug.cgi?id=171557 Reviewed by Simon Fraser. No new tests, behavior is not changed. * page/FrameView.cpp: (WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling): * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::updateViewportConstrainedNode): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.cpp: (WebCore::ScrollingCoordinator::synchronousScrollingReasons): * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::supportsFixedPositionLayers): Deleted. * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp: (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateViewportConstrainedNode): * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: (): Deleted. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): 2017-05-03 Chris Dumez Use PassRefPtr less in CompositeEditCommand https://bugs.webkit.org/show_bug.cgi?id=171590 Reviewed by Sam Weinig. Use PassRefPtr less in CompositeEditCommand. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * editing/ApplyStyleCommand.cpp: (WebCore::hasNoAttributeOrOnlyStyleAttribute): (WebCore::isStyleSpanOrSpanWithOnlyStyleAttribute): (WebCore::isSpanWithoutAttributesOrUnstyledStyleSpan): (WebCore::isEmptyFontTag): (WebCore::ApplyStyleCommand::doApply): (WebCore::ApplyStyleCommand::applyBlockStyle): (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): (WebCore::dummySpanAncestorForNode): (WebCore::ApplyStyleCommand::cleanupUnstyledAppleStyleSpans): (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock): (WebCore::ApplyStyleCommand::applyInlineStyle): (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle): (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange): (WebCore::ApplyStyleCommand::shouldApplyInlineStyleToRun): (WebCore::ApplyStyleCommand::removeConflictingInlineStyleFromRun): (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): (WebCore::ApplyStyleCommand::replaceWithSpanOrRemoveIfWithoutAttributes): (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement): (WebCore::ApplyStyleCommand::removeCSSStyle): (WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle): (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode): (WebCore::ApplyStyleCommand::removeInlineStyle): (WebCore::ApplyStyleCommand::shouldSplitTextElement): (WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical): (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical): (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement): (WebCore::ApplyStyleCommand::addBlockStyle): (WebCore::ApplyStyleCommand::joinChildTextNodes): * editing/ApplyStyleCommand.h: (WebCore::ApplyStyleCommand::shouldRemoveInlineStyleFromElement): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::removeChildrenInRange): (WebCore::CompositeEditCommand::mergeIdenticalElements): (WebCore::CompositeEditCommand::insertTextIntoNode): (WebCore::CompositeEditCommand::deleteTextFromNode): (WebCore::CompositeEditCommand::replaceTextInNode): (WebCore::CompositeEditCommand::replaceSelectedTextInNode): (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): (WebCore::CompositeEditCommand::removeNodeAttribute): (WebCore::CompositeEditCommand::rebalanceWhitespaceAt): (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring): (WebCore::CompositeEditCommand::prepareWhitespaceAtPositionForSplit): (WebCore::CompositeEditCommand::deleteInsignificantText): (WebCore::CompositeEditCommand::removePlaceholderAt): (WebCore::CompositeEditCommand::cleanupAfterDeletion): (WebCore::CompositeEditCommand::moveParagraphs): * editing/CompositeEditCommand.h: * editing/DeleteFromTextNodeCommand.cpp: (WebCore::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand): (WebCore::DeleteFromTextNodeCommand::doApply): (WebCore::DeleteFromTextNodeCommand::doUnapply): (WebCore::DeleteFromTextNodeCommand::getNodesInCommand): * editing/DeleteFromTextNodeCommand.h: (WebCore::DeleteFromTextNodeCommand::create): * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::deleteTextFromNode): (WebCore::DeleteSelectionCommand::handleGeneralDelete): (WebCore::DeleteSelectionCommand::fixupWhitespace): * editing/DeleteSelectionCommand.h: * editing/EditingAllInOne.cpp: * editing/EditingStyle.cpp: (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode): (WebCore::elementMatchesAndPropertyIsNotInInlineStyleDecl): (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement): (WebCore::EditingStyle::wrappingStyleForSerialization): (WebCore::styleFromMatchedRulesForElement): (WebCore::EditingStyle::mergeStyleFromRules): (WebCore::EditingStyle::mergeStyleFromRulesForSerialization): (WebCore::EditingStyle::removeStyleFromRulesAndContext): (WebCore::EditingStyle::removePropertiesInElementDefaultStyle): * editing/EditingStyle.h: * editing/IndentOutdentCommand.cpp: (WebCore::IndentOutdentCommand::tryIndentingAsListItem): * editing/InsertIntoTextNodeCommand.cpp: (WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand): (WebCore::InsertIntoTextNodeCommand::getNodesInCommand): * editing/InsertIntoTextNodeCommand.h: (WebCore::InsertIntoTextNodeCommand::create): * editing/InsertLineBreakCommand.cpp: (WebCore::InsertLineBreakCommand::doApply): * editing/InsertListCommand.cpp: (WebCore::InsertListCommand::mergeWithNeighboringLists): (WebCore::InsertListCommand::listifyParagraph): * editing/InsertParagraphSeparatorCommand.cpp: (WebCore::InsertParagraphSeparatorCommand::doApply): * editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::performOverwrite): (WebCore::InsertTextCommand::doApply): (WebCore::InsertTextCommand::insertTab): * editing/MergeIdenticalElementsCommand.cpp: (WebCore::MergeIdenticalElementsCommand::MergeIdenticalElementsCommand): (WebCore::MergeIdenticalElementsCommand::doApply): (WebCore::MergeIdenticalElementsCommand::doUnapply): (WebCore::MergeIdenticalElementsCommand::getNodesInCommand): * editing/MergeIdenticalElementsCommand.h: (WebCore::MergeIdenticalElementsCommand::create): * editing/RemoveCSSPropertyCommand.cpp: Removed. * editing/RemoveCSSPropertyCommand.h: Removed. * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline): (WebCore::ReplaceSelectionCommand::doApply): (WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace): (WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition): * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::appendElement): (WebCore::styleFromMatchedRulesAndInlineDecl): (WebCore::createMarkupInternal): 2017-05-03 Joanmarie Diggs AX: Treat cells with ARIA table cell properties as cells https://bugs.webkit.org/show_bug.cgi?id=171178 Reviewed by Chris Fleizach. Add the following checks to heuristics in AccessibilityTable::isDataTable(): 1. If the author has provided a valid aria-rowcount or aria-colcount value on the table element, expose it as a data table. 2. If the author has provided a valid aria-colindex or aria-rowindex on the cell element, expose it as a data table. 3. If the author has provided a valid aria-rowindex on the row element, expose it as a data table. 4. If the author has provided a value for aria-colspan or aria-rowspan on a cell, expose it as a data table (even though we are supposed to ignore the value for the purpose of exposing the span via platform accessibility APIs) Remove the heuristic that a table with only one cell is "not a good AXTable candidate." It prevents us from ever doing the above checks. Test: accessibility/minimal-table-with-aria-is-data-table.html * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::isDataTable): 2017-05-03 Carlos Garcia Campos [Cairo] Handle extended colors in gradients https://bugs.webkit.org/show_bug.cgi?id=171596 Reviewed by Michael Catanzaro. Check if every gradient color step is an extended color and use asExtended() instead of getRGBA() in such case. Fixes: css3/color/gradients.html * platform/graphics/cairo/GradientCairo.cpp: (WebCore::Gradient::platformGradient): 2017-05-03 Daniel Bates Abandon the current load once the provisional loader detaches from the frame https://bugs.webkit.org/show_bug.cgi?id=171577 Reviewed by Brent Fulgham and Brady Eidson. We detach all child frames as part of setting our document loader to the provisional document loader when committing a load for a frame. Detaching child frames invokes the unload event handler on the child frames that can run arbitrary JavaScript script. Among other things, such script can initiate a new load in the frame whose current load is being committed. We should stop processing the current load as soon as we detect that updating our document loader has started a new provisional load. Test: fast/loader/inner-iframe-loads-data-url-into-parent-on-unload-crash.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::transitionToCommitted): 2017-05-03 Daniel Bates Cleanup: Remove out-of-date comment and null check from DocumentLoader::detachFromFrame() https://bugs.webkit.org/show_bug.cgi?id=171604 Reviewed by Brady Eidson. We no longer want to passively allow DocumentLoader::detachFromFrame() to be called twice. It does not make sense to be called twice and should never be called twice. A release assert in DocumentLoader::cancelPolicyCheckIfNeeded() (added in r187558) called by DocumentLoader::detachFromFrame() enforces this invariant. Therefore we can remove the null check of DocumentLoader::m_frame and the comment that explains the purpose of this null check from DocumentLoader::detachFromFrame(). * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::detachFromFrame): 2017-05-03 Ryan Haddad Unreviewed attempt to fix the Windows build after r216117. https://bugs.webkit.org/show_bug.cgi?id=171601 * css/CSSAllInOne.cpp: 2017-05-03 Antti Koivisto Rename StyleInvalidationAnalysis to Style::Invalidator https://bugs.webkit.org/show_bug.cgi?id=171601 Reviewed by Žan Doberšek. Also move it to the 'style' directory. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * css/StyleInvalidationAnalysis.cpp: Removed. * css/StyleInvalidationAnalysis.h: Removed. * dom/ExtensionStyleSheets.cpp: * style/AttributeChangeInvalidation.cpp: (WebCore::Style::AttributeChangeInvalidation::invalidateDescendants): * style/ClassChangeInvalidation.cpp: (WebCore::Style::ClassChangeInvalidation::invalidateDescendantStyle): * style/StyleInvalidator.cpp: Copied from Source/WebCore/css/StyleInvalidationAnalysis.cpp. (WebCore::Style::Invalidator::Invalidator): (WebCore::Style::Invalidator::invalidateIfNeeded): (WebCore::Style::Invalidator::invalidateStyleForTree): (WebCore::Style::Invalidator::invalidateStyle): (WebCore::shouldDirtyAllStyle): Deleted. (WebCore::StyleInvalidationAnalysis::StyleInvalidationAnalysis): Deleted. (WebCore::StyleInvalidationAnalysis::invalidateIfNeeded): Deleted. (WebCore::StyleInvalidationAnalysis::invalidateStyleForTree): Deleted. (WebCore::StyleInvalidationAnalysis::invalidateStyle): Deleted. * style/StyleInvalidator.h: Copied from Source/WebCore/css/StyleInvalidationAnalysis.h. (WebCore::StyleInvalidationAnalysis::dirtiesAllStyle): Deleted. (WebCore::StyleInvalidationAnalysis::hasShadowPseudoElementRulesInAuthorSheet): Deleted. * style/StyleScope.cpp: (WebCore::Style::Scope::resolver): (WebCore::Style::Scope::analyzeStyleSheetChange): 2017-05-02 Andrew Gold Typo in AVAudioSessionCaptureDeviceManager.mm https://bugs.webkit.org/show_bug.cgi?id=171572 Reviewed by Jer Noble. We attempt to call +[AVAudioSession sharedSession], but the actual method is called +[AVAudioSession sharedInstance]. * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm: (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices): 2017-05-02 Simon Fraser Improve scrolling tree logging https://bugs.webkit.org/show_bug.cgi?id=171574 Reviewed by Tim Horton. Make a call to showScrollingStateTree() print debugging-related information like node and layer IDs. Required fixing scrolling state tree nodes to respect ScrollingStateTreeAsTextBehavior, and fixing fixed and sticky nodes to call super. Also enhance compositing logging to show layer IDs, and to log for layer scrolling tree registration. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.cpp: (WebCore::ScrollingCoordinator::scrollingStateTreeAsText): * page/scrolling/ScrollingCoordinator.h: * page/scrolling/ScrollingStateFixedNode.cpp: (WebCore::ScrollingStateFixedNode::dumpProperties): * page/scrolling/ScrollingStateNode.cpp: (WebCore::ScrollingStateNode::dumpProperties): (WebCore::ScrollingStateNode::scrollingStateTreeAsText): * page/scrolling/ScrollingStateNode.h: * page/scrolling/ScrollingStateScrollingNode.cpp: (WebCore::ScrollingStateScrollingNode::dumpProperties): * page/scrolling/ScrollingStateStickyNode.cpp: (WebCore::ScrollingStateStickyNode::dumpProperties): * page/scrolling/ScrollingStateTree.cpp: (showScrollingStateTree): * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::commitTreeState): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::detachFromScrollingCoordinator): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::logLayerInfo): (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): 2017-05-02 Daniel Bates Using StringView.split() instead of String.split() in some places https://bugs.webkit.org/show_bug.cgi?id=170925 Reviewed by Darin Adler and Sam Weinig. Replace some uses of String.split() with StringView.split() (added in r211087) as the latter avoids the need to allocate an intermediary Vector of substrings. Instead StringView.split() returns an iterator for traversing the substrings. No functionality changed. So, no new tests. * accessibility/AccessibilityObject.cpp: Convert some typedefs to modern C++ using declarations. (WebCore::AccessibilityObject::ariaRoleToWebCoreRole): Modified code to use StringView.split(). (WebCore::AccessibilityObject::elementsFromAttribute): Ditto. * dom/TreeScope.cpp: (WebCore::TreeScope::getElementById): Added. * dom/TreeScope.h: * html/LinkRelAttribute.cpp: (WebCore::LinkRelAttribute::LinkRelAttribute): Modified code to use StringView.split(). * html/parser/XSSAuditor.cpp: (WebCore::semicolonSeparatedValueContainsJavaScriptURL): Ditto. * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm: (WebCore::CDMPrivateMediaSourceAVFObjC::createSession): Ditto. * platform/network/CacheValidation.cpp: (WebCore::collectVaryingRequestHeaders): Simplify code by using the String.split(UChar, Vector&) overload. * svg/SVGAnimationElement.cpp: (WebCore::parseKeyTimes): Modified code to use StringView.split(). * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Ditto. * testing/Internals.cpp: (WebCore::Internals::setMediaSessionRestrictions): Ditto. (WebCore::Internals::setMediaElementRestrictions): Ditto. (WebCore::Internals::setAudioContextRestrictions): Ditto. (WebCore::Internals::setPageMuted): Ditto. * testing/Internals.h: 2017-05-02 Gwang Yoon Hwang [GTK] Drop coordinated surfaces from the compositing thread as soon as possible https://bugs.webkit.org/show_bug.cgi?id=171544 Reviewed by Žan Doberšek. * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h: Remove atlasesToRemove from the GraphicsState. It is not a commit state anymore. 2017-05-02 Gwang Yoon Hwang [GTK] Recycle textures while handling tiles https://bugs.webkit.org/show_bug.cgi?id=171541 Reviewed by Žan Doberšek. * platform/graphics/texmap/TextureMapperTile.h: Modified m_texture as a protected member to avoid unnessary refcountings from the CoordinatedBackingStore. * platform/graphics/texmap/coordinated/CoordinatedSurface.h: Use reference instead of RefPtr to pass BitmapTexture No new tests since there should be no change in behavior. 2017-05-02 Zalan Bujtas Defer AX cache update when text content changes until after layout is finished. https://bugs.webkit.org/show_bug.cgi?id=171429 Reviewed by Simon Fraser. When the content of the RenderText changes (even as the result of a text-transform change) instead of updating the AX cache eagerly (and trigger layout on a half-backed render tree) we should just defer it until after the subsequent layout is done. Test: accessibility/crash-while-adding-text-child-with-transform.html * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::remove): (WebCore::AXObjectCache::performDeferredCacheUpdate): (WebCore::AXObjectCache::recomputeDeferredIsIgnored): (WebCore::AXObjectCache::deferTextChanged): (WebCore::AXObjectCache::performDeferredIsIgnoredChange): Deleted. * accessibility/AXObjectCache.h: (WebCore::AXObjectCache::deferTextChanged): (WebCore::AXObjectCache::performDeferredCacheUpdate): (WebCore::AXObjectCache::performDeferredIsIgnoredChange): Deleted. * page/FrameView.cpp: (WebCore::FrameView::performPostLayoutTasks): * rendering/RenderText.cpp: (WebCore::RenderText::setText): 2017-05-02 Wenson Hsieh Remove an extraneous call to dispatch_group_async in WebItemProviderPasteboard.mm https://bugs.webkit.org/show_bug.cgi?id=171561 Reviewed by Tim Horton. In -[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:], the lifetime of the dispatch group `fileLoadingGroup` is already guarded by dispatch_group_enter/leave calls when beginning and concluding an item provider load, respectively. As such, the call to dispatch_group_async serves no purpose and should be removed. No new tests, since there is no change in behavior. * platform/ios/WebItemProviderPasteboard.mm: (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]): 2017-05-02 Youenn Fablet [LibWebRTC] Set explicitly logging level in debug mode https://bugs.webkit.org/show_bug.cgi?id=171562 Reviewed by Eric Carlson. No change of behavior. * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::initializePeerConnectionFactoryAndThreads): Setting explictly LibWebRTC logging to Info level for debug builds if WebRTC channel is on. 2017-05-02 Joanmarie Diggs AX: Update implementation of aria-orientation https://bugs.webkit.org/show_bug.cgi?id=171166 Reviewed by Chris Fleizach. Update AccessibilityRenderObject::orientation() to be consistent with what is in the ARIA 1.1 spec. Also add an isTreeGrid() convenience method to be consistent with what we do for other roles. Test: accessibility/aria-orientation.html * accessibility/AccessibilityARIAGridRow.cpp: (WebCore::AccessibilityARIAGridRow::isARIATreeGridRow): * accessibility/AccessibilityObject.h: (WebCore::AccessibilityObject::isTreeGrid): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::orientation): 2017-05-02 Myles C. Maxfield REGRESSION (r211382): Partial right-to-left text runs are painted at an offset (breaks Find indicators, Look Up, and custom ::selection style) https://bugs.webkit.org/show_bug.cgi?id=169517 Reviewed by Dean Jackson. FontCascade::getGlyphsAndAdvancesForComplexText() is tasked with calculating paint advances for a subrange of RTL text. It does this by creating a ComplexTextController, telling it to iterate to the beginning of the subrange (outputting to a GlyphBuffer), then telling it to iterate to the end of the subrange (outputting to another GlyphBuffer). Because the text is RTL, the sum of the advances gathered so far is the distance from the right edge of the text to the left edge of the subrange (because we advance in logical order). Therefore, the x-coordinate we are at now is the total width minus the sum of both of the GlyphBuffers. For some reason, when I wrote this code I forgot to add in the contribution from the first GlyphBuffer. Unfortunately, this particular codepath is rarely hit in practice and completely untested, which made me miss it when I wrote it. Test: fast/text/complex-text-selection.html * platform/graphics/cocoa/FontCascadeCocoa.mm: (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText): 2017-05-02 Chris Dumez [macOS] Flaky Crash under EventTarget::fireEventListeners on imported/blink/paint/deprecatedpaintlayer/non-self-painting-layer-overrides-visibility.html https://bugs.webkit.org/show_bug.cgi?id=171406 Reviewed by Eric Carlson. I was unfortunately unable to reproduce the flaky crash locally. However, the crash trace indicates that one of the EventTarget::scriptExecutionContext() overrides is returning a stale ScriptExecutionContext pointer. Since a GenericEventQueue is involved, the EventTarget is likely a media-related object. I therefore audited media classes that override EventTarget::scriptExecutionContext() and found several that look unsafe. I am fixing those by having them override ContextDestructionObserver, instead of having a raw ScriptExecutionContext pointer member. This makes sure the pointer gets nulled out whenever the scriptexecutioncontext gets destroyed, ensuring that those classes's EventTarget::scriptExecutionContext() overrides can never return a stale pointer. * Modules/mediasource/SourceBufferList.cpp: (WebCore::SourceBufferList::SourceBufferList): * Modules/mediasource/SourceBufferList.h: * html/track/TextTrack.cpp: (WebCore::TextTrack::TextTrack): * html/track/TextTrack.h: * html/track/TrackListBase.cpp: (TrackListBase::TrackListBase): * html/track/TrackListBase.h: 2017-05-02 Antti Koivisto Document style resolvers should share user rulesets https://bugs.webkit.org/show_bug.cgi?id=171549 Reviewed by Andreas Kling. Large user stylesheets (like those used by ad blockers) can end up using lots of memory if a document uses large number of shadow trees. User style is inherently per-document and the resulting rulesets can be shared between the document and the shadow trees. * css/DocumentRuleSets.cpp: (WebCore::DocumentRuleSets::DocumentRuleSets): (WebCore::DocumentRuleSets::userStyle): Return per-document user style for shadow trees. (WebCore::DocumentRuleSets::collectFeatures): * css/DocumentRuleSets.h: (WebCore::DocumentRuleSets::setUsesSharedUserStyle): (WebCore::DocumentRuleSets::userStyle): Deleted. * css/StyleResolver.cpp: (WebCore::StyleResolver::StyleResolver): (WebCore::StyleResolver::initializeUserStyle): Separate user style initialization from construction. * css/StyleResolver.h: * style/StyleScope.cpp: (WebCore::Style::Scope::resolver): Don't initialize user style for user agents shadow trees. 2017-05-02 Myles C. Maxfield Font Loading API specifies font is loaded but sizing of font after load reports inconsistent values https://bugs.webkit.org/show_bug.cgi?id=168533 Reviewed by Zalan Bujtas. Previously, we were marking all local() fonts as immediately successful, regardless of whether or not they were present on the system. Instead, we should use the load() function to make this determination and mark the font as failed if it doesn't exist. (This is, after all, the whole point of the load() function). This brings us in-line with Firefox's and Chrome's behavior. Test: fast/text/font-loading-local.html * css/CSSFontFace.cpp: (WebCore::CSSFontFace::pump): Remote loading requires the FontSelector, but it isn't available for local fonts. Now that load() is called for both local and remote fonts, the ASSERT() should be lowered into the load() function and scoped to just the case where we have a remote font. (WebCore::CSSFontFace::font): Ditto. * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::CSSFontFaceSource): Don't immediatley set the success/failure state for local fonts. (WebCore::CSSFontFaceSource::load): Move loading logic from font() to load(). None of this code is new; it just is moved. (WebCore::CSSFontFaceSource::font): Delete code moved to load(). * css/CSSFontFaceSource.h: * css/FontFace.cpp: (WebCore::FontFace::create): 2017-05-02 Youenn Fablet Allow media stream based videos with sound to autoplay if the page is already playing sound https://bugs.webkit.org/show_bug.cgi?id=171447 Reviewed by Eric Carlson. Test: http/tests/media/autoplay-if-audio-is-playing.html for ensuring non-mediastream based video will not autoplay. Manual testing for the autoplay of media stream based videos since such a test should happen without using getUserMedia. * html/MediaElementSession.cpp: (WebCore::MediaElementSession::playbackPermitted): 2017-05-02 Chris Dumez Use PassRefPtr less in editing code https://bugs.webkit.org/show_bug.cgi?id=171534 Reviewed by Geoffrey Garen. Use PassRefPtr less in editing code. * editing/AppendNodeCommand.cpp: (WebCore::AppendNodeCommand::AppendNodeCommand): (WebCore::AppendNodeCommand::getNodesInCommand): * editing/AppendNodeCommand.h: (WebCore::AppendNodeCommand::create): * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement): (WebCore::ApplyStyleCommand::positionToComputeInlineStyleChange): * editing/BreakBlockquoteCommand.cpp: (WebCore::BreakBlockquoteCommand::doApply): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::insertNodeBefore): (WebCore::CompositeEditCommand::insertNodeAfter): (WebCore::CompositeEditCommand::insertNodeAt): (WebCore::CompositeEditCommand::appendNode): (WebCore::CompositeEditCommand::moveRemainingSiblingsToNewParent): (WebCore::CompositeEditCommand::mergeIdenticalElements): (WebCore::CompositeEditCommand::insertNodeAtTabSpanPosition): (WebCore::CompositeEditCommand::appendBlockPlaceholder): (WebCore::CompositeEditCommand::insertBlockPlaceholder): (WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded): (WebCore::CompositeEditCommand::insertNewDefaultParagraphElementAt): (WebCore::CompositeEditCommand::cloneParagraphUnderNewElement): (WebCore::CompositeEditCommand::moveParagraphs): * editing/CompositeEditCommand.h: * editing/CreateLinkCommand.cpp: (WebCore::CreateLinkCommand::doApply): * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss): (WebCore::DeleteSelectionCommand::mergeParagraphs): * editing/FormatBlockCommand.cpp: (WebCore::FormatBlockCommand::formatRange): * editing/IndentOutdentCommand.cpp: (WebCore::IndentOutdentCommand::tryIndentingAsListItem): (WebCore::IndentOutdentCommand::indentIntoBlockquote): (WebCore::IndentOutdentCommand::outdentParagraph): * editing/InsertLineBreakCommand.cpp: (WebCore::InsertLineBreakCommand::doApply): * editing/InsertLineBreakCommand.h: * editing/InsertListCommand.cpp: (WebCore::InsertListCommand::fixOrphanedListChild): (WebCore::InsertListCommand::doApplyForSingleParagraph): (WebCore::InsertListCommand::unlistifyParagraph): (WebCore::InsertListCommand::listifyParagraph): * editing/InsertListCommand.h: * editing/InsertNodeBeforeCommand.cpp: (WebCore::InsertNodeBeforeCommand::InsertNodeBeforeCommand): (WebCore::InsertNodeBeforeCommand::doApply): (WebCore::InsertNodeBeforeCommand::doUnapply): (WebCore::InsertNodeBeforeCommand::getNodesInCommand): * editing/InsertNodeBeforeCommand.h: (WebCore::InsertNodeBeforeCommand::create): * editing/InsertParagraphSeparatorCommand.cpp: (WebCore::InsertParagraphSeparatorCommand::cloneHierarchyUnderNewBlock): (WebCore::InsertParagraphSeparatorCommand::doApply): * editing/InsertParagraphSeparatorCommand.h: * editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::positionInsideTextNode): (WebCore::InsertTextCommand::insertTab): * editing/ModifySelectionListLevel.cpp: (WebCore::ModifySelectionListLevelCommand::insertSiblingNodeRangeBefore): (WebCore::ModifySelectionListLevelCommand::insertSiblingNodeRangeAfter): (WebCore::ModifySelectionListLevelCommand::appendSiblingNodeRange): (WebCore::IncreaseSelectionListLevelCommand::doApply): * editing/RemoveNodePreservingChildrenCommand.cpp: (WebCore::RemoveNodePreservingChildrenCommand::doApply): * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor): (WebCore::ReplaceSelectionCommand::mergeEndIfNeeded): (WebCore::ReplaceSelectionCommand::doApply): (WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace): (WebCore::ReplaceSelectionCommand::insertAsListItems): * editing/SimplifyMarkupCommand.cpp: (WebCore::SimplifyMarkupCommand::pruneSubsequentAncestorsToRemove): 2017-05-02 Ben Kelly Set Response.blob() type correctly when body is a ReadableStream. https://bugs.webkit.org/show_bug.cgi?id=171489 Reviewed by Youenn Fablet The Fetch API specification requires setting the blob contentType using the Content-Type header value, if present. Currently WebKit only sets the type on the FetchBodyConsumer when FetchBody::blob() is called. Unfortunately, this is never called if the body is actually a ReadableStream. This change allows WebKit to pass the "Consume response's body: from stream to blob" case in the WPT response-consume.html test. Test: http://w3c-test.org/fetch/api/response/response-consume.html * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::startConsumingStream): Modified to call FetchBodyConsumer::setContentType() before processing the stream. 2017-05-02 Ryan Haddad Unreviewed, rolling out r216069. This change broke the build. Reverted changeset: "Document style resolvers should share user rulesets" https://bugs.webkit.org/show_bug.cgi?id=171549 http://trac.webkit.org/changeset/216069 2017-05-02 Antti Koivisto Document style resolvers should share user rulesets https://bugs.webkit.org/show_bug.cgi?id=171549 Reviewed by Andreas Kling. Large user stylesheets (like those used by ad blockers) can end up using lots of memory if a document uses large number of shadow trees. User style is inherently per-document and the resulting rulesets can be shared between the document and the shadow trees. * css/DocumentRuleSets.cpp: (WebCore::DocumentRuleSets::DocumentRuleSets): (WebCore::DocumentRuleSets::userStyle): Return per-document user style for shadow trees. (WebCore::DocumentRuleSets::collectFeatures): * css/DocumentRuleSets.h: (WebCore::DocumentRuleSets::setUsesSharedUserStyle): (WebCore::DocumentRuleSets::userStyle): Deleted. * css/StyleResolver.cpp: (WebCore::StyleResolver::StyleResolver): (WebCore::StyleResolver::initializeUserStyle): Separate user style initialization from construction. * css/StyleResolver.h: * style/StyleScope.cpp: (WebCore::Style::Scope::resolver): Don't initialize user style for user agents shadow trees. 2017-05-02 Gwang Yoon Hwang [GTK] Remove undefined nativeImage method from the ImageBuffer's header https://bugs.webkit.org/show_bug.cgi?id=171502 Unreviewed, remove a dead code accidentally committed in r194630. * platform/graphics/ImageBuffer.h: Remove nativeImage method. It is accidentally added during a refectorying at r194630, and there is no definition for this method. 2017-05-02 Carlos Garcia Campos [GStreamer] Dailymotion live stream videos don't play https://bugs.webkit.org/show_bug.cgi?id=170767 Reviewed by Sergio Villar Senin. The video shows a message saying that an error occurred and nothing is played. There are actually several problems with dailymotion. The main issue is that URLs are redirected by the server, and GStreamer needs to know the redirected URL. Once GStreamer knows the redirected URL the error message no longer appears, the video starts but it always stops after a few seconds. This is because the source receives an early EOS while still downloading the fragments. The reason of the early EOS is because dailymotion sends a wrong Content-Length header, something that is expected to happen and we correctly handle that case when receiving the data, by updating the size accordingly if the bytes received are longer than the expected content length. This particular case doesn't work well with GStreamer automatic EOS handling, which is the default. At some point, GStreamer detects that the bytes received are at least the expected ones and emits a GST_EVENT_EOS that the GstUriDownloader handles finishing the download early. We should always disable automatic EOS, since we know when EOS actually happens and we already call gst_app_src_end_of_stream(). This patch also emits a GST_EVENT_CUSTOM_DOWNSTREAM_STICKY event to let GStreamer know about the HTTP headers sent and received. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webkit_web_src_init): Disable automatic EOS. (webKitWebSrcGetProperty): Return the redirected URL in case of redirection. (webKitWebSrcStart): Pass the ResourceRequest to the stream clients. (webKitWebSrcQueryWithParent): Set the redirected URL in the query in case of redirection. (webKitWebSrcSetUri): Clear also the redirected URL when setting a new URI. (StreamingClient::StreamingClient): Use GRefPtr for the source and initialize the request too. (StreamingClient::~StreamingClient): Remove explicit unref. (StreamingClient::createReadBuffer): (StreamingClient::handleResponseReceived): Initialize the redirected URL in case of redirection. Create and push the HTTP headers event. (StreamingClient::handleDataReceived): (StreamingClient::handleNotifyFinished): (CachedResourceStreamingClient::CachedResourceStreamingClient): (CachedResourceStreamingClient::responseReceived): (CachedResourceStreamingClient::accessControlCheckFailed): (CachedResourceStreamingClient::loadFailed): (ResourceHandleStreamingClient::ResourceHandleStreamingClient): (ResourceHandleStreamingClient::didFail): (ResourceHandleStreamingClient::wasBlocked): (ResourceHandleStreamingClient::cannotShowURL): 2017-05-02 Youenn Fablet Adding logging to RTCPeerConnection to allow WebRTC application debugging https://bugs.webkit.org/show_bug.cgi?id=171531 Reviewed by Jon Lee. No change of behavior. This allows easier debugging of webrtc-enabled web pages. * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::createOfferSucceeded): (WebCore::PeerConnectionBackend::createOfferFailed): (WebCore::PeerConnectionBackend::createAnswerSucceeded): (WebCore::PeerConnectionBackend::createAnswerFailed): (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded): (WebCore::PeerConnectionBackend::setLocalDescriptionFailed): (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded): (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed): (WebCore::PeerConnectionBackend::addIceCandidateSucceeded): (WebCore::PeerConnectionBackend::addIceCandidateFailed): (WebCore::PeerConnectionBackend::newICECandidate): (WebCore::PeerConnectionBackend::doneGatheringCandidates): * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::queuedCreateOffer): (WebCore::RTCPeerConnection::queuedCreateAnswer): (WebCore::RTCPeerConnection::queuedSetLocalDescription): (WebCore::RTCPeerConnection::queuedSetRemoteDescription): (WebCore::RTCPeerConnection::queuedAddIceCandidate): 2017-04-12 Carlos Garcia Campos [GTK] Crash at WebCore::ResourceHandle::clearClient() when streaming live video from dailymotion https://bugs.webkit.org/show_bug.cgi?id=169725 Reviewed by Michael Catanzaro. Make ResourceHandleStreamingClient refcounted and add an invalidate method to do the cleanup in the networking thread while keeping a reference. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcStop): Call invalidate before reseting client pointer. (webKitWebSrcStart): Ditto. (ResourceHandleStreamingClient::ResourceHandleStreamingClient): Remove all cleanup code after the run loop run call. (ResourceHandleStreamingClient::~ResourceHandleStreamingClient): Just detach the thread. (ResourceHandleStreamingClient::invalidate): Schedule a task on the networking thread to clean up and fiish the run loop, protecting this. (ResourceHandleStreamingClient::setDefersLoading): Protect this. (ResourceHandleStreamingClient::didReceiveResponse): Do nothing if client was invalidated. (ResourceHandleStreamingClient::didReceiveBuffer): Ditto. (ResourceHandleStreamingClient::didFinishLoading): Ditto. 2017-05-01 Zan Dobersek [GCrypt] ECDSA signing and verification support https://bugs.webkit.org/show_bug.cgi?id=171103 Reviewed by Carlos Garcia Campos. Implement WebCrypto ECDSA support for configurations that are using libgcrypt. For signing, the provided data is first hashed with the specified digest algorithm and embedded into a data s-expression. It's then passed to gcry_pk_sign() along with the private key, returning a sig-val s-expression. The r and s parameters are then retrieved from that sig-val and their data extracted and concatenated in the output Vector<>. For verification, the data is again hashed and embedded into a data s-expression. The r and s parameters are extracted from the passed-in signature Vector<> and embedded into a sig-val s-expression. The data and sig-val s-expressions are then passed to gcry_pk_verify() along with the public key. The verification succeeds if no error is returned and fails if the returned error code is GPG_ERR_BAD_SIGNATURE. * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp: (WebCore::hashCryptoDigestAlgorithm): (WebCore::hashAlgorithmName): (WebCore::mpiData): (WebCore::gcryptSign): (WebCore::gcryptVerify): (WebCore::CryptoAlgorithmECDSA::platformSign): (WebCore::CryptoAlgorithmECDSA::platformVerify): 2017-05-01 Zan Dobersek [GCrypt] HKDF bit derivation support https://bugs.webkit.org/show_bug.cgi?id=171074 Reviewed by Michael Catanzaro. Implement bit derivation support for the HKDF algorithm for configurations that use libgcrypt. libgcrypt doesn't provide HKDF support out of the box, so we have to implement the two steps manually. In the first one, we retrieve the pseudo-random key by using the specified MAC algorithm with the salt data as the key and the key data as the input keying material. In the expand step, we do the required amount of iterations to derive a sufficient amount of data, using the same MAC algorithm with the pseudo-random key from the previous step on the data we compose from the previous block data, the info data, and the current iteration value. The resulting blocks are appended together until they can be clipped to the desired output length. * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp: (WebCore::macAlgorithmForHashFunction): (WebCore::gcryptDeriveBits): (WebCore::CryptoAlgorithmHKDF::platformDeriveBits): 2017-05-01 Zan Dobersek [GCrypt] ECDH bit derivation support https://bugs.webkit.org/show_bug.cgi?id=171070 Reviewed by Michael Catanzaro. Implement bit derivation support for the ECDH algorithm for configurations that use libgcrypt. This is done by retrieving the private key data and wrapping it in a new data s-expression. That's then encrypted with the public key, and the returned s-expression contains the shared point data. That data is then decoded into an EC point, from which the x-coordinate is retrieved. This coordinate data is finally our bit derivation result. * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp: (WebCore::gcryptDerive): (WebCore::CryptoAlgorithmECDH::platformDeriveBits): 2017-05-01 Youenn Fablet Ensure RealtimeOutgoingVideoSource sends a black frame when its related source is muted https://bugs.webkit.org/show_bug.cgi?id=171497 Reviewed by Eric Carlson. Covered by updated test. When the track is being muted or disabled, send a black frame explicitly. VideoToolBox sometimes does not output a frame until it receives the other. That is why we end up sending two frames, the second asynchronously so that libwebrtc will not skip it. Also storing the rotation so that we keep the same rotation for black frames. Storing width and height for consistency as well. * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource): (WebCore::RealtimeOutgoingVideoSource::setSource): (WebCore::RealtimeOutgoingVideoSource::stop): (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged): (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged): (WebCore::RealtimeOutgoingVideoSource::setSizeFromSource): (WebCore::RealtimeOutgoingVideoSource::sendBlackFrame): (WebCore::RealtimeOutgoingVideoSource::sendFrame): (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable): * platform/mediastream/mac/RealtimeOutgoingVideoSource.h: 2017-05-01 Joseph Pecoraro Simplify Resource Timing handling of cached resource https://bugs.webkit.org/show_bug.cgi?id=171526 Reviewed by Youenn Fablet. * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::loadRequest): * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::init): (WebCore::SubresourceLoader::reportResourceTiming): Use auto in ResourceTiming construction. Eliminate an outdated comment. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestResource): We can avoid the checks around the request.origin. It should already be the cases we were checking and asserting because of login in CachedResourceLoader::prepareFetch. 2017-05-01 Ryan Haddad Unreviewed, rolling out r216024. This change caused ios-simulator LayoutTests to exit early with assertion failures. Reverted changeset: "Add audio device change notifications to AudioSession." https://bugs.webkit.org/show_bug.cgi?id=171403 http://trac.webkit.org/changeset/216024 2017-05-01 Timothy Horton Expose viewport-fit instead of clip-to-safe-area https://bugs.webkit.org/show_bug.cgi?id=171503 Reviewed by Simon Fraser. Tests: fast/viewport/ios/viewport-fit-auto.html fast/viewport/ios/viewport-fit-contain.html fast/viewport/ios/viewport-fit-cover.html * dom/ConstantPropertyMap.cpp: (WebCore::ConstantPropertyMap::buildValues): (WebCore::ConstantPropertyMap::updateConstantsForUnobscuredSafeAreaInsets): (WebCore::ConstantPropertyMap::didChangeSafeAreaInsets): (WebCore::ConstantPropertyMap::updateConstantsForObscuredInsets): Deleted. (WebCore::ConstantPropertyMap::didChangeObscuredInsets): Deleted. * dom/ConstantPropertyMap.h: Retrieve the safe area insets from page, instead of assuming that we should just expose the entire obscured inset. Also, do some renames. * dom/ViewportArguments.cpp: (WebCore::ViewportArguments::resolve): (WebCore::parseViewportFitValue): (WebCore::setViewportFeature): * dom/ViewportArguments.h: (WebCore::ViewportArguments::operator==): * page/ChromeClient.h: * page/FrameView.cpp: (WebCore::FrameView::enableSpeculativeTilingIfNeeded): (WebCore::FrameView::calculateExtendedBackgroundMode): (WebCore::FrameView::setClipToSafeArea): Deleted. * page/FrameView.h: * page/ViewportConfiguration.cpp: (WebCore::ViewportConfiguration::updateConfiguration): (WebCore::operator<<): (WebCore::ViewportConfiguration::description): (WebCore::ViewportConfiguration::dump): * page/ViewportConfiguration.h: (WebCore::ViewportConfiguration::avoidsUnsafeArea): (WebCore::ViewportConfiguration::Parameters::Parameters): (WebCore::ViewportConfiguration::clipToSafeArea): Deleted. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateRootContentLayerClipping): * rendering/RenderObject.cpp: (WebCore::RenderObject::repaintUsingContainer): Un-do changes to support clip-to-safe-area, and instead implement a new viewport-fit argument in the viewport meta tag, which takes "auto", "contain", and "cover". "auto" and "contain" cause web content to lay out excluding the safe area inset from the layout size, while "cover" causes web content to expand into the unsafe area. * page/Page.cpp: (WebCore::Page::setUnobscuredSafeAreaInsets): (WebCore::Page::setObscuredInsets): Deleted. * page/Page.h: (WebCore::Page::setObscuredInsets): (WebCore::Page::unobscuredSafeAreaInsets): Keep safe area and obscured insets separately. 2017-05-01 Chris Dumez Documents created using DOMParser.parseFromString should inherit their context document's origin / URL https://bugs.webkit.org/show_bug.cgi?id=171499 Reviewed by Sam Weinig. Documents created using DOMParser.parseFromString should inherit their context document's origin / URL: - https://w3c.github.io/DOM-Parsing/#dom-domparser-parsefromstring Test: fast/dom/domparser-parsefromstring-origin.html * xml/DOMParser.cpp: (WebCore::DOMParser::parseFromString): 2017-05-01 Ross Kirsling Web Inspector: ASSERT(!m_startedComposite) fails when recording on non-Cocoa Timeline https://bugs.webkit.org/show_bug.cgi?id=171363 Reviewed by Matt Baker. * page/FrameView.cpp: (WebCore::FrameView::flushCompositingStateIncludingSubframes): Add PLATFORM(COCOA) guard. 2017-05-01 David Kilzer Stop using strcpy() in fullyQualifiedInfoTableName() from Database.cpp Reviewed by Brady Eidson. * Modules/webdatabase/Database.cpp: (WebCore::fullyQualifiedInfoTableName): Switch from strcpy() to snprintf(). 2017-05-01 Chris Fleizach AX: Support time@datetime for verbosity clarification of dates, times, and durations https://bugs.webkit.org/show_bug.cgi?id=171498 Reviewed by Joanmarie Diggs. Expose the datetime attribute value. Test: accessibility/datetime-attribute.html * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::datetimeAttributeValue): * accessibility/AccessibilityObject.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored): (WebCore::AccessibilityRenderObject::determineAccessibilityRole): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]): (-[WebAccessibilityObjectWrapper accessibilityDatetimeValue]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]): (createAccessibilityRoleMap): (-[WebAccessibilityObjectWrapper subrole]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): 2017-05-01 Joseph Pecoraro RejectedPromiseTracker should produce better callstacks and avoid capturing callstacks unless there is a debugger/inspector https://bugs.webkit.org/show_bug.cgi?id=171416 Reviewed by Saam Barati and Brian Burg. Test: inspector/console/message-stack-trace.html * dom/RejectedPromiseTracker.cpp: (WebCore::UnhandledPromise::UnhandledPromise): (WebCore::UnhandledPromise::callStack): Switch to RefPtr to allow not capturing the stack. (WebCore::createScriptCallStackFromReason): Use the VM's lastException if the value in the exception is the rejected promise value. Using the Exception call stack is important because uncaught exceptions in promise rejections trigger a built-in try/catch and re-enter JavaScript before passing the Error through to the RejectionTracker. When possible, we don't want to capture the new stack originating from the try/catch. Instead, we want the stack from before the try/catch when the error was created. * dom/ScriptExecutionContext.h: * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::reportUnhandledPromiseRejection): Switch to a pointer since the stack could be empty. 2017-05-01 Jer Noble Unreviewed build fix after r216033. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::create): 2017-05-01 Jer Noble Use AVAudioSession to enumerate audio capture devices on iOS https://bugs.webkit.org/show_bug.cgi?id=170861 Reviewed by Eric Carlson. Hook up the new AVAudioSessionCaptureDeviceManager class to CoreAudioCaptureSource and to the (increasingly ill-named) RealtimeMediaSourceCenterMac. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::create): * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: (WebCore::RealtimeMediaSourceCenterMac::setUseAVFoundationAudioCapture): 2017-05-01 Joanmarie Diggs [ATK] Expose values of aria-rowcount, aria-colcount, aria-rowindex, aria-colindex, aria-rowspan, and aria-colspan as object attributes https://bugs.webkit.org/show_bug.cgi?id=171496 Reviewed by Chris Fleizach. Expose valid, author-provided values as an object attribute. In order to distinguish author-provided values from the default returned by WebCore Accessibility (1), change the default return value to -1. We cannot return 0 because the ARIA spec states that 0 is a valid value for authors to provide to indicate that the cell spans the remaining rows in the row group. Also removed some legacy code. The "layout-guess" attribute was needed and expected as a way for AT-SPI2-based assistive technologies to identify layout tables. WebCore Accessibility does not expose tables which are purely for layout as accessible tables, and WebKitGtk uses that implementation, thus this attribute is no longer relevant. No new tests. Unskipped existing test which is now passing. * accessibility/AccessibilityARIAGridCell.cpp: (WebCore::AccessibilityARIAGridCell::ariaRowSpanWithRowIndex): (WebCore::AccessibilityARIAGridCell::columnIndexRange): * accessibility/AccessibilityTableCell.cpp: (WebCore::AccessibilityTableCell::ariaColumnSpan): (WebCore::AccessibilityTableCell::ariaRowSpan): * accessibility/AccessibilityTableCell.h: * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetAttributes): 2017-05-01 Jer Noble Add audio device change notifications to AudioSession. https://bugs.webkit.org/show_bug.cgi?id=171403 Reviewed by Eric Carlson. Add notifications to AudioSession which fire when the current input and output audio devices change. Also add a notification when audio services are lost (which will only fire on iOS). Take this opportunity to make the existing hardwareMutedStateDidChange() notification be platform agnostic, to move the outputDeviceSupportsLowPowerMode() code from AudioHardwareListener, and to do a few more clean-ups of the AudioSession code. * WebCore.xcodeproj/project.pbxproj: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): (WebCore::HTMLMediaElement::~HTMLMediaElement): * html/HTMLMediaElement.h: * platform/audio/AudioSession.cpp: (WebCore::AudioSession::AudioSession): * platform/audio/AudioSession.h: (WebCore::AudioSession::Observer::hardwareMutedStateDidChange): (WebCore::AudioSession::Observer::audioInputDeviceChanged): (WebCore::AudioSession::Observer::audioOutputDeviceChanged): (WebCore::AudioSession::Observer::audioServicesLost): (WebCore::AudioSession::Observer::audioServicesReset): (WebCore::AudioSession::MutedStateObserver::~MutedStateObserver): Deleted. * platform/audio/ios/AudioSessionIOS.mm: (WebCore::AudioSessionPrivate::AudioSessionPrivate): (WebCore::AudioSession::AudioSession): (WebCore::AudioSession::setCategoryOverride): (WebCore::AudioSession::categoryOverride): (WebCore::AudioSession::isMuted): (WebCore::AudioSession::outputDeviceSupportsLowPowerMode): (WebCore::AudioSession::addObserver): (WebCore::AudioSession::removeObserver): * platform/audio/mac/AudioSessionMac.mm: Renamed from Source/WebCore/platform/audio/mac/AudioSessionMac.cpp. (WebCore::defaultDevice): (WebCore::AudioSessionPrivate::AudioSessionPrivate): (WebCore::AudioSession::AudioSession): (WebCore::AudioSession::~AudioSession): (WebCore::AudioSession::category): (WebCore::AudioSession::setCategory): (WebCore::AudioSession::categoryOverride): (WebCore::AudioSession::setCategoryOverride): (WebCore::AudioSession::sampleRate): (WebCore::AudioSession::bufferSize): (WebCore::AudioSession::numberOfOutputChannels): (WebCore::AudioSession::tryToSetActive): (WebCore::AudioSession::preferredBufferSize): (WebCore::AudioSession::setPreferredBufferSize): (WebCore::AudioSession::isMuted): (WebCore::currentDeviceSupportsLowPowerBufferSize): (WebCore::AudioSession::outputDeviceSupportsLowPowerMode): (WebCore::AudioSession::addObserver): (WebCore::AudioSession::removeObserver): 2017-05-01 Chris Dumez Do not dispatch SVG load event in frameless documents https://bugs.webkit.org/show_bug.cgi?id=171505 Reviewed by Andreas Kling. We should not dispatch SVG load events in frameless documents. took care of most load events but forgot the SVG load event. Test: fast/dom/domparser-parsefromstring-svg-load-event.html * dom/Document.cpp: (WebCore::Document::implicitClose): 2017-05-01 Chris Dumez Remove some usage of PassRefPtr in editing code https://bugs.webkit.org/show_bug.cgi?id=171490 Reviewed by Darin Adler. Remove some usage of PassRefPtr in editing code. * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::markersInRange): (DocumentMarkerController::hasMarkers): (DocumentMarkerController::clearDescriptionOnMarkersIntersectingRange): * dom/DocumentMarkerController.h: * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::isSpellingMarkerAllowed): (WebCore::AlternativeTextController::show): (WebCore::AlternativeTextController::applyAlternativeTextToRange): (WebCore::AlternativeTextController::timerFired): (WebCore::AlternativeTextController::handleAlternativeTextUIResult): (WebCore::AlternativeTextController::recordAutocorrectionResponse): (WebCore::AlternativeTextController::markReversed): (WebCore::AlternativeTextController::markCorrection): (WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection): (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult): (WebCore::AlternativeTextController::applyDictationAlternative): * editing/AlternativeTextController.h: (WebCore::AlternativeTextController::UNLESS_ENABLED): * editing/ApplyStyleCommand.cpp: (WebCore::createFontElement): (WebCore::createStyleSpanElement): (WebCore::ApplyStyleCommand::ApplyStyleCommand): (WebCore::copyStyleOrCreateEmpty): (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange): (WebCore::ApplyStyleCommand::removeConflictingInlineStyleFromRun): (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): (WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle): (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown): (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode): (WebCore::ApplyStyleCommand::removeInlineStyle): (WebCore::ApplyStyleCommand::shouldSplitTextElement): (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement): (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded): (WebCore::ApplyStyleCommand::positionToComputeInlineStyleChange): (WebCore::ApplyStyleCommand::applyInlineStyleChange): * editing/ApplyStyleCommand.h: (WebCore::ApplyStyleCommand::create): (WebCore::ApplyStyleCommand::shouldRemoveInlineStyleFromElement): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::applyCommandToComposite): (WebCore::CompositeEditCommand::applyStyledElement): (WebCore::CompositeEditCommand::removeStyledElement): (WebCore::CompositeEditCommand::replaceElementWithSpanPreservingChildrenAndAttributes): (WebCore::CompositeEditCommand::inputText): (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): (WebCore::CompositeEditCommand::pushAnchorElementDown): * editing/CompositeEditCommand.h: * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::originalStringForAutocorrectionAtBeginningOfSelection): * editing/DictationCommand.cpp: (WebCore::DictationCommand::insertTextRunWithoutNewlines): * editing/EditingStyle.cpp: (WebCore::copyEditingProperties): (WebCore::copyPropertiesFromComputedStyle): (WebCore::extractPropertyValue): (WebCore::HTMLAttributeEquivalent::attributeValueAsCSSValue): (WebCore::HTMLFontSizeEquivalent::attributeValueAsCSSValue): (WebCore::EditingStyle::setStyle): (WebCore::EditingStyle::copy): (WebCore::EditingStyle::extractAndRemoveBlockProperties): (WebCore::EditingStyle::extractAndRemoveTextDirection): (WebCore::EditingStyle::mergeInlineStyleOfElement): (WebCore::extractEditingProperties): (WebCore::EditingStyle::styleAtSelectionStart): (WebCore::getPropertiesNotIn): * editing/EditingStyle.h: * editing/Editor.cpp: (WebCore::Editor::handleTextEvent): (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::insertOrderedList): (WebCore::Editor::insertUnorderedList): (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): (WebCore::correctSpellcheckingPreservingTextCheckingParagraph): (WebCore::Editor::markAndReplaceFor): (WebCore::Editor::changeBackToReplacedString): (WebCore::Editor::updateMarkersForWordsAffectedByEditing): (WebCore::Editor::rangeForPoint): * editing/Editor.h: * editing/ModifySelectionListLevel.cpp: (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevel): (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelOrdered): (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelUnordered): * editing/ModifySelectionListLevel.h: * editing/SpellChecker.cpp: (WebCore::SpellChecker::requestCheckingFor): (WebCore::SpellChecker::didCheckSucceed): * editing/SpellChecker.h: (WebCore::SpellCheckRequest::checkingRange): (WebCore::SpellCheckRequest::paragraphRange): (WebCore::SpellCheckRequest::rootEditableElement): * editing/SpellingCorrectionCommand.cpp: (WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand): (WebCore::SpellingCorrectionCommand::willApplyCommand): (WebCore::SpellingCorrectionCommand::doApply): (WebCore::SpellingCorrectionCommand::targetRanges): * editing/SpellingCorrectionCommand.h: (WebCore::SpellingCorrectionCommand::create): * editing/SurroundingText.h: * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingParagraph::expandRangeToNextEnd): (WebCore::TextCheckingParagraph::rangeLength): (WebCore::TextCheckingParagraph::paragraphRange): (WebCore::TextCheckingParagraph::subrange): (WebCore::TextCheckingParagraph::offsetTo): (WebCore::TextCheckingParagraph::offsetAsRange): (WebCore::TextCheckingParagraph::text): (WebCore::TextCheckingParagraph::checkingStart): * editing/TextCheckingHelper.h: * editing/TypingCommand.cpp: (WebCore::TypingCommand::insertTextRunWithoutNewlines): * editing/cocoa/HTMLConverter.mm: (HTMLConverterCaches::computedStylePropertyForElement): (HTMLConverterCaches::inlineStylePropertyForElement): * page/ios/FrameIOS.mm: (WebCore::Frame::interpretationsForCurrentRoot): 2017-05-01 Jer Noble Add notifications from CaptureDeviceManager (and subclasses) when device lists change https://bugs.webkit.org/show_bug.cgi?id=171442 Reviewed by Youenn Fablet. Add a new callback-based notification to CaptureDeviceManager which fires when the underlying list of devices changes. Add support for enumerating AVAudioSession capture devices. * WebCore.xcodeproj/project.pbxproj: * platform/mediastream/CaptureDeviceManager.cpp: (nextObserverToken): (CaptureDeviceManager::addCaptureDeviceChangedObserver): (CaptureDeviceManager::removeCaptureDeviceChangedObserver): * platform/mediastream/CaptureDeviceManager.h: * platform/mediastream/ios/AVAudioSessionCaptureDevice.h: Added. * platform/mediastream/ios/AVAudioSessionCaptureDevice.mm: Added. (WebCore::AVAudioSessionCaptureDevice::create): (WebCore::AVAudioSessionCaptureDevice::AVAudioSessionCaptureDevice): * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h: Added. * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm: Added. (-[WebAVAudioSessionAvailableInputsListener initWithCallback:]): (-[WebAVAudioSessionAvailableInputsListener invalidate]): (-[WebAVAudioSessionAvailableInputsListener observeValueForKeyPath:ofObject:change:context:]): (WebCore::AVAudioSessionCaptureDeviceManager::singleton): (WebCore::AVAudioSessionCaptureDeviceManager::captureDevices): (WebCore::AVAudioSessionCaptureDeviceManager::audioSessionCaptureDevices): (WebCore::AVAudioSessionCaptureDeviceManager::audioSessionDeviceWithUID): (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices): * platform/mediastream/mac/AVCaptureDeviceManager.mm: (WebCore::AVCaptureDeviceManager::deviceConnected): (WebCore::AVCaptureDeviceManager::deviceDisconnected): * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp: (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices): (WebCore::CoreAudioCaptureDeviceManager::devicesChanged): 2017-05-01 Joanmarie Diggs AX: AccessibilityTable::ariaRowCount() and ariaColumnCount() should not return -1 unless that is the author-provided value https://bugs.webkit.org/show_bug.cgi?id=171475 Reviewed by Chris Fleizach. If the author has provided a valid value, return it. Otherwise, return 0. No new tests needed. Update existing test expectations to reflect the change. * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::ariaColumnCount): (WebCore::AccessibilityTable::ariaRowCount): 2017-05-01 Joanmarie Diggs AX: Implement support for ARIA "figure" and "term" roles; update AXRoleDescription mapping for "feed" role https://bugs.webkit.org/show_bug.cgi?id=171183 Reviewed by Chris Fleizach. Create FeedRole, FigureRole, and TermRole and map them on the Mac and Gtk ports. Also rename AccessibilityObject::isFigure() to isFigureElement() for clarity as this method is specific to the HTML element and not the role. No new tests needed: We have existing tests that cover mappings. Add new test cases to roles-exposed.html, xml-roles-exposed.html, and roles-computedRoleString.html. * English.lproj/Localizable.strings: * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::captionForFigure): (WebCore::AccessibilityNodeObject::alternativeText): * accessibility/AccessibilityObject.cpp: (WebCore::initializeRoleMap): (WebCore::AccessibilityObject::isFigureElement): Added. (WebCore::AccessibilityObject::isFigure): Deleted. * accessibility/AccessibilityObject.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::exposesTitleUIElement): (WebCore::AccessibilityRenderObject::titleUIElement): (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored): (WebCore::AccessibilityRenderObject::determineAccessibilityRole): * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (atkRole): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (createAccessibilityRoleMap): (-[WebAccessibilityObjectWrapper subrole]): (-[WebAccessibilityObjectWrapper roleDescription]): * platform/LocalizedStrings.cpp: (WebCore::AXFeedText): * platform/LocalizedStrings.h: 2017-04-30 Chris Dumez Drop support for legacy ClientRect / ClientRectList https://bugs.webkit.org/show_bug.cgi?id=171418 Reviewed by Sam Weinig. Drop support for legacy ClientRect / ClientRectList types now we use DOMRect everywhere. * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * dom/ClientRect.cpp: Removed. * dom/ClientRect.h: Removed. * dom/ClientRect.idl: Removed. * dom/ClientRectList.cpp: Removed. * dom/ClientRectList.h: Removed. * dom/ClientRectList.idl: Removed. * dom/DOMAllInOne.cpp: * dom/Element.cpp: * html/HTMLMediaElement.cpp: * html/track/VTTRegion.cpp: * page/DragController.cpp: 2017-04-30 Zalan Bujtas Initialize a new layout state while bailing out of simple line layout only when needed. https://bugs.webkit.org/show_bug.cgi?id=171481 '-webkit-border-fit: lines' requires inline box tree. We normally bail out of simple line layout early when we see this property. When this property is dynamically set and we already have a simple line layout context, RenderBlockFlow::ensureLineBoxes() takes care of the switch by calling layoutLineBoxes(). This patch makes sure that we create the layout state for this (forced)line layout only when we don't yet have one. Reviewed by Antti Koivisto. Test: fast/multicol/simple-line-layout-switch-to-normal-layout-while-inside-layout.html * rendering/RenderBlockFlow.cpp: (WebCore::PaginatedLayoutStateMaintainer::PaginatedLayoutStateMaintainer): (WebCore::PaginatedLayoutStateMaintainer::~PaginatedLayoutStateMaintainer): (WebCore::RenderBlockFlow::ensureLineBoxes): * rendering/RenderView.cpp: (WebCore::RenderView::pushLayoutStateForPaginationIfNeeded): (WebCore::RenderView::pushLayoutStateForPagination): Deleted. * rendering/RenderView.h: 2017-04-30 Dan Bernstein Tried to fix the iOS build after r215992 * platform/ios/WebVideoFullscreenControllerAVKit.mm: 2017-04-30 Brady Eidson Fix r215991 https://bugs.webkit.org/show_bug.cgi?id=171483 Unreviewed. * platform/spi/cf/CFNetworkSPI.h: 2017-04-30 Dan Bernstein Tried to fix the iOS build after r215992 * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: (WebAVPlayerLayerView_pictureInPicturePlayerLayerView): (WebVideoFullscreenInterfaceAVKit::setupFullscreen): 2017-04-30 Dan Bernstein [Cocoa] Replaces uses of [get…() alloc] with alloc…Instance() https://bugs.webkit.org/show_bug.cgi?id=171485 Reviewed by Geoffrey Garen. * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: (WebCore::CDMSessionAVContentKeySession::contentKeySession): * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: (WebCore::MediaPlaybackTargetPickerMac::devicePicker): * platform/ios/ValidationBubbleIOS.mm: (-[WebValidationBubbleTapRecognizer initWithPopoverController:]): (WebCore::ValidationBubble::ValidationBubble): * platform/ios/WebVideoFullscreenControllerAVKit.mm: (WebVideoFullscreenControllerContext::setUpFullscreen): * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: (WebAVPlayerLayerView_pictureInPicturePlayerLayerView): (WebVideoFullscreenInterfaceAVKit::setupFullscreen): * platform/mac/WebVideoFullscreenInterfaceMac.mm: (-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]): * platform/network/ios/PreviewConverter.mm: (WebCore::PreviewConverter::PreviewConverter): * rendering/RenderThemeIOS.mm: (WebCore::iconForAttachment): 2017-04-30 Brady Eidson Updates to _WKWebsiteDataStoreConfiguration cookie storage location SPI. and https://bugs.webkit.org/show_bug.cgi?id=171483 Reviewed by Geoff Garen (and kind of Andy Estes). No new tests (Covered by API test). * platform/spi/cf/CFNetworkSPI.h: 2017-04-30 Dan Bernstein WebCore-7604.1.19 has failed to build * platform/ios/WebItemProviderPasteboard.mm: (-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]): Resolved type ambiguity by using allocUIItemProviderInstance() instead of [getUIItemProviderClass() alloc]. 2017-04-30 Joanmarie Diggs [ATK] Implement support for aria-autocomplete https://bugs.webkit.org/show_bug.cgi?id=171167 Reviewed by Chris Fleizach. Expose ATK_STATE_SUPPORTS_AUTOCOMPLETION in the state set, and the value of aria-autocomplete as an object attribute, for elements which indicate they support autocompletion. Test: accessibility/gtk/aria-autocomplete.html * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::supportsARIAAutoComplete): (WebCore::AccessibilityObject::ariaAutoCompleteValue): * accessibility/AccessibilityObject.h: * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetAttributes): (setAtkStateSetFromCoreObject): * html/HTMLAttributeNames.in: 2017-04-30 Joanmarie Diggs [ATK] ARIA treegrid role should be exposed as ATK_ROLE_TREE_TABLE; not ATK_ROLE_TABLE https://bugs.webkit.org/show_bug.cgi?id=171170 Reviewed by Chris Fleizach. AccessibilityTable::roleValue() was returning GridRole for both grid and treegrid. Change this so that GridRole is returned for grid and TreeGridRole is returned for treegrid. Add TreeGridRole to, or call isTable() in, methods where the behavior should be the same as GridRole. Test: accessibility/gtk/interface-table.html * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::selectedChildren): * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::roleValue): * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (atkRole): (getInterfaceMaskFromObject): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]): (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (createAccessibilityRoleMap): 2017-04-30 Joanmarie Diggs [ATK] Emit object:state-changed:busy event when aria-busy value changes https://bugs.webkit.org/show_bug.cgi?id=171181 Reviewed by Chris Fleizach. Emit object:state-changed:busy for AXElementBusyChanged notifications. Test: accessibility/gtk/aria-busy-changed-notification.html * accessibility/atk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::postPlatformNotification): 2017-04-29 Joseph Pecoraro Zero out PerformanceResourceTiming properties for cached cross-origin responses without Timing-Allow-Origin https://bugs.webkit.org/show_bug.cgi?id=171394 Reviewed by Youenn Fablet. * loader/ResourceTiming.cpp: (WebCore::ResourceTiming::fromCache): (WebCore::ResourceTiming::ResourceTiming): * loader/ResourceTiming.h: * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestResource): Include the timing-allow-origin check for cached responses. Also, avoid including an extra entry for an ongoing cached resource load, since when that load completes it should be reported. 2017-04-29 Youenn Fablet Readd assertion removed accidentally in r215955 https://bugs.webkit.org/show_bug.cgi?id=171466 Reviewed by Eric Carlson. Unreviewed. * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: (WebCore::MockRealtimeVideoSourceMac::orientationChanged): Improved FIXME after review. 2017-04-29 Andy Estes [macOS] Picture-in-picture should be disabled in WebPlaybackControlsManager during external media playback https://bugs.webkit.org/show_bug.cgi?id=171468 Reviewed by Eric Carlson. * platform/mac/WebPlaybackControlsManager.h: Declared canTogglePictureInPicture as a readwrite property. * platform/mac/WebPlaybackControlsManager.mm: Synthesize canTogglePictureInPicture. (-[WebPlaybackControlsManager canTogglePictureInPicture]): Deleted. * platform/mac/WebPlaybackSessionInterfaceMac.h: * platform/mac/WebPlaybackSessionInterfaceMac.mm: (WebCore::WebPlaybackSessionInterfaceMac::externalPlaybackChanged): Called -[WebPlaybackControlsManager setCanTogglePictureInPicture:]. 2017-04-29 Simon Fraser Fix tests broken by r215964. Fix copy-paste error that caused the wrong paint phase to get passed to the fire writeLayerRenderers() call, causing extra renderer dumping. Also remove unused default arguments. * rendering/RenderTreeAsText.cpp: (WebCore::writeLayerRenderers): (WebCore::writeLayers): 2017-04-28 Zalan Bujtas iBooks text can overlap, sometimes columns are shifted splitting words. https://bugs.webkit.org/show_bug.cgi?id=171472 Reviewed by Antti Koivisto. Instead of just checking if the glyph is taller than the line, we need to ensure that both the ascent and the descent have enough space (this is for -webkit-line-box-contain: glyph). Test: fast/text/simple-line-layout-glyph-overflows-line.html * rendering/SimpleLineLayout.cpp: (WebCore::SimpleLineLayout::canUseForText): compute the available space for the ascent/descent and check them against the ceil-ed(see FontCascade::floatWidthForSimpleText) glyph min/max y. 2017-04-29 Nan Wang AX: Improve performance of addChildren()/childrenChanged() https://bugs.webkit.org/show_bug.cgi?id=171443 Reviewed by Chris Fleizach. There's a lot of unnecessary work happening when childrenChanged() is being called. Some of the improvements here: 1. When childrenChanged() is being called on some element, we are marking its parent chain dirty. However, in the addChild() method we are then clearing each child of that 'dirty' parent, eventually making the entire tree dirty. Added a m_subTreeDirty flag and using the needsToUpdateChildren() check to make sure we are only clearing the right chain without updating the unchanged siblings. 2. In the addChild() method we are calling accessibilityIsIgnored() on each child and that might lead to going up the parent chain again to get necessary information. Since we are already traversing the tree from top to bottom to add children, added a struct to store the information and pass it to the child so to avoid unnecessary traversal. 3. Reduced the amount work of ARIA text controls perform when updating its parents in childrenChanged() so that we don't update a big portion of the tree while typing. No new tests since this didn't change any functionality. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::AccessibilityNodeObject): (WebCore::AccessibilityNodeObject::childrenChanged): (WebCore::AccessibilityNodeObject::insertChild): (WebCore::AccessibilityNodeObject::addChildren): (WebCore::AccessibilityNodeObject::isDescendantOfBarrenParent): * accessibility/AccessibilityNodeObject.h: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::AccessibilityObject): (WebCore::AccessibilityObject::defaultObjectInclusion): (WebCore::AccessibilityObject::setIsIgnoredFromParentDataForChild): * accessibility/AccessibilityObject.h: (WebCore::AccessibilityIsIgnoredFromParentData::AccessibilityIsIgnoredFromParentData): (WebCore::AccessibilityIsIgnoredFromParentData::isNull): (WebCore::AccessibilityObject::setNeedsToUpdateSubTree): (WebCore::AccessibilityObject::needsToUpdateChildren): (WebCore::AccessibilityObject::setIsIgnoredFromParentData): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::updateChildrenIfNecessary): (WebCore::AccessibilityRenderObject::addChildren): * accessibility/AccessibilityRenderObject.h: (WebCore::AccessibilityRenderObject::setRenderObject): (WebCore::AccessibilityRenderObject::needsToUpdateChildren): Deleted. 2017-04-29 Yusuke Suzuki Move WebCore CPUTime to WTF and implement it in all the platforms https://bugs.webkit.org/show_bug.cgi?id=171477 Reviewed by Chris Dumez. Move CPUTime to WTF. And rename getCPUTime to CPUTime::get(). * CMakeLists.txt: * PlatformMac.cmake: * WebCore.xcodeproj/project.pbxproj: * page/ChromeClient.h: * page/PerformanceMonitor.cpp: (WebCore::PerformanceMonitor::PerformanceMonitor): (WebCore::PerformanceMonitor::measurePostLoadCPUUsage): (WebCore::PerformanceMonitor::measurePostBackgroundingCPUUsage): (WebCore::PerformanceMonitor::measureCPUUsageInActivityState): * page/PerformanceMonitor.h: * platform/CPUMonitor.cpp: (WebCore::CPUMonitor::setCPULimit): (WebCore::CPUMonitor::timerFired): * platform/CPUMonitor.h: 2017-04-28 Per Arne Vollan Crash under WebCore::AccessibilityRenderObject::handleAriaExpandedChanged(). https://bugs.webkit.org/show_bug.cgi?id=171427 rdar://problem/31863417 Reviewed by Brent Fulgham. The AccessibilityRenderObject object might delete itself in handleAriaExpandedChanged() under the call to the parentObject() method. This will cause a crash when accessing the object later in this method. Protect the current object while executing arbitrary event code. Test: accessibility/accessibility-crash-setattribute.html * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::handleAriaExpandedChanged): 2017-04-28 Chris Dumez Diagnostic logging of navigations is too verbose https://bugs.webkit.org/show_bug.cgi?id=171455 Reviewed by Andreas Kling. Diagnostic logging of navigation is too verbose. We log things that are not actually user navigations (e.g. speculative loads, bookmark icon fetches, ...). To address the issue, we now only log *observable* loads. We do so by only logging if the page is visible or if it becomes visible. * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::logNavigation): Deleted. * page/Page.cpp: (WebCore::Page::setIsVisibleInternal): (WebCore::Page::logNavigation): (WebCore::Page::mainFrameLoadStarted): * page/Page.h: 2017-04-28 Joanmarie Diggs AX: ARIA "region" role which lacks an accessible name should not be treated as a landmark https://bugs.webkit.org/show_bug.cgi?id=171180 Reviewed by Chris Fleizach. Remove mapping of LandmarkRegionRole for regions which lack an accessible name. Doing so had a side effect of causing a number of DPub ARIA roles to stop being mapped as ARIA landmarks. This is due to our internal role mappings, namely treating the DPub ARIA landmark roles as if they were regions. Because DPub's landmarks do not subclass region, and do not have the same name-from-author requirement as region, create a new LandmarkDocRegionRole AccessibilityRole and map DPub ARIA's generic landmarks to it. No new tests because we already have sufficient coverage. Several existing tests were given additional test cases to cover named and unnamed regions, and test expectations updated accordingly. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::determineAriaRoleAttribute): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::accessibleNameDerivesFromContent): (WebCore::AccessibilityObject::isLandmark): (WebCore::initializeRoleMap): (WebCore::AccessibilityObject::computedRoleString): * accessibility/AccessibilityObject.h: * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (atkRole): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]): (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]): * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (createAccessibilityRoleMap): (-[WebAccessibilityObjectWrapper subrole]): 2017-04-28 Simon Fraser Enhance showLayerTree() to show fragments https://bugs.webkit.org/show_bug.cgi?id=171469 Reviewed by Zalan Bujtas. Have showLayerTree() dump fragments, like: normal flow list(1) layer 0x11c1879c0 at (0,0) size 700x1858 backgroundClip at (0,0) size 2120x779 clip at (0,0) size 2120x779 fragment 0: bounds in layer at (0,0) size 700x1858 fragment bounds at (0,0) size 700x779 fragment 1: bounds in layer at (710,-779) size 700x1858 fragment bounds at (710,0) size 700x779 fragment 2: bounds in layer at (1420,-1558) size 700x1858 fragment bounds at (1420,0) size 700x300 RenderMultiColumnFlowThread 0x11f1f3340 at (0,0) size 700x1858 We want these to show before the child renderers, so factor that code into writeLayerRenderers(). Overloading of write() for layers doesn't help anyone, so call it writeLayer() for searchability. * rendering/RenderLayer.cpp: (WebCore::showLayerTree): * rendering/RenderLayer.h: * rendering/RenderTreeAsText.cpp: (WebCore::writeLayer): (WebCore::writeLayerRenderers): (WebCore::writeLayers): * rendering/RenderTreeAsText.h: 2017-04-28 Simon Fraser Modernize RenderTreeAsText code https://bugs.webkit.org/show_bug.cgi?id=171458 Reviewed by Zalan Bujtas. Use modern loops. More references to render objects and layers. * rendering/RenderTreeAsText.cpp: (WebCore::write): (WebCore::writeRenderNamedFlowThreads): (WebCore::writeLayers): (WebCore::writeSelection): (WebCore::externalRepresentation): 2017-04-28 Wenson Hsieh Fix and re-enable data interaction unit tests https://bugs.webkit.org/show_bug.cgi?id=171446 Reviewed by Tim Horton. Three small tweaks to get all data interaction tests passing again (changes detailed below). Fixes a failing unit test: DataInteractionTests.RespectsExternalSourceFidelityRankings. * page/mac/DragControllerMac.mm: When dropping in a plain text editable area, don't consider kUTTypeText to be a UTI supported by the destination. This is because doing so would cause rich text UTIs, such as kUTTypeHTML, to match, so that the plain text area would report HTML as a preferred UTI type to load when dropping rich content over it. What we want to check for conformance here is really kUTTypePlainText. (WebCore::DragController::updatePreferredTypeIdentifiersForDragHandlingMethod): * platform/Pasteboard.h: * platform/ios/PasteboardIOS.mm: The default Pasteboard constructor no longer makes a sync call to the UI process to get the change count. Instead, we introduce a new constructor that takes and sets the change count. This default constructor was used from three places: Pasteboard::createForCopyAndPaste, Pasteboard::createPrivate and StaticPasteboard::create. The first two call sites have been refactored to first fetch the change count from the UI process and then pass it in to the constructor. (WebCore::changeCountForPasteboard): (WebCore::Pasteboard::Pasteboard): (WebCore::Pasteboard::createForCopyAndPaste): (WebCore::Pasteboard::createPrivate): (WebCore::Pasteboard::readString): (WebCore::Pasteboard::types): * platform/mac/DragDataMac.mm: (WebCore::typeIsAppropriateForSupportedTypes): (WebCore::DragData::updatePreferredTypeIdentifiers): Remove the two-pass heuristic. Instead, we should follow this policy: "select the highest fidelity UTI that conforms to one of the destination's supported types". * platform/mac/PasteboardMac.mm: (WebCore::Pasteboard::Pasteboard): 2017-04-28 Dean Jackson App crashing: Dispatch queue: com.apple.root.user-interactive-qos / vBoxConvolve / WebCore::FEGaussianBlur::platformApplySoftware() https://bugs.webkit.org/show_bug.cgi?id=171461 Reviewed by Eric Carlson. We're getting reports of crashes in this function, caused by null or empty data being passed to vImage. Guard against this, in a way that will ASSERT in debug builds if anyone comes across it. Test: css3/filters/blur-various-radii.html * platform/graphics/filters/FEGaussianBlur.cpp: (WebCore::accelerateBoxBlur): Return early if things don't look good. 2017-04-28 Chris Dumez Stop using legacy ClientRect / ClientRectList in Internals https://bugs.webkit.org/show_bug.cgi?id=171412 Reviewed by Simon Fraser. Stop using legacy ClientRect / ClientRectList in Internals amd use the newer DOMRect instead. * dom/DOMRect.idl: * page/Page.cpp: (WebCore::Page::nonFastScrollableRects): (WebCore::Page::touchEventRectsForEvent): (WebCore::Page::passiveTouchEventListenerRects): * page/Page.h: * testing/Internals.cpp: (WebCore::Internals::absoluteCaretBounds): (WebCore::Internals::boundingBox): (WebCore::Internals::inspectorHighlightRects): (WebCore::Internals::layoutViewportRect): (WebCore::Internals::visualViewportRect): (WebCore::Internals::touchEventRectsForEvent): (WebCore::Internals::passiveTouchEventListenerRects): (WebCore::Internals::nonFastScrollableRects): (WebCore::Internals::selectionBounds): * testing/Internals.h: * testing/Internals.idl: 2017-04-28 Youenn Fablet getUserMedia video streams should follow device orientation https://bugs.webkit.org/show_bug.cgi?id=171284 Reviewed by Eric Carlson. Only really affects AVVideoCaptureSource on iOS. Manually testing the following cases: - Mac: no change of behavior - iOS: page loaded in portrait, video is portrait. page loaded in landscape, video is landscape - iOS: changing the device orientation makes the video samples to be moved to landscape/portrait. - Same tests as above with peer connection. Making Document having an OrientationNotifier that AVVideoCaptureSources get registered to. Making AVVideoCaptureSource an OrientationNotifier::Observer so that it can changes width/height if needed. Refactoring to specialize CaptureFactory in VideoCaptureFactory and AudioCaptureFactory. Refactoring to return a CaptureSourceOrError instead of passing an out parameter plus returning a RefPtr. * Modules/mediastream/UserMediaRequest.cpp: (WebCore::UserMediaRequest::allow): * WebCore.xcodeproj/project.pbxproj: * dom/Document.cpp: (WebCore::Document::orientationChanged): * dom/Document.h: * page/Frame.cpp: (WebCore::Frame::orientationChanged): * platform/OrientationNotifer.h: Copied from Source/WebKit2/UIProcess/Cocoa/UserMediaCaptureManagerProxy.h. (WebCore::OrientationNotifier::Observer::setNotifier): (WebCore::OrientationNotifier::Observer::~Observer): (WebCore::OrientationNotifier::orientationChanged): (WebCore::OrientationNotifier::addObserver): (WebCore::OrientationNotifier::removeObserver): * platform/mediastream/MediaStreamPrivate.cpp: (WebCore::MediaStreamPrivate::monitorOrientation): * platform/mediastream/MediaStreamPrivate.h: * platform/mediastream/RealtimeMediaSource.h: (WebCore::CaptureSourceOrError::CaptureSourceOrError): (WebCore::CaptureSourceOrError::operator bool): (WebCore::CaptureSourceOrError::source): * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::setAudioFactory): (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory): (WebCore::RealtimeMediaSourceCenter::setVideoFactory): (WebCore::RealtimeMediaSourceCenter::unsetVideoFactory): * platform/mediastream/RealtimeMediaSourceCenter.h: (WebCore::RealtimeMediaSourceCenter::defaultAudioFactory): (WebCore::RealtimeMediaSourceCenter::defaultVideoFactory): (WebCore::RealtimeMediaSourceCenter::audioFactory): (WebCore::RealtimeMediaSourceCenter::videoFactory): * platform/mediastream/mac/AVAudioCaptureSource.h: * platform/mediastream/mac/AVAudioCaptureSource.mm: (WebCore::AVAudioCaptureSource::create): (WebCore::AVAudioCaptureSource::factory): * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::create): (WebCore::AVVideoCaptureSource::factory): (WebCore::AVVideoCaptureSource::monitorOrientation): (WebCore::AVVideoCaptureSource::orientationChanged): (WebCore::AVVideoCaptureSource::processNewFrame): * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::create): (WebCore::CoreAudioCaptureSource::factory): * platform/mediastream/mac/CoreAudioCaptureSource.h: * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm: (WebCore::MockRealtimeAudioSource::create): * platform/mediastream/mac/MockRealtimeVideoSourceMac.h: * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: (WebCore::MockRealtimeVideoSource::create): (WebCore::MockRealtimeVideoSourceMac::orientationChanged): * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: (WebCore::RealtimeMediaSourceCenterMac::createMediaStream): (WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints): (WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory): (WebCore::RealtimeMediaSourceCenterMac::defaultVideoFactory): * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h: * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp: (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h: * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::MockRealtimeAudioSource::create): (WebCore::MockRealtimeAudioSource::factory): * platform/mock/MockRealtimeAudioSource.h: * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints): (WebCore::MockRealtimeMediaSourceCenter::createMediaStream): (WebCore::MockRealtimeMediaSourceCenter::defaultAudioFactory): (WebCore::MockRealtimeMediaSourceCenter::defaultVideoFactory): * platform/mock/MockRealtimeMediaSourceCenter.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::create): (WebCore::MockRealtimeVideoSource::factory): * platform/mock/MockRealtimeVideoSource.h: 2017-04-28 Said Abou-Hallawa Unify how BitmapImage handles the availability of a decoded for large and animated images https://bugs.webkit.org/show_bug.cgi?id=171410 Reviewed by Simon Fraser. Rename some functions which are related to animation frame availability. Make BitmapImage call ImageObserver::imageFrameAvailable() whenever a frame is available regardless it is for an animated or for a large image. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::isVisibleInViewport): * html/MediaElementSession.cpp: (WebCore::MediaElementSession::autoplayPermitted): (WebCore::isMainContentForPurposesOfAutoplay): * loader/cache/CachedImage.cpp: (WebCore::CachedImage::CachedImageObserver::imageFrameAvailable): (WebCore::CachedImage::imageFrameAvailable): (WebCore::CachedImage::usesImageContainerSize): Deleted. (WebCore::CachedImage::imageHasRelativeWidth): Deleted. (WebCore::CachedImage::imageHasRelativeHeight): Deleted. (WebCore::CachedImage::CachedImageObserver::animationAdvanced): Deleted. (WebCore::CachedImage::animationAdvanced): Deleted. * loader/cache/CachedImage.h: * loader/cache/CachedImageClient.h: (WebCore::CachedImageClient::imageFrameAvailable): (WebCore::CachedImageClient::newImageAnimationFrameAvailable): Deleted. * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::internalAdvanceAnimation): (WebCore::BitmapImage::imageFrameAvailableAtIndex): (WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex): Deleted. * platform/graphics/BitmapImage.h: * platform/graphics/Image.h: (WebCore::Image::imageFrameAvailableAtIndex): (WebCore::Image::newFrameNativeImageAvailableAtIndex): Deleted. * platform/graphics/ImageFrameCache.cpp: (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): * platform/graphics/ImageObserver.h: * platform/graphics/ImageTypes.h: * rendering/RenderElement.cpp: (WebCore::RenderElement::RenderElement): (WebCore::RenderElement::shouldRepaintInVisibleRect): (WebCore::RenderElement::imageFrameAvailable): (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded): (WebCore::shouldRepaintForImageAnimation): Deleted. (WebCore::RenderElement::newImageAnimationFrameAvailable): Deleted. * rendering/RenderElement.h: * rendering/RenderView.cpp: (WebCore::RenderView::updateVisibleViewportRect): * svg/graphics/SVGImageClients.h: 2017-04-28 Jeremy Jones ARGUMENT BAD: time, time >= 0 https://bugs.webkit.org/show_bug.cgi?id=164336 rdar://problem/29314891 Reviewed by Eric Carlson. Handle invalid duration and current time when calculating remaining time. Test media/modern-media-controls/pip-support/pip-support-click.html now works without a workaround in media/modern-media-controls/pip-support/pip-support-enabled.html * platform/mac/WebVideoFullscreenHUDWindowController.mm: (-[WebVideoFullscreenHUDWindowController remainingTimeText]): 2017-04-28 Daniel Bates Add WebCore::protocolIsJavaScript(StringView) https://bugs.webkit.org/show_bug.cgi?id=171396 Reviewed by Alex Christensen. Add an overload of WebCore::protocolIsJavaScript() that takes a StringView to avoid the need for a caller to allocate a new String object when converting from a StringView to a String. We are not using this functionality at the moment, but we will in the patch for . No functionality has changed. So, no new tests. * platform/URL.cpp: Remove an outdated comment about protocolIs(StringView, const char*). This overload was removed in r212508. (WebCore::protocolIsInternal): Added. (WebCore::protocolIs): Implemented in terms of WebCore::protocolIsInternal(). (WebCore::URL::protocolIs): Ditto. (WebCore::protocolIsJavaScript): Added; overload that takes a StringView. (WebCore::mimeTypeFromDataURL): Modified to use WebCore::protocolIsInternal(). * platform/URL.h: 2017-04-28 Andy Estes [macOS] WebPlaybackControlsManager needs to know when the selected text or audio track changes https://bugs.webkit.org/show_bug.cgi?id=171434 Reviewed by Eric Carlson. * dom/GenericEventQueue.cpp: (WebCore::GenericEventQueue::hasPendingEventsOfType): Added to check if a pending event exists of a certain type. * dom/GenericEventQueue.h: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::setSelectedTextTrack): Even if no track modes change, fire a change event when the track to select is off or automatic so that WebPlaybackSessionModelMediaElement detects the change. * html/track/TrackListBase.cpp: (TrackListBase::isChangeEventScheduled): Returns true if m_asyncEventQueue has a pending change event. * html/track/TrackListBase.h: * platform/cocoa/WebPlaybackSessionModel.h: (WebCore::WebPlaybackSessionModelClient::audioMediaSelectionIndexChanged): (WebCore::WebPlaybackSessionModelClient::legibleMediaSelectionIndexChanged): * platform/cocoa/WebPlaybackSessionModelMediaElement.h: * platform/cocoa/WebPlaybackSessionModelMediaElement.mm: (WebCore::WebPlaybackSessionModelMediaElement::setMediaElement): Registered/unregistered for the change event on the audio and text tracks. (WebCore::WebPlaybackSessionModelMediaElement::updateForEventName): Called updateMediaSelectionIndices() when the change event fires. (WebCore::WebPlaybackSessionModelMediaElement::updateMediaSelectionOptions): Renamed from updateLegibleOptions(). (WebCore::WebPlaybackSessionModelMediaElement::updateMediaSelectionIndices): Called audioMediaSelectionIndexChanged() and legibleMediaSelectionIndexChanged() on m_clients with the updated indices. (WebCore::WebPlaybackSessionModelMediaElement::legibleMediaSelectedIndex): Fixed a bug where selectedIndex would never be set to offIndex if offIndex is 0 (which it usually is). (WebCore::WebPlaybackSessionModelMediaElement::updateLegibleOptions): Renamed to updateMediaSelectionOptions(). * platform/mac/WebPlaybackControlsManager.h: * platform/mac/WebPlaybackControlsManager.mm: (-[WebPlaybackControlsManager setAudioMediaSelectionIndex:]): Set _currentAudioTouchBarMediaSelectionOption to the object at selectedIndex and manually triggered a KVO notification. We can't call -setCurrentAudioTouchBarMediaSelectionOption: here since that will send a message back to the Web process. (-[WebPlaybackControlsManager setLegibleMediaSelectionIndex:]): Ditto for _currentLegibleTouchBarMediaSelectionOption. * platform/mac/WebPlaybackSessionInterfaceMac.h: * platform/mac/WebPlaybackSessionInterfaceMac.mm: (WebCore::WebPlaybackSessionInterfaceMac::audioMediaSelectionIndexChanged): Called -[WebPlaybackControlsManager setAudioMediaSelectionIndex:]. (WebCore::WebPlaybackSessionInterfaceMac::legibleMediaSelectionIndexChanged): Called -[WebPlaybackControlsManager setLegibleMediaSelectionIndex:]. 2017-04-28 Chris Dumez Range.getClientRects() / getBoundingClientRect() should return DOMRect types https://bugs.webkit.org/show_bug.cgi?id=171393 Reviewed by Simon Fraser. Range.getClientRects() / getBoundingClientRect() should return DOMRect types: - https://drafts.csswg.org/cssom-view/#extensions-to-the-range-interface Test: fast/dom/Range/getBoundingClientRect-getClientRects-return-type.html * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/DOMRect.cpp: Copied from Source/WebCore/dom/DOMRect.h. (WebCore::createDOMRectVector): * dom/DOMRect.h: * dom/Element.cpp: (WebCore::Element::getClientRects): * dom/Range.cpp: (WebCore::Range::getClientRects): (WebCore::Range::getBoundingClientRect): * dom/Range.h: * dom/Range.idl: 2017-04-28 Chris Dumez Tweak window.open features argument tokenizer to match HTML standard and Edge https://bugs.webkit.org/show_bug.cgi?id=170548 Reviewed by Geoffrey Garen. Update window.open() features argument tokenizer to match HTML standard: - https://html.spec.whatwg.org/#concept-window-open-features-tokenize Also update window.open() to return null instead of the window when the 'noopener' feature is activated, as per: - https://html.spec.whatwg.org/#dom-open (Step 10) No new tests, rebaselined existing test. * page/DOMWindow.cpp: (WebCore::DOMWindow::createWindow): Update window.open() to return null instead of the window when the 'noopener' feature is activated, as per: - https://html.spec.whatwg.org/#dom-open (Step 10) * page/WindowFeatures.cpp: (WebCore::isSeparator): Treat all ASCII spaces as feature separators, as per: - https://html.spec.whatwg.org/#feature-separator This has the effect of adding U+000C (FormFeed) as a separator. (WebCore::processFeaturesString): Align tokenizing code with the specification: - https://html.spec.whatwg.org/#concept-window-open-features-tokenize In particular, the following changes were made: - After the key, skip to first '=', but don't skip past a ',' or a non-separator. The "or a non-separator" part is new in the spec (step 3.6.1) and is now implemented. - After looking for the '=', only treat what follows as a value if the current character is a separator. This is as per step 7 in the spec. These changes now cause us to parse 'foo noopener=1' as ('foo', ''), ('noopener', '1'). 2017-04-28 Eric Carlson Implement ondevicechange https://bugs.webkit.org/show_bug.cgi?id=169872 Unreviewed, remove some dead code accidentally committed in r215929. * platform/mediastream/CaptureDeviceManager.cpp: 2017-04-28 Chris Dumez Update DOMTokenList.replace() to match the latest DOM specification https://bugs.webkit.org/show_bug.cgi?id=171388 Reviewed by Alex Christensen. Update DOMTokenList.replace() to match the latest DOM specification after: - https://github.com/whatwg/dom/issues/442 - https://github.com/whatwg/infra/pull/126 The latest spec text is at: - https://dom.spec.whatwg.org/#dom-domtokenlist-replace - https://infra.spec.whatwg.org/#set-replace The behavior change in this patch causes (a, b, c).replace(a, c) to return (c, b) instead of (b, c). This new behavior is aligned with Firefox as well. No new tests, updated existing test. * html/DOMTokenList.cpp: (WebCore::DOMTokenList::replace): 2017-04-28 Brady Eidson Start of support for multiple WebsiteDataStore/SessionIDs per process https://bugs.webkit.org/show_bug.cgi?id=171422 Reviewed by Geoffrey Garen. Covered by API tests. * platform/network/NetworkStorageSession.h: * platform/network/cf/NetworkStorageSessionCFNet.cpp: (WebCore::NetworkStorageSession::ensureSession): * platform/spi/cf/CFNetworkSPI.h: 2017-04-28 Chris Dumez URLSearchParams should be reflective https://bugs.webkit.org/show_bug.cgi?id=171345 Reviewed by Alex Christensen. There was a bug in our implementation of [1] where we would replace '+' with 0x20 *after* URL-decoding the string, instead of *before*. This was causing us to replace URL-encoded '+' characters with 0x20. [1] https://url.spec.whatwg.org/#concept-urlencoded-parser No new tests, updated existing test. * platform/URLParser.cpp: 2017-04-28 Youenn Fablet Adding a runtime flag specific to MediaDevices https://bugs.webkit.org/show_bug.cgi?id=171433 Reviewed by Geoffrey Garen. Covered by existing tests. Adding a preference for MediaDevices. Setting media devices runtime flag to false by default. Setting peer connection and media stream flags to true by default. Activating mediaDevices and getUserMedia Navigator properties based on media devices flag. * Modules/mediastream/NavigatorMediaDevices.idl: * Modules/mediastream/NavigatorUserMedia.idl: * page/RuntimeEnabledFeatures.cpp: (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::mediaDevicesEnabled): (WebCore::RuntimeEnabledFeatures::setMediaDevicesEnabled): 2017-04-28 Eric Carlson Implement ondevicechange https://bugs.webkit.org/show_bug.cgi?id=169872 Unreviewed, fix test crash. * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::addDevicesChangedObserver): "nextToken" must be static. 2017-04-28 Dean Jackson [WebGPU] Label MTLCommandQueues with a prefix for internal telemetry https://bugs.webkit.org/show_bug.cgi?id=171441 Reviewed by Tim Horton. Prefix any label that is set by the WebGPU API so that our telemetry can identify the use. Don't expose that prefix to the API though. New API Test: GPUCommandQueue * platform/graphics/cocoa/GPUCommandQueueMetal.mm: (WebCore::GPUCommandQueue::GPUCommandQueue): (WebCore::GPUCommandQueue::label): (WebCore::GPUCommandQueue::setLabel): 2017-04-28 Joanmarie Diggs [ATK] aria-modal="true" should be exposed via ATK_STATE_MODAL https://bugs.webkit.org/show_bug.cgi?id=171188 Reviewed by Chris Fleizach. Include ATK_STATE_MODAL in the AtkObject's state set if the accessible element's node is the current ARIA modal node. Test: accessibility/gtk/aria-modal-state-exposed.html * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isAriaModalNode): * accessibility/AccessibilityObject.h: * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (setAtkStateSetFromCoreObject): 2017-04-28 Eric Carlson Implement ondevicechange https://bugs.webkit.org/show_bug.cgi?id=169872 Reviewed by Jer Noble. Test: fast/mediastream/device-change-event.html * Modules/mediastream/MediaDevices.cpp: (WebCore::MediaDevices::MediaDevices): Register for devicechange callbacks. (WebCore::MediaDevices::~MediaDevices): Unregister. (WebCore::MediaDevices::scheduledEventTimerFired): * Modules/mediastream/MediaDevices.h: * Modules/mediastream/MediaDevices.idl: * Modules/mediastream/MediaDevicesEnumerationRequest.cpp: (WebCore::MediaDevicesEnumerationRequest::setDeviceInfo): Remove unnecessary instance variables. * Modules/mediastream/MediaDevicesEnumerationRequest.h: * Modules/mediastream/MediaDevicesRequest.cpp: (WebCore::MediaDevicesRequest::start): Remove m_idHashSalt, it isn't used. RealtimeMediaSourceCenter now has the method to hash ids and group IDs. (WebCore::hashString): Deleted. (WebCore::MediaDevicesRequest::hashID): Deleted. * Modules/mediastream/MediaDevicesRequest.h: * dom/Document.h: (WebCore::Document::setDeviceIDHashSalt): (WebCore::Document::deviceIDHashSalt): * dom/EventNames.h: Add devicechange. * dom/EventTargetFactory.in: Add MediaDevices. * html/HTMLAttributeNames.in: Add ondevicechange. * platform/mediastream/CaptureDeviceManager.cpp: (WebCore::CaptureDeviceManager::captureDeviceFromPersistentID): Renamed from captureDeviceFromDeviceID and changed to return a std::optional. (WebCore::CaptureDeviceManager::captureDeviceFromDeviceID): Deleted. * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::addStringToSHA): New, add string bytes to SHA1. Moved from MediaDevicesRequest so we can use for in testing. (WebCore::RealtimeMediaSourceCenter::hashStringWithSalt): Generate hash for a string with a salt. Moved from MediaDevicesRequest so we can use for in testing. (WebCore::RealtimeMediaSourceCenter::captureDeviceWithUniqueID): Find a CaptureDevice given a unique ID and the process hash salt. (WebCore::RealtimeMediaSourceCenter::setDeviceEnabled): Enable/disable a device. Used for layout tests only. (WebCore::RealtimeMediaSourceCenter::addDevicesChangedObserver): Add a devices changed listener. (WebCore::RealtimeMediaSourceCenter::removeDevicesChangedObserver): Remove a listener. (WebCore::RealtimeMediaSourceCenter::captureDevicesChanged): Notify listeners. * platform/mediastream/RealtimeMediaSourceCenter.h: * platform/mediastream/mac/AVCaptureDeviceManager.mm: (WebCore::AVCaptureDeviceManager::addDevicesChangedObserver): Update for change to captureDeviceFromDeviceID. * platform/mock/MockRealtimeMediaSource.cpp: (WebCore::MockRealtimeMediaSource::audioDevices): All devices are enabled by default. (WebCore::MockRealtimeMediaSource::videoDevices): Ditto. * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::MockRealtimeMediaSourceCenter::createMediaStream): Drive-by cleanup: use the vector of devices instead of making assumptions about the number. (WebCore::MockRealtimeMediaSourceCenter::getMediaStreamDevices): Only include enabled devices. (WebCore::MockRealtimeMediaSourceCenter::setDeviceEnabled): Enable or disable a device. * platform/mock/MockRealtimeMediaSourceCenter.h: * testing/Internals.cpp: (WebCore::Internals::setMediaDeviceState): Enable or disable a mock capture device. * testing/Internals.h: * testing/Internals.idl: 2017-04-28 Alex Christensen Fix memory corruption issue after r215883. https://bugs.webkit.org/show_bug.cgi?id=171365 Reviewed by Brady Eidson. This fixes a crash when starting WebKit2. * platform/network/cf/NetworkStorageSessionCFNet.cpp: (WebCore::NetworkStorageSession::NetworkStorageSession): Initialize m_platformCookieStorage with the default constructor of RetainPtr, then call NetworkStorageSession::cookieStorage which checks m_platformCookieStorage for null. It was checking uninitialized memory when we had m_platformCookieStorage in the initializer list. 2017-04-28 Joanmarie Diggs AX: Implement aria-value support for focusable separators https://bugs.webkit.org/show_bug.cgi?id=171169 Reviewed by Chris Fleizach. Add SplitterRole to the roles which support range value and are considered a range control, as long as the SplitterRole element is focusable. Also replace ATK's role- based check with a call to supportsRangeValue() when determining if the AtkValue interface should be implemented. Test: accessibility/separator-values.html * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isRangeControl): (WebCore::AccessibilityObject::supportsRangeValue): * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (getInterfaceMaskFromObject): 2017-04-28 Joanmarie Diggs [ATK] GridCellRole should implement AtkTableCell (regression?) https://bugs.webkit.org/show_bug.cgi?id=171179 Reviewed by Chris Fleizach. Add GridCellRole to the group of roles which should implement AtkTableCell. Test: accessibility/gtk/interface-table-cell.html * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (getInterfaceMaskFromObject): 2017-04-28 Miguel Gomez REGRESSION(r215211): [GTK] Several webgl related tests are failing https://bugs.webkit.org/show_bug.cgi?id=170730 Reviewed by Said Abou-Hallawa. There is a wrong situation in the image decoders where the complete data has been assigned to them but the size of the image hasn't been decoded yet. This is causing rendering issues in webgl when decoding the images used as textures. To fix this, we refactor how the encoded data status is stored to avoid that situation: the status is handled completely by ImageDecoder.h, and it's the one forcing the decode of the size when data gets assigned to the decoders. Covered by existent tests. * platform/image-decoders/ImageDecoder.h: (WebCore::ImageDecoder::isAllDataReceived): (WebCore::ImageDecoder::setData): (WebCore::ImageDecoder::encodedDataStatus): (WebCore::ImageDecoder::isSizeAvailable): (WebCore::ImageDecoder::setSize): (WebCore::ImageDecoder::setFailed): (WebCore::ImageDecoder::failed): * platform/image-decoders/bmp/BMPImageDecoder.cpp: (WebCore::BMPImageDecoder::frameBufferAtIndex): (WebCore::BMPImageDecoder::decode): (WebCore::BMPImageDecoder::encodedDataStatus): Deleted. * platform/image-decoders/bmp/BMPImageDecoder.h: * platform/image-decoders/gif/GIFImageDecoder.cpp: (WebCore::GIFImageDecoder::frameCount): (WebCore::GIFImageDecoder::frameBufferAtIndex): (WebCore::GIFImageDecoder::decode): (WebCore::GIFImageDecoder::encodedDataStatus): Deleted. * platform/image-decoders/gif/GIFImageDecoder.h: * platform/image-decoders/ico/ICOImageDecoder.cpp: (WebCore::ICOImageDecoder::setData): (WebCore::ICOImageDecoder::frameCount): (WebCore::ICOImageDecoder::frameBufferAtIndex): (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex): (WebCore::ICOImageDecoder::decode): (WebCore::ICOImageDecoder::decodeAtIndex): (WebCore::ICOImageDecoder::encodedDataStatus): Deleted. * platform/image-decoders/ico/ICOImageDecoder.h: * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: (WebCore::JPEGImageDecoder::frameBufferAtIndex): (WebCore::JPEGImageDecoder::decode): (WebCore::JPEGImageDecoder::encodedDataStatus): Deleted. * platform/image-decoders/jpeg/JPEGImageDecoder.h: * platform/image-decoders/png/PNGImageDecoder.cpp: (WebCore::PNGImageDecoder::frameBufferAtIndex): (WebCore::PNGImageDecoder::decode): (WebCore::PNGImageDecoder::encodedDataStatus): Deleted. * platform/image-decoders/png/PNGImageDecoder.h: * platform/image-decoders/webp/WEBPImageDecoder.cpp: (WebCore::WEBPImageDecoder::frameBufferAtIndex): (WebCore::WEBPImageDecoder::decode): (WebCore::WEBPImageDecoder::encodedDataStatus): Deleted. * platform/image-decoders/webp/WEBPImageDecoder.h: 2017-04-27 Carlos Garcia Campos Move UUID from WebCore/platform to WTF https://bugs.webkit.org/show_bug.cgi?id=171372 Reviewed by Michael Catanzaro. UUID only contains createCanonicalUUIDString() that is platform independent and doesn't depend on anything from WebCore, only from WTF. * CMakeLists.txt: * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp: * Modules/mediacontrols/MediaControlsHost.cpp: * Modules/mediastream/RTCPeerConnection.cpp: * Modules/webaudio/MediaStreamAudioSource.cpp: * Modules/webdatabase/DatabaseTracker.cpp: * WebCore.order: * WebCore.xcodeproj/project.pbxproj: * editing/mac/EditorMac.mm: * fileapi/BlobURL.cpp: * loader/appcache/ApplicationCacheHost.cpp: * loader/appcache/ApplicationCacheStorage.cpp: * platform/URL.cpp: * platform/glib/FileSystemGlib.cpp: * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp: * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm: * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: * platform/mediastream/CaptureDeviceManager.cpp: * platform/mediastream/MediaStreamPrivate.h: * platform/mediastream/MediaStreamTrackPrivate.cpp: * platform/mediastream/RealtimeMediaSource.cpp: * platform/mediastream/mac/AVCaptureDeviceManager.mm: * platform/mediastream/mac/AVMediaCaptureSource.mm: * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp: * platform/mock/MockRealtimeAudioSource.cpp: * platform/mock/MockRealtimeMediaSourceCenter.cpp: * platform/mock/MockRealtimeVideoSource.cpp: * testing/MockCDMFactory.cpp: 2017-04-27 Alex Christensen Make navigation policy checking more robust https://bugs.webkit.org/show_bug.cgi?id=171409 Reviewed by Geoffrey Garen. No change in behavior. Just added a protectedThis to a lambda and made the functions non-copyable. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::willSendRequest): * loader/PolicyCallback.cpp: (WebCore::PolicyCallback::set): (WebCore::PolicyCallback::clear): Deleted. * loader/PolicyCallback.h: * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::cancelCheck): (WebCore::PolicyChecker::stopCheck): (WebCore::PolicyChecker::continueAfterNavigationPolicy): (WebCore::PolicyChecker::continueAfterNewWindowPolicy): (WebCore::PolicyChecker::continueAfterContentPolicy): 2017-04-27 Wenson Hsieh Data interaction should not load pasteboard content before performing the data operation https://bugs.webkit.org/show_bug.cgi?id=171414 Reviewed by Tim Horton. When interacting with a link, we should not try to fetch pasteboard contents for the URL UTI type before performing the data operation. Teaches DragController to know whether it is allowed to load data from the dragging pasteboard, and uses this information in DragController::dragOperation to determine whether to use DragData::containsURLTypeIdentifier or DragData::containsURL. * page/DragController.cpp: (WebCore::DragController::DragController): (WebCore::DragController::performDragOperation): * page/DragController.h: (WebCore::DragController::canLoadDataFromDraggingPasteboard): * page/mac/DragControllerMac.mm: (WebCore::DragController::dragOperation): * platform/DragData.h: * platform/ios/WebItemProviderPasteboard.mm: (-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]): * platform/mac/DragDataMac.mm: (WebCore::DragData::containsURLTypeIdentifier): 2017-04-27 Joseph Pecoraro Support for promise rejection events (unhandledrejection) https://bugs.webkit.org/show_bug.cgi?id=150358 Reviewed by Saam Barati. Patch by Joseph Pecoraro and Yusuke Suzuki. Implement support for the `onunhandledrejection` and `rejectionhandled` events. They dispatch a new PromiseRejectionEvent using the ES6 HostPromiseRejectionTracker hook: https://tc39.github.io/ecma262/#sec-host-promise-rejection-tracker https://html.spec.whatwg.org/multipage/webappapis.html#unhandled-promise-rejections This is currently implemented only for Documents and not yet Web Workers. Tests: js/dom/unhandled-promise-rejection-basic.html js/dom/unhandled-promise-rejection-bindings-type-error.html js/dom/unhandled-promise-rejection-console-no-report.html js/dom/unhandled-promise-rejection-console-report.html js/dom/unhandled-promise-rejection-handle-during-event.html js/dom/unhandled-promise-rejection-handle-in-handler.html js/dom/unhandled-promise-rejection-handle.html js/dom/unhandled-promise-rejection-order.html * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * dom/DOMAllInOne.cpp: New files. * bindings/scripts/CodeGenerator.pm: (IsPromiseType): * bindings/scripts/CodeGeneratorJS.pm: (AddToIncludesForIDLType): (GetBaseIDLType): Binding support for Promise attributes. * bindings/js/JSDOMConvert.h: * bindings/js/JSDOMConvertPromise.h: Copied from Source/JavaScriptCore/runtime/JSPromise.h. (WebCore::Converter>::convert): (WebCore::JSConverter>::convert): Promise binding conversion is currently unimplemented, which only means web developers creating their own PromiseRejectionEvent will not get autowrapping of values assigned to `promise` in event initialization. Engine generated events will have expected behavior. * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::promiseRejectionTracker): * bindings/js/JSDOMWindowBase.h: * bindings/js/JSWorkerGlobalScopeBase.cpp: Implement HostPromiseRejectionTracker hook for Document but not Worker. Passes through to the ScriptExecutionContext's tracker. * bindings/js/JSMainThreadExecState.cpp: (WebCore::JSMainThreadExecState::didLeaveScriptContext): * bindings/js/JSMainThreadExecState.h: (WebCore::JSMainThreadExecState::~JSMainThreadExecState): When completing script execution and performing microtasks notify about rejected promises. Technically this should go inside of performing a microtask checkpoint, except lacking EventLoop concepts we use ScriptExecutionState. * dom/EventNames.h: * dom/EventNames.in: * dom/PromiseRejectionEvent.cpp: Added. (WebCore::PromiseRejectionEvent::PromiseRejectionEvent): (WebCore::PromiseRejectionEvent::~PromiseRejectionEvent): * dom/PromiseRejectionEvent.h: Added. * dom/PromiseRejectionEvent.idl: Added. New PromiseRejectionEvent event interface. * dom/GlobalEventHandlers.idl: New onunhandledrejection and onrejectionhandled. * dom/RejectedPromiseTracker.cpp: Added. (WebCore::RejectedPromise::RejectedPromise): (WebCore::RejectedPromise::globalObject): (WebCore::RejectedPromise::promise): (WebCore::UnhandledPromise::UnhandledPromise): (WebCore::UnhandledPromise::callStack): (WebCore::RejectedPromiseTracker::RejectedPromiseTracker): (WebCore::RejectedPromiseTracker::~RejectedPromiseTracker): (WebCore::createScriptCallStackFromReason): (WebCore::RejectedPromiseTracker::promiseRejected): (WebCore::RejectedPromiseTracker::promiseHandled): (WebCore::RejectedPromiseTracker::processQueueSoon): (WebCore::RejectedPromiseTracker::reportUnhandledRejections): (WebCore::RejectedPromiseTracker::reportRejectionHandled): * dom/RejectedPromiseTracker.h: Added. Track and report rejected promises. The promises are tracked weakly allowing them to be collected before they are reported. When reporting we dispatch PromiseRejectionEvent events, and if the default is not prevented we log a message to the console. * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::reportUnhandledPromiseRejection): (WebCore::ScriptExecutionContext::ensureRejectedPromiseTrackerSlow): * dom/ScriptExecutionContext.h: (WebCore::ScriptExecutionContext::ensureRejectedPromiseTracker): Each ScriptExecutionContext can own a rejected promise tracker. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::pauseInternal): https://html.spec.whatwg.org/multipage/embedded-content.html#internal-pause-steps Internal pause steps say to timeupdate, pause, and rejecting pending play promises should all happen in a queued task. Here the first two actions are already scheduled on tasks, but rejecting play promises was not being done in a task, so this makes that change. * Modules/streams/ReadableStream.js: (pipeThrough): * Modules/streams/ReadableStreamInternals.js: (readableStreamReaderGenericInitialize): (readableStreamError): (readableStreamReaderGenericRelease): Satisfy parts of the Streams specification which state to set the [[PromiseIsHandled]] internal state of promises created internally by the Streams APIs. This prevents some internal promises from appearing as unhandled promise rejections. 2017-04-27 Chris Dumez Align colspan/rowspan limits with the latest HTML specification https://bugs.webkit.org/show_bug.cgi?id=171322 Reviewed by Darin Adler. Align colspan/rowspan limits with the latest HTML specification after: - https://github.com/whatwg/html/pull/1993 The following changes were made: - Our rowspan limit was raised from 8190 to 65534 - A colspan limit of 1000 was introduced. Blink has UseCounter data showing that colspans over 1000 are extremely rare and Gecko has data showing that when we get a colspan greater than 1000, it is usually a bug. Therefore, this change should be fine. - The limits are now properly reflected via the IDL attributes instead of lying to the Web about the colspan / rowspan we are using internally. Test: imported/w3c/web-platform-tests/html/semantics/tabular-data/processing-model-1/span-limits.html * html/HTMLTableCellElement.cpp: (WebCore::HTMLTableCellElement::colSpan): (WebCore::HTMLTableCellElement::rowSpan): (WebCore::HTMLTableCellElement::rowSpanForBindings): (WebCore::HTMLTableCellElement::setColSpan): * html/HTMLTableCellElement.h: * html/HTMLTableCellElement.idl: * html/parser/HTMLParserIdioms.cpp: (WebCore::parseHTMLIntegerInternal): (WebCore::parseHTMLInteger): (WebCore::parseHTMLNonNegativeInteger): (WebCore::parseValidHTMLNonNegativeIntegerInternal): (WebCore::parseHTTPRefreshInternal): * html/parser/HTMLParserIdioms.h: (WebCore::parseHTMLInteger): (WebCore::parseHTMLNonNegativeInteger): (WebCore::clampHTMLNonNegativeIntegerToRange): Add utility function to implement: - https://html.spec.whatwg.org/#clamped-to-the-range 2017-04-27 Wenson Hsieh WKUIDelegatePrivate needs a hook to vend data used to initialize item providers for data interaction https://bugs.webkit.org/show_bug.cgi?id=171386 Reviewed by Beth Dakin. Teach WebItemProviderPasteboard to remember what WebItemProviderRegistrationInfoList it was initialized with when beginning a drag. This information is cleared out the next time the list of item providers is set to something different, which happens when the data interaction session concludes. * platform/ios/WebItemProviderPasteboard.h: * platform/ios/WebItemProviderPasteboard.mm: (-[WebItemProviderPasteboard init]): (-[WebItemProviderPasteboard setItemProviders:]): (-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]): (-[WebItemProviderPasteboard registrationInfoAtIndex:]): (-[WebItemProviderPasteboard itemProviderAtIndex:]): 2017-04-27 Brady Eidson Refactor SessionID to support multiple non-ephemeral (persistent) sessions. https://bugs.webkit.org/show_bug.cgi?id=171367 Reviewed by Andy Estes. This is also a nice general cleanup of SessionID, including privatizing the "arbitrary number" constructor and moving encode/decode into the class. No new tests (Refactor, no behavior change yet). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * page/SessionID.cpp: Added. (WebCore::SessionID::generatePersistentSessionID): (WebCore::SessionID::generateEphemeralSessionID): (WebCore::SessionID::enableGenerationProtection): * page/SessionID.h: (WebCore::SessionID::SessionID): (WebCore::SessionID::emptySessionID): (WebCore::SessionID::hashTableDeletedValue): (WebCore::SessionID::defaultSessionID): (WebCore::SessionID::legacyPrivateSessionID): (WebCore::SessionID::isValid): (WebCore::SessionID::isEphemeral): (WebCore::SessionID::encode): (WebCore::SessionID::decode): (WTF::HashTraits::constructDeletedValue): (WTF::HashTraits::isDeletedValue): 2017-04-27 Said Abou-Hallawa Attempt to fix a PLT regression on Mac Unreviewed. Disable passing the TypeIdentifierHint to CGImageSourceCreateIncremental() on Mac for now. * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::ImageDecoder::ImageDecoder): 2017-04-27 Daniel Bates Rename callerDOMWindow()/CallerDocument to incumbentDOMWindow()/IncumbentDocument https://bugs.webkit.org/show_bug.cgi?id=171145 Reviewed by Saam Barati. Standardize on the terminology "incumbent" to refer to "most-recently-entered author function or script on the stack, or the author function or script that originally scheduled the currently-running callback" (1). [1] (27 April 2017) * bindings/js/JSDOMWindowBase.cpp: (WebCore::incumbentDOMWindow): (WebCore::callerDOMWindow): Deleted. * bindings/js/JSDOMWindowBase.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateCallWith): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::jsTestObjPrototypeFunctionWithCallerDocumentArgumentCaller): (WebCore::jsTestObjPrototypeFunctionWithCallerWindowArgumentCaller): * bindings/scripts/test/TestObj.idl: * page/DOMWindow.idl: 2017-04-27 Youenn Fablet LayoutTest webrtc/datachannel/datachannel-event.html is a flaky crash https://bugs.webkit.org/show_bug.cgi?id=171092 Reviewed by Eric Carlson. Covered by manual testing on iterating on the crashing tests. With the patch, they appear to no longer crash. The current RTCPeerConnection/RTCController was expecting that peer connections would be stopped before the controller. This assumption is sometimes wrong. Adding clean-up on both sides so that if controller goes away, it notifies its peer connections that they are unregistered. * Modules/mediastream/RTCController.cpp: (WebCore::RTCController::~RTCController): * Modules/mediastream/RTCController.h: * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::create): (WebCore::RTCPeerConnection::~RTCPeerConnection): (WebCore::RTCPeerConnection::doStop): (WebCore::RTCPeerConnection::registerToController): (WebCore::RTCPeerConnection::unregisterFromController): (WebCore::RTCPeerConnection::rtcController): Deleted. * Modules/mediastream/RTCPeerConnection.h: 2017-04-27 Said Abou-Hallawa REGRESSION(r213764): Async decoding of animated images is disabled for ImageDocument https://bugs.webkit.org/show_bug.cgi?id=170333 Reviewed by Simon Fraser. The way the image drawing settings are transfered from the Settings to BitmapImage is problematic. The drawing settings are retrieved from the CachedImageObserver which store them in the constructor only if the CachedImage as a loader. In the case of ImageDocument, there isn't loader set in CachedImage so the settings of ImageDocument are not set. Also the CachedImage can be used after loading by another document which may have a different drawing settings. The fix is to make BitmapImage reads the drawing settings every time it is drawn as a foreground or background image in a RenderElement. * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::drawImage): * loader/cache/CachedImage.cpp: (WebCore::CachedImage::CachedImageObserver::CachedImageObserver): * loader/cache/CachedImage.h: * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::setDrawingSettings): (WebCore::BitmapImage::draw): (WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImages): I was trying to disable the async image decoding temporarily but this way will even prevent testing it until it is enabled. Disable it through WK1 and WK2 preferences. (WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImages): (WebCore::BitmapImage::advanceAnimation): * platform/graphics/BitmapImage.h: * platform/graphics/ImageObserver.h: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintFillLayerExtended): * rendering/RenderImage.cpp: (WebCore::RenderImage::paintIntoRect): 2017-04-27 Wenson Hsieh Performing data interaction with plain text into a contenteditable does not insert any content https://bugs.webkit.org/show_bug.cgi?id=171381 Reviewed by Tim Horton. Attempt to read plain-text-conformant UTI types as kUTTypePlainText before reading them as kUTTypeText. This allows WebItemProviderPasteboard to properly materialize an NSString in -valuesForPasteboardType: inItemSet: using a pre-loaded NSData blob. This scenario is covered by DataInteractionTests.ExternalSourceUTF8PlainTextOnly, but DataInteractionTests are temporarily disabled due to incompatibilities with the current internal SDK. * platform/ios/PasteboardIOS.mm: (WebCore::readPasteboardWebContentDataForType): 2017-04-27 Chris Dumez Element.getBoundingClientRect() / getClientRects() should return a DOMRect types https://bugs.webkit.org/show_bug.cgi?id=171226 Reviewed by Simon Fraser. Element.getBoundingClientRect() / getClientRects() should return a DOMRect types as per: - https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface DOMRect is compatible with ClientRect, which we used to return so the risk should be low. Tests: fast/css/DOMRect-attributes-prototype.html fast/css/DOMRect-serialization.html fast/dom/Element/getClientRects-return-type.html * dom/ClientRectList.cpp: (WebCore::ClientRectList::ClientRectList): * dom/ClientRectList.h: (WebCore::ClientRectList::create): * dom/DOMRect.h: (WebCore::DOMRect::create): * dom/DOMRectReadOnly.h: * dom/Element.cpp: (WebCore::toDOMRectVector): (WebCore::Element::getClientRects): (WebCore::Element::getBoundingClientRect): * dom/Element.h: * dom/Element.idl: * html/track/VTTRegion.cpp: (WebCore::VTTRegion::displayLastTextTrackCueBox): 2017-04-27 Joanmarie Diggs AX: Expose elements with the ARIA "feed" role https://bugs.webkit.org/show_bug.cgi?id=171184 Reviewed by Chris Fleizach. Map elements with the "feed" role to the internal ApplicationGroupRole AccessibilityRole. This prevents them from being unexpectedly pruned from the accessibility tree, and causes them to be exposed with ATK_ROLE_PANEL in WebKitGtk and AXGroup in Safari. No new tests needed. Instead, add the "feed" role to roles-exposed.html, xml-roles-exposed.html, and roles-computedRoleString.html. * accessibility/AccessibilityObject.cpp: (WebCore::initializeRoleMap): 2017-04-27 Brady Eidson Update NetworkStorageSession to support multiple persistent sessions and explicitly set cookie storages. https://bugs.webkit.org/show_bug.cgi?id=171365 Reviewed by Andy Estes. No new tests (No testable behavior change yet). * platform/network/NetworkStorageSession.cpp: (WebCore::NetworkStorageSession::destroySession): * platform/network/NetworkStorageSession.h: * platform/network/NetworkStorageSessionStub.cpp: (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): (WebCore::NetworkStorageSession::ensureSession): * platform/network/cf/NetworkStorageSessionCFNet.cpp: (WebCore::createCFStorageSessionForIdentifier): (WebCore::NetworkStorageSession::NetworkStorageSession): (WebCore::NetworkStorageSession::switchToNewTestingSession): (WebCore::NetworkStorageSession::defaultStorageSession): (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): (WebCore::NetworkStorageSession::ensureSession): (WebCore::NetworkStorageSession::cookieStorage): * platform/network/soup/NetworkStorageSessionSoup.cpp: (WebCore::NetworkStorageSession::ensureSession): * platform/spi/cf/CFNetworkSPI.h: 2017-04-27 Zalan Bujtas Use text-shadow to visualize simple line layout coverage. https://bugs.webkit.org/show_bug.cgi?id=171379 Reviewed by Antti Koivisto. It's more subtle (for everyday use). * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::paintFlow): (WebCore::SimpleLineLayout::paintDebugBorders): Deleted. 2017-04-27 Joanmarie Diggs [ATK] ARIA alertdialogs should be exposed with ROLE_DIALOG https://bugs.webkit.org/show_bug.cgi?id=171187 Reviewed by Chris Fleizach. Map ApplicationAlertDialogRole to ATK_ROLE_DIALOG. While ATK_ROLE_ALERT is appropriate as far as ATK is concerned, the Core Accessibility API Mappings map ARIA's alertdialog role to ATK_ROLE_DIALOG. We should be consistent with the spec. The fact that this is an alert dialog can still be obtained via the AtkObject attributes. No new tests needed. Update the expectations for roles-exposed.html, xml-roles-exposed.html, and aria-mappings.html to reflect the change. * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (atkRole): 2017-04-27 Antti Koivisto Repeated layouts in Mail due to viewport units being used with auto-sizing https://bugs.webkit.org/show_bug.cgi?id=171371 Reviewed by Zalan Bujtas. Test: css3/viewport-percentage-lengths/vh-auto-size.html Auto-sizing code would adjust the size of the view in the beginning of layout(). This would end up invalidating style for elements that use vh units and we would perform main layout with unclean style. This would result in endless layout loops and hit assert on debug. * page/FrameView.cpp: (WebCore::FrameView::availableContentSizeChanged): Ensure we heve clean style after resize if we are in pre-layout. 2017-04-27 Alex Christensen Modernize Frame.h https://bugs.webkit.org/show_bug.cgi?id=171357 Reviewed by Andy Estes. Frame.h has several std::unique_ptrs that are created in the constructor, never null, and destroyed in the destructor. This is what WTF::UniqueRef is for, and using UniqueRef allows us to not check for null values because a UniqueRef can never be null. An interesting case was the EventHandler, which we explicitly set to nullptr in the destructor of MainFrame, a subclass of Frame. We added this in r199181 to fix a crash tested by fast/events/wheel-event-destroys-frame.html and this improved lifetime also does not crash or assert in that test. Using UniqueRef also requires const correctness, which this patch adds when necessary. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::dispatchTouchEvent): * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete): * editing/Editor.cpp: (WebCore::Editor::isSelectTrailingWhitespaceEnabled): (WebCore::Editor::computeAndSetTypingStyle): * editing/Editor.h: * editing/FrameSelection.cpp: (WebCore::FrameSelection::contains): (WebCore::FrameSelection::copyTypingStyle): * editing/FrameSelection.h: (WebCore::FrameSelection::setTypingStyle): * loader/EmptyClients.cpp: * loader/FrameLoader.cpp: (WebCore::FrameLoader::clear): * page/EditorClient.h: * page/EventHandler.cpp: (WebCore::EventHandler::hitTestResultAtPoint): * page/EventHandler.h: * page/Frame.cpp: (WebCore::Frame::Frame): (WebCore::Frame::setView): (WebCore::Frame::injectUserScripts): * page/Frame.h: (WebCore::Frame::editor): (WebCore::Frame::eventHandler): (WebCore::Frame::selection): (WebCore::Frame::animation): (WebCore::Frame::script): (WebCore::Frame::eventHandlerPtr): Deleted. * page/MainFrame.cpp: (WebCore::MainFrame::~MainFrame): * replay/UserInputBridge.cpp: (WebCore::UserInputBridge::handleContextMenuEvent): * replay/UserInputBridge.h: 2017-04-27 Andy Estes Fix the macOS build. * platform/mac/WebPlaybackControlsManager.h: 2017-04-27 Zalan Bujtas Text gets cut off when bailing out of simple line layout with widows. https://bugs.webkit.org/show_bug.cgi?id=171370 Reviewed by Antti Koivisto. Normal line layout requires an extra layout to handle widows. See RenderBlockFlow::relayoutToAvoidWidows. Test: fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::ensureLineBoxes): 2017-04-27 Dean Jackson Use the correct modern-media-controls https://bugs.webkit.org/show_bug.cgi?id=171358 Reviewed by Antoine Quint. * WebCore.xcodeproj/project.pbxproj: 2017-04-26 Dan Bernstein Reverted r215774. That change wasn’t doing what it was intended to do and was inappropriate for WebCore. * WebCore.xcodeproj/project.pbxproj: 2017-04-26 Said Abou-Hallawa Attempt to fix a PLT regression. Unreviewed. Disable passing the TypeIdentifierHint to CGImageSourceCreateIncremental() on iOS for now. * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::ImageDecoder::ImageDecoder): 2017-04-26 Joanmarie Diggs [ATK] ARIA buttons which have a popup should be ATK_ROLE_PUSH_BUTTON; not ATK_ROLE_COMBO_BOX https://bugs.webkit.org/show_bug.cgi?id=171182 Reviewed by Chris Fleizach. Test: accessibility/gtk/button-with-aria-haspopup-is-not-a-combobox.html WebCore Accessibility assigns PopUpButtonRole to collapsed select elements, which the ATK code correctly maps to ATK_ROLE_COMBO_BOX. It turns out that WebCore Accessibility also maps the ARIA button role to PopUpButtonRole if it also has aria-haspopup. Add a check to atkRole() so that the latter case is mapped to ATK_ROLE_PUSH_BUTTON. * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (atkRole): 2017-04-26 Tim Horton Should not drag x-apple-data-detectors links https://bugs.webkit.org/show_bug.cgi?id=171352 Reviewed by Beth Dakin. Test: fast/events/do-not-drag-and-drop-data-detectors-link.html These links are only meaningful in the context of the original document, so they should not be draggable. * editing/cocoa/DataDetection.h: * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::dataDetectorURLProtocol): (WebCore::DataDetection::isDataDetectorURL): * page/DragController.cpp: (WebCore::isDraggableLink): Disallow dragging of links. 2017-04-26 Tim Horton Revert accidentally smushed commit. * editing/cocoa/DataDetection.h: * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::dataDetectorURLProtocol): Deleted. (WebCore::DataDetection::isDataDetectorURL): Deleted. * page/DragController.cpp: (WebCore::isDraggableLink): * platform/mac/DragImageMac.mm: (WebCore::createDragImageForLink): 2017-04-26 Alex Christensen REGRESSION (r215686): ASSERTION FAILED: data seen with webarchive/loading tests https://bugs.webkit.org/show_bug.cgi?id=171340 Reviewed by Brady Eidson. This fixes a flaky assertion in webarchive/loading/missing-data.html * platform/cf/SharedBufferCF.cpp: (WebCore::SharedBuffer::append): If there's no CFDataRef, there's no need to append data. This happens sometimes. 2017-04-26 Ryan Haddad Unreviewed, rolling out r215814. The LayoutTest for this change is failing on ios-simulator and is flaky on macOS. Reverted changeset: "Response.blob() does not set the content-type based on the header value." https://bugs.webkit.org/show_bug.cgi?id=170849 http://trac.webkit.org/changeset/215814 2017-04-26 Wenson Hsieh WebItemProviderPasteboard should not synchronously load provided data https://bugs.webkit.org/show_bug.cgi?id=171341 Reviewed by Tim Horton. Refactors WebItemProviderPasteboard to not require asynchronously loading item provider data. To accomplish this, we ensure that before performing data interaction, the UTI type that the data operation target should consume is propagated to the UI process prior to the web process receiving the signal from the UI process to begin the data operation itself. This information is sent via WebPlatformStrategies::updatePreferredTypeIdentifiers, a new pasteboard helper function. * page/DragController.cpp: (WebCore::DragController::DragController): (WebCore::dragIsHandledByDocument): (WebCore::DragController::performDragOperation): (WebCore::DragController::dragEnteredOrUpdated): (WebCore::DragController::updatePreferredTypeIdentifiersForDragHandlingMethod): (WebCore::DragController::tryDocumentDrag): Give DragHandlingMethod a richer representation of what type of action will be performed. DragController:: updatePreferredTypeIdentifiersForDragHandlingMethod uses this to determine what kinds of UTIs are acceptable for the current drop session. * page/DragController.h: (WebCore::DragController::documentIsHandlingNonDefaultDrag): * page/mac/DragControllerMac.mm: (WebCore::DragController::updatePreferredTypeIdentifiersForDragHandlingMethod): Updates the data interaction pasteboard's list of preferred type identifiers it should load upon data operation. * platform/DragData.h: * platform/PasteboardStrategy.h: * platform/PlatformPasteboard.h: * platform/ios/AbstractPasteboard.h: * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::updatePreferredTypeIdentifiers): * platform/ios/WebItemProviderPasteboard.mm: Introduce _preferredTypeIdentifiers, which -doAfterLoadingProvidedContentIntoFileURLs: uses as a hint when determining which UTI to load for an item provider. In the absence of preferred type identifiers, the default behavior is to use the highest fidelity type adhering to "public.content". (-[WebItemProviderPasteboard init]): (-[WebItemProviderPasteboard updatePreferredTypeIdentifiers:]): (-[WebItemProviderPasteboard setItemProviders:]): (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]): (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]): Remove calls to -createObjectOfClass: and -copyDataRepresentation:. Instead, rely solely on the loaded file URL to read and initialize data and objects from the pasteboard. (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]): (-[WebItemProviderPasteboard _tryToCreateObjectOfClass:usingProvider:]): Deleted. * platform/mac/DragDataMac.mm: (WebCore::DragData::updatePreferredTypeIdentifiers): 2017-04-26 Joanmarie Diggs [ATK] Elements with a defined, non-false value for aria-current should expose ATK_STATE_ACTIVE https://bugs.webkit.org/show_bug.cgi?id=171163 Reviewed by Chris Fleizach. Add ATK_STATE_ACTIVE to the state set of elements which have a valid, non-false value for aria-current, expose the value of via the "current" AtkObject attribute, and emit state-change notifications when the value of aria-current changes from non-false to false, or vice versa. Tests: accessibility/gtk/aria-current-changed-notification.html accessibility/gtk/aria-current.html * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::handleAttributeChanged): * accessibility/AXObjectCache.h: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::supportsARIACurrent): (WebCore::AccessibilityObject::ariaCurrentValue): * accessibility/AccessibilityObject.h: * accessibility/atk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::postPlatformNotification): * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetAttributes): (setAtkStateSetFromCoreObject): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): Moved code returning string value for aria-current into AccessibilityObject:ariaCurrentValue(). 2017-04-26 Wenson Hsieh WebItemProviderPasteboard should fetch preloaded assets from disk when possible https://bugs.webkit.org/show_bug.cgi?id=171320 Reviewed by Tim Horton. Adds a mechanism to WebItemProviderPasteboard to remember the temporary file URLs of assets it has loaded using doAfterLoadingProvidedContentIntoFileURLs:. When retrieving data from the pasteboard, we then see if we can first fetch serialized data straight from disk instead of having to go through the item provider in both -dataForPasteboardType:inItemSet: and -valuesForPasteboardType:inItemSet:. See below annotations for more detail. * platform/ios/AbstractPasteboard.h: * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::filenamesForDataInteraction): * platform/ios/WebItemProviderPasteboard.h: * platform/ios/WebItemProviderPasteboard.mm: Introduces _typeToFileURLMaps, an array of dictionaries. A dictionary at the ith index of this array represents a mapping of UTIs to loaded temo file URLs for the ith UIItemProvider in the _itemProviders array. Before data interaction is performed, all entries in this array will be empty. (-[WebItemProviderPasteboard init]): (-[WebItemProviderPasteboard setItemProviders:]): (-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]): (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]): (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]): Consult any loaded assets on disk before hitting UIItemProviders via the new -_preLoadedDataConformingToType:forItemProviderAtIndex: helper method. (-[WebItemProviderPasteboard _tryToCreateObjectOfClass:usingProvider:]): (-[WebItemProviderPasteboard fileURLsForDataInteraction]): Traverse _typeToFileURLMaps to collect all file URLs. (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]): Refactored to populate and set _typeToFileURLMaps when loading completes, rather than an array of file URLs. (-[WebItemProviderPasteboard _tryToCreateAndAppendObjectOfClass:toArray:usingProvider:]): Deleted. (-[WebItemProviderPasteboard filenamesForDataInteraction]): Deleted. Correct an erroneously named method (replaces filenames with fileURLs). 2017-04-26 Youenn Fablet LayoutTest webrtc/datachannel/basic.html is a flaky crash https://bugs.webkit.org/show_bug.cgi?id=170154 Reviewed by Geoffrey Garen. Before the patch, we are setting the channel handler client to null and then unregistering from observer to libwebrtc data channel. Since this happens in two different threads, there might be a timing issue. Removing this risk by first unregistering (done synchronously on the other thread), before setting client to null. Made some clean-up related refactoring. * Modules/mediastream/RTCDataChannel.cpp: (WebCore::RTCDataChannel::create): (WebCore::RTCDataChannel::close): * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp: (WebCore::LibWebRTCDataChannelHandler::setClient): (WebCore::LibWebRTCDataChannelHandler::close): * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h: * platform/mediastream/RTCDataChannelHandler.h: * platform/mock/RTCDataChannelHandlerMock.cpp: (WebCore::RTCDataChannelHandlerMock::setClient): * platform/mock/RTCDataChannelHandlerMock.h: 2017-04-26 Alex Christensen Make user script injection more robust https://bugs.webkit.org/show_bug.cgi?id=171339 Reviewed by Geoffrey Garen. * loader/EmptyClients.cpp: * page/Frame.cpp: (WebCore::Frame::injectUserScripts): * page/UserContentController.cpp: (WebCore::UserContentController::forEachUserScript): (WebCore::UserContentController::forEachUserStyleSheet): (WebCore::UserContentController::forEachUserMessageHandler): * page/UserContentController.h: * page/UserContentProvider.h: 2017-04-26 Zalan Bujtas RTL: recent searches popover is displayed in incorrect location https://bugs.webkit.org/show_bug.cgi?id=171338 Reviewed by Dean Jackson. Compute the absolute coordinates for the popup the same way we do for the select dropdown. * rendering/RenderSearchField.cpp: (WebCore::RenderSearchField::showPopup): 2017-04-26 Said Abou-Hallawa Restrict WebKit image formats to a known whitelist https://bugs.webkit.org/show_bug.cgi?id=170700 Reviewed by Tim Horton. If the image format is not supported, the load should be canceled and the image is marked a broken image. Test: fast/images/image-formats-support.html * loader/cache/CachedImage.cpp: (WebCore::CachedImage::addIncrementalDataBuffer): (WebCore::CachedImage::setImageDataBuffer): (WebCore::CachedImage::finishLoading): * loader/cache/CachedImage.h: 2017-04-26 Joanmarie Diggs [ATK] Implement support for new ARIA 1.1 values of aria-haspopup https://bugs.webkit.org/show_bug.cgi?id=171164 Reviewed by Chris Fleizach. In ARIA 1.1, aria-haspopup's value type changed from true/false to a token. Values: true, false (default, unless it's a combobox), dialog, grid, listbox (default for combobox), menu, and tree. Any value of aria-haspopup that is not included in the list of allowed values, including an empty string, must be treated as if the value false had been provided. Add AccessibilityObject::ariaPopupValue() to validate the value, handle implicit values, and give platform assistive technologies a means to access that value. If there is a valid, non-false value of aria-haspopup, include ATK_STATE_HAS_POPUP in the AtkStateSet. Lastly, expose the value (rather than true/false) via the "haspop" AtkObject attribute. Test: accessibility/gtk/aria-haspopup.html * accessibility/AccessibilityObject.h: (WebCore::AccessibilityObject::ariaPopupValue): (WebCore::AccessibilityObject::supportsARIAHasPopup): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::ariaHasPopup): * accessibility/AccessibilityRenderObject.h: * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetAttributes): (setAtkStateSetFromCoreObject): 2017-04-26 Alex Christensen Fix CMake build. * PlatformMac.cmake: 2017-04-26 Antti Koivisto Enable expired-only reload policy on Mac and iOS https://bugs.webkit.org/show_bug.cgi?id=171264 Reviewed by Andreas Kling. Limit the behavior to http and data URLs (where we explicitly know about expiration). * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::setCSSStyleSheet): * loader/FrameLoader.cpp: (WebCore::FrameLoader::subresourceCachePolicy): Pass the URL so we can test for protocol. * loader/FrameLoader.h: * loader/NavigationAction.cpp: (WebCore::navigationType): Test for reload navigation type correctly. * loader/cache/CachedResource.cpp: (WebCore::CachedResource::load): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::determineRevalidationPolicy): (WebCore::CachedResourceLoader::cachePolicy): * loader/cache/CachedResourceLoader.h: 2017-04-26 WebKit Contributor Response.blob() does not set the content-type based on the header value. https://bugs.webkit.org/show_bug.cgi?id=170849 Reviewed by Alex Christensen. The Fetch API specification requires setting the blob contentType using the Content-Type header value, if present. Previously the FetchResponse class only called updateContentType() when first created even though all the headers were not available. Call updateContentType() again after the headers are populated. This change allows WebKit to pass the "Consume response's body: from fetch to blob" case in the WPT response-consume.html test. Test: http://w3c-test.org/fetch/api/response/response-consume.html * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::BodyLoader::didReceiveResponse): Modified to call FetchBodyOwner::updateContentType() after filling m_headers. 2017-04-26 Andy Estes Try to fix the macOS Sierra build. * platform/mac/WebVideoFullscreenInterfaceMac.mm: 2017-04-26 Andy Estes [macOS] Add picture-in-picture support to WebPlaybackControlsManager https://bugs.webkit.org/show_bug.cgi?id=171328 Reviewed by Jer Noble. * platform/cocoa/WebPlaybackSessionModel.h: * platform/cocoa/WebPlaybackSessionModelMediaElement.h: * platform/cocoa/WebPlaybackSessionModelMediaElement.mm: (WebCore::WebPlaybackSessionModelMediaElement::togglePictureInPicture): If the media element is currently in PiP fullscreen mode, exit fullscreen. Otherwise, enter PiP fullscreen mode. * platform/mac/WebPlaybackControlsManager.h: * platform/mac/WebPlaybackControlsManager.mm: (-[WebPlaybackControlsManager canTogglePictureInPicture]): Added. Returns YES if -allowsPictureInPicturePlayback returns YES. (-[WebPlaybackControlsManager togglePictureInPicture]): Added. Calls WebPlaybackSessionModel::togglePictureInPicture(). * platform/mac/WebVideoFullscreenInterfaceMac.mm: (WebCore::WebVideoFullscreenInterfaceMac::enterFullscreen): Added a call to -[WebPlaybackControlsManager setPictureInPictureActive:YES]. (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreen): Added a call to -[WebPlaybackControlsManager setPictureInPictureActive:NO]. (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode): Ditto. * platform/spi/cocoa/AVKitSPI.h: Declared new SPI on AVTouchBarPlaybackControlsControlling. 2017-04-25 Dean Jackson [Color] Make gradients work with ExtendedColors https://bugs.webkit.org/show_bug.cgi?id=171315 Reviewed by Antoine Quint. Allow gradients to hold Color objects, and thus handle ExtendedColor. Implement the backend for CoreGraphics. Test: css3/color/gradients.html * platform/graphics/Gradient.cpp: (WebCore::Gradient::addColorStop): Just copy the Color now. (WebCore::compareStops): Handle rename of stop to offset. (WebCore::Gradient::hasAlpha): Use Color's helper. * platform/graphics/Gradient.h: (WebCore::Gradient::ColorStop::ColorStop): Rename stop to offset, and store a Color rather than four floating point values. * platform/graphics/cairo/GradientCairo.cpp: (WebCore::Gradient::platformGradient): * platform/graphics/cg/GradientCG.cpp: (WebCore::Gradient::platformGradient): Use the CG method that can handle CGColorRefs with ColorSpace values, and pass the Extended sRGB space which should be no change for all existing gradients but also handle ColorSpaces like Display P3. * platform/graphics/win/GradientDirect2D.cpp: (WebCore::Gradient::generateGradient): * svg/SVGGradientElement.cpp: (WebCore::SVGGradientElement::buildStops): 2017-04-25 Alex Christensen Encoded filename should be decoded for WKContentExtension.identifier https://bugs.webkit.org/show_bug.cgi?id=171316 Reviewed by Andy Estes. * platform/FileSystem.h: 2017-04-26 Frederic Wang Fix typo in RenderFrameBase https://bugs.webkit.org/show_bug.cgi?id=171324 Reviewed by Zalan Bujtas. No new tests, behavior unchanged. * rendering/RenderFrameBase.cpp: (WebCore::RenderFrameBase::layoutWithFlattening): (WebCore::RenderFrameBase::performLayoutWithFlattening): (WebCore::RenderFrameBase::peformLayoutWithFlattening): Deleted. * rendering/RenderFrameBase.h: 2017-04-26 Zalan Bujtas Forced page break on :after triggers infinite loop in column balancing https://bugs.webkit.org/show_bug.cgi?id=171309 rdar://problem/26285884 Reviewed by David Hyatt. Stop trying to balance the columns when the forced page breaks >= the number of columns even when this number is 1. Content will always overflow to the next page. see https://chromium.googlesource.com/chromium/src/+/fbbebf38cefb2712c912581eccb046ef363ec84e%5E%21/#F2 Test: fast/multicol/infinite-loop-when-forced-break.html * rendering/RenderMultiColumnSet.cpp: (WebCore::RenderMultiColumnSet::calculateBalancedHeight): 2017-04-26 Said Abou-Hallawa Attempt to fix a JetStream regression. Unreviewed. Disable async decoding for large images till the flickering bug wk170640 is fixed. * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImages): 2017-04-26 Ryan Haddad Unreviewed, rolling out r215767. The LayoutTest for this change is a flaky failure. Reverted changeset: "Restrict WebKit image formats to a known whitelist" https://bugs.webkit.org/show_bug.cgi?id=170700 http://trac.webkit.org/changeset/215767 2017-04-26 Dave Hyatt Improve wavy underline rendering https://bugs.webkit.org/show_bug.cgi?id=171281 Reviewed by Sam Weinig. Change wavy underline rendering to use font size instead of stroke thickness as a way to tune it. Cut the extra offset from 2 to 1. Change the parameters to make the line flatter and to make the proportion of the wave that renders underneath a glyph the same. * rendering/TextDecorationPainter.cpp: (WebCore::strokeWavyTextDecoration): (WebCore::TextDecorationPainter::paintTextDecoration): * style/InlineTextBoxStyle.cpp: (WebCore::getWavyStrokeParameters): (WebCore::visualOverflowForDecorations): * style/InlineTextBoxStyle.h: (WebCore::wavyOffsetFromDecoration): 2017-04-24 Sergio Villar Senin [css-grid] Remove most of the usage of SizingOperation https://bugs.webkit.org/show_bug.cgi?id=171225 Reviewed by Darin Adler. SizingOperation was added as a way to modify the behaviour of the track sizing algorithm with the specifics for intrinsic size computations. The problem is that although intrinsic size computation does imply indefinite sizes, the opposite is not always true. For example, a grid container with height:auto would compute the row sizes with an indefinite size but is not part of the intrinsic size (preferred widths) computation. That's why it was wrongly used in some parts of the current code, in most of the cases is more than enough to check whether the available space is indefinite or not. In order to do that we have to keep both available sizes (height & width) around all the time to properly support orthogonal flows. This change does not imply any change in behaviour. * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithm::setAvailableSpace): (WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize): (WebCore::GridTrackSizingAlgorithm::initialBaseSize): (WebCore::GridTrackSizingAlgorithm::initialGrowthLimit): (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem): (WebCore::GridTrackSizingAlgorithm::increaseSizesToAccommodateSpanningItems): (WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild): (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild): (WebCore::GridTrackSizingAlgorithm::gridTrackSize): (WebCore::IndefiniteSizeStrategy::findUsedFlexFraction): (WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded): (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes): (WebCore::GridTrackSizingAlgorithm::setup): (WebCore::GridTrackSizingAlgorithm::reset): * rendering/GridTrackSizingAlgorithm.h: (WebCore::GridTrackSizingAlgorithmStrategy::availableSpace): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::availableSpaceForGutters): (WebCore::RenderGrid::computeTrackBasedLogicalHeight): (WebCore::RenderGrid::computeTrackSizesForDefiniteSize): (WebCore::RenderGrid::layoutBlock): (WebCore::RenderGrid::gridGap): (WebCore::RenderGrid::guttersSize): (WebCore::RenderGrid::computeIntrinsicLogicalWidths): (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize): (WebCore::RenderGrid::computeAutoRepeatTracksCount): (WebCore::RenderGrid::placeItemsOnGrid): (WebCore::RenderGrid::trackSizesForComputedStyle): (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded): (WebCore::RenderGrid::offsetAndBreadthForPositionedChild): (WebCore::RenderGrid::populateGridPositionsForDirection): (WebCore::RenderGrid::columnAxisOffsetForChild): (WebCore::RenderGrid::rowAxisOffsetForChild): (WebCore::RenderGrid::gridGapForDirection): Deleted. * rendering/RenderGrid.h: 2017-04-26 Frederic Wang Remove Document::*FrameElementsShouldIgnoreScrolling https://bugs.webkit.org/show_bug.cgi?id=171271 Reviewed by Chris Dumez. setFrameElementsShouldIgnoreScrolling and frameElementsShouldIgnoreScrolling were introduced bug 23072 in order to work around a bug in the Dictionary application. However, this was removed in bug 132095 and hence the functions are no longer necessary. No new tests. * dom/Document.h: (WebCore::Document::setFrameElementsShouldIgnoreScrolling): Deleted. (WebCore::Document::frameElementsShouldIgnoreScrolling): Deleted. * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::parseAttribute): 2017-04-26 Zan Dobersek [GCrypt] CryptoKeyRSA: implement create(), keySizeInBits(), buildAlgorithm(), exportData() https://bugs.webkit.org/show_bug.cgi?id=171213 Reviewed by Michael Catanzaro. CryptoKeyRSA::create() validates the specified key type along with the provided data. If everything is OK, it then proceeds to build the key of the appropriate type through an s-expression that is constructed with the necessary data. We don't currently support creating private keys with any additional prime information (apart from p and q). CryptoKeyRSA::keySizeInBits() calls the helper getRSAModulusLength() function that find the modulus MPI in the key s-expression and returns the modulus data length in bits. CryptoKeyRSA::buildAlgorithm() returns KeyAlgorithm that's constructed from the appropriate name, this key's modulus length, and this key's public exponent data. It also specifies the hash if there is such a restriction for this key. CryptoKeyRSA::exportData() returns a properly-constructed CryptoKeyDataRSAComponents object. The public modulus and exponent are used in case the key is public. If the key is private, the secret exponent and the p and q prime numbers are retrieved in MPI format. They're then used to calculate the dp, dq and qi parameters that are exported in the JWK format. Note that libgcrypt internally switches the p and q prime numbers such that p < q, but the Web Crypto specification and the dependant RFCs expect that q < p. We address this by simply switching the roles of the two primes and follow the usual q < p assumption when exporting the primes and computing the dependant exponents and coefficients. No new tests -- existing ones cover this but don't work yet due to missing RSA-related CryptoAlgorithm implementations. * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: (WebCore::getRSAModulusLength): (WebCore::getParameterMPIData): (WebCore::getRSAKeyParameter): (WebCore::CryptoKeyRSA::create): (WebCore::CryptoKeyRSA::keySizeInBits): (WebCore::CryptoKeyRSA::buildAlgorithm): (WebCore::CryptoKeyRSA::exportData): 2017-04-25 Jiewen Tan [WebCrypto] Enhance ways to convert an ECDSA signature binary into DER format https://bugs.webkit.org/show_bug.cgi?id=171287 Reviewed by Brent Fulgham. Covered by existing tests. * crypto/mac/CryptoAlgorithmECDSAMac.cpp: (WebCore::verifyECDSA): 2017-04-25 Brent Fulgham Relax the event firing ASSERT for Attr changes https://bugs.webkit.org/show_bug.cgi?id=171236 Reviewed by Dean Jackson. The assertions added in Bug 167318 were overly strict, and trigger for valid behavior. Relax the assertion preventing event dispatch for the case of Attr elements at the end of childrenChanged. Test: fast/dom/HTMLLinkElement/event-while-removing-attribute.html * dom/Attr.cpp: (WebCore::Attr::childrenChanged): 2017-04-25 John Wilander Resource Load Statistics: Introduce shorter time-to-live for cookie partition whitelisting https://bugs.webkit.org/show_bug.cgi?id=171295 Reviewed by Brent Fulgham. Test: http/tests/loading/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html * loader/ResourceLoadObserver.cpp: (WebCore::reduceTimeResolutionToOneDay): Deleted. (WebCore::reduceTimeResolution): Changed name to no longer lock this to a specific resolution. (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Now calls WebCore::reduceTimeResolution(). (WebCore::ResourceLoadObserver::setTimeToLiveCookiePartitionFree): Added for testing purposes. (WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler): Added for testing purposes. * loader/ResourceLoadObserver.h: * loader/ResourceLoadStatisticsStore.cpp: (WebCore::shouldPartitionCookies): Static inline convenience function. (WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler): Now decides whether a domain should get partitioned cookies based on timeToLiveCookiePartitionFree. Removed clearFirst parameter since it's not needed here and it introduced complexity in keeping the store and the network process cache in sync. (WebCore::ResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree): Added for testing purposes. * loader/ResourceLoadStatisticsStore.h: 2017-04-25 Saam Barati JSArray::isArrayPrototypeIteratorProtocolFastAndNonObservable is wrong because it does not do the necessary checks on the base object https://bugs.webkit.org/show_bug.cgi?id=171150 Reviewed by Sam Weinig. This patch moves the sequence converters to use the now fixed JSArray::isArrayPrototypeIteratorProtocolFastAndNonObservable test inside JSC. This patch also fixes a few bugs: 1. Converting to a sequence of numbers must prove that the JSArray is filled only with Int32/Double. If there is a chance the array contains objects, the conversion to a numeric IDLType can be observable (via valueOf()), and can change the iterator protocol. 2. There are other conversions that can have side effects a-la valueOf(). This patch introduces a new static constant in the various Converter classes that tell the sequence converter if the conversion operation can have JS side effects. If it does have side effects, we fall back to the generic conversion that uses the iterator protocol. If not, we can do a faster version that iterates over each element of the array, reading it directly, and converting it. Tests: js/sequence-iterator-protocol-2.html js/sequence-iterator-protocol.html * bindings/js/JSDOMConvertAny.h: Does not have side effects. * bindings/js/JSDOMConvertBase.h: We pessimistically assume inside DefaultConverter that converions have side effects. * bindings/js/JSDOMConvertBoolean.h: Does not have side effects. * bindings/js/JSDOMConvertCallbacks.h: Does not have side effects. * bindings/js/JSDOMConvertObject.h: Does not have side effects. * bindings/js/JSDOMConvertSequences.h: (WebCore::Detail::NumericSequenceConverter::convert): (WebCore::Detail::SequenceConverter::convert): 2017-04-25 Michael Saboff Call bmalloc scavenger first when handling a memory pressure event https://bugs.webkit.org/show_bug.cgi?id=171289 Reviewed by Geoffrey Garen. Let bmalloc free any pages to the OS that it can before doing anything else. * page/MemoryRelease.cpp: (WebCore::releaseMemory): 2017-04-25 Dean Jackson Skip WebKitAdditions for Safari Technology Preview media controls https://bugs.webkit.org/show_bug.cgi?id=171302 Reviewed by Simon Fraser. Safari Technology Preview should use the same controls as OpenSource. * WebCore.xcodeproj/project.pbxproj: 2017-04-25 Ryan Haddad Unreviewed, rolling out r215730. The LayoutTest for this change is a flaky timeout on mac-wk1 debug. Reverted changeset: "Enable expired-only reload policy on Mac and iOS" https://bugs.webkit.org/show_bug.cgi?id=171264 http://trac.webkit.org/changeset/215730 2017-04-24 Matt Rajca Indicate presence of audio when handling autoplay events. https://bugs.webkit.org/show_bug.cgi?id=171227 Reviewed by Alex Christensen. Added API tests. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::handleAutoplayEvent): (WebCore::HTMLMediaElement::playInternal): (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): (WebCore::HTMLMediaElement::userDidInterfereWithAutoplay): (WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture): * html/HTMLMediaElement.h: * page/AutoplayEvent.h: * page/ChromeClient.h: 2017-04-25 Aakash Jain WebCore.framework should restrict allowable_clients https://bugs.webkit.org/show_bug.cgi?id=171260 Reviewed by Alexey Proskuryakov. * Configurations/WebCore.xcconfig: Adding allowable_client to all platform, in order to restrict WebCore from being directly linked on any platform. Moved WebKitLegacy and WebCoreTestSupport to OTHER_LDFLAGS_BASE. Removed WebKit2 as allowable_client from mac. Added iTunesU, Casablanca and Remote to OTHER_LDFLAGS_BASE_ios for iTunes related projects. Added WebKit, TVBooks, DumpRenderTree, WebKitTestRunner and TestWebKitAPI to OTHER_LDFLAGS_BASE_ios. 2017-04-25 Said Abou-Hallawa Restrict WebKit image formats to a known whitelist https://bugs.webkit.org/show_bug.cgi?id=170700 Reviewed by Tim Horton. If the image format is not supported, the load should be canceled and the image is marked a broken image. Test: fast/images/image-formats-support.html * loader/cache/CachedImage.cpp: (WebCore::CachedImage::addIncrementalDataBuffer): (WebCore::CachedImage::setImageDataBuffer): (WebCore::CachedImage::finishLoading): * loader/cache/CachedImage.h: 2017-04-25 Youenn Fablet CoreAudioCaptureSource::suspend is asserting too often https://bugs.webkit.org/show_bug.cgi?id=171285 Reviewed by Eric Carlson. No change of behavior. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::suspend): Moving the assertion to where it might be useful. 2017-04-25 Daniel Bates Use an OptionSet for compositing reasons bitmask https://bugs.webkit.org/show_bug.cgi?id=171153 Reviewed by Simon Fraser. We should make use of OptionSet to represent the bitmask of the reasons a layer was composited instead of using an integer and bitwise operations. * inspector/InspectorLayerTreeAgent.cpp: (WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::reasonsForCompositing): (WebCore::RenderLayerCompositor::logReasonsForCompositing): Also fix code style issues; an else-if statement should be written as an if-statement when the prior if-statement concludes with a return statement. * rendering/RenderLayerCompositor.h: 2017-04-25 Myles C. Maxfield Supplementary Multilingual Plane Complex Scripts Rendered Incorrectly https://bugs.webkit.org/show_bug.cgi?id=171272 Reviewed by Zalan Bujtas. These scripts need to take the complex text codepath. Test: fast/text/kaithi.html * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::characterRangeCodePath): 2017-04-25 Carlos Alberto Lopez Perez [GTK] Revert r215745 (especulative build fix) after r215752. https://bugs.webkit.org/show_bug.cgi?id=170842 Unreviewed. * platform/graphics/harfbuzz/HarfBuzzShaper.cpp: (WebCore::normalizeCharacters): 2017-04-25 Daniel Bates [Cocoa][Win] Enable of X-Content-Type-Options: nosniff header https://bugs.webkit.org/show_bug.cgi?id=136452 Reviewed by Brent Fulgham. Enable support for X-Content-Type-Options: nosniff on Mac, iOS and Windows. Additionally, honor X-Content-Type-Options: nosniff header for stylesheets as per (30 March 2017). Test: http/tests/security/contentTypeOptions/nosniff-dynamic-script-blocked.html * Configurations/FeatureDefines.xcconfig: * css/StyleSheetContents.cpp: (WebCore::StyleSheetContents::parseAuthorStyleSheet): Log an error if the stylesheet has the nosniff header and does not have a valid MIME type. Also update code for renaming of MIMETypeCheck to MIMETypeCheckHint. (WebCore::StyleSheetContents::notifyLoadedSheet): If the stylesheet is blocked by nosniff then consider it analogous to a load error so that we dispatch a DOM error event at the
  • content inside
      should mid-word wrap when word-break: break-word is present. https://bugs.webkit.org/show_bug.cgi?id=171108 Reviewed by Dan Bernstein. This patch ensures that we search for mid-word breaks when a zero sized element has been committed on the line unless it's an image or some other replaced element with special properties (e.g. list-style: inside). Tests: fast/replaced/ul-li-word-break-break-word.html fast/replaced/zero-width-image-force-linebreak.html * rendering/line/BreakingContext.h: (WebCore::BreakingContext::handleReplaced): (WebCore::BreakingContext::handleText): This matches pre-r205374 behaviour, but it's explicit about whether a replaced width has already been committed on the current line. * rendering/line/LineWidth.cpp: (WebCore::LineWidth::commit): * rendering/line/LineWidth.h: (WebCore::LineWidth::hasCommittedReplaced): (WebCore::LineWidth::addUncommittedReplacedWidth): These 2 last functions were removed with r205374 (and now I am adding them back). 2017-04-21 Jer Noble [MediaCapture] Improvements to CoreAudioCaptureSource https://bugs.webkit.org/show_bug.cgi?id=171146 Reviewed by Eric Carlson. Various interlocking improvements to CoreAudioCaptureSource: - Allow the volume, sampleRate, and echoCancellation settings to be applied to the source. - Update the values returned via settings() when these values change. - Obey the sampleRate and echoCancellation settings when creating the VPIO unit. - Because AudioUnitRender() mutates the passed in AudioBufferList, reset it immediately before calling. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::create): (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::preferredSampleRate): (WebCore::CoreAudioCaptureSource::preferredIOBufferSize): (WebCore::CoreAudioCaptureSource::configureMicrophoneProc): (WebCore::CoreAudioCaptureSource::configureSpeakerProc): (WebCore::CoreAudioCaptureSource::processMicrophoneSamples): (WebCore::CoreAudioCaptureSource::setupAudioUnits): (WebCore::CoreAudioCaptureSource::stopProducingData): (WebCore::CoreAudioCaptureSource::settings): (WebCore::CoreAudioCaptureSource::settingsDidChange): (WebCore::CoreAudioCaptureSource::preferredIOBufferDuration): Deleted. * platform/mediastream/mac/CoreAudioCaptureSource.h: 2017-04-21 Youenn Fablet com.apple.WebCore: non-virtual thunk to WebCore::LibWebRTCDataChannelHandler::OnBufferedAmountChange + 39 https://bugs.webkit.org/show_bug.cgi?id=171087 Reviewed by Eric Carlson. Covered by existing tests. No test added as this behavior is really libwebrtc specific and cannot be triggered easily. * Modules/mediastream/RTCDataChannel.cpp: (WebCore::RTCDataChannel::close): Stopping observing libwebrtc data channel before closing it. This ensures we will stop getting notified as soon as there is no more interest. * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp: (WebCore::LibWebRTCDataChannelHandler::OnStateChange): libwebrtc can still notify us even though we said we were not interested. Ensuring we do not call the client if we are no longer interested. (WebCore::LibWebRTCDataChannelHandler::OnMessage): Ditto. (WebCore::LibWebRTCDataChannelHandler::OnBufferedAmountChange): Ditto. 2017-04-21 Andy Estes [macOS] Enable media selection button on AVTouchBarScrubber https://bugs.webkit.org/show_bug.cgi?id=171149 Reviewed by Beth Dakin. * platform/spi/cocoa/AVKitSPI.h: 2017-04-21 Andy Estes [macOS] Name WebPlaybackControlsManager delegate methods correctly depending on OS version https://bugs.webkit.org/show_bug.cgi?id=171147 Reviewed by Beth Dakin. On macOS 10.12, WebPlaybackControlsManager conforms to AVFunctionBarPlaybackControlsControlling, but on 10.13 it conforms to AVTouchBarPlaybackControlsControlling. These protocols are near-identical, except for instances of "FunctionBar" in method names are renamed to "TouchBar". This patch updates to the new method names, and generally renames things with "FunctionBar" to "TouchBar". * platform/mac/WebPlaybackControlsManager.h: * platform/mac/WebPlaybackControlsManager.mm: (-[WebPlaybackControlsManager generateTouchBarThumbnailsForTimes:tolerance:size:thumbnailHandler:]): (-[WebPlaybackControlsManager generateTouchBarAudioAmplitudeSamples:completionHandler:]): (-[WebPlaybackControlsManager canBeginTouchBarScrubbing]): (-[WebPlaybackControlsManager beginTouchBarScrubbing]): (-[WebPlaybackControlsManager endTouchBarScrubbing]): (-[WebPlaybackControlsManager generateFunctionBarThumbnailsForTimes:size:completionHandler:]): (-[WebPlaybackControlsManager generateFunctionBarAudioAmplitudeSamples:completionHandler:]): (-[WebPlaybackControlsManager canBeginFunctionBarScrubbing]): (-[WebPlaybackControlsManager beginFunctionBarScrubbing]): (-[WebPlaybackControlsManager endFunctionBarScrubbing]): (-[WebPlaybackControlsManager audioTouchBarMediaSelectionOptions]): (-[WebPlaybackControlsManager setAudioTouchBarMediaSelectionOptions:]): (-[WebPlaybackControlsManager currentAudioTouchBarMediaSelectionOption]): (-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]): (-[WebPlaybackControlsManager legibleTouchBarMediaSelectionOptions]): (-[WebPlaybackControlsManager setLegibleTouchBarMediaSelectionOptions:]): (-[WebPlaybackControlsManager currentLegibleTouchBarMediaSelectionOption]): (-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]): (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]): (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]): (-[WebPlaybackControlsManager audioFunctionBarMediaSelectionOptions]): Deleted. (-[WebPlaybackControlsManager setAudioFunctionBarMediaSelectionOptions:]): Deleted. (-[WebPlaybackControlsManager currentAudioFunctionBarMediaSelectionOption]): Deleted. (-[WebPlaybackControlsManager setCurrentAudioFunctionBarMediaSelectionOption:]): Deleted. (-[WebPlaybackControlsManager legibleFunctionBarMediaSelectionOptions]): Deleted. (-[WebPlaybackControlsManager setLegibleFunctionBarMediaSelectionOptions:]): Deleted. (-[WebPlaybackControlsManager currentLegibleFunctionBarMediaSelectionOption]): Deleted. (-[WebPlaybackControlsManager setCurrentLegibleFunctionBarMediaSelectionOption:]): Deleted. 2017-04-21 Jer Noble Make CoreAudioCaptureDevice stackable. https://bugs.webkit.org/show_bug.cgi?id=171097 Reviewed by Eric Carlson. There's no real reason to keep CoreAudioCaptureDevice from being created on the stack. Make it un-RefCounted, and have it's static factory method return an std::optional rather than a RefPtr. Drive-by fix: clean up the factory method of CoreAudioCaptureSource a bit. * platform/mediastream/mac/CoreAudioCaptureDevice.cpp: (WebCore::CoreAudioCaptureDevice::create): (WebCore::CoreAudioCaptureDevice::deviceID): Deleted. * platform/mediastream/mac/CoreAudioCaptureDevice.h: (WebCore::CoreAudioCaptureDevice::deviceID): * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp: (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices): (WebCore::CoreAudioCaptureDeviceManager::coreAudioDeviceWithUID): (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices): * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h: * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::create): (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): * platform/mediastream/mac/CoreAudioCaptureSource.h: 2017-04-21 Eric Carlson [MediaStream iOS] Release capture session when not producing data https://bugs.webkit.org/show_bug.cgi?id=171148 Reviewed by Jer Noble. On iOS, only one AVCaptureSession can be active at a time, so release a session whenever it is told to stop producing data. The session will recreated if the capture source if/when told to produce data again. * platform/mediastream/mac/AVMediaCaptureSource.mm: (WebCore::AVMediaCaptureSource::stopProducingData): Clear m_session to release the session. It will be re-allocated if startProducingData is called later. 2017-04-21 Aaron Chu AX: FKA: Buttons need a visible focus indicator https://bugs.webkit.org/show_bug.cgi?id=171040 Reviewed by Antoine Quint. Added a background color for the focus state of the icon buttons in modern media controls. Test: media/modern-media-controls/icon-button/icon-button-focus-state.html * Modules/modern-media-controls/controls/icon-button.css: (button.icon:focus): 2017-03-22 Matt Rajca Consider muting audio hardware a form of autoplay interference. https://bugs.webkit.org/show_bug.cgi?id=169971 Reviewed by Eric Carlson. If the user mutes audio hardware and a media element is auto-playing, consider that as a form of auto-play interference that we tell clients about. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): (WebCore::HTMLMediaElement::~HTMLMediaElement): (WebCore::HTMLMediaElement::hardwareMutedStateDidChange): * html/HTMLMediaElement.h: * platform/audio/AudioSession.h: (WebCore::AudioSession::MutedStateObserver::~MutedStateObserver): * platform/audio/mac/AudioSessionMac.cpp: (WebCore::AudioSession::isMuted): (WebCore::muteProcess): (WebCore::AudioSession::handleMutedStateChange): (WebCore::AudioSession::addMutedStateObserver): (WebCore::AudioSession::removeMutedStateObserver): 2017-04-21 Chris Dumez Regression(r206240): XMLSerializer.serializeToString() does not properly escape '<' / '>' in attribute values https://bugs.webkit.org/show_bug.cgi?id=171132 Reviewed by Ryosuke Niwa. Use XMLSerialization [1] in MarkupAccumulator::appendAttribute() when inXMLFragmentSerialization() returns true, even if the node's associated document is an HTML document. When XMLSerializer.serializeToString() is called on a Node, we want XML serialization, even if the node comes from an HTML document. [1] https://w3c.github.io/DOM-Parsing/#dfn-xml-serialization Test: fast/dom/XMLSerializer-serializeToString-entities.html * editing/MarkupAccumulator.cpp: (WebCore::MarkupAccumulator::appendAttributeValue): (WebCore::MarkupAccumulator::appendAttribute): * editing/MarkupAccumulator.h: 2017-04-20 Sam Weinig Split cryptographic digest computation and parsing out of CSP code so it can be reused https://bugs.webkit.org/show_bug.cgi?id=171076 Reviewed by Chris Dumez. Factor out cryptographic digest parsing from Content Security Policy code so that it can be reused for the Subresource Integrity implementation. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: Add new files. * html/parser/ParsingUtilities.h: (WebCore::skipExactlyIgnoringASCIICase): Add parsing helper to match / skip over a constant string, using IgnoringASCIICase semantics. * loader/ResourceCryptographicDigest.cpp: Added. (WebCore::parseHashAlgorithmAdvancingPosition): (WebCore::parseCryptographicDigestImpl): (WebCore::parseCryptographicDigest): Move parsing of cryptographic-digest strings from ContentSecurityPolicySourceList.cpp and optimize it a little by avoiding String allocations and generalizing it so that it can parse either UChars or LChars. * loader/ResourceCryptographicDigest.h: Added. (WebCore::ResourceCryptographicDigest::operator==): (WebCore::ResourceCryptographicDigest::operator!=): (WTF::DefaultHash::Hash::hash): (WTF::DefaultHash::Hash::equal): (WTF::HashTraits::emptyValue): (WTF::HashTraits::constructDeletedValue): (WTF::HashTraits::isDeletedValue): Add a struct (rather than using a std::pair) to represent the digest + algorithm. And add HashTraits so it can be used as HashMap. * page/csp/ContentSecurityPolicy.cpp: (WebCore::ContentSecurityPolicy::findHashOfContentInPolicies): (WebCore::toCryptoDigestAlgorithm): Deleted. Move algorithm conversion to ResourceCryptographicDigest.cpp. Make use of new cryptographicDigestForBytes function to do hashing. * page/csp/ContentSecurityPolicy.h: * page/csp/ContentSecurityPolicyHash.h: (WTF::DefaultHash::Hash::hash): Deleted. (WTF::DefaultHash::Hash::equal): Deleted. Remove HashTraits for the digest, this is now handled by ResourceCryptographicDigest. To keep things relatively straight-forward, redefine ContentSecurityPolicyHashAlgorithm and ContentSecurityPolicyHash in terms of ResourceCryptographicDigest, so that less code has to be changed all at once. In a later pass, if wanted, we can remove these using declarations. * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::isNonceCharacter): Use renamed isBase64OrBase64URLCharacter predicate. (WebCore::ContentSecurityPolicySourceList::parseHashSource): Rework using ResourceCryptographicDigest parsing. Quotation and maximum digest length have been kept here, as they are not applicable to other uses of the digest, specifically Subresource Integrity. 2017-04-21 Jer Noble Unreviewed fix after r215624; null-deref crash. Make sure to call reset() inside each constructor. * platform/audio/WebAudioBufferList.cpp: (WebCore::WebAudioBufferList::WebAudioBufferList): 2017-04-21 Anders Carlsson Stop using deprecated APIs, part 5 https://bugs.webkit.org/show_bug.cgi?id=171134 rdar://problem/31589635 Reviewed by Tim Horton. * Modules/applepay/ApplePaySession.cpp: (WebCore::convertAndValidate): Stop using the toPaymentAuthorizationStatus. Convert the passed in status results to the remaining PaymentAuthorizationStatus values, and add errors if needed. (WebCore::toPaymentAuthorizationStatus): This function is no longer used. * Modules/applepay/PaymentAuthorizationStatus.h: Remove deprecated status values. We can achieve the same results with errors now. * Modules/applepay/PaymentRequest.cpp: (WebCore::isFinalStateResult): Remove deprecated status values. * Modules/applepay/PaymentRequest.h: Remove deprecated status values. 2017-04-21 Per Arne Vollan Validate vImage arguments https://bugs.webkit.org/show_bug.cgi?id=171109 rdar://problem/30236606 Reviewed by Brent Fulgham. When writing data to a canvas context, clip the source rectangle to the data rectangle to make sure we will not attempt to read data outside of the buffer. Test: fast/canvas/canvas-crash.html * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::putImageData): 2017-04-21 David Kilzer Switch from -std=gnu++11 to -std=gnu++14 for consistency in DerivedSources.make Reviewed by Brent Fulgham. * DerivedSources.make: Switch to -std=gnu++14 for preprocessing headers to check for build settings. 2017-04-21 Jer Noble [MediaCapture][iOS] AVAudioSession must be active and the correct category before IO AudioUnits start producing data. https://bugs.webkit.org/show_bug.cgi?id=171095 Reviewed by Youenn Fablet. If an input audio unit is asked to start before the AVAudioSession is in a recording category and active, CoreAudio will return an error stating that no input device is available. The PlatformMediaSessionManager will automatically set the category of and activate the AVAudioSession when one of its associated MediaStreams has a capturing RealtimeMediaSource and is currently producing data. To solve the chicken-or-egg problem of activating the AVAudioSession before the source produces data, move the state bit of "producing data" directly into MediaStreams, and notify the PlatformMediaSessionManager that capturing is occurring after flipping that bit, but before asking the constituent tracks to begin producing data. In places (i.e. UserMediaRequest) where we previously told a stream's tracks to begin producing data, instead allow the stream to handle that by telling it to produce data directly. * Modules/mediastream/MediaStream.cpp: (WebCore::MediaStream::startProducingData): (WebCore::MediaStream::stopProducingData): (WebCore::MediaStream::mediaState): (WebCore::MediaStream::mediaType): (WebCore::MediaStream::characteristics): (WebCore::MediaStream::canProduceAudio): * Modules/mediastream/MediaStream.h: * Modules/mediastream/UserMediaRequest.cpp: (WebCore::UserMediaRequest::allow): * platform/mediastream/mac/CoreAudioCaptureSource.h: 2017-04-21 Jer Noble Add a method to retrieve the current I/O buffer size from AudioSession https://bugs.webkit.org/show_bug.cgi?id=171126 Reviewed by Eric Carlson. There is an existing method to get and set the preferred I/O buffer size; add a matching method to return the acutal I/O buffer size. * platform/audio/AudioSession.cpp: (WebCore::AudioSession::bufferSize): * platform/audio/AudioSession.h: * platform/audio/ios/AudioSessionIOS.mm: (WebCore::AudioSession::bufferSize): * platform/audio/mac/AudioSessionMac.cpp: (WebCore::AudioSession::bufferSize): 2017-04-21 Jer Noble Make AudioSampleBufferList::reset() less expensive. https://bugs.webkit.org/show_bug.cgi?id=171124 Reviewed by Eric Carlson. Previously, AudioSampleBufferList would reallocate its constituent WebAudioBufferList every time reset() was called. Instead, add a reset() method to WebAudioBufferList which re-initializes its AudioBufferList (which is a simple memcpy of a 24-byte struct), reusing the existing memory buffers. While making these changes, we'll also take the opportunity to clean up the AudioSampleBufferList class by making some of its members into UniqueRefs instead of unique_ptrs, thus removing the possibility of null- dereferences. * platform/audio/WebAudioBufferList.cpp: (WebCore::WebAudioBufferList::WebAudioBufferList): (WebCore::WebAudioBufferList::reset): * platform/audio/WebAudioBufferList.h: * platform/audio/mac/AudioSampleBufferList.cpp: (WebCore::AudioSampleBufferList::AudioSampleBufferList): (WebCore::AudioSampleBufferList::applyGain): (WebCore::AudioSampleBufferList::mixFrom): (WebCore::AudioSampleBufferList::reset): (WebCore::AudioSampleBufferList::zero): (WebCore::AudioSampleBufferList::~AudioSampleBufferList): Deleted. * platform/audio/mac/AudioSampleBufferList.h: (WebCore::AudioSampleBufferList::bufferList): 2017-04-21 Jer Noble Fix some spurious ASSERTs when working with capturing media elements https://bugs.webkit.org/show_bug.cgi?id=171096 Reviewed by Youenn Fablet. Two related ASSERTS: 1) When we added a new PlatformMediaSession MediaType (MediaStreamCapturingAudio), we did not update all the places that validated the enum. This would lead to spurious ASSERTs when an element capturing audio would fail various checks to enusre it's type's validity. 2) Audio elements will ASSERT when they change page visibility, as they do not have a renderer which implements visibleInViewportStateChanged(). So opt out of visibility-state checking for non-video media elements. * html/MediaElementSession.cpp: (WebCore::MediaElementSession::wantsToObserveViewportVisibilityForAutoplay): * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::resetRestrictions): (WebCore::PlatformMediaSessionManager::addRestriction): (WebCore::PlatformMediaSessionManager::removeRestriction): (WebCore::PlatformMediaSessionManager::restrictions): * platform/audio/PlatformMediaSessionManager.h: 2017-04-21 Konstantin Tokarev [cmake] WTF target should not have wtf and subdirectries in public interface https://bugs.webkit.org/show_bug.cgi?id=171115 Reviewed by Michael Catanzaro. In r209665 WEBCORE_FRAMEWORK macro started to export INCLUDE_DIRECTORIES of targets as their public interface, so that linked targets can use them implicitly without copying directory lists around. This matches existing practice for all targets except WTF, headers from which are always included with full path starting from " Do not paint the border of the box if the dirty region does not intersect with border area https://bugs.webkit.org/show_bug.cgi?id=170988 Reviewed by Simon Fraser. No new tests, since there is no change in behavior. * platform/graphics/GeometryUtilities.cpp: (WebCore::ellipseContainsPoint): Checks if a point is within an ellipse. * platform/graphics/GeometryUtilities.h: Replace header-guards with #pragma once. * platform/graphics/RoundedRect.cpp: (WebCore::RoundedRect::contains): Implemented to know the dirty rectangle intersects with rounded rectangle or not. * platform/graphics/RoundedRect.h: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintBorder): When typing in decorated text box, the dirty rect generated only for the inside of the text box, not for the decorations. So we can avoid the calculations to draw borders if the inner border totally covers the target surface. It will optimize the rendering process since we don't have to render border decorations whenever we type somethings in side of the text input element. 2017-04-21 Anders Carlsson Remove another use of toPaymentAuthorizationStatus https://bugs.webkit.org/show_bug.cgi?id=171114 Reviewed by Dan Bernstein. * Modules/applepay/ApplePaySession.cpp: (WebCore::ApplePaySession::completeShippingContactSelection): 2017-04-21 Alex Christensen Reduce copies and allocations in SharedBuffer::append https://bugs.webkit.org/show_bug.cgi?id=170956 Reviewed by Andreas Kling. SharedBuffer was a mess of different data structures added over the years. SharedBuffer::append would allocate large Vectors and call memcpy, and that is inefficient and causes crashes when large allocations fail, and the allocations and copies aren't even necessary. There were also const correctness problems in ResourceLoader::addDataOrBuffer, and iterating a SharedBuffer was strange because sometimes we don't want to add unnecessary copies. These problems are solved by making SharedBuffer a Vector of read-only data segments, which can be contained in various ways but we don't care because all we want to do is read them. Appending SharedBuffers is now const correct because we just add to a Vector> and neither SharedBuffer can write to the data. Sometimes, though, we want all the data to be in continuous memory, and if there are multiple segments then the data needs to be copied once to a new segment. We should audit the call sites of SharedBuffer::data and see if this is really necessary. No change in functional behavior. Fewer copies of the data are made when buffering data in the NetworkProcess. No extra memory is allocated for bytes we think we might need to append in the future. Data is now only copied into one buffer lazily as needed, which could slightly change when small delays from memcpy happen, but it's an overall improvement. We could have a performance hit if we were to call append() then data() then append() then data() etc. but that doesn't happen in WebKit because we call append repeatedly when buffering the data then call data() once when reading the data. * editing/cocoa/EditorCocoa.mm: (WebCore::archivedDataForAttributedString): (WebCore::Editor::selectionInWebArchiveFormat): (WebCore::Editor::dataInRTFDFormat): (WebCore::Editor::dataInRTFFormat): * editing/ios/EditorIOS.mm: (WebCore::Editor::WebContentReader::readURL): * editing/mac/EditorMac.mm: (WebCore::Editor::imageInWebArchiveFormat): * loader/TextTrackLoader.cpp: (WebCore::TextTrackLoader::processNewCueData): * loader/archive/cf/LegacyWebArchive.cpp: (WebCore::LegacyWebArchive::createResource): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::tryReplaceEncodedData): * loader/cocoa/DiskCacheMonitorCocoa.mm: (WebCore::DiskCacheMonitor::tryGetFileBackedSharedBufferFromCFURLCachedResponse): * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::SharedBuffer): (WebCore::SharedBuffer::create): (WebCore::SharedBuffer::combineToOneSegment): (WebCore::SharedBuffer::data): (WebCore::SharedBuffer::createArrayBuffer): (WebCore::SharedBuffer::append): (WebCore::SharedBuffer::clear): (WebCore::SharedBuffer::copy): (WebCore::SharedBuffer::DataSegment::data): (WebCore::SharedBuffer::DataSegment::size): (WebCore::segmentIndex): Deleted. (WebCore::offsetInSegment): Deleted. (WebCore::allocateSegment): Deleted. (WebCore::freeSegment): Deleted. (WebCore::SharedBuffer::~SharedBuffer): Deleted. (WebCore::SharedBuffer::size): Deleted. (WebCore::SharedBuffer::duplicateDataBufferIfNecessary): Deleted. (WebCore::SharedBuffer::appendToDataBuffer): Deleted. (WebCore::SharedBuffer::clearDataBuffer): Deleted. (WebCore::SharedBuffer::copyBufferAndClear): Deleted. (WebCore::SharedBuffer::buffer): Deleted. (WebCore::SharedBuffer::getSomeData): Deleted. (WebCore::SharedBuffer::maybeTransferMappedFileData): Deleted. (WebCore::SharedBuffer::clearPlatformData): Deleted. (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted. (WebCore::SharedBuffer::hasPlatformData): Deleted. (WebCore::SharedBuffer::platformData): Deleted. (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted. * platform/SharedBuffer.h: (WebCore::SharedBuffer::create): Deleted. (WebCore::SharedBuffer::isEmpty): Deleted. * platform/SharedBufferChunkReader.cpp: (WebCore::SharedBufferChunkReader::nextChunk): (WebCore::SharedBufferChunkReader::peek): * platform/SharedBufferChunkReader.h: * platform/URLParser.cpp: (WebCore::URLParser::URLParser): * platform/cf/KeyedEncoderCF.cpp: (WebCore::KeyedEncoderCF::finishEncoding): * platform/cf/SharedBufferCF.cpp: (WebCore::SharedBuffer::SharedBuffer): (WebCore::SharedBuffer::createCFData): (WebCore::SharedBuffer::create): (WebCore::SharedBuffer::hintMemoryNotNeededSoon): (WebCore::SharedBuffer::append): (WebCore::SharedBuffer::wrapCFData): Deleted. (WebCore::SharedBuffer::hasPlatformData): Deleted. (WebCore::SharedBuffer::platformData): Deleted. (WebCore::SharedBuffer::platformDataSize): Deleted. (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted. (WebCore::SharedBuffer::clearPlatformData): Deleted. (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Deleted. (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted. (WebCore::SharedBuffer::copyBufferAndClear): Deleted. (WebCore::SharedBuffer::copySomeDataFromDataArray): Deleted. (WebCore::SharedBuffer::singleDataArrayBuffer): Deleted. (WebCore::SharedBuffer::maybeAppendDataArray): Deleted. * platform/cocoa/NetworkExtensionContentFilter.mm: (WebCore::NetworkExtensionContentFilter::replacementData): * platform/cocoa/ParentalControlsContentFilter.mm: (WebCore::ParentalControlsContentFilter::replacementData): * platform/cocoa/SharedBufferCocoa.mm: (-[WebCoreSharedBufferData initWithSharedBufferDataSegment:]): (-[WebCoreSharedBufferData length]): (-[WebCoreSharedBufferData bytes]): (WebCore::SharedBuffer::create): (WebCore::SharedBuffer::createCFData): (WebCore::SharedBuffer::createFromReadingFile): (WebCore::SharedBuffer::createNSDataArray): (-[WebCoreSharedBufferData initWithSharedBufferDataBuffer:]): Deleted. (WebCore::SharedBuffer::wrapNSData): Deleted. (WebCore::SharedBuffer::existingCFData): Deleted. * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm: (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource): * platform/graphics/cocoa/FontPlatformDataCocoa.mm: (WebCore::FontPlatformData::openTypeTable): * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (ResourceHandleStreamingClient::didReceiveBuffer): * platform/graphics/mac/ImageMac.mm: (WebCore::Image::loadPlatformResource): * platform/image-decoders/ImageDecoder.cpp: (WebCore::ImageDecoder::create): * platform/image-decoders/png/PNGImageDecoder.cpp: (WebCore::PNGImageReader::decode): * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::readBuffer): * platform/mac/PasteboardMac.mm: (WebCore::writeFileWrapperAsRTFDAttachment): (WebCore::Pasteboard::write): * platform/mac/PlatformPasteboardMac.mm: (WebCore::PlatformPasteboard::bufferForType): * platform/network/BlobResourceHandle.cpp: (WebCore::BlobResourceHandle::notifyReceiveData): * platform/network/MIMEHeader.cpp: * platform/network/MIMEHeader.h: * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp: (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData): * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveData): * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: (-[WebCoreResourceHandleAsDelegate connection:didReceiveData:lengthReceived:]): * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]): * platform/soup/SharedBufferSoup.cpp: (WebCore::SharedBuffer::SharedBuffer): (WebCore::SharedBuffer::createSoupBuffer): (WebCore::SharedBuffer::clearPlatformData): Deleted. (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted. (WebCore::SharedBuffer::hasPlatformData): Deleted. (WebCore::SharedBuffer::platformData): Deleted. (WebCore::SharedBuffer::platformDataSize): Deleted. (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted. (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Deleted. 2017-04-21 Timothy Horton Expose obscured insets to web content (as "safe area insets") https://bugs.webkit.org/show_bug.cgi?id=171013 Reviewed by Wenson Hsieh and Dave Hyatt. Tests: fast/css/variables/constants/invalid-constant-name-fallback.html fast/css/variables/constants/ios/safe-area-inset-set.html fast/css/variables/constants/safe-area-inset-cannot-override.html fast/css/variables/constants/safe-area-inset-zero.html * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSValueKeywords.in: * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCyclesWithRange): (WebCore::CSSVariableData::resolveTokenRange): * css/parser/CSSVariableParser.cpp: (WebCore::isValidConstantName): (WebCore::classifyBlock): (WebCore::isValidConstantReference): Add a constant() function, which takes both custom properties and arbitrary idents which are looked up in ConstantPropertyMap, allowing fallback from the arbitrary, UA-defined idents to custom properties. * dom/ConstantPropertyMap.cpp: Added. (WebCore::ConstantPropertyMap::ConstantPropertyMap): (WebCore::ConstantPropertyMap::values): (WebCore::ConstantPropertyMap::nameForProperty): (WebCore::ConstantPropertyMap::setValueForProperty): (WebCore::ConstantPropertyMap::buildValues): (WebCore::variableDataForSafeAreaInset): (WebCore::ConstantPropertyMap::didChangeObscuredInsets): * dom/ConstantPropertyMap.h: Added. Keep a mapping of UA-defined "constants", which can be looked up from CSS via the aforementioned function. For now, this mapping includes only safe-area-inset-{top, right, bottom, left}, which expose the obscured insets (now that they can be painted into via the viewport parameter clip-to-safe-area-inset=no). * dom/Document.cpp: (WebCore::Document::Document): (WebCore::Document::didChangeObscuredInsets): * dom/Document.h: (WebCore::Document::constantProperties): * page/Page.cpp: (WebCore::Page::setObscuredInsets): * page/Page.h: (WebCore::Page::setObscuredInsets): Deleted. Make setObscuredInsets and related storage not iOS-specific, though nothing from the other platforms yet calls this code. * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Grab the constant properties from ConstantPropertyMap and plop them into the CustomPropertyValueMap. Constant properties aren't allowed to start with --, and variable properties must, so there is no opportunity here for exposing things to var() (or allowing custom properties to override UA-defined constant properties). 2017-04-20 Konstantin Tokarev [cmake] Define FORWARDING_HEADERS_DIR in WebKitFS and use it everywhere https://bugs.webkit.org/show_bug.cgi?id=171071 Reviewed by Michael Catanzaro. "${DERIVED_SOURCES_DIR}/ForwardingHeaders" path occurs very often in the build system files. GTK-specifc FORWARDING_HEADERS_DIR variable should be available for all ports. * CMakeLists.txt: * PlatformMac.cmake: * PlatformWin.cmake: * PlatformWinCairo.cmake: 2017-04-20 Commit Queue Unreviewed, rolling out r215597. https://bugs.webkit.org/show_bug.cgi?id=171102 Made all tests crash under GuardMalloc (Requested by ap on #webkit). Reverted changeset: "Expose obscured insets to web content (as "safe area insets")" https://bugs.webkit.org/show_bug.cgi?id=171013 http://trac.webkit.org/changeset/215597 2017-04-20 Dean Jackson Add Web Sharing to the features under consideration. * features.json: 2017-04-20 Dean Jackson Add Scroll Anchoring to features under consideration. * features.json: 2017-04-20 Konstantin Tokarev Remove unused lamda captures https://bugs.webkit.org/show_bug.cgi?id=171098 Reviewed by Yusuke Suzuki. * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo): * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::activateTransactionInBackingStore): * loader/ResourceLoadStatisticsStore.cpp: (WebCore::ResourceLoadStatisticsStore::createEncoderFromData): (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder): 2017-04-20 Timothy Horton Expose obscured insets to web content (as "safe area insets") https://bugs.webkit.org/show_bug.cgi?id=171013 Reviewed by Wenson Hsieh and Dave Hyatt. Tests: fast/css/variables/constants/invalid-constant-name-fallback.html fast/css/variables/constants/ios/safe-area-inset-set.html fast/css/variables/constants/safe-area-inset-cannot-override.html fast/css/variables/constants/safe-area-inset-zero.html * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSValueKeywords.in: * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCyclesWithRange): (WebCore::CSSVariableData::resolveTokenRange): * css/parser/CSSVariableParser.cpp: (WebCore::isValidConstantName): (WebCore::classifyBlock): (WebCore::isValidConstantReference): Add a constant() function, which takes both custom properties and arbitrary idents which are looked up in ConstantPropertyMap, allowing fallback from the arbitrary, UA-defined idents to custom properties. * dom/ConstantPropertyMap.cpp: Added. (WebCore::ConstantPropertyMap::ConstantPropertyMap): (WebCore::ConstantPropertyMap::values): (WebCore::ConstantPropertyMap::nameForProperty): (WebCore::ConstantPropertyMap::setValueForProperty): (WebCore::ConstantPropertyMap::buildValues): (WebCore::variableDataForSafeAreaInset): (WebCore::ConstantPropertyMap::didChangeObscuredInsets): * dom/ConstantPropertyMap.h: Added. Keep a mapping of UA-defined "constants", which can be looked up from CSS via the aforementioned function. For now, this mapping includes only safe-area-inset-{top, right, bottom, left}, which expose the obscured insets (now that they can be painted into via the viewport parameter clip-to-safe-area-inset=no). * dom/Document.cpp: (WebCore::Document::Document): (WebCore::Document::didChangeObscuredInsets): * dom/Document.h: (WebCore::Document::constantProperties): * page/Page.cpp: (WebCore::Page::setObscuredInsets): * page/Page.h: (WebCore::Page::setObscuredInsets): Deleted. Make setObscuredInsets and related storage not iOS-specific, though nothing from the other platforms yet calls this code. * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Grab the constant properties from ConstantPropertyMap and plop them into the CustomPropertyValueMap. Constant properties aren't allowed to start with --, and variable properties must, so there is no opportunity here for exposing things to var() (or allowing custom properties to override UA-defined constant properties). 2017-04-20 Anders Carlsson Remove one use of toPaymentAuthorizationStatus https://bugs.webkit.org/show_bug.cgi?id=171086 Reviewed by Tim Horton. Just switch on the individual ApplePaySession::STATUS_ values. * Modules/applepay/ApplePaySession.cpp: (WebCore::ApplePaySession::completeShippingMethodSelection): 2017-04-20 Fujii Hironori [WinCairo] Fix build break after updating ANGLE https://bugs.webkit.org/show_bug.cgi?id=170980 Reviewed by Brent Fulgham. By stopping using SoftLinking for ANGLE, some changes are needed for WebCore and WebKit. - Define a macro 'GL_GLEXT_PROTOTYPES' before #include or . - Link libEGL import library explicitly. * PlatformWin.cmake: Link libEGL to WebCore. * platform/graphics/PlatformDisplay.cpp: (WebCore::PlatformDisplay::initializeEGLDisplay): Removed the code for SoftLinking. * platform/graphics/GLContext.cpp: Define GL_GLEXT_PROTOTYPES. * platform/graphics/egl/GLContextEGL.cpp: Ditto. * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp: Ditto. * platform/graphics/opengl/Extensions3DOpenGLES.h: Ditto. * platform/graphics/opengl/TemporaryOpenGLSetting.cpp: Ditto. * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp: Ditto. 2017-04-20 Matt Baker Web Inspector: Add regular expression support to XHR breakpoints https://bugs.webkit.org/show_bug.cgi?id=170099 Reviewed by Joseph Pecoraro. * inspector/InspectorDOMDebuggerAgent.cpp: (WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint): (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest): Use ContentSearchUtilities for both Text and RegularExpression breakpoints. * inspector/InspectorDOMDebuggerAgent.h: Associate XHR breakpoint with a type. 2017-04-20 Eric Carlson [MediaStream] Cleanup and simplify CoreAudioCaptureSource https://bugs.webkit.org/show_bug.cgi?id=171064 There is no need for a mutex to guard against internal state changes because we don't currently change configuration after the audio unit is allocated. Once we do support reconfiguration on the fly, we can just stop the output unit before changing configuration because the I/O proc isn't called if the output unit is stopped, and AudioOutputUnitStop blocks until the audio device has stopped. Reviewed by Jer Noble. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource): Call cleanupAudioUnits instead of duplicating logic. (WebCore::CoreAudioCaptureSource::preferredIOBufferDuration): Change preferred duration from 20ms to 40ms. (WebCore::CoreAudioCaptureSource::configureMicrophoneProc): Set mSampleRate to the preferred sample rate if it is 0. (WebCore::CoreAudioCaptureSource::configureSpeakerProc): Ditto. (WebCore::CoreAudioCaptureSource::provideSpeakerData): Only increment counter and check timestamps in debug builds. (WebCore::CoreAudioCaptureSource::processMicrophoneSamples): Ditto. (WebCore::CoreAudioCaptureSource::cleanupAudioUnits): We only need the audio unit name in debug builds. (WebCore::CoreAudioCaptureSource::setupAudioUnits): Ditto. No more internal state lock. Don't try to get the default input device on iOS. (WebCore::CoreAudioCaptureSource::startProducingData): No more internal state lock. Assert if not called on the main thread. (WebCore::CoreAudioCaptureSource::stopProducingData): Ditto. (WebCore::CoreAudioCaptureSource::suspend): Ditto. (WebCore::CoreAudioCaptureSource::resume): Ditto. * platform/mediastream/mac/CoreAudioCaptureSource.h: 2017-04-20 Eric Carlson [MediaStream iOS] Hold process assertion while media capture is active https://bugs.webkit.org/show_bug.cgi?id=171017 Reviewed by Dean Jackson. * page/ActivityState.h: Add IsCapturingMedia flag. * page/Page.cpp: (WebCore::Page::updateTimerThrottlingState): Enable timer throttling when capture is active like we do when playing audio. (WebCore::Page::setActivityState): Ditto. * page/PerformanceMonitor.cpp: (WebCore::PerformanceMonitor::updateProcessStateForMemoryPressure): A process is active when capturing media, as it is when playing audio. 2017-04-20 Wenson Hsieh Inline anchor elements cannot be dragged when starting the drag from a block descendant https://bugs.webkit.org/show_bug.cgi?id=171062 Reviewed by Tim Horton. Tweaks DragController::draggableElement to traverse the DOM instead of the render tree when finding a draggable element. This prevents us from skipping elements that are in the DOM ancestor chain, but appear as siblings to the hit-tested node's renderer in the render tree. There was also previously a check to ensure that we skip anonymous RenderObjects while traversing up the chain, but this is no longer necessary fter this change, since all the elements we traverse in the DOM should have renderers that are not anonymous. Test: fast/events/drag-and-drop-link-containing-block.html * page/DragController.cpp: (WebCore::DragController::draggableElement): 2017-04-20 Michael Catanzaro -Wformat warning on HistoryController.cpp:295:5 https://bugs.webkit.org/show_bug.cgi?id=171028 Reviewed by Daniel Bates. Need to cast WebCore::FrameLoadType to int before using it in printf. * loader/HistoryController.cpp: (WebCore::HistoryController::goToItem): 2017-04-20 Per Arne Vollan The toleranceBefore parameter in the AVPlayerItem method seekToTime should not be negative. https://bugs.webkit.org/show_bug.cgi?id=171063 Reviewed by Eric Carlson. The AVPlayerItem method seekToTime will throw an exception if toleranceBefore is negative. No new tests since the change is a sanity check. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::seekTask): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime): 2017-04-20 Anders Carlsson Replace isFinalStateStatus with isFinalStateResult https://bugs.webkit.org/show_bug.cgi?id=171072 rdar://problem/31589635 Reviewed by Tim Horton. This will let us get rid of some of the status enum declarations. * Modules/applepay/ApplePaySession.cpp: (WebCore::ApplePaySession::completePayment): * Modules/applepay/PaymentAuthorizationStatus.h: (WebCore::isFinalStateStatus): Deleted. * Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::completePaymentSession): * Modules/applepay/PaymentRequest.cpp: (WebCore::isFinalStateResult): * Modules/applepay/PaymentRequest.h: 2017-04-20 Brent Fulgham [Win] REGRESSION(r215486): Windows Release build is broken https://bugs.webkit.org/show_bug.cgi?id=171024 Reviewed by Mark Lam. Add missing include needed for clean Release build on Windows (proper fix found by Fujii Hironori). * bindings/js/JSDOMGlobalObject.h: 2017-04-20 Said Abou-Hallawa CachedImage should cancel loading images for unsupported/unknown types https://bugs.webkit.org/show_bug.cgi?id=170697 Reviewed by Youenn Fablet. Currently when the image decoder detects an error with the incoming encoded data of an image, we mark the image to be a broken image. But the network process keeps feeding the web process with the rest of the data. We should cancel loading the rest of the data to save network bandwidth and CPU time loading and processing useless data. * loader/cache/CachedImage.cpp: (WebCore::CachedImage::addIncrementalDataBuffer): (WebCore::CachedImage::finishLoading): 2017-04-20 Aaron Chu AX: Modern Media Controls Timeline slider should be operable https://bugs.webkit.org/show_bug.cgi?id=170250 Reviewed by Antoine Quint. Added a "change" event listener and aria-valuetext to the slider so that when a VoiceOver user operates the timeline control, VO speaks the updated timestamp Test: media/modern-media-controls/scrubber/scrubber-has-correct-ax-label.html * English.lproj/modern-media-controls-localized-strings.js: * Modules/modern-media-controls/controls/scrubber.js: (Scrubber.prototype.set inputAccessibleLabel): (Scrubber.prototype._formatTime): * Modules/modern-media-controls/controls/slider.js: (Slider.prototype.handleEvent): (Slider.prototype._handleInputEvent): Deleted. * Modules/modern-media-controls/controls/time-control.js: (TimeControl.prototype.updateScrubberLabel): * Modules/modern-media-controls/controls/time-label.js: (TimeLabel.prototype.commitProperty): (TimeLabel.prototype._formattedTime): * Modules/modern-media-controls/main.js: (formatTimeByUnit): (unitizeTime): 2017-04-20 Andy Estes Fix indentation in AVKitSPI.h https://bugs.webkit.org/show_bug.cgi?id=171066 Reviewed by Jer Noble. * platform/spi/cocoa/AVKitSPI.h: 2017-04-20 Jer Noble [MediaCapture] gUM() with CoreAudio fails if capturing audio in the UIProcess. https://bugs.webkit.org/show_bug.cgi?id=171021 Reviewed by Eric Carlson. Refactor the creation of RealtimeMediaSources to take a persistent device ID rather than a CaptureDevice directly. This allows WebKit2 to iterate devices in the UIProcess rather than the WebProcess. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/mac/AVAudioCaptureSource.mm: * platform/mediastream/mac/AVVideoCaptureSource.mm: * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::create): (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): * platform/mediastream/mac/CoreAudioCaptureSource.h: * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: (WebCore::RealtimeMediaSourceCenterMac::createMediaStream): (WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints): * platform/mock/MockRealtimeAudioSource.cpp: * platform/mock/MockRealtimeVideoSource.cpp: 2017-04-20 Tim Horton Make it possible to request the non-expanded scrollbar width from ScrollbarTheme https://bugs.webkit.org/show_bug.cgi?id=171047 Reviewed by Sam Weinig. No new tests, new behavior is not exposed in any way. * platform/ScrollTypes.h: * platform/ScrollbarTheme.h: (WebCore::ScrollbarTheme::scrollbarThickness): * platform/gtk/ScrollbarThemeGtk.cpp: (WebCore::ScrollbarThemeGtk::scrollbarThickness): * platform/gtk/ScrollbarThemeGtk.h: * platform/ios/ScrollbarThemeIOS.h: * platform/ios/ScrollbarThemeIOS.mm: (WebCore::ScrollbarThemeIOS::scrollbarThickness): * platform/mac/ScrollbarThemeMac.h: * platform/mac/ScrollbarThemeMac.mm: (WebCore::ScrollbarThemeMac::scrollbarThickness): * platform/mock/ScrollbarThemeMock.cpp: (WebCore::ScrollbarThemeMock::scrollbarThickness): * platform/mock/ScrollbarThemeMock.h: * platform/win/ScrollbarThemeWin.cpp: (WebCore::ScrollbarThemeWin::scrollbarThickness): * platform/win/ScrollbarThemeWin.h: * rendering/RenderScrollbarTheme.h: On Mac, when the scrollbar is hovered, it gets bigger. Currently, scrollbarThickness always returns the big size. It should be possible to request the smaller, "regular" scrollbar size as well. 2017-04-20 Jon Lee Update pip placard to "picture in picture" https://bugs.webkit.org/show_bug.cgi?id=171036 rdar://problem/30201536 Reviewed by Antoine Quint. Updated media/modern-media-controls/pip-placard/pip-placard.html Update the text shown with the picture in picture placard. * English.lproj/mediaControlsLocalizedStrings.js: * English.lproj/modern-media-controls-localized-strings.js: * Modules/mediacontrols/mediaControlsApple.js: (Controller.prototype.updatePictureInPicturePlaceholder): * Modules/modern-media-controls/controls/pip-placard.js: (PiPPlacard): 2017-04-20 Youenn Fablet RTCPeerConnection is stopping its backend twice sometimes https://bugs.webkit.org/show_bug.cgi?id=171043 Reviewed by Eric Carlson. Test: webrtc/closing-peerconnection.html Making sure we stop the backend only once. Adding an internals API to close the peer connection so as to replicate frame disconnection. * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::doClose): (WebCore::RTCPeerConnection::doStop): * Modules/mediastream/RTCPeerConnection.h: * testing/Internals.cpp: (WebCore::Internals::stopPeerConnection): * testing/Internals.h: * testing/Internals.idl: 2017-04-20 Antti Koivisto Increase large animation cutoff https://bugs.webkit.org/show_bug.cgi?id=171051 Reviewed by Andreas Kling. We currently switch to per-frame decoding if the animation is larger than 5MB. This is very power-inefficient and such animations are now common. The cutoff originates from 2007 (r20069), it is time update it. Note that the normal low memory handling will still kill animation frames as needed. * platform/graphics/BitmapImage.h: Increase cutoff to 30MB. This is enough (with some room to spare) for animations on current tumblr.com/search/aww. Also remove the separate cutoff value for iOS. 2017-04-20 Zan Dobersek Register missing AES_CTR, ECDSA and HKDF algorithms in GCrypt's CryptoAlgorithmRegistry implementation. Rubber-stamped by Carlos Alberto Lopez Perez. * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp: (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): 2017-04-20 Joanmarie Diggs [ATK] Implement support for DPub ARIA roles https://bugs.webkit.org/show_bug.cgi?id=170679 Reviewed by Chris Fleizach. Create two new WebCore AccessibilityRole values: TextGroup and ApplicationTextGroup. These roles make it possible for platforms to distinguish groups which are primarily intended to display textual content from groups which are primarily intended to hold user-interface objects. Use these roles to fix the ATK mapping of DPub's groups, which should be exposed as ATK_ROLE_SECTION; not ATK_ROLE_PANEL. Modify the following WebCore AccessibilityRole mappings: - doc-abstract changed to ApplicationTextGroupRole because this DPub ARIA role does not subclass the ARIA landmark role - doc-biblioentry and doc-endnote changed to ListItemRole, because these DPub ARIA roles subclass the ARIA listitem role - doc-notice and doc-tip changed to DocumentNoteRole because these DPub ARIA roles subclass the ARIA note role - doc-pagebreak changed to SplitterRole because this DPub ARIA role subclasses the ARIA separator role No new tests required: New test cases were added to xml-roles-exposed.html, and the platform expectations for roles-exposed.html were updated to reflect the correct mappings. * accessibility/AccessibilityList.cpp: (WebCore::AccessibilityList::determineAccessibilityRole): * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::isGroup): (WebCore::AccessibilityNodeObject::helpText): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::ariaTreeItemContent): (WebCore::initializeRoleMap): (WebCore::AccessibilityObject::computedRoleString): * accessibility/AccessibilityObject.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::helpText): (WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant): (WebCore::AccessibilityRenderObject::determineAccessibilityRole): * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetAttributes): (atkRole): (roleIsTextType): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]): (-[WebAccessibilityObjectWrapper containsUnnaturallySegmentedChildren]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (createAccessibilityRoleMap): (-[WebAccessibilityObjectWrapper subrole]): 2017-04-19 Youenn Fablet [Mac] Allow customizing H264 encoder https://bugs.webkit.org/show_bug.cgi?id=170829 Reviewed by Alex Christensen. Using WebKitAdditions CreateCompressionSession if available. * Configurations/FeatureDefines.xcconfig: * WebCore.xcodeproj/project.pbxproj: * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.h: Added. * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.mm: Added. (WebCore::H264VideoToolboxEncoder::CreateCompressionSession): * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.cpp: (WebCore::VideoToolboxVideoEncoderFactory::CreateSupportedVideoEncoder): 2017-04-19 Eric Carlson Another deadlock in CoreAudioCaptureSource https://bugs.webkit.org/show_bug.cgi?id=171001 Fix another regression introduced by r215201, plus make changes suggested in the review of 170771. Reviewed by Youenn Fablet. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::configureSpeakerProc): Assert if the lock is no held. (WebCore::CoreAudioCaptureSource::provideSpeakerData): Don't reset the buffer. (WebCore::CoreAudioCaptureSource::processMicrophoneSamples): Take the state lock. Don't reset the buffer. No more microphone callbacks. (WebCore::CoreAudioCaptureSource::stopProducingData): Return early if the io unit isn't running. Drop the lock before calling setMuted to avoid another deadlock. (WebCore::CoreAudioCaptureSource::addMicrophoneDataConsumer): Deleted. (WebCore::CoreAudioCaptureSource::removeMicrophoneDataConsumer): Deleted. * platform/mediastream/mac/CoreAudioCaptureSource.h: 2017-04-19 Anders Carlsson Stop using deprecated APIs, part 3 https://bugs.webkit.org/show_bug.cgi?id=171003 rdar://problem/31589635 rdar://problem/31589635 Reviewed by Tim Horton. * Modules/applepay/ApplePaySession.cpp: (WebCore::convertAndValidate): The status member variable has been removed from ApplePayShippingMethodUpdate. (WebCore::ApplePaySession::completeShippingMethodSelection): If status is not STATUS_SUCCESS, cancel the payment session. (WebCore::ApplePaySession::canSuspendForDocumentSuspension): (WebCore::ApplePaySession::canBegin): (WebCore::ApplePaySession::canAbort): (WebCore::ApplePaySession::canCancel): (WebCore::ApplePaySession::canCompleteShippingMethodSelection): (WebCore::ApplePaySession::canCompleteShippingContactSelection): (WebCore::ApplePaySession::canCompletePaymentMethodSelection): (WebCore::ApplePaySession::canCompletePayment): (WebCore::ApplePaySession::isFinalState): Add State::CancelRequested. * Modules/applepay/ApplePayShippingMethodUpdate.h: * Modules/applepay/ApplePayShippingMethodUpdate.idl: Remove status. * Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::cancelPaymentSession): Call through to the client. * Modules/applepay/PaymentCoordinator.h: * Modules/applepay/PaymentCoordinatorClient.h: Add cancelPaymentSession(). * Modules/applepay/PaymentRequest.h: Remove status. * loader/EmptyClients.cpp: Add new client member function. 2017-04-19 Eric Carlson [MediaStream] Limit capture to one tab at a time https://bugs.webkit.org/show_bug.cgi?id=171009 Reviewed by Jon Lee. No new tests yet, filed bug 171011. * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::stopTrack): Drive-by fix: renamed from stopProducingData because stopProducingData is a method in RealtimeMediaSource that does something different. (WebCore::MediaStreamTrack::stop): Call stopTrack. (WebCore::MediaStreamTrack::stopProducingData): Deleted. * Modules/mediastream/MediaStreamTrack.h: * Modules/mediastream/MediaStreamTrack.idl: * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::replaceTrack): Update for rename. * platform/mediastream/MediaStreamPrivate.cpp: (WebCore::MediaStreamPrivate::muted): Drive-by fix: a track that has ended but which is not muted will never produce data. 2017-04-19 Alex Christensen Parsing large XML strings fails https://bugs.webkit.org/show_bug.cgi?id=170999 Reviewed by Brady Eidson. Test: fast/dom/xml-large.html * xml/parser/XMLDocumentParserLibxml2.cpp: (WebCore::XMLParserContext::createStringParser): (WebCore::XMLParserContext::createMemoryParser): Allow huge XML strings. They work fine in Chrome and Firefox. 2017-04-19 Chris Fleizach AX:
      should use a different role description than interactive separators https://bugs.webkit.org/show_bug.cgi?id=170317 Reviewed by Joanmarie Diggs. Users are confused with WebKit's accessibility description of separators. We should call these what they are, horizontal rules. Updated test: accessibility/mac/hr-element-expected.txt * English.lproj/Localizable.strings: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::orientation): * platform/cocoa/LocalizedStringsCocoa.mm: (WebCore::AXHorizontalRuleDescriptionText): 2017-04-19 Anders Carlsson Rename cancelPayment to cancelPaymentSession https://bugs.webkit.org/show_bug.cgi?id=171007 Reviewed by Tim Horton. * Modules/applepay/ApplePaySession.cpp: (WebCore::ApplePaySession::didCancelPaymentSession): (WebCore::ApplePaySession::didCancelPayment): Deleted. * Modules/applepay/ApplePaySession.h: * Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::didCancelPaymentSession): (WebCore::PaymentCoordinator::didCancelPayment): Deleted. * Modules/applepay/PaymentCoordinator.h: 2017-04-19 Joseph Pecoraro ASAN Crash running LayoutTests/inspector/worker tests https://bugs.webkit.org/show_bug.cgi?id=170967 Reviewed by Alex Christensen. * workers/WorkerMessagingProxy.h: * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::WorkerMessagingProxy): (WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyedInternal): Make the MessagingProxy thread safe ref counted. Since it used to delete itself, turn this into a ref (implicit on construction) and deref (replacing delete this). (WebCore::WorkerMessagingProxy::postMessageToPageInspector): When dispatching have the lambda implicitly ref/deref with the lambda to keep the proxy alive while a lambda is queued. 2017-04-19 Brent Fulgham [iOS, macOS] Guard against passing nullptr to vImagePremultiplyData https://bugs.webkit.org/show_bug.cgi?id=170912 Reviewed by Brady Eidson. * platform/graphics/cg/ImageBufferDataCG.cpp: (WebCore::affineWarpBufferData): Assert if we passed nullptr buffers. (WebCore::transferData): Ditto. (WebCore::ImageBufferData::getData): Check for nullptr data member and avoid passing to vImage routines. (WebCore::ImageBufferData::putData): Ditto. 2017-04-19 Dave Hyatt Remove bogus assert for :not. https://bugs.webkit.org/show_bug.cgi?id=170995 Reviewed by Zalan Bujtas. * css/parser/CSSSelectorParser.cpp: 2017-04-19 Antoine Quint [Modern Media Controls] Allow non-PNG resources https://bugs.webkit.org/show_bug.cgi?id=170992 Reviewed by Dean Jackson. Instead of passing in a name and a platform to MediaControlsHost::base64StringForIconAndPlatform(), we now pass in a name and a type to MediaControlsHost::base64StringForIconNameAndType(). We've removed the need to provide a platform by copying the resources directly under "Resources/modern-media-controls" insted of "Resources/modern-media-controls/platform-name-here", and now we provide a type so that it may be passed down to -[NSBundle pathForResource:ofType:inDirectory:]. * Modules/mediacontrols/MediaControlsHost.cpp: (WebCore::MediaControlsHost::base64StringForIconNameAndType): (WebCore::MediaControlsHost::base64StringForIconAndPlatform): Deleted. * Modules/mediacontrols/MediaControlsHost.h: * Modules/mediacontrols/MediaControlsHost.idl: * Modules/modern-media-controls/controls/icon-service.js: (const.iconService.new.IconService.prototype.imageForIconNameAndLayoutTraits): * WebCore.xcodeproj/project.pbxproj: * rendering/RenderTheme.h: (WebCore::RenderTheme::mediaControlsBase64StringForIconNameAndType): (WebCore::RenderTheme::mediaControlsBase64StringForIconAndPlatform): Deleted. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::mediaControlsBase64StringForIconNameAndType): (WebCore::RenderThemeIOS::mediaControlsBase64StringForIconAndPlatform): Deleted. * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::mediaControlsBase64StringForIconNameAndType): (WebCore::RenderThemeMac::mediaControlsBase64StringForIconAndPlatform): Deleted. 2017-04-19 Antti Koivisto Avoid repaints for invisible animations on tumblr.com/search/aww https://bugs.webkit.org/show_bug.cgi?id=170986 Reviewed by Andreas Kling. Test: fast/repaint/mutate-non-visible.html * rendering/style/RenderStyle.cpp: (WebCore::requiresPainting): (WebCore::RenderStyle::changeRequiresRepaint): If an element is invisible it does not require repaint even if something else changes. 2017-04-19 Dean Jackson Non-muxable GPUs shouldn't allow offline rendering https://bugs.webkit.org/show_bug.cgi?id=170984 Reviewed by Myles Maxfield. Setting the kCGLPFAAllowOfflineRenderers flag doesn't do any harm on devices that only have one GPU. It's also what we want on devices that can mux between GPUs. However, we were also setting it unconditionally on devices with multiple GPUs that have issues muxing. * platform/graphics/mac/GraphicsContext3DMac.mm: (WebCore::setPixelFormat): Add a test for hasMuxableGPU. 2017-04-18 Youenn Fablet RTCOfferOptions iceRestart should be supported https://bugs.webkit.org/show_bug.cgi?id=170966 Reviewed by Alex Christensen. No ability to test iceRestart as of now. Passing iceRestart value to libwebrtc. Passing also voiceActivityDetection value to libwebrtc. Updating mock to use the new overloaded CreateOffer method. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::doCreateOffer): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::doCreateOffer): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::doCreateOffer): * testing/MockLibWebRTCPeerConnection.cpp: (WebCore::MockLibWebRTCPeerConnection::CreateOffer): * testing/MockLibWebRTCPeerConnection.h: 2017-04-18 Wenson Hsieh [WK2] Support DataTransfer::files() when performing a DHTML data interaction https://bugs.webkit.org/show_bug.cgi?id=170880 Reviewed by Tim Horton. Adds support for fetching files from the DataTransfer when performing a data interaction operation handled by JavaScript. There are two changes we make here to achieve this: First, we teach the Pasteboard on iOS to know what file paths hold the item provider contents used in the current data interaction operation. On iOS, Pasteboard::readFilenames is currently hard-coded to return an empty vector. To fix this, we add logic to the iOS Pasteboard to remember what the paths of all files that were successfully loaded from item providers as the data interaction is taking place. This ensures that at the WebCore layer, the implementation of Pasteboard::readFilenames on Mac and iOS is similar -- they both call out to the client layer in order to read file paths off of their respective pasteboards. Once in the client layer (WebKit1 or WebKit2) we then call into PlatformPasteboard::filenamesForDataInteraction, which then calls into WebItemProviderPasteboard if applicable. The second tweak is to propagate information about whether the document is preventing default data interaction behavior to the client layer. This prevents us from having to save pasteboard content when performing data interaction in cases where file information is not needed (i.e. the default behavior is being performed, and the target is not a file input). This also avoids compatibility issues with insertion animations when performing data interaction in editable areas, due to the extra time spent loading item provider data into a temporary file. Unit tests in . * page/DragController.cpp: (WebCore::DragController::DragController): (WebCore::DragController::performDragOperation): (WebCore::DragController::dragEnteredOrUpdated): (WebCore::DragController::tryDocumentDrag): Refactor DragController::tryDocumentDrag to return a DragHandlingMethod. This method currently returns either true or false; this patch changes it to return a DragHandlingMethod, which is either None (the equivalent of returning false before the patch), Default (indicating that the drop destination is allowing default handling), or NonDefault, which indicates that the drop destination has explicitly prevented default. * page/DragController.h: (WebCore::DragController::documentIsHandlingNonDefaultDrag): Used by WebPage when sending an IPC response after handling dragentered or dragupdated. * platform/PasteboardStrategy.h: * platform/PlatformPasteboard.h: * platform/ios/AbstractPasteboard.h: * platform/ios/PasteboardIOS.mm: (WebCore::Pasteboard::readFilenames): * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::filenamesForDataInteraction): * platform/ios/WebItemProviderPasteboard.h: * platform/ios/WebItemProviderPasteboard.mm: WebItemProviderPasteboard now remembers the file URLs of successfully loaded item provider content when a data interaction is being performed. The new filenamesForDataInteraction property returns the array of data interaction file URLs which have been propagated to the web process along with sandbox extensions. This state is cleaned up when list of item providers change (i.e. when the data interaction operation is finished, or if the web content process crashes, etc.) (-[WebItemProviderPasteboard init]): (-[WebItemProviderPasteboard setItemProviders:]): (-[WebItemProviderPasteboard filenamesForDataInteraction]): (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]): 2017-04-18 Dean Jackson Cairo build fix. https://bugs.webkit.org/show_bug.cgi?id=170941 * platform/graphics/cairo/GraphicsContext3DCairo.cpp: (WebCore::GraphicsContext3D::GraphicsContext3D): 2017-04-18 Ryan Haddad Rebaseline bindings tests after r215486. Unreviewed test gardening. * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::jsTestObjOnfooGetter): (WebCore::jsTestObjOnwebkitfooGetter): 2017-04-18 Dean Jackson Attempted build fix. Add/remove some files from ANGLE. * CMakeLists.txt: 2017-04-18 Dean Jackson Update ANGLE https://bugs.webkit.org/show_bug.cgi?id=170941 Reviewed by Alex Christensen. * platform/graphics/ANGLEWebKitBridge.cpp: (WebCore::getSymbolInfo): (WebCore::ANGLEWebKitBridge::ANGLEWebKitBridge): (WebCore::ANGLEWebKitBridge::cleanupCompilers): (WebCore::ANGLEWebKitBridge::compileShaderSource): * platform/graphics/mac/GraphicsContext3DMac.mm: (WebCore::GraphicsContext3D::GraphicsContext3D): * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: (WebCore::GraphicsContext3D::checkVaryingsPacking): 2017-04-18 John Wilander Make WebCore::topPrivatelyControlledDomain() return "localhost" for localhost https://bugs.webkit.org/show_bug.cgi?id=170798 Reviewed by Alex Christensen. API test augmented. * platform/mac/PublicSuffixMac.mm: (WebCore::topPrivatelyControlledDomain): Now returns the lowercase top privately controlled domain including "localhost" for the host localhost. 2017-04-18 Brent Fulgham JSEventListener::m_isolatedWorld should be a Ref https://bugs.webkit.org/show_bug.cgi?id=170910 Reviewed by Alex Christensen. Since m_isolatedWorld should never be nullptr, change the implementation of m_isolatedWorld from a RefPtr to a Ref, and adjust the various call sites to support this change. This should help us catch any changes that permit the isolatedWorld to be set to nullptr. No new tests since there should be no change in behavior. * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::JSEventListener): (WebCore::JSEventListener::initializeJSFunction): (WebCore::JSEventListener::handleEvent): * bindings/js/JSEventListener.h: (WebCore::JSEventListener::cast): (WebCore::JSEventListener::isolatedWorld): (WebCore::JSEventListener::jsFunction): 2017-04-18 Brent Fulgham Correct handling of isolatedWorld in event handling https://bugs.webkit.org/show_bug.cgi?id=65589 Reviewed by Geoffrey Garen. This patch was inspired by Adam's original patch as well as the following Blink change: https://src.chromium.org/viewvc/blink?revision=152377&view=revision Thread isolatedWorld state through event handling logic. Tests: fast/dom/event-attrs-isolated-world.html http/tests/security/isolatedWorld/onclick-attribute.html * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::initializeJSFunction): (WebCore::JSEventListener::world): (WebCore::eventHandlerAttribute): (WebCore::setEventHandlerAttribute): (WebCore::windowEventHandlerAttribute): (WebCore::setWindowEventHandlerAttribute): (WebCore::documentEventHandlerAttribute): (WebCore::setDocumentEventHandlerAttribute): * bindings/js/JSEventListener.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): * dom/Document.cpp: (WebCore::Document::setWindowAttributeEventListener): (WebCore::Document::getWindowAttributeEventListener): * dom/Document.h: * dom/Element.cpp: (WebCore::Element::setAttributeEventListener): * dom/EventTarget.cpp: (WebCore::EventTarget::setAttributeEventListener): (WebCore::EventTarget::attributeEventListener): * dom/EventTarget.h: * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplacementFragment::ReplacementFragment): * html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::parseAttribute): * html/HTMLFrameSetElement.cpp: (WebCore::HTMLFrameSetElement::parseAttribute): * svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::parseAttribute): 2017-04-18 Jeremy Jones Deadlock in CoreAudioCaptureSource https://bugs.webkit.org/show_bug.cgi?id=170771 rdar://problem/31578919 Reviewed by Eric Carlson. Fixes a regression introduced by r215201. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::startProducingData): (WebCore::CoreAudioCaptureSource::stopProducingData): 2017-04-18 Anders Carlsson Stop using deprecated APIs, part 2 https://bugs.webkit.org/show_bug.cgi?id=170965 rdar://problem/31589635 Reviewed by Tim Horton. * Modules/applepay/ApplePaySession.cpp: (WebCore::convertAndValidate): No need to convert the status anymore. (WebCore::ApplePaySession::completeShippingContactSelection): Create an ApplePayError given the status. * Modules/applepay/ApplePayShippingContactUpdate.h: Remove the status member variable. * Modules/applepay/PaymentRequest.h: Remove the status member variable. 2017-04-18 Tim Horton Safari crash when clicking phone number data detector popover button https://bugs.webkit.org/show_bug.cgi?id=170936 Reviewed by Wenson Hsieh. * platform/spi/mac/DataDetectorsSPI.h: Soft-link the phone number key from the correct framework. 2017-04-17 Sam Weinig [WebIDL] Make annotated types first class allowing them to be used in sequences and unions https://bugs.webkit.org/show_bug.cgi?id=170926 Reviewed by Chris Dumez. - Adds IDL types for WebIDL annotated types: [Clamp] T -> IDLClampAdaptor [EnforceRange] T -> IDLEnforceRangeAdaptor [TreatNullAs=EmptyString] T -> IDLTreatNullAsEmptyAdaptor - Adds additional adaptors for existing specializations [AtomicString] T -> IDLAtomicStringAdaptor [RequiresExistingAtomicString] T -> IDLRequiresExistingAtomicStringAdaptor - Removes the need for IntegerConversionConfiguration and StringConversionConfiguration overloads of convert(). - Allows the use of annotated types as subtypes, such as in sequences and unions. * bindings/IDLTypes.h: Add new types: - IDLClampAdaptor - IDLEnforceRangeAdaptor - IDLTreatNullAsEmptyAdaptor - IDLAtomicStringAdaptor - IDLRequiresExistingAtomicStringAdaptor Add new predicates for matching strings and strings/enumerations. * bindings/js/JSDOMConvertNullable.h: Remove now unnecessary overloads of convert that took IntegerConversionConfiguration and StringConversionConfiguration. * bindings/js/JSDOMConvertNumbers.cpp: * bindings/js/JSDOMConvertNumbers.h: Replace individually named conversion functions with explicit template specializations based on type. (WebCore::Converter::convert): (WebCore::Converter::convert): (WebCore::Converter::convert): (WebCore::Converter::convert): (WebCore::Converter::convert): (WebCore::Converter::convert): (WebCore::Converter::convert): (WebCore::Converter::convert): Simplify convert functions for normal integer converters to only handle the normal case. (WebCore::Converter>::convert): (WebCore::JSConverter>::convert): (WebCore::Converter>::convert): (WebCore::JSConverter>::convert): Add converters for the new annotated types that call into the new template specialized conversion functions. * bindings/js/JSDOMConvertStrings.h: (WebCore::Converter::convert): (WebCore::Converter::convert): (WebCore::Converter::convert): Remove no longer needed StringConversionConfiguration parameter. (WebCore::Converter>::convert): (WebCore::JSConverter>::convert): (WebCore::Converter>::convert): (WebCore::JSConverter>::convert): (WebCore::Converter>::convert): (WebCore::JSConverter>::convert): Add converters for new annotated types. Statically assert that the atomic string adaptors only work for DOMString at present. * bindings/js/JSDOMConvertUnion.h: Update union code to fix a long standing FIXME, treating enumerations as strings for the purposes of the union algorithm, and using the new predicate that works with the slightly more complicated IDLString type (e.g. it can now either be a String or an AtomicString). * bindings/js/JSCSSStyleDeclarationCustom.cpp: * bindings/js/JSCryptoAlgorithmDictionary.cpp: * bindings/js/JSDocumentCustom.cpp: * bindings/js/JSEventListener.cpp: * bindings/js/JSHTMLCanvasElementCustom.cpp: * bindings/js/JSMockContentFilterSettingsCustom.cpp: * bindings/js/JSNodeFilterCustom.cpp: * bindings/js/JSSubtleCryptoCustom.cpp: Remove explicit passing of Normal for the conversion configuration and use new adaptors where appropriate. * bindings/scripts/CodeGeneratorJS.pm: (IsAnnotatedType): (GetAnnotatedIDLType): (GetIDLType): (JSValueToNative): (UnsafeToNative): (GetIntegerConversionConfiguration): Deleted. (GetStringConversionConfiguration): Deleted. Replace passing conversion configuration and specializing for atomic string with annotated types. * bindings/scripts/IDLParser.pm: (parseUnionMemberType): Fix parser error where we weren't parsing extended attributes for a union correctly. * 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/JSTestCustomNamedGetter.cpp: * bindings/scripts/test/JS/JSTestDOMJIT.cpp: * bindings/scripts/test/JS/JSTestEventConstructor.cpp: * bindings/scripts/test/JS/JSTestEventTarget.cpp: * bindings/scripts/test/JS/JSTestGlobalObject.cpp: * bindings/scripts/test/JS/JSTestInterface.cpp: * bindings/scripts/test/JS/JSTestNamedConstructor.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/JSTestSerialization.cpp: * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp: * bindings/scripts/test/JS/JSTestTypedefs.cpp: Update tests for changes to integer and string conversion. * domjit/DOMJITIDLConvert.h: * domjit/DOMJITIDLType.h: * domjit/DOMJITIDLTypeFilter.h: Add specializations for AtomicString related adaptors. * testing/TypeConversions.h: * testing/TypeConversions.idl: - Re-arrange integer attributes to be in size order, and add [Clamp] variants. - Replace function taking a dictionary + attributes to inspect it with a dictionary attribute. This has been supported for a while and makes the test much clearer (this includes the enum used for inspecting the union in the dictionary). - Add additional test unions that exercise annotated types as subtypes. - Add additional dictionary items that exercise annotated types as subtypes. 2017-04-18 Antti Koivisto Enable optimized layer flushes on iOS https://bugs.webkit.org/show_bug.cgi?id=170938 Reviewed by Simon Fraser. Test: compositing/ios/overflow-scroll-touch-tiles.html * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::setApproximatePosition): Make virtual. (WebCore::GraphicsLayer::flushCompositingState): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::syncPosition): Rename PositionChanged enum value to more descriptive NeedsComputeVisibleAndCoverageRect. (WebCore::GraphicsLayerCA::setApproximatePosition): (WebCore::GraphicsLayerCA::syncBoundsOrigin): Like syncPosition make these invalidate the geometry without scheduling a flush. This is needed so when flush happens we don't just optimize it away. Tile coverage depends on position and bounds. (WebCore::GraphicsLayerCA::flushCompositingState): Remove FlushScope argument. Disable optimization on WK1 due to some UIKit interactions. * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: (WebCore::GraphicsLayerTextureMapper::flushCompositingState): * platform/graphics/texmap/GraphicsLayerTextureMapper.h: 2017-04-18 Tim Horton Try to fix the iOS Debug build * platform/LengthBox.h: 2017-04-18 Andreas Kling Break Document::m_associatedFormControls reference cycle. Reviewed by Antti Koivisto. There was a race between didAssociateFormControls() and didAssociateFormControlsTimerFired() where detaching Document from its frame between the two would lead to an unbreakable reference cycle between Document and its form elements. Solve this by clearing the set of associated form elements in removedLastRef(), where we clear all the other strong smart pointers to elements. * dom/Document.cpp: (WebCore::Document::removedLastRef): 2017-04-18 Manuel Rego Casasnovas [css-grid] Add support for percentage gaps https://bugs.webkit.org/show_bug.cgi?id=170764 Reviewed by Sergio Villar Senin. Part of the code to support percentage gaps was already imported from Blink in r213149 (bug #168657). However parsing was not enabled yet, so some pieces were missing. This patch accepts percentages in the parsing of grid-column-gap and grid-row-gap properties, and the grid-gap shorthand. On top of that it gets rid of GridTrackSizingAlgorithm::sizingOperation() method as it's not needed. And instead it passes the specific operation to each call to RenderGrid::guttersSize(), otherwise we would be getting wrong results. Test: fast/css-grid-layout/grid-gutters-as-percentage.html * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Add support for percentage values. (WebCore::CSSPropertyParser::parseShorthand): Ditto. * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded): Pass the specific sizing operation. * rendering/GridTrackSizingAlgorithm.h: Remove sizingOperation(). * rendering/RenderGrid.cpp: (WebCore::RenderGrid::computeTrackBasedLogicalHeight): Pass the specific sizing operation. (WebCore::RenderGrid::computeTrackSizesForDefiniteSize): Ditto. (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize): Ditto. (WebCore::RenderGrid::populateGridPositionsForDirection): Ditto. 2017-04-18 Per Arne Vollan Add fallback fonts to video captions stylesheet. https://bugs.webkit.org/show_bug.cgi?id=170495 Reviewed by Eric Carlson. The kCTFontCascadeListAttribute key is used to obtain the cascade list for a font reference. I have not added a test, since CaptionUserPreferences::testingMode() returns true when running tests, preventing this code path from being executed. * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS): * platform/spi/win/CoreTextSPIWin.h: 2017-04-18 Miguel Gomez [GTK+] Crash in WebCore::ImageFrame::ImageFrame() https://bugs.webkit.org/show_bug.cgi?id=170332 Reviewed by Carlos Garcia Campos. When decoding a PNG image, don't reset the number of frames to 1 when there's a decoding error. Doing so causes a crash if the number of frames we reported before is bigger than 1. Test: fast/images/bad-png-missing-fdat.html * platform/image-decoders/png/PNGImageDecoder.cpp: (WebCore::PNGImageDecoder::fallbackNotAnimated): 2017-04-18 Carlos Garcia Campos [GLIB] Define priorities also for async network IO tasks https://bugs.webkit.org/show_bug.cgi?id=170905 Reviewed by Žan Doberšek. * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::redirectSkipCallback): (WebCore::sendRequestCallback): (WebCore::continueAfterDidReceiveResponse): (WebCore::readCallback): * platform/network/soup/SocketStreamHandleImplSoup.cpp: (WebCore::SocketStreamHandleImpl::connected): (WebCore::SocketStreamHandleImpl::readBytes): 2017-04-17 Zan Dobersek Unreviewed build fix for !ENABLE(MEDIA_STREAM) configurations. * html/MediaElementSession.cpp: (WebCore::MediaElementSession::playbackPermitted): Guard the use of HTMLMediaElement::hasMediaStreamSrcObject() with ENABLE(MEDIA_STREAM). 2017-04-17 Alex Christensen Allow Variants of RetainPtrs https://bugs.webkit.org/show_bug.cgi?id=170923 Reviewed by Tim Horton and Sam Weinig. No change in behavior. Just updated the one class that used RetainPtr::operator& to cleanly initialize RetainPtrs instead of taking the address of a smart pointer and forcing a value inside of it. * platform/mac/SSLKeyGeneratorMac.mm: (WebCore::signedPublicKeyAndChallengeString): 2017-04-17 Fujii Hironori [WinCairo] 'WebCore::GraphicsLayerTextureMapper::flushCompositingStated': method with override specifier 'override' did not override any base class methods https://bugs.webkit.org/show_bug.cgi?id=170928 Reviewed by Simon Fraser. Apply the same change of CoordinatedGraphicsLayer.{cpp,h} of r215410 to GraphicsLayerTextureMapper.{cpp,h}. * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: (WebCore::GraphicsLayerTextureMapper::flushCompositingState): Added the second argument. * platform/graphics/texmap/GraphicsLayerTextureMapper.h: Ditto. 2017-04-17 Timothy Horton Plumb all four obscured insets to WebCore, instead of just top/left https://bugs.webkit.org/show_bug.cgi?id=170913 Reviewed by Wenson Hsieh. No new tests, no observable behavior change yet. In preparation for a future patch (for rdar://problem/31564652), plumb all four obscured insets to WebCore/the Web Content process, instead of just the top and left insets. * history/HistoryItem.cpp: (WebCore::HistoryItem::HistoryItem): * history/HistoryItem.h: (WebCore::HistoryItem::obscuredInsets): (WebCore::HistoryItem::setObscuredInsets): (WebCore::HistoryItem::obscuredInset): Deleted. (WebCore::HistoryItem::setObscuredInset): Deleted. * loader/HistoryController.cpp: (WebCore::HistoryController::saveScrollPositionAndViewStateToItem): * page/Page.h: (WebCore::Page::obscuredInsets): (WebCore::Page::setObscuredInsets): (WebCore::Page::obscuredInset): Deleted. (WebCore::Page::setObscuredInset): Deleted. Adopt FloatBoxExtent for obscuredInsets (and adjust pluralization). 2017-04-17 Joseph Pecoraro Web Inspector: Doesn't show size of compressed content correctly https://bugs.webkit.org/show_bug.cgi?id=155112 Reviewed by Alex Christensen and Timothy Hatcher. Tests: http/tests/inspector/network/resource-sizes-disk-cache.html http/tests/inspector/network/resource-sizes-memory-cache.html http/tests/inspector/network/resource-sizes-network.html * inspector/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::buildObjectForMetrics): * platform/network/NetworkLoadMetrics.h: (WebCore::NetworkLoadMetrics::isolatedCopy): (WebCore::NetworkLoadMetrics::reset): (WebCore::NetworkLoadMetrics::clearNonTimingData): (WebCore::NetworkLoadMetrics::operator==): (WebCore::NetworkLoadMetrics::encode): (WebCore::NetworkLoadMetrics::decode): * platform/spi/cf/CFNetworkSPI.h: 2017-04-17 Youenn Fablet Enable video autoplay when getUserMedia is on https://bugs.webkit.org/show_bug.cgi?id=170919 Reviewed by Geoffrey Garen. Test: webrtc/video-autoplay.html * dom/Document.h: (WebCore::Document::isCapturing): * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::hasMediaStreamSrcObject): * html/MediaElementSession.cpp: (WebCore::MediaElementSession::playbackPermitted): Allowing playback if getUserMedia is capturing audio or video on the document and if element is rendering MediaStream based content. * page/MediaProducer.h: (WebCore::MediaProducer::isCapturing): 2017-04-17 Alex Christensen Fix CMake build. * PlatformMac.cmake: 2017-04-17 Anders Carlsson Stop using deprecated APIs, part 1 https://bugs.webkit.org/show_bug.cgi?id=170915 rdar://problem/31589635 Reviewed by Tim Horton. Get rid of the status parameter from ApplePayPaymentMethodUpdate. * Modules/applepay/ApplePayPaymentMethodUpdate.h: * Modules/applepay/ApplePayPaymentMethodUpdate.idl: * Modules/applepay/ApplePaySession.cpp: (WebCore::convertAndValidate): (WebCore::ApplePaySession::completePaymentMethodSelection): * Modules/applepay/PaymentRequest.h: 2017-04-17 Youenn Fablet Disable outdated WritableStream API https://bugs.webkit.org/show_bug.cgi?id=170749 Reviewed by Alex Christensen. No change of behavior. Replacing READABLE_STREAM_API, READABLE_BYTE_STREAM_API and WRITABLE_STREAM_API compilation flag by: - A STREAMS_API compilation flag. - A ReadableByteStreamAPI and WritableStreamAPI runtime flags, turned off except for RWT and DRT. * Configurations/FeatureDefines.xcconfig: * Modules/fetch/FetchBody.cpp: * Modules/fetch/FetchBody.h: * Modules/fetch/FetchBodyOwner.cpp: (WebCore::FetchBodyOwner::isDisturbedOrLocked): (WebCore::FetchBodyOwner::blobLoadingSucceeded): (WebCore::FetchBodyOwner::blobLoadingFailed): (WebCore::FetchBodyOwner::blobChunk): * Modules/fetch/FetchBodyOwner.h: * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::BodyLoader::didSucceed): (WebCore::FetchResponse::BodyLoader::didFail): (WebCore::FetchResponse::BodyLoader::didReceiveData): * Modules/fetch/FetchResponse.h: * Modules/fetch/FetchResponse.idl: * Modules/fetch/FetchResponseSource.cpp: * Modules/fetch/FetchResponseSource.h: * Modules/streams/ByteLengthQueuingStrategy.idl: * Modules/streams/ByteLengthQueuingStrategy.js: * Modules/streams/CountQueuingStrategy.idl: * Modules/streams/CountQueuingStrategy.js: * Modules/streams/ReadableByteStreamController.idl: * Modules/streams/ReadableByteStreamController.js: * Modules/streams/ReadableByteStreamInternals.js: * Modules/streams/ReadableStream.idl: * Modules/streams/ReadableStream.js: (initializeReadableStream): Using readableByteStreamAPI runtime flag directly. * Modules/streams/ReadableStreamBYOBRequest.idl: * Modules/streams/ReadableStreamBYOBRequest.js: * Modules/streams/ReadableStreamDefaultController.idl: * Modules/streams/ReadableStreamDefaultController.js: * Modules/streams/ReadableStreamDefaultReader.idl: * Modules/streams/ReadableStreamDefaultReader.js: * Modules/streams/ReadableStreamInternals.js: * Modules/streams/ReadableStreamSource.h: * Modules/streams/ReadableStreamSource.idl: * Modules/streams/StreamInternals.js: * Modules/streams/WritableStream.idl: * Modules/streams/WritableStream.js: * Modules/streams/WritableStreamInternals.js: * bindings/js/JSDOMGlobalObject.cpp: (WebCore::isReadableByteStreamAPIEnabled): (WebCore::JSDOMGlobalObject::addBuiltinGlobals): * bindings/js/JSReadableStreamPrivateConstructors.cpp: (WebCore::constructJSReadableStreamBYOBRequest): (WebCore::JSBuiltinReadableStreamBYOBRequestPrivateConstructor::initializeExecutable): (WebCore::createReadableStreamBYOBRequestPrivateConstructor): * bindings/js/JSReadableStreamPrivateConstructors.h: * bindings/js/JSReadableStreamSourceCustom.cpp: * bindings/js/ReadableStreamDefaultController.cpp: * bindings/js/ReadableStreamDefaultController.h: * bindings/js/WebCoreBuiltinNames.h: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setReadableByteStreamAPIEnabled): (WebCore::RuntimeEnabledFeatures::readableByteStreamAPIEnabled): (WebCore::RuntimeEnabledFeatures::setWritableStreamAPIEnabled): (WebCore::RuntimeEnabledFeatures::writableStreamAPIEnabled): * testing/Internals.cpp: * testing/Internals.h: * testing/Internals.idl: 2017-04-17 Tim Horton Provide a viewport parameter to disable clipping to the safe area https://bugs.webkit.org/show_bug.cgi?id=170766 Reviewed by Beth Dakin. Tests: tiled-drawing/ios/viewport-clip-to-safe-area-no-gets-margin-tiles.html, tiled-drawing/ios/viewport-clip-to-safe-area-yes-gets-no-margin-tiles.html, * dom/ViewportArguments.cpp: (WebCore::ViewportArguments::resolve): (WebCore::setViewportFeature): * dom/ViewportArguments.h: (WebCore::ViewportArguments::operator==): * page/ViewportConfiguration.cpp: (WebCore::ViewportConfiguration::updateConfiguration): (WebCore::operator<<): (WebCore::ViewportConfiguration::description): * page/ViewportConfiguration.h: (WebCore::ViewportConfiguration::Parameters::Parameters): (WebCore::ViewportConfiguration::clipToSafeArea): Add viewport parameter. * page/ChromeClient.h: * page/FrameView.h: * page/FrameView.cpp: (WebCore::FrameView::enableSpeculativeTilingIfNeeded): If not clipping to the safe area, enable "speculative" tiling immediately, because the margin tiles can be visible immediately. (WebCore::FrameView::hasExtendedBackgroundRectForPainting): (WebCore::FrameView::updateTilesForExtendedBackgroundMode): Don't check the setting here; just respect the mode that is computed by calculateExtendedBackgroundMode. (WebCore::FrameView::calculateExtendedBackgroundMode): If the viewport parameter was set, add margin tiles on both axes. (WebCore::FrameView::setClipToSafeArea): Notify ChromeClient of the change, and re-compute the margin tile mode. * rendering/RenderLayerCompositor.h: * rendering/RenderLayerCompositor.cpp: Factor out code that decides whether the content layer clips to bounds, and make it take the new viewport parameter into account. * rendering/RenderObject.cpp: Don't clip RenderView repaints to RenderView's GraphicsLayer bounds if clip-to-safe-area is off, just like we do for slow-repaint objects in extended background mode. 2017-04-17 Dan Bernstein [Cocoa] Move isNullFunctionPointer down into WTF https://bugs.webkit.org/show_bug.cgi?id=170892 Reviewed by Sam Weinig. * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::LibWebRTCProvider::webRTCAvailable): Changed to use WTF::isNullFunctionPointer, and removed the static variable, so instead of loading from the initialization guard, branching, then loading from the variable itself, we just load from the function pointer. (WebCore::isNullFunctionPointer): Deleted. 2017-04-14 Jiewen Tan [WebCrypto] Add support for ECDSA https://bugs.webkit.org/show_bug.cgi?id=170789 Reviewed by Brent Fulgham. This patch implements ECDSA according to the spec: https://www.w3.org/TR/WebCryptoAPI/#ecdsa. Supported operations include sign, verify, generateKey, importKey and exportKey. Tests: crypto/subtle/ecdh-generate-export-key-pkcs8-p256.html crypto/subtle/ecdh-generate-export-key-pkcs8-p384.html crypto/subtle/ecdsa-generate-export-jwk-key.html crypto/subtle/ecdsa-generate-export-key-pkcs8.html crypto/subtle/ecdsa-generate-export-key-raw.html crypto/subtle/ecdsa-generate-export-key-spki.html crypto/subtle/ecdsa-generate-key-sign-verify-p256.html crypto/subtle/ecdsa-generate-key-sign-verify-p384.html crypto/subtle/ecdsa-generate-key.html crypto/subtle/ecdsa-import-jwk-private-key.html crypto/subtle/ecdsa-import-jwk-public-key-alg-256.html crypto/subtle/ecdsa-import-jwk-public-key-alg-384.html crypto/subtle/ecdsa-import-jwk-public-key.html crypto/subtle/ecdsa-import-key-sign-p256.html crypto/subtle/ecdsa-import-key-sign-p384.html crypto/subtle/ecdsa-import-key-verify-p256.html crypto/subtle/ecdsa-import-key-verify-p384.html crypto/subtle/ecdsa-import-pkcs8-key.html crypto/subtle/ecdsa-import-raw-key.html crypto/subtle/ecdsa-import-spki-key.html crypto/subtle/ecdsa-verify-malformed-parameters.html crypto/workers/subtle/ecdsa-import-key-sign.html crypto/workers/subtle/ecdsa-import-key-verify.html * CMakeLists.txt: * DerivedSources.make: * PlatformGTK.cmake: * PlatformMac.cmake: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSSubtleCryptoCustom.cpp: (WebCore::normalizeCryptoAlgorithmParameters): (WebCore::jsSubtleCryptoFunctionSignPromise): (WebCore::jsSubtleCryptoFunctionVerifyPromise): Add missing parameters. * crypto/CommonCryptoUtilities.h: * crypto/CryptoAlgorithm.cpp: (WebCore::CryptoAlgorithm::sign): (WebCore::CryptoAlgorithm::verify): * crypto/CryptoAlgorithm.h: Add missing parameters. * crypto/CryptoAlgorithmParameters.h: * crypto/algorithms/CryptoAlgorithmECDSA.cpp: Added. (WebCore::CryptoAlgorithmECDSA::create): (WebCore::CryptoAlgorithmECDSA::identifier): (WebCore::CryptoAlgorithmECDSA::sign): (WebCore::CryptoAlgorithmECDSA::verify): (WebCore::CryptoAlgorithmECDSA::generateKey): (WebCore::CryptoAlgorithmECDSA::importKey): (WebCore::CryptoAlgorithmECDSA::exportKey): * crypto/algorithms/CryptoAlgorithmECDSA.h: Added. * crypto/algorithms/CryptoAlgorithmHMAC.cpp: (WebCore::CryptoAlgorithmHMAC::sign): (WebCore::CryptoAlgorithmHMAC::verify): * crypto/algorithms/CryptoAlgorithmHMAC.h: Add missing parameters. * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp: (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign): (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify): * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h: Add missing parameters. * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp: Added. (WebCore::CryptoAlgorithmECDSA::platformSign): (WebCore::CryptoAlgorithmECDSA::platformVerify): * crypto/mac/CommonCryptoDERUtilities.cpp: Added. (WebCore::bytesUsedToEncodedLength): (WebCore::extraBytesNeededForEncodedLength): (WebCore::addEncodedASN1Length): (WebCore::bytesNeededForEncodedLength): * crypto/mac/CommonCryptoDERUtilities.h: (WebCore::bytesUsedToEncodedLength): Deleted. (WebCore::extraBytesNeededForEncodedLength): Deleted. (WebCore::addEncodedASN1Length): Deleted. (WebCore::bytesNeededForEncodedLength): Deleted. Move implementations to a .cpp file. * crypto/mac/CryptoAlgorithmECDSAMac.cpp: Added. (WebCore::cryptoDigestAlgorithm): (WebCore::signECDSA): (WebCore::verifyECDSA): (WebCore::CryptoAlgorithmECDSA::platformSign): (WebCore::CryptoAlgorithmECDSA::platformVerify): * crypto/mac/CryptoAlgorithmRegistryMac.cpp: (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): * crypto/parameters/CryptoAlgorithmEcdsaParams.h: Added. * crypto/parameters/EcdsaParams.idl: Added. 2017-04-17 Jeremy Jones Refactor enumerateDevices to allow separate CaptureDeviceManagers for audio and video. https://bugs.webkit.org/show_bug.cgi?id=170778 Reviewed by Eric Carlson. Add CoreAudioCaptureDeviceManager to enumerate CoreAudio devices. Refactor RealtimeMediaSourceCenter and RealtimeMediaSourceCenterMac to provide independent audio and video capture device managers and the abiliity to override the capture device managers. CoreAudioCaptureSource now uses CoreAudioCaptureDeviceManager to use the specified device instead of the default one. * WebCore.xcodeproj/project.pbxproj: * platform/mediastream/CaptureDeviceManager.cpp: (CaptureDeviceManager::getAudioSourcesInfo): (CaptureDeviceManager::getVideoSourcesInfo): (CaptureDeviceManager::getSourcesInfo): Deleted. * platform/mediastream/CaptureDeviceManager.h: * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::setAudioCaptureDeviceManager): (WebCore::RealtimeMediaSourceCenter::unsetAudioCaptureDeviceManager): (WebCore::RealtimeMediaSourceCenter::setVideoCaptureDeviceManager): (WebCore::RealtimeMediaSourceCenter::unsetVideoCaptureDeviceManager): * platform/mediastream/RealtimeMediaSourceCenter.h: (WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureDeviceManager): (WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureDeviceManager): (WebCore::RealtimeMediaSourceCenter::audioCaptureDeviceManager): (WebCore::RealtimeMediaSourceCenter::videoCaptureDeviceManager): * platform/mediastream/mac/AVCaptureDeviceManager.h: * platform/mediastream/mac/AVCaptureDeviceManager.mm: (WebCore::AVCaptureDeviceManager::refreshAVCaptureDevicesOfType): (WebCore::AVCaptureDeviceManager::refreshCaptureDevices): (WebCore::AVCaptureDeviceManager::getAudioSourcesInfo): (WebCore::AVCaptureDeviceManager::getVideoSourcesInfo): (WebCore::AVCaptureDeviceManager::setUseAVFoundationAudioCapture): Deleted. (WebCore::AVCaptureDeviceManager::getSourcesInfo): Deleted. * platform/mediastream/mac/CoreAudioCaptureDevice.cpp: Added. (WebCore::getDeviceInfo): (WebCore::CoreAudioCaptureDevice::create): (WebCore::CoreAudioCaptureDevice::CoreAudioCaptureDevice): (WebCore::CoreAudioCaptureDevice::deviceID): (WebCore::CoreAudioCaptureDevice::deviceClock): (WebCore::CoreAudioCaptureDevice::isAlive): * platform/mediastream/mac/CoreAudioCaptureDevice.h: Copied from Source/WebCore/platform/mediastream/CaptureDeviceManager.h. * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp: Added. (WebCore::CoreAudioCaptureDeviceManager::singleton): (WebCore::CoreAudioCaptureDeviceManager::captureDevices): (WebCore::deviceHasInputStreams): (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices): (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices): (WebCore::CoreAudioCaptureDeviceManager::devicesChanged): * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h: Copied from Source/WebCore/platform/mediastream/CaptureDeviceManager.h. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::startProducingData): (WebCore::CoreAudioCaptureSource::stopProducingData): * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: (WebCore::RealtimeMediaSourceCenterMac::setUseAVFoundationAudioCapture): (WebCore::RealtimeMediaSourceCenterMac::RealtimeMediaSourceCenterMac): (WebCore::RealtimeMediaSourceCenterMac::createMediaStream): (WebCore::RealtimeMediaSourceCenterMac::getMediaStreamDevices): * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h: 2017-04-17 Ryan Haddad Unreviewed, rolling out r215366. This test is failing on performance bots. Reverted changeset: "Add performance test for asking the platform for a font for U+2060 WORD JOINER" https://bugs.webkit.org/show_bug.cgi?id=170842 http://trac.webkit.org/changeset/215366 2017-04-17 Youenn Fablet RTCPeerConnection addTrack does not require a stream parameter https://bugs.webkit.org/show_bug.cgi?id=170894 Reviewed by Alex Christensen. Test: webrtc/video-addTrack.html * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::addTrack): Removing obsolete error throwing. 2017-04-17 Youenn Fablet Add an external libwebrtc encoder factory in WebCore https://bugs.webkit.org/show_bug.cgi?id=170883 Reviewed by Alex Christensen. No change of behavior, WebCore factory instantiating the default libwebrtc H264 encoder. * WebCore.xcodeproj/project.pbxproj: * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::staticFactoryAndThreads): * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.cpp: Added. (WebCore::VideoToolboxVideoEncoderFactory::CreateVideoEncoder): (WebCore::VideoToolboxVideoEncoderFactory::DestroyVideoEncoder): * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.h: Added. 2017-04-17 Antti Koivisto GraphicsLayerCA::recursiveCommitChanges should not descend into subtrees without changes https://bugs.webkit.org/show_bug.cgi?id=170851 Reviewed by Simon Fraser. With lots of layers this can be very slow as it always traverses the entire layer tree. For example GIF animations on tumblr.com trigger expensive commits where almost nothing changes. This patch adds m_hasDescendantsWithUncommittedChanges bit to GraphicsLayerCA. With this we can avoid descending to branches without changes when committing. This patch enabled the optimization on Mac. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::GraphicsLayerCA::syncPosition): Set PositionChanged flag when syncing layer position. This flag does nothing except makes next commit to update the coverage rect (so tiling gets updated). (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): Do all setting of m_uncommittedChanges bits via addUncommittedChanges function. (WebCore::GraphicsLayerCA::recursiveCommitChanges): Bail out if neither the current layer nor any of its descendants have any uncommited changes and none of the ancestors had changes. (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): (WebCore::GraphicsLayerCA::ensureStructuralLayer): (WebCore::GraphicsLayerCA::changeLayerTypeTo): (WebCore::GraphicsLayerCA::addUncommittedChanges): Set m_hasDescendantsWithUncommittedChanges bit in ancestors when mutating m_uncommittedChanges. (WebCore::GraphicsLayerCA::noteLayerPropertyChanged): * platform/graphics/ca/GraphicsLayerCA.h: (WebCore::RenderLayerCompositor::frameViewDidScroll): Tell the scrolling layer that it needs to recompute coverage. This also schedules a layer flush so no need to do that separately. 2017-04-16 Chris Dumez CMD+R / CMD+Q is considered as user interaction and beforeunload alert is shown https://bugs.webkit.org/show_bug.cgi?id=169995 Reviewed by Sam Weinig. Any key event was considered as user interaction with the page, which meant that they would allow beforeunload alerts to be shown even when they do not represent actual user interaction (e.g CMD+R / CMD+Q / CMD+T keyboard shortcuts). To address the issue, we now only treat as user interaction with the page key events that are actually handled by the page (i.e. handled by JS, typed into a field, ...). Tests: fast/events/beforeunload-alert-handled-keydown.html fast/events/beforeunload-alert-unhandled-keydown.html * dom/Document.h: (WebCore::Document::setUserDidInteractWithPage): (WebCore::Document::userDidInteractWithPage): * dom/UserGestureIndicator.cpp: (WebCore::UserGestureIndicator::UserGestureIndicator): * loader/FrameLoader.cpp: (WebCore::shouldAskForNavigationConfirmation): * page/EventHandler.cpp: (WebCore::EventHandler::keyEvent): (WebCore::EventHandler::internalKeyEvent): * page/EventHandler.h: 2017-04-16 Sam Weinig [WebIDL] Switch IDLAttributes.txt over to a more structured format so that more information can be added for each attribute https://bugs.webkit.org/show_bug.cgi?id=170843 Reviewed by Chris Dumez. - Converts IDLAttributes.txt to IDLAttributes.json, and adds additional information for each attribute about what contexts they are valid in which is checked by the parser. - Removes CustomSetPrototype which was unused, and Immutable which did nothing. * DerivedSources.make: Update extension of IDLAttributes to .json * WebCore.xcodeproj/project.pbxproj: Update project file for new file name and add some missing IDL files. * bindings/scripts/CodeGenerator.pm: Store the processed IDLAttributes in the code generator, so it can be used for any additional Parser instantiations. * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): Remove support for CustomSetPrototype. Nobody is using it. * bindings/scripts/IDLAttributes.json: Copied from Source/WebCore/bindings/scripts/IDLAttributes.txt. * bindings/scripts/IDLAttributes.txt: Removed. Rename IDLAttributes.txt -> IDLAttributes.json and move the data into a more structured format. For now each extended attribute can have the following fields: Required: 'contextsAllowed' -> Non-empty array of strings from the contexts array. Optional: 'values' -> Non-empty array of strings allowed after the equal (=) sign in the extended attribute. Like before, an empty string indicates it is ok to not have a value and a star (*) indicates any string is allowed. Not providing a values property at all indicates that no value is allowed. 'standard' -> An object with information about the standard this attribute comes from. Should only be added to attributes that come from standards. 'unsupported' -> A boolean with value true, indicating this property is not yet supported. Should only be used for standard attributes. 'notes' -> A string with notes explaining something about this attribute. * bindings/scripts/IDLParser.pm: Pass and store the processed extended attribute map to the parser, and use it validate that extended attributes being added to things are appropriate for the context. Fix FIXME in isExtendedAttributeApplicableToTypes by using the map to implement the predicate, rather than hard coding the list. * bindings/scripts/generate-bindings.pl: (generateEmptyHeaderAndCpp): (loadIDLAttributes): Deleted. (checkIDLAttributes): Deleted. (checkIfIDLAttributesExists): Deleted. Make specifying an IDL attributes file required. Switch to processing it as a JSON file, and having the parser validate attributes. * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestTypedefs.cpp: * bindings/scripts/test/TestImplements.idl: * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestSupplemental.idl: * bindings/scripts/test/TestTypedefs.idl: - Remove use of Immutable extended attribute in the tests, as it does nothing. - Remove use of the made up ReadOnly attribute, as the tests now use the IDLAttributes file to validate that the attributes are supported, so this would otherwise fail. * css/WebKitCSSMatrix.idl: * svg/SVGZoomEvent.idl: - Remove use of the Immutable extended attribute, as it does nothing. * page/NavigatorID.idl: * page/NavigatorLanguage.idl: - Remove use of the Nondeterministic extended attribute, as it does nothing. * Modules/mediasource/SourceBufferList.idl: Remove use of CallWith on the interface. It is illegal, and does nothing. * animation/KeyframeEffect.idl: * animation/WebAnimation.idl: Remove use of [Default=Undefined]. This construct does nothing and now correctly fails to parse. 2017-04-15 Alex Christensen Fix Windows build after r215396. https://bugs.webkit.org/show_bug.cgi?id=170828 * platform/graphics/win/FontPlatformDataWin.cpp: (WebCore::FontPlatformData::openTypeTable): 2017-04-15 Alex Christensen Remove unused SharedBuffer constructor https://bugs.webkit.org/show_bug.cgi?id=170828 Reviewed by Brady Eidson. * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::append): * platform/SharedBuffer.h: (WebCore::SharedBuffer::create): * platform/graphics/freetype/FontPlatformDataFreeType.cpp: (WebCore::FontPlatformData::openTypeTable): * platform/graphics/win/FontPlatformDataWin.cpp: (WebCore::FontPlatformData::openTypeTable): 2017-04-15 Commit Queue Unreviewed, rolling out r215393. https://bugs.webkit.org/show_bug.cgi?id=170876 breaks scrollable iframes on ios (Requested by anttik on #webkit). Reverted changeset: "GraphicsLayerCA::recursiveCommitChanges should not descend into subtrees without changes" https://bugs.webkit.org/show_bug.cgi?id=170851 http://trac.webkit.org/changeset/215393 2017-04-14 Antti Koivisto GraphicsLayerCA::recursiveCommitChanges should not descend into subtrees without changes https://bugs.webkit.org/show_bug.cgi?id=170851 Reviewed by Simon Fraser. With lots of layers this can be very slow as it always traverses the entire layer tree. For example GIF animations on tumblr.com trigger expensive commits where almost nothing changes. This patch adds m_hasDescendantsWithUncommittedChanges bit to GraphicsLayerCA. With this we can avoid descending to branches without changes when committing. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): Do all setting of m_uncommittedChanges bits via addUncommittedChanges function. (WebCore::GraphicsLayerCA::recursiveCommitChanges): Bail out if neither the current layer nor any of its descendants have any uncommited changes and none of the ancestors had changes. (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): (WebCore::GraphicsLayerCA::ensureStructuralLayer): (WebCore::GraphicsLayerCA::changeLayerTypeTo): (WebCore::GraphicsLayerCA::addUncommittedChanges): Set m_hasDescendantsWithUncommittedChanges bit in ancestors when mutating m_uncommittedChanges. (WebCore::GraphicsLayerCA::noteLayerPropertyChanged): * platform/graphics/ca/GraphicsLayerCA.h: (WebCore::RenderLayerCompositor::frameViewDidScroll): Tell the scrolling layer that it needs to recompute coverage. This also schedules a layer flush so no need to do that separately. 2017-04-15 Wenson Hsieh [WK2] Support data interaction of files into file inputs https://bugs.webkit.org/show_bug.cgi?id=170803 Reviewed by Tim Horton. Adds remaining support to allow data interaction of files onto inputs of type file. See per-change annotations for more details. Unit tests to be added in the next patch. * platform/PasteboardStrategy.h: * platform/PlatformPasteboard.h: * platform/ios/AbstractPasteboard.h: * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::numberOfFiles): * platform/ios/WebItemProviderPasteboard.mm: Implements numberOfFiles by counting the number of item providers that may be represented as a file, which includes all item providers that contain at least one content UTI type. (-[WebItemProviderPasteboard numberOfFiles]): Adds boilerplate plumbing to fetch the number of files available on the pasteboard. On Mac, logic that previously existed in DragData::numberOfFiles to query the number of files available in the pasteboard is now on PlatformPasteboard instead, which both makes the implementation of DragData::numberOfFiles platform-invariant, and also saves us one synchronous IPC call to the UI process in the WebKit2 implementation. * platform/mac/DragDataMac.mm: (WebCore::DragData::containsFiles): (WebCore::DragData::numberOfFiles): (WebCore::DragData::asFilenames): Add support for recognizing objects in the pasteboard that may be represented by files, and therefore may be uploaded via file input. Following suit with behavior elsewhere on the platform, we consider item providers able to be represented by a file if they contain at least one content UTI type. * platform/mac/PlatformPasteboardMac.mm: Logic previously in DragData::numberOfFiles to get and then count all file path names in the pasteboard has been moved here instead, and no longer needs to go through the pasteboard proxy. (WebCore::PlatformPasteboard::numberOfFiles): 2017-04-15 Wenson Hsieh Unreviewed, fix the build after r215389 Use WebCore::createTemporaryDirectory instead of -_webkit_createTemporaryDirectoryWithTemplatePrefix:. * platform/ios/WebItemProviderPasteboard.mm: (temporaryFileURLForDataInteractionContent): 2017-04-14 Wenson Hsieh Implement a way in WebItemProviderPasteboard to perform actions after file loading completes https://bugs.webkit.org/show_bug.cgi?id=170839 Reviewed by Tim Horton, Andy Estes, and Dan Bernstein. Introduces -[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:], which performs an action after all item providers which are able to provide content are done loading their content into temporary file URLs. If no item providers have available data, we will immediately invoke the action with an empty URL array. For each item provider with data, we save the local URL returned in the load completion block to a randomly generated path in the container's temporary directory. When all files are finished loading, we then invoke the action with all file URLs that successfully loaded. No new tests, since there is no change in behavior. * platform/ios/WebItemProviderPasteboard.h: * platform/ios/WebItemProviderPasteboard.mm: (temporaryFileURLForDataInteractionContent): (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]): 2017-04-14 Nikita Vasilyev Web Inspector: WebSockets: messages with non-latin letters are displayed incorrectly https://bugs.webkit.org/show_bug.cgi?id=170760 Reviewed by Joseph Pecoraro. Add payloadLength property, which is used to display size. When payloadLength is unavailable, it is calculated from payloadData by Web Inspector frontend. This fixes Web Inspector: WebSockets: Transferred size is incorrect. Tests: http/tests/websocket/tests/hybi/inspector/binary.html http/tests/websocket/tests/hybi/inspector/send-and-receive.html * inspector/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::didReceiveWebSocketFrame): (WebCore::InspectorNetworkAgent::didSendWebSocketFrame): 2017-04-14 Mark Lam Update architectures in xcconfig files. https://bugs.webkit.org/show_bug.cgi?id=170867 Reviewed by Joseph Pecoraro. No new tests needed. Only updating xcconfig files. * Configurations/Base.xcconfig: * Configurations/FeatureDefines.xcconfig: 2017-04-14 Wenson Hsieh [WK2] Support Icon creation from file URLs on iOS https://bugs.webkit.org/show_bug.cgi?id=170809 Reviewed by Tim Horton. Minor tweaks and refactoring to support displaying a WebCore::Icon from a list of filepaths on iOS. Please see below annotations for more details. No new tests yet, as behavior on Mac should not have changed, and behavior on iOS will not change until later patches land. Tests will be added in a later patch. Most of the changes here remove platform special-casing in FileInputType for iOS and Mac, refactoring the code such that it works for both platforms while preserving behavior. * html/FileInputType.cpp: (WebCore::FileInputType::~FileInputType): (WebCore::FileInputType::setFiles): (WebCore::FileInputType::filesChosen): * html/FileInputType.h: Un-guard m_fileIconLoader on iOS, and un-guard m_displayString for Mac. Consolidate logic in both version of filesChosen and remove the iOS-specific version. Behavior when passing in an empty display string and null Icon will be the same as that of the existing filesChosen method on Mac. Also, introduce a version of setFiles that takes an additional RequestIcon enum that indicates whether or not to additionally use the new filepaths to request an Icon update. filesChosen invokes this with RequestIcon::No if a non-null Icon was specified, as is the case when uploading a file via the image picker on iOS. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::displayString): * html/HTMLInputElement.h: * html/InputType.cpp: * html/InputType.h: * loader/EmptyClients.h: * page/ChromeClient.h: Introduce ChromeClient::createIconForFiles, which generates an icon representing the content at a list of file paths. See WebKit and WebKit2 ChangeLogs for more details. * platform/FileChooser.h: (WebCore::FileChooserClient::filesChosen): * rendering/RenderFileUploadControl.cpp: (WebCore::RenderFileUploadControl::fileTextValue): Remove platform special-casing when generating the text to display when uploading a file. If a displayString is specified, then we use the contents of the displayString; otherwise, fall back to using the input element's FileList to compute the display string. 2017-04-14 Brady Eidson Fix basic WKURLSchemeHandler bugs. and https://bugs.webkit.org/show_bug.cgi?id=170862 Reviewed by Andy Estes. Covered by new API tests. * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::didReceiveDataOrBuffer): 2017-04-14 Jiewen Tan [WebCrypto] Support HKDF https://bugs.webkit.org/show_bug.cgi?id=170636 Reviewed by Brent Fulgham. This patch implements HKDF according to the spec: https://www.w3.org/TR/WebCryptoAPI/#hkdf. Supported operations include deriveKey, deriveBits, importKey and getKeyLength. Tests: crypto/subtle/ecdh-import-key-derive-hkdf-key.html crypto/subtle/hkdf-derive-bits-malformed-parametrs.html crypto/subtle/hkdf-import-key-derive-bits.html crypto/subtle/hkdf-import-key-derive-hmac-key.html crypto/subtle/hkdf-import-key-malformed-parameters.html crypto/subtle/hkdf-import-key.html crypto/workers/subtle/hkdf-import-key-derive-bits.html crypto/workers/subtle/hkdf-import-key-derive-hmac-key.html crypto/workers/subtle/hkdf-import-key.html * CMakeLists.txt: * DerivedSources.make: * PlatformGTK.cmake: * PlatformMac.cmake: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCryptoAlgorithmDictionary.cpp: (WebCore::JSCryptoAlgorithmDictionary::createParametersForEncrypt): (WebCore::JSCryptoAlgorithmDictionary::createParametersForDecrypt): (WebCore::JSCryptoAlgorithmDictionary::createParametersForSign): (WebCore::JSCryptoAlgorithmDictionary::createParametersForVerify): (WebCore::JSCryptoAlgorithmDictionary::createParametersForDigest): (WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey): (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveKey): (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveBits): (WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey): (WebCore::JSCryptoAlgorithmDictionary::createParametersForExportKey): Rename HKDF_CTR to HKDF. * bindings/js/JSSubtleCryptoCustom.cpp: (WebCore::normalizeCryptoAlgorithmParameters): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::write): (WebCore::CloneDeserializer::read): Rename HKDF_CTR to HKDF. * crypto/CommonCryptoUtilities.h: * crypto/CryptoAlgorithmIdentifier.h: * crypto/CryptoAlgorithmParameters.h: * crypto/algorithms/CryptoAlgorithmHKDF.cpp: Added. (WebCore::CryptoAlgorithmHKDF::create): (WebCore::CryptoAlgorithmHKDF::identifier): (WebCore::CryptoAlgorithmHKDF::deriveBits): (WebCore::CryptoAlgorithmHKDF::importKey): (WebCore::CryptoAlgorithmHKDF::getKeyLength): * crypto/algorithms/CryptoAlgorithmHKDF.h: Added. * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp: Added. (WebCore::CryptoAlgorithmHKDF::platformDeriveBits): * crypto/mac/CryptoAlgorithmHKDFMac.cpp: Added. (WebCore::CryptoAlgorithmHKDF::platformDeriveBits): * crypto/mac/CryptoAlgorithmRegistryMac.cpp: (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): * crypto/parameters/CryptoAlgorithmHkdfParams.h: Added. * crypto/parameters/HkdfParams.idl: Added. 2017-04-14 Zalan Bujtas text-align start / end failure in table cells https://bugs.webkit.org/show_bug.cgi?id=141417 Reviewed by Antti Koivisto. Apply "text-align: center" on th elements when parent's computed value for the 'text-align' property is its initial value, unless it is explicitly set. Test: fast/table/center-th-when-parent-has-initial-text-align.html * css/CSSProperties.json: * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialTextAlign): (WebCore::StyleBuilderCustom::applyValueTextAlign): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): (WebCore::StyleResolver::applyProperty): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::hasExplicitlySetTextAlign): (WebCore::RenderStyle::setHasExplicitlySetTextAlign): (WebCore::RenderStyle::NonInheritedFlags::hasExplicitlySetTextAlign): (WebCore::RenderStyle::NonInheritedFlags::setHasExplicitlySetTextAlign): 2017-04-14 Andy Estes [ios-simulator] API test WebKit2.DataDetectionReferenceDate timing out https://bugs.webkit.org/show_bug.cgi?id=161967 Reviewed by Alexey Proskuryakov. DataDetectorsCoreSPI.h defined DDQueryOffset as a struct of two CFIndexes, which is 16 bytes on LP64, but the struct is actually defined as two CFIndex-typed 32-bit bitfields, which is 8 bytes on LP64. This breaks the ABI on Public SDK builds when calling functions that take or return DDQueryOffsets. * platform/spi/cocoa/DataDetectorsCoreSPI.h: Updated the DDQueryOffset definition for Public SDK builds, and added a static_assert to detect future size changes at compile time. 2017-04-14 Konstantin Tokarev Removed unused and unimplemented methods from MediaPlayer https://bugs.webkit.org/show_bug.cgi?id=170848 Reviewed by Jer Noble. No new tests needed. * platform/graphics/MediaPlayer.h: 2017-04-14 Myles C. Maxfield Add performance test for asking the platform for a font for U+2060 WORD JOINER https://bugs.webkit.org/show_bug.cgi?id=170842 Reviewed by Tim Horton. No new tests because there is no behavior change. * platform/graphics/WidthCache.h: (WebCore::WidthCache::add): (WebCore::WidthCache::addSlowCase): 2017-04-14 Ryan Haddad Unreviewed, rolling out r215350. This change broke the Windows build. Reverted changeset: "Remove unused SharedBuffer constructor" https://bugs.webkit.org/show_bug.cgi?id=170828 http://trac.webkit.org/changeset/215350 2017-04-14 Jer Noble [MediaSource] Push capabilities across process boundary during UIProcess capture. https://bugs.webkit.org/show_bug.cgi?id=170814 Reviewed by Eric Carlson. There's no real reason for RealtimeMediaSourceCapabilities to be RefCounted nor to keep them from being created on the stack. So in addition to making that class coder-compliant, change all the classes that vend capabilities to use a unique_ptr<> instead of a RefPtr<>. * Modules/mediastream/CanvasCaptureMediaStreamTrack.h: * Modules/webaudio/MediaStreamAudioSource.cpp: (WebCore::MediaStreamAudioSource::capabilities): * Modules/webaudio/MediaStreamAudioSource.h: * platform/mediastream/MediaEndpoint.cpp: * platform/mediastream/MediaStreamTrackPrivate.cpp: (WebCore::MediaStreamTrackPrivate::capabilities): * platform/mediastream/MediaStreamTrackPrivate.h: * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeMediaSourceCapabilities.h: (WebCore::CapabilityValueOrRange::encode): (WebCore::CapabilityValueOrRange::decode): (WebCore::RealtimeMediaSourceCapabilities::RealtimeMediaSourceCapabilities): (WebCore::RealtimeMediaSourceCapabilities::supportedConstraints): (WebCore::RealtimeMediaSourceCapabilities::setSupportedConstraints): (WebCore::RealtimeMediaSourceCapabilities::encode): (WebCore::RealtimeMediaSourceCapabilities::decode): (WebCore::RealtimeMediaSourceCapabilities::create): Deleted. * platform/mediastream/RealtimeMediaSourceSettings.h: * platform/mediastream/mac/AVMediaCaptureSource.h: * platform/mediastream/mac/AVMediaCaptureSource.mm: (WebCore::AVMediaCaptureSource::initializeCapabilities): (WebCore::AVMediaCaptureSource::capabilities): * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::capabilities): * platform/mediastream/mac/CoreAudioCaptureSource.h: * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp: (WebCore::RealtimeIncomingAudioSource::capabilities): * platform/mediastream/mac/RealtimeIncomingAudioSource.h: * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp: (WebCore::RealtimeIncomingVideoSource::capabilities): * platform/mediastream/mac/RealtimeIncomingVideoSource.h: * platform/mock/MockRealtimeMediaSource.cpp: (WebCore::MockRealtimeMediaSource::initializeCapabilities): (WebCore::MockRealtimeMediaSource::capabilities): * platform/mock/MockRealtimeMediaSource.h: * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h: 2017-04-13 Saam Barati WebAssembly: We should be able to postMessage a JSWebAssemblyModule https://bugs.webkit.org/show_bug.cgi?id=170573 Reviewed by Filip Pizlo. This patch's main purpose is to implement postMessage of JSWebAssemblyModule. The spec text describing the behavior is: https://github.com/WebAssembly/design/blob/master/JS.md#structured-clone-of-a-webassemblymodule We only allow for JSWebAssemblyModule to be serialized in the postMessage context. More work needs to be done to make it valid to store a module in IndexDB. All that is needed to serialize a JSWebAssemblyModule is grab a Ref to its underlying Wasm::Module. So, when doing a postMessage, all we do is grab this Ref, and then re-create the JSWebAssemblyModule from the Wasm::Module in the new VM/global object. Because the code for Wasm::Module is VM-independent, this is all that's needed. This turned out nicely, because it requires little knowledge from WebCore about what it means to clone a JSWebAssemblyModule. The second significant part of this patch is teaching WorkerRunLoop about the various timers inside JSC. Before, the WorkerRunLoop wouldn't always wake up to address JSC timers. I noticed this bug when I was writing tests to make sure that Wasm was running concurrently in different workers. The bug is that the WorkerRunLoop's message queue has no insight into a timer being scheduled. This effected the PromiseDeferredTimer that Wasm uses, as well as the various GC timers that Heap uses. Now, WorkerRunLoop will set itself up to be notified when timers are set. When a timer is set, the WorkerRunLoop will perform an iteration to to reset its top level MessageQueue timeout to be no longer than the next timer fire date. Tests: storage/indexeddb/wasm-exceptions.html workers/wasm-hashset-many.html workers/wasm-hashset.html workers/wasm-long-compile-many.html workers/wasm-long-compile.html * ForwardingHeaders/heap/GCActivityCallback.h: Added. * ForwardingHeaders/runtime/JSRunLoopTimer.h: Added. * ForwardingHeaders/runtime/PromiseDeferredTimer.h: Added. * ForwardingHeaders/wasm: Added. * ForwardingHeaders/wasm/js: Added. * ForwardingHeaders/wasm/js/JSWebAssemblyModule.h: Added. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::serialize): (WebCore::CloneSerializer::CloneSerializer): (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::CloneDeserializer::deserialize): (WebCore::CloneDeserializer::CloneDeserializer): (WebCore::CloneDeserializer::readTerminal): (WebCore::SerializedScriptValue::SerializedScriptValue): (WebCore::SerializedScriptValue::create): (WebCore::SerializedScriptValue::deserialize): * bindings/js/SerializedScriptValue.h: * bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::addTimerSetNotification): (WebCore::WorkerScriptController::removeTimerSetNotification): * bindings/js/WorkerScriptController.h: * workers/WorkerRunLoop.cpp: (WebCore::WorkerRunLoop::runInMode): 2017-04-13 Dean Jackson Large negative animation-delays may not work depending on machine uptime https://bugs.webkit.org/show_bug.cgi?id=166962 Reviewed by Tim Horton. If you set a really negative animation delay, it would cause AnimationBase::m_startTime to become negative, because the delay value was "bigger" than monotonicallyIncreasingTime. However, the state machine was using -1 to mean that the start time hadn't yet been set. Classic cmarrin! Replace all the special values with std::optional, and use nullopt to mean the value doesn't exist yet. Test: animations/large-negative-delay.html * page/animation/AnimationBase.cpp: (WebCore::AnimationBase::updateStateMachine): (WebCore::AnimationBase::fireAnimationEventsIfNeeded): (WebCore::AnimationBase::getTimeToNextEvent): (WebCore::AnimationBase::freezeAtTime): (WebCore::AnimationBase::getElapsedTime): * page/animation/AnimationBase.h: Use std::optional. (WebCore::AnimationBase::paused): 2017-04-13 Alex Christensen Remove unused SharedBuffer constructor https://bugs.webkit.org/show_bug.cgi?id=170828 Reviewed by Brady Eidson. * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::append): * platform/SharedBuffer.h: (WebCore::SharedBuffer::create): 2017-04-13 Antti Koivisto Don't invalidate composition for style changes in non-composited layers https://bugs.webkit.org/show_bug.cgi?id=170805 Reviewed by Simon Fraser. Test: compositing/updates/animation-non-composited.html In most cases they can't affect composition. Composition updates are expensive, this can save a lot of work (tumblr.com animations hit this at the moment). * rendering/RenderElement.h: (WebCore::RenderElement::createsGroup): (WebCore::RenderElement::createsGroupForStyle): Factor to a static function so we can test style directly. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::layerStyleChanged): (WebCore::RenderLayerCompositor::styleChangeMayAffectIndirectCompositingReasons): Test if style change might cause compositing change that can't be determined without compositing update. * rendering/RenderLayerCompositor.h: 2017-04-13 JF Bastien WebAssembly: manage memory better https://bugs.webkit.org/show_bug.cgi?id=170628 Reviewed by Keith Miller, Michael Saboff. Re-use a VM tag which was intended for JavaScript core, was then used by our GC, and is now unused. If I don't do this then WebAssembly fast memories will make vmmap look super weird because it'll look like multi-gigabyte of virtual memory are allocated as part of our process' regular memory! Separately I need to update vmmap and other tools to print the right name. Right now this tag gets identified as "JS garbage collector". * page/ResourceUsageData.cpp: (WebCore::ResourceUsageData::ResourceUsageData): * page/ResourceUsageData.h: * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::HistoricResourceUsageData::HistoricResourceUsageData): * page/cocoa/ResourceUsageThreadCocoa.mm: (WebCore::displayNameForVMTag): (WebCore::categoryForVMTag): 2017-04-13 Ryosuke Niwa Update the comments for the number of bits in RenderStyle::InheritedFlags. Rubber-stamped by Zalan Bujtas * rendering/style/RenderStyle.h: 2017-04-13 Myles C. Maxfield Addressing post-review comment after r215314. https://bugs.webkit.org/show_bug.cgi?id=169015 Reviewed by Alexey Proskuryakov. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::fontForPostScriptName): 2017-04-13 Sam Weinig [WebIDL] Add support for extended attributes on types in WebIDL https://bugs.webkit.org/show_bug.cgi?id=170759 Reviewed by Alex Christensen. - Update parsing for WebIDL grammar changes. - Adds an extended attributes hash to IDLType that is filled according to the WebIDL annotated type rules. - Updates code generation to take advantage of IDLType's extended attribute simplifying some existing code. - Update IDLs in the project to adhere to the new grammar. * Modules/indexeddb/IDBFactory.idl: * Modules/indexeddb/IDBIndex.idl: * Modules/indexeddb/IDBKeyRange.idl: * Modules/indexeddb/IDBObjectStore.idl: * Modules/websockets/WebSocket.idl: * crypto/parameters/AesCtrParams.idl: * crypto/parameters/AesKeyParams.idl: * crypto/parameters/Pbkdf2Params.idl: * crypto/parameters/RsaKeyGenParams.idl: * testing/TypeConversions.idl: Update for grammar change. * bindings/scripts/CodeGeneratorJS.pm: (GenerateDefaultValue): (GetBaseIDLType): (GetIDLType): (GetIntegerConversionConfiguration): (GetStringConversionConfiguration): (JSValueToNative): (UnsafeToNative): (NativeToJSValueDOMConvertNeedsState): (NativeToJSValueDOMConvertNeedsGlobalObject): (NativeToJSValue): Remove the need for the type's context in many places since type associated extended attributes are now on the type itself. * bindings/scripts/IDLParser.pm: (copyExtendedAttributes): Move up so it can be reused. (isExtendedAttributeApplicableToTypes): Add temporary predicated to indicate which attributes should be moved to types. This logic should be moved to IDLAttributes.txt. (moveExtendedAttributesApplicableToTypes): Add helper to move attributes to the type's extended attributes hash if applicable. (makeSimpleType): Use initializer syntax to simplify. (cloneType): Support cloning types with extended attributes. (typeByApplyingTypedefs): When constructing the clone for a typedef application, move any applicable attributes to the clone from the original type. (parseDictionaryMember): (parseTypedef): (parseAttributeOrOperationRest): (parseAttributeRest): (parseOperationOrIterator): (parseSpecialOperation): (parseOptionalIterableInterface): (parseMapLikeProperties): (parseOptionalOrRequiredArgument): (parseType): (parseTypeWithExtendedAttributes): (parseUnionMemberType): (parseNonAnyType): Update for new grammar, moving applicable attributes eagerly. (assertNoExtendedAttributesInTypedef): Deleted. * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::jsTestObjPrototypeFunctionClassMethodWithClampOnOptional): (WebCore::jsTestObjPrototypeFunctionClassMethodWithClampOnOptionalCaller): (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRangeOnOptional): (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRangeOnOptionalCaller): * bindings/scripts/test/JS/JSTestTypedefs.cpp: (WebCore::jsTestTypedefsAttributeWithClamp): (WebCore::jsTestTypedefsAttributeWithClampGetter): (WebCore::jsTestTypedefsAttributeWithClampInTypedef): (WebCore::jsTestTypedefsAttributeWithClampInTypedefGetter): (WebCore::setJSTestTypedefsAttributeWithClamp): (WebCore::setJSTestTypedefsAttributeWithClampFunction): (WebCore::setJSTestTypedefsAttributeWithClampInTypedef): (WebCore::setJSTestTypedefsAttributeWithClampInTypedefFunction): (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampInTypedef): (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampInTypedefCaller): * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestTypedefs.idl: Update for new grammar. Add some new tests for uncovered cases. 2017-04-13 Alex Christensen Fix CMake build https://bugs.webkit.org/show_bug.cgi?id=170815 Reviewed by Beth Dakin. * platform/spi/cocoa/AVKitSPI.h: 2017-04-13 JF Bastien cmake build fix Unreviewed build fix. A file was removed but left in the cmake build. * PlatformMac.cmake: 2017-04-13 Youenn Fablet Remove RTCSignalingState::Closed https://bugs.webkit.org/show_bug.cgi?id=170811 Reviewed by Eric Carlson. Covered by existing and rebased tests. Adding RTCPeerConnection::isClosed to better match the isClosed internal slot in webrtc specification. Using isClosed instead of checking signalingState value. Implementing isClosed in terms of m_connectionState which has a Closed value. * Modules/mediastream/MediaEndpointPeerConnection.cpp: (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask): (WebCore::MediaEndpointPeerConnection::replaceTrackTask): * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::createOffer): (WebCore::PeerConnectionBackend::createOfferSucceeded): (WebCore::PeerConnectionBackend::createOfferFailed): (WebCore::PeerConnectionBackend::createAnswer): (WebCore::PeerConnectionBackend::createAnswerSucceeded): (WebCore::PeerConnectionBackend::createAnswerFailed): (WebCore::PeerConnectionBackend::setLocalDescription): (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded): (WebCore::PeerConnectionBackend::setLocalDescriptionFailed): (WebCore::PeerConnectionBackend::setRemoteDescription): (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded): (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed): (WebCore::PeerConnectionBackend::addIceCandidate): (WebCore::PeerConnectionBackend::addIceCandidateSucceeded): (WebCore::PeerConnectionBackend::addIceCandidateFailed): * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::create): (WebCore::RTCPeerConnection::RTCPeerConnection): (WebCore::RTCPeerConnection::addTrack): (WebCore::RTCPeerConnection::removeTrack): (WebCore::RTCPeerConnection::queuedCreateOffer): (WebCore::RTCPeerConnection::queuedCreateAnswer): (WebCore::RTCPeerConnection::queuedSetLocalDescription): (WebCore::RTCPeerConnection::queuedSetRemoteDescription): (WebCore::RTCPeerConnection::queuedAddIceCandidate): (WebCore::RTCPeerConnection::setConfiguration): (WebCore::RTCPeerConnection::createDataChannel): (WebCore::RTCPeerConnection::doClose): (WebCore::RTCPeerConnection::updateIceGatheringState): (WebCore::RTCPeerConnection::updateIceConnectionState): (WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent): * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::signalingState): * platform/mediastream/RTCSignalingState.h: 2017-04-13 Zalan Bujtas BreakingContext::WordTrailingSpace cleanup. https://bugs.webkit.org/show_bug.cgi?id=170750 Reviewed by Myles C. Maxfield. No change in functionality. * rendering/RenderText.cpp: (WebCore::RenderText::computePreferredLogicalWidths): * rendering/line/BreakingContext.h: (WebCore::WordTrailingSpace::WordTrailingSpace): (WebCore::WordTrailingSpace::width): (WebCore::BreakingContext::handleText): 2017-04-13 Romain Bellessort [Readable Streams API] Implement cloneArrayBuffer in WebCore https://bugs.webkit.org/show_bug.cgi?id=170008 Reviewed by Youenn Fablet. Implemented cloneArrayBuffer based on existing structuredCloneArrayBuffer implementation. The code has been factorized so that both cloneArrayBuffer and structuredCloneArrayBuffer rely on the same code (which is basically the previous implementation of structuredCloneArrayBuffer + the ability to clone only a part of considered buffer). Test: streams/clone-array-buffer.html * Modules/streams/ReadableByteStreamInternals.js: Deleted cloneArrayBuffer JS implementation. * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::addBuiltinGlobals): Add cloneArrayBuffer private declaration. * bindings/js/StructuredClone.cpp: (WebCore::cloneArrayBufferImpl): Added (mostly based on previous structuredCloneArrayBuffer). (WebCore::cloneArrayBuffer): Added. (WebCore::structuredCloneArrayBuffer): Updated. * bindings/js/StructuredClone.h: Added cloneArrayBuffer declaration. * bindings/js/WebCoreBuiltinNames.h: Added cloneArrayBuffer declaration. * testing/Internals.cpp: Added support for testing cloneArrayBuffer. * testing/Internals.h: Added support for testing cloneArrayBuffer. * testing/Internals.idl: Added support for testing cloneArrayBuffer. 2017-04-13 Youenn Fablet onnegotiationneeded should only be called once https://bugs.webkit.org/show_bug.cgi?id=170785 Reviewed by Alex Christensen. Covered by updated test. Disabling explicit call to markAsNeedingNegotiation in case libwebrtc is used as libwebrtc is calling it. Making sure removeTrack gets notified up to libwebrtc. * Modules/mediastream/PeerConnectionBackend.h: (WebCore::PeerConnectionBackend::notifyRemovedTrack): * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::addTrack): (WebCore::RTCPeerConnection::removeTrack): (WebCore::RTCPeerConnection::completeAddTransceiver): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::removeTrack): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::notifyRemovedTrack): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: 2017-04-13 Dave Hyatt Rendering flexbox children across columns https://bugs.webkit.org/show_bug.cgi?id=164166 Reviewed by Zalan Bujtas. Added fast/multicol/flexbox-rows.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::adjustForUnsplittableChild): 2017-04-12 Alex Christensen Clean up SharedBuffer public functions https://bugs.webkit.org/show_bug.cgi?id=170795 Reviewed by Andreas Kling. Make some member functions that are now only used internally private. * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::append): (WebCore::SharedBuffer::platformDataSize): Deleted. * platform/SharedBuffer.h: 2017-04-12 Dan Bernstein [Mac] Future-proof .xcconfig files https://bugs.webkit.org/show_bug.cgi?id=170802 Reviewed by Tim Horton. * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/FeatureDefines.xcconfig: * Configurations/Version.xcconfig: 2017-04-12 Brady Eidson QuotaExceededError when saving to localStorage in private mode. https://bugs.webkit.org/show_bug.cgi?id=157010 Reviewed by Alex Christensen. No new tests (Covered by changes to existing test). LocalStorage in private browsing is now effectively SessionStorage. It's ephemeral, per-tab, and copied over to tabs window.open()'ed from the current. * loader/EmptyClients.cpp: (WebCore::EmptyStorageNamespaceProvider::createEphemeralLocalStorageNamespace): * page/Chrome.cpp: (WebCore::Chrome::createWindow): * page/Page.cpp: (WebCore::Page::ephemeralLocalStorage): (WebCore::Page::setEphemeralLocalStorage): * page/Page.h: * page/SecurityOriginData.h: * storage/Storage.cpp: (WebCore::Storage::length): (WebCore::Storage::key): (WebCore::Storage::getItem): (WebCore::Storage::setItem): (WebCore::Storage::removeItem): (WebCore::Storage::clear): (WebCore::Storage::contains): (WebCore::Storage::isDisabledByPrivateBrowsing): Deleted. * storage/StorageMap.h: * storage/StorageNamespaceProvider.cpp: (WebCore::StorageNamespaceProvider::localStorageArea): * storage/StorageNamespaceProvider.h: * storage/StorageType.h: (WebCore::isLocalStorage): (WebCore::isPersistentLocalStorage): 2017-04-12 Myles C. Maxfield [Cocoa] Suppress font download dialog in new matching algorithm https://bugs.webkit.org/show_bug.cgi?id=169015 Reviewed by Alexey Proskuryakov. Not testable. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::lookupPostScriptName): 2017-04-12 Eric Carlson REGRESSION (r215242-215243): [ios-simulator] API test WebKit1.AudioSessionCategoryIOS is failing https://bugs.webkit.org/show_bug.cgi?id=170777 Reviewed by Jer Noble. No new tests, fixes an existing test. * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: (PlatformMediaSessionManager::updateSessionState): Pass parameters to lambda by reference. 2017-04-12 Eric Carlson [MediaStream] Set correct audio session category when capturing audio https://bugs.webkit.org/show_bug.cgi?id=170736 Unreviewed, update an assertion I missed in r215242. * platform/audio/PlatformMediaSession.cpp: (WebCore::PlatformMediaSession::PlatformMediaSession): 2017-04-12 Alex Christensen Remove unused SharedBuffer::wrapCFDataArray https://bugs.webkit.org/show_bug.cgi?id=170794 Reviewed by Brady Eidson. It's unused since r215280. * platform/SharedBuffer.h: * platform/cf/SharedBufferCF.cpp: (WebCore::SharedBuffer::wrapCFDataArray): Deleted. 2017-04-12 Anders Carlsson Tweak WebCore::setMetadataURL function https://bugs.webkit.org/show_bug.cgi?id=170786 Reviewed by Beth Dakin. Get rid of the "referrer" parameter, it isn't used. Make the remaining parameters const. Swap the urlString and path parameters since that makes more sense. Use String instead of NSString in the call to WKSetMetadataURL. * platform/FileSystem.cpp: (WebCore::setMetadataURL): Deleted. * platform/FileSystem.h: * platform/mac/FileSystemMac.mm: (WebCore::setMetadataURL): 2017-04-12 Myles C. Maxfield Well-known variations should clamp to the values listed in the @font-face block https://bugs.webkit.org/show_bug.cgi?id=169260 Reviewed by Dean Jackson. Most of this patch is plumbing the variation ranges from the CSSFontFace object to preparePlatformFont() where variation values get applied. Beyond that, there is one other piece of this patch - a nonspecified value in an @font-face block shouldn't perform any clamping, but a specified value should be clamped. This means that we need to retain whether or not a value is specified. This patch does this by migrating CSSFontFace from using FontSelectionCapabilities to using FontSelectionSpecifiedCapabilities, which has its internals behind std::optionals which represent whether or not the value was specified. For the purposes of font selection, these unspecified values are replaced with default values. Test: fast/text/variations/font-face-clamp.html * css/CSSFontFace.cpp: (WebCore::CSSFontFace::font): * css/CSSFontFace.h: * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::font): * css/CSSFontFaceSource.h: * css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::addFontFaceRule): * loader/cache/CachedFont.cpp: (WebCore::CachedFont::createFont): (WebCore::CachedFont::platformDataFromCustomData): * loader/cache/CachedFont.h: * loader/cache/CachedSVGFont.cpp: (WebCore::CachedSVGFont::createFont): (WebCore::CachedSVGFont::platformDataFromCustomData): * loader/cache/CachedSVGFont.h: * platform/graphics/FontCache.cpp: (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey): (WebCore::FontPlatformDataCacheKey::operator==): (WebCore::FontPlatformDataCacheKeyHash::hash): (WebCore::FontCache::getCachedFontPlatformData): (WebCore::FontCache::fontForFamily): * platform/graphics/FontCache.h: (WebCore::FontCache::fontForFamily): (WebCore::FontCache::getCachedFontPlatformData): (WebCore::FontCache::createFontPlatformDataForTesting): * platform/graphics/FontSelectionAlgorithm.h: (WebCore::FontSelectionRange::uniqueValue): (WebCore::FontSelectionCapabilities::operator==): (WebCore::FontSelectionCapabilities::operator!=): (WebCore::FontSelectionSpecifiedCapabilities::computeFontSelectionCapabilities): (WebCore::FontSelectionSpecifiedCapabilities::operator==): (WebCore::FontSelectionSpecifiedCapabilities::operator!=): (WebCore::FontSelectionSpecifiedCapabilities::operator=): (WebCore::FontSelectionSpecifiedCapabilities::computeWeight): (WebCore::FontSelectionSpecifiedCapabilities::computeWidth): (WebCore::FontSelectionSpecifiedCapabilities::computeSlope): * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::preparePlatformFont): (WebCore::fontWithFamily): (WebCore::FontCache::createFontPlatformData): (WebCore::FontCache::systemFallbackForCharacters): * platform/graphics/mac/FontCacheMac.mm: (WebCore::FontCache::lastResortFallbackFont): * platform/graphics/mac/FontCustomPlatformData.cpp: (WebCore::FontCustomPlatformData::fontPlatformData): * platform/graphics/mac/FontCustomPlatformData.h: 2017-04-12 Beth Dakin Speculative open source build fix. * platform/spi/cocoa/AVKitSPI.h: 2017-04-12 Alex Christensen Stop using didReceiveDataArray callback on El Capitan https://bugs.webkit.org/show_bug.cgi?id=170780 Reviewed by Brady Eidson. didReceiveDataArray was an optimization that improved performance on iOS but is not needed any more. The only platform where this is used is El Capitan, and didReceiveData works fine on that platform. I've left some cleanup still to be done in SharedBuffer, and doing that is the motivation for this change. * WebCore.xcodeproj/project.pbxproj: * loader/ResourceLoader.h: * loader/SubresourceLoader.h: * loader/cf/SubresourceLoaderCF.cpp: Removed. * loader/mac/ResourceLoaderMac.mm: (WebCore::ResourceLoader::didReceiveDataArray): Deleted. * platform/network/ResourceHandleClient.h: (WebCore::ResourceHandleClient::supportsDataArray): Deleted. (WebCore::ResourceHandleClient::didReceiveDataArray): Deleted. * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp: (WebCore::ResourceHandleCFURLConnectionDelegate::makeConnectionClient): (WebCore::ResourceHandleCFURLConnectionDelegate::didReceiveDataArrayCallback): Deleted. * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h: * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp: (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveDataArray): Deleted. * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h: * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveDataArray): Deleted. * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h: * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: (-[WebCoreResourceHandleAsDelegate connection:didReceiveDataArray:]): Deleted. * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveDataArray:]): Deleted. 2017-04-12 Beth Dakin Attempted build fix. * platform/spi/cocoa/AVKitSPI.h: 2017-04-12 Beth Dakin Adopt AVKit name change from AVFunctionBar* to AVTouchBar* https://bugs.webkit.org/show_bug.cgi?id=170693 -and corresponding- rdar://problem/31230018 Reviewed by San Weinig. Since the new names only apply to some versions of macOS, this patch uses typedefs for the older OS’s. SO: AVFunctionBarScrubber is now AVTouchBarScrubber AVFunctionBarPlaybackControlsProvider is now AVTouchBarPlaybackControlsProvider AVFunctionBarMediaSelectionOption is now AVTouchBarMediaSelectionOption And the protocol AVFunctionBarPlaybackControlsControlling is now AVTouchBarPlaybackControlsControlling * platform/mac/WebPlaybackControlsManager.h: * platform/mac/WebPlaybackControlsManager.mm: (-[WebPlaybackControlsManager audioFunctionBarMediaSelectionOptions]): (-[WebPlaybackControlsManager setAudioFunctionBarMediaSelectionOptions:]): (-[WebPlaybackControlsManager currentAudioFunctionBarMediaSelectionOption]): (-[WebPlaybackControlsManager setCurrentAudioFunctionBarMediaSelectionOption:]): (-[WebPlaybackControlsManager legibleFunctionBarMediaSelectionOptions]): (-[WebPlaybackControlsManager setLegibleFunctionBarMediaSelectionOptions:]): (-[WebPlaybackControlsManager currentLegibleFunctionBarMediaSelectionOption]): (-[WebPlaybackControlsManager setCurrentLegibleFunctionBarMediaSelectionOption:]): (mediaSelectionOptions): Here is where the typedefs and #define are declared. * platform/spi/cocoa/AVKitSPI.h: 2017-04-12 Alex Christensen Fix WinCairo build after r215265 https://bugs.webkit.org/show_bug.cgi?id=170502 m_threadId was removed in the header but not in the constructor implementation. Initializer lists are our friends. * platform/network/curl/CurlDownload.cpp: (WebCore::CurlDownloadManager::CurlDownloadManager): (WebCore::CurlDownload::CurlDownload): Deleted. * platform/network/curl/CurlDownload.h: 2017-04-12 Yusuke Suzuki Unreviewed, build fix for Win and GTK https://bugs.webkit.org/show_bug.cgi?id=170758 * platform/posix/SharedBufferPOSIX.cpp: (WebCore::SharedBuffer::createFromReadingFile): * platform/win/SharedBufferWin.cpp: (WebCore::SharedBuffer::createFromReadingFile): 2017-04-12 Yusuke Suzuki [WTF] Introduce Thread class and use RefPtr and align Windows Threading implementation semantics to Pthread one https://bugs.webkit.org/show_bug.cgi?id=170502 Reviewed by Mark Lam. Mechanical change. Use Thread:: APIs. * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::IDBServer): * Modules/indexeddb/server/IDBServer.h: * Modules/webaudio/AsyncAudioDecoder.cpp: (WebCore::AsyncAudioDecoder::AsyncAudioDecoder): (WebCore::AsyncAudioDecoder::~AsyncAudioDecoder): (WebCore::AsyncAudioDecoder::runLoop): * Modules/webaudio/AsyncAudioDecoder.h: * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::OfflineAudioDestinationNode): (WebCore::OfflineAudioDestinationNode::uninitialize): (WebCore::OfflineAudioDestinationNode::startRendering): * Modules/webaudio/OfflineAudioDestinationNode.h: * Modules/webdatabase/Database.cpp: (WebCore::Database::securityOrigin): * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::start): (WebCore::DatabaseThread::databaseThread): (WebCore::DatabaseThread::recordDatabaseOpen): (WebCore::DatabaseThread::recordDatabaseClosed): * Modules/webdatabase/DatabaseThread.h: (WebCore::DatabaseThread::getThreadID): * bindings/js/GCController.cpp: (WebCore::GCController::garbageCollectOnAlternateThreadForDebugging): * fileapi/AsyncFileStream.cpp: (WebCore::callOnFileThread): * loader/icon/IconDatabase.cpp: (WebCore::IconDatabase::open): (WebCore::IconDatabase::close): * loader/icon/IconDatabase.h: * page/ResourceUsageThread.cpp: (WebCore::ResourceUsageThread::createThreadIfNeeded): * page/ResourceUsageThread.h: * page/scrolling/ScrollingThread.cpp: (WebCore::ScrollingThread::ScrollingThread): (WebCore::ScrollingThread::isCurrentThread): (WebCore::ScrollingThread::createThreadIfNeeded): (WebCore::ScrollingThread::threadCallback): * page/scrolling/ScrollingThread.h: * platform/audio/HRTFDatabaseLoader.cpp: (WebCore::HRTFDatabaseLoader::HRTFDatabaseLoader): (WebCore::HRTFDatabaseLoader::loadAsynchronously): (WebCore::HRTFDatabaseLoader::waitForLoaderThreadCompletion): * platform/audio/HRTFDatabaseLoader.h: * platform/audio/ReverbConvolver.cpp: (WebCore::ReverbConvolver::ReverbConvolver): (WebCore::ReverbConvolver::~ReverbConvolver): * platform/audio/ReverbConvolver.h: * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp: (WebCore::createBusFromAudioFile): (WebCore::createBusFromInMemoryAudioFile): * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (ResourceHandleStreamingClient::ResourceHandleStreamingClient): (ResourceHandleStreamingClient::~ResourceHandleStreamingClient): * platform/network/cf/LoaderRunLoopCF.cpp: (WebCore::loaderRunLoop): * platform/network/curl/CurlDownload.cpp: (WebCore::CurlDownloadManager::startThreadIfNeeded): (WebCore::CurlDownloadManager::stopThread): * platform/network/curl/CurlDownload.h: * platform/network/curl/SocketStreamHandleImpl.h: * platform/network/curl/SocketStreamHandleImplCurl.cpp: (WebCore::SocketStreamHandleImpl::startThread): (WebCore::SocketStreamHandleImpl::stopThread): * workers/WorkerThread.cpp: (WebCore::WorkerThread::WorkerThread): (WebCore::WorkerThread::start): (WebCore::WorkerThread::workerThread): * workers/WorkerThread.h: (WebCore::WorkerThread::threadID): 2017-04-10 Antti Koivisto Cache small media resources in disk cache https://bugs.webkit.org/show_bug.cgi?id=170676 Reviewed by Andreas Kling. Test: http/tests/cache/disk-cache/disk-cache-media-small.html Testing support. Functional changes are in WebKit2. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader): (WebCore::HTMLMediaElement::lastMediaResourceLoaderForTesting): * html/HTMLMediaElement.h: * loader/MediaResourceLoader.cpp: (WebCore::MediaResourceLoader::MediaResourceLoader): (WebCore::MediaResourceLoader::addResponseForTesting): (WebCore::MediaResource::responseReceived): * loader/MediaResourceLoader.h: * platform/network/cocoa/WebCoreNSURLSession.mm: (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): We can now receive cached responses. * testing/Internals.cpp: (WebCore::responseSourceToString): (WebCore::Internals::xhrResponseSource): (WebCore::Internals::mediaResponseSources): (WebCore::Internals::mediaResponseContentRanges): * testing/Internals.h: * testing/Internals.idl: 2017-04-12 Alex Christensen Modernize vector adoption https://bugs.webkit.org/show_bug.cgi?id=170758 Reviewed by Geoffrey Garen. * Modules/encryptedmedia/InitDataRegistry.cpp: (WebCore::extractKeyIDsKeyids): * Modules/indexeddb/IDBGetResult.cpp: (WebCore::IDBGetResult::dataFromBuffer): * Modules/indexeddb/IDBKeyData.cpp: (WebCore::IDBKeyData::decode): * Modules/indexeddb/server/IDBSerialization.cpp: (WebCore::serializeIDBKeyData): (WebCore::decodeKey): * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey): * Modules/indexeddb/server/SQLiteIDBCursor.cpp: (WebCore::IDBServer::SQLiteIDBCursor::internalFetchNextRecord): * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::font): * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadResourceSynchronously): * loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::loadCache): * loader/archive/mhtml/MHTMLParser.cpp: (WebCore::MHTMLParser::parseNextPart): * loader/cache/CachedFont.cpp: (WebCore::CachedFont::createCustomFontData): * loader/cache/CachedSVGFont.cpp: (WebCore::CachedSVGFont::ensureCustomFontData): * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::create): (WebCore::utf8Buffer): (WebCore::SharedBuffer::adoptVector): Deleted. * platform/SharedBuffer.h: * platform/ThreadSafeDataBuffer.h: (WebCore::ThreadSafeDataBufferImpl::ThreadSafeDataBufferImpl): (WebCore::ThreadSafeDataBuffer::create): (WebCore::ThreadSafeDataBuffer::ThreadSafeDataBuffer): (WebCore::ThreadSafeDataBuffer::decode): (): Deleted. (WebCore::ThreadSafeDataBuffer::adoptVector): Deleted. * platform/network/BlobRegistryImpl.cpp: (WebCore::BlobRegistryImpl::registerBlobURL): * platform/network/DataURLDecoder.cpp: (WebCore::DataURLDecoder::decodeBase64): (WebCore::DataURLDecoder::decodeEscaped): 2017-04-12 Per Arne Vollan Implement stroke-color CSS property. https://bugs.webkit.org/show_bug.cgi?id=169352 Reviewed by Jon Lee. Support setting text stroke color using the CSS property stroke-color, see https://drafts.fxtf.org/paint/. Text stroke color can currently be set with the -webkit-text-stroke-color property. To make sure this still works, I added a check to determine if the stroke-color property has been explicitly set. If it has not been set, we fall back to the value of the -webkit-text-stroke-color property. Tests: fast/css/stroke-color-fallback.html fast/css/stroke-color.html fast/css/visited-link-stroke-color.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/CSSProperties.json: * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyValueStrokeColor): * css/StyleResolver.cpp: (WebCore::isValidVisitedLinkProperty): * css/parser/CSSParserFastPaths.cpp: (WebCore::isColorPropertyID): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): * rendering/TextDecorationPainter.cpp: (WebCore::decorationColor): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): (WebCore::computeTextSelectionPaintStyle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline): (WebCore::RenderStyle::colorIncludingFallback): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::strokeColor): (WebCore::RenderStyle::setStrokeColor): (WebCore::RenderStyle::setVisitedLinkStrokeColor): (WebCore::RenderStyle::visitedLinkStrokeColor): (WebCore::RenderStyle::setHasExplicitlySetStrokeColor): (WebCore::RenderStyle::hasExplicitlySetStrokeColor): * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): (WebCore::StyleRareInheritedData::operator==): * rendering/style/StyleRareInheritedData.h: 2017-04-11 Zan Dobersek [GTK] Use the DisplayRefreshMonitor facilities https://bugs.webkit.org/show_bug.cgi?id=170599 Reviewed by Carlos Garcia Campos. * CMakeLists.txt: Add missing files to the build. * platform/graphics/DisplayRefreshMonitor.cpp: Build fixes. (WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor): * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer): Mark the platform layer as updated in the layer's CoordinatedGraphicsState. * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h: 2017-04-11 Antoine Quint [Modern Media Controls] Allow modern-media-controls to be provided through WebKitAdditions https://bugs.webkit.org/show_bug.cgi?id=170722 Reviewed by Dean Jackson. If modern media controls source files are provided through WebKitAdditions, use these instead of the sources found in the WebCore module. * WebCore.xcodeproj/project.pbxproj: 2017-04-11 Dean Jackson Disable outdated WritableStream API https://bugs.webkit.org/show_bug.cgi?id=170749 Reviewed by Tim Horton. The API we implement is no longer accurate. Disable it until we are compatible with the new specification * Configurations/FeatureDefines.xcconfig: 2017-04-11 Matt Rajca Consider the current document when allowing autoplay quirks. https://bugs.webkit.org/show_bug.cgi?id=170744 Reviewed by Eric Carlson. Added API test. In addition to checking if the top-level document supports autoplay quirks, we should check if the current document supports quirks. This allows all embedded YouTube videos (which use iframes) to play correctly if the client allows autoplay quirks on youtube.com. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::dispatchPlayPauseEventsIfNeedsQuirks): 2017-04-11 Ryan Haddad Unreviewed, rolling out r215245. This change broke internal builds. Reverted changeset: "[Modern Media Controls] Allow modern-media-controls to be provided through WebKitAdditions" https://bugs.webkit.org/show_bug.cgi?id=170722 http://trac.webkit.org/changeset/215245 2017-04-11 Antoine Quint [Modern Media Controls] Allow modern-media-controls to be provided through WebKitAdditions https://bugs.webkit.org/show_bug.cgi?id=170722 Reviewed by Dean Jackson. If modern media controls source files are provided through WebKitAdditions, use these instead of the sources found in the WebCore module. * WebCore.xcodeproj/project.pbxproj: 2017-04-10 Matt Rajca Change autoplay state to "prevented" when media is paused due to restrictions. https://bugs.webkit.org/show_bug.cgi?id=170686 Reviewed by Alex Christensen. Added API tests. Currently, the autoplay state is set to "prevented" when playback is about to begin without user interaction and there are restrictions in place. We should also be setting this flag when autoplay is allowed but due to a change in audio tracks, for example, it gets paused. This patch also moves some common logic into setPlaybackWithoutUserGesture without changing behavior. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::setReadyState): (WebCore::HTMLMediaElement::play): (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): (WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture): (WebCore::HTMLMediaElement::updateShouldPlay): 2017-04-11 Eric Carlson [MediaStream] Set correct audio session category when capturing audio https://bugs.webkit.org/show_bug.cgi?id=170736 Reviewed by Jer Noble. No new tests yet, filed bug 170737. * Modules/mediastream/MediaStream.cpp: (WebCore::MediaStream::MediaStream): Initialize m_mediaSession. (WebCore::MediaStream::statusDidChange): Call canProduceAudioChanged. (WebCore::MediaStream::mediaType): New. Return MediaStreamCapturingAudio when actively capturing audio. (WebCore::MediaStream::presentationType): (WebCore::MediaStream::characteristics): (WebCore::MediaStream::mayResumePlayback): (WebCore::MediaStream::suspendPlayback): (WebCore::MediaStream::sourceApplicationIdentifier): (WebCore::MediaStream::canProduceAudio): * Modules/mediastream/MediaStream.h: * platform/audio/PlatformMediaSession.h: Add MediaStreamCapturingAudio. * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::has): Adjust assert for MediaStreamCapturingAudio. (WebCore::PlatformMediaSessionManager::count): Ditto. * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: (PlatformMediaSessionManager::updateSessionState): Set small preferred buffer size when capturing audio. Set audio session category to PlayAndRecord whenever there is a media stream that is capturing audio. 2017-04-11 Yusuke Suzuki [WebCore][JSC] ResourceUsageData.{timeOfNextEdenCollection,timeOfNextFullCollection} should be MonotonicTime https://bugs.webkit.org/show_bug.cgi?id=170725 Reviewed by Sam Weinig. Use MonotonicTime instead of raw doubles. Currently, large part of data structures and helper functions are the same in ResourceUsageOverlayCocoa.mm and ResourceUsageOverlayLinux.cpp. This should be unified in a separate patch. * page/ResourceUsageData.h: * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::gcTimerString): (WebCore::ResourceUsageOverlay::platformDraw): * page/linux/ResourceUsageOverlayLinux.cpp: (WebCore::gcTimerString): 2017-04-11 Youenn Fablet Activate WebRTC data channel tests for WK1 https://bugs.webkit.org/show_bug.cgi?id=170710 Reviewed by Eric Carlson. Covered by existing and activated tests. Making LibWebRTCProvider::factory not static. For that purpose LibWebRTCMediaEndpoint now stores its peer connection factory reference. Making LibWebRTCProvider use libebrtc networking by default. Removing some no longer needed checks related to libwebrtc availability. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint): (WebCore::LibWebRTCMediaEndpoint::addTrack): (WebCore::LibWebRTCMediaEndpoint::doCreateOffer): (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::LibWebRTCProvider::factory): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: 2017-04-11 Youenn Fablet MediaStream id should be equal to msid https://bugs.webkit.org/show_bug.cgi?id=170712 Reviewed by Eric Carlson. Covered by rebased tests. Setting MediaStream id to libwebrtc mediastream label. Refactoring to use more Ref<> in MediaStream code. Making PeerConnection use the libwebrtc backend by default for layout tests instead of the mock. * Modules/mediastream/MediaStream.cpp: (WebCore::MediaStream::create): (WebCore::createTrackPrivateVector): (WebCore::MediaStream::MediaStream): * Modules/mediastream/MediaStream.h: * Modules/mediastream/MediaStreamRegistry.cpp: (WebCore::MediaStreamRegistry::lookUp): * Modules/mediastream/UserMediaRequest.cpp: (WebCore::UserMediaRequest::allow): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream): (WebCore::LibWebRTCMediaEndpoint::addRemoteStream): (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::load): * platform/graphics/MediaPlayer.h: * platform/mediastream/MediaStreamPrivate.cpp: (WebCore::MediaStreamPrivate::MediaStreamPrivate): * platform/mediastream/MediaStreamPrivate.h: (WebCore::MediaStreamPrivate::create): * testing/Internals.cpp: (WebCore::Internals::Internals): 2017-04-11 Chris Fleizach AX: Web article navigation does not work (article rotor for Facebook, Twitter, Messages etc.) https://bugs.webkit.org/show_bug.cgi?id=170330 Reviewed by Joanmarie Diggs. Add a search ability for the "article" role. Test: accessibility/mac/search-predicate-article.html * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex): * accessibility/AccessibilityObject.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper _accessibilityArticleAncestor]): * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (createAccessibilitySearchKeyMap): 2017-04-11 Chris Fleizach AX: PDF plugin needs to support PDF-DOM Mode https://bugs.webkit.org/show_bug.cgi?id=170589 Reviewed by Tim Horton. Provide WebCore support for accessibility connect to PDF document. This includes the ability to connect a PDF annotation created node within WebKit to its PDFAnnotation parent (through use of shadowPluginParent). * accessibility/AXObjectCache.h: * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXPostNotificationWithUserInfo): * accessibility/mac/WebAccessibilityObjectWrapperMac.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper shadowPluginParent]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): * html/HTMLAttributeNames.in: * plugins/PluginViewBase.h: (WebCore::PluginViewBase::accessibilityShadowPluginParentForElement): 2017-04-11 Carlos Garcia Campos REGRESSION(r215153): Request Animation Frame broken when building without REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR https://bugs.webkit.org/show_bug.cgi?id=170719 Reviewed by Žan Doberšek. This is because when not using the display refresh monitor, the timer is always used, not only when throttling, but since r215153 the rAF timer is always aligned to 30ms. Fixes: fast/animation/request-animation-frame-too-rapid.html * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::scheduleAnimation): Only do the timer alignment when throttling. 2017-04-11 Yoav Weiss [link preload] Double downloads of preloaded content when it's in MemoryCache https://bugs.webkit.org/show_bug.cgi?id=170122 Reviewed by Antti Koivisto. No new tests, but unflaked http/tests/preload/single_download_preload_headers_charset.html. The test was flaky because it appears as if MemoryCache is not being evicted between runs, and running multiple iterations of the test resulted in preloaded being taken out of MemoryCache and not having the unknown encoding flag. In those cases, the result was a double download and a failed test. * loader/TextResourceDecoder.cpp: (WebCore::TextResourceDecoder::setEncoding): Set the m_encodingSet flag. * loader/TextResourceDecoder.h: Added an m_encodingSet flag initialized to false. * loader/cache/CachedCSSStyleSheet.cpp: (WebCore::CachedCSSStyleSheet::setEncoding): Assert that stylesheets don't maintain decoded text. * loader/cache/CachedResource.cpp: (WebCore::CachedResource::CachedResource): Remove initialization of hasUnknownEncoding flag. * loader/cache/CachedResource.h: (WebCore::CachedResource::hasUnknownEncoding): Remove. (WebCore::CachedResource::setHasUnknownEncoding): Remove. (WebCore::CachedResource::CachedResource): Remove initialization of hasUnknownEncoding flag. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::determineRevalidationPolicy): Set the encoding in case it changed. 2017-04-11 Miguel Gomez REGRESSION(r215211): [GTK] Lots of image related tests are timing out, causing the test bot to exit early https://bugs.webkit.org/show_bug.cgi?id=170727 Reviewed by Carlos Garcia Campos. Since r215211 ImageDecoder::isSizeAvailable() calls encodedDataStatus() in the different decoder implementations, and those implementations force a partial decoding of the image if the size is not available yet. But ImageDecoder::isSizeAvailable() was already being used inside the decoders assuming that it wasn't going to force this partial decoding. Due to this, there are some situations where the partial decoding is not desired but it's happening anyway. For example, the check in setSize(), which causes the partial decoding to happen again and again because no value is actually set to the animation size (which causes the timouts in the test bot). To avoid this, replace all the calls to ImageDecoder::isSizeAvailable() inside the decoders with calls to ImageDecoder::encodedDataStatus(), which doesn't force the partial decoding. Covered by existent tests. * platform/image-decoders/gif/GIFImageDecoder.cpp: (WebCore::GIFImageDecoder::setSize): * platform/image-decoders/ico/ICOImageDecoder.cpp: (WebCore::ICOImageDecoder::decodeAtIndex): * platform/image-decoders/jpeg/JPEGImageDecoder.h: * platform/image-decoders/png/PNGImageDecoder.cpp: (WebCore::PNGImageReader::decode): (WebCore::PNGImageDecoder::frameBufferAtIndex): * platform/image-decoders/webp/WEBPImageDecoder.cpp: (WebCore::WEBPImageDecoder::decode): 2017-04-11 Miguel Gomez REGRESSION(r215211): [GTK] Lots of image related tests are crashing, causing the test bot to exit early https://bugs.webkit.org/show_bug.cgi?id=170721 Reviewed by Carlos Garcia Campos. r215211 caused an infinite loop because of calls between ImageDecoder::isSizeAvailable() and the specializations of ImageDecoder::encodedDataStatus(). Change the different decoders so ImageDecoder::encodedDataStatus doesn't call ImageDecoder::isSizeAvailable(). Covered by existent tests. * platform/image-decoders/bmp/BMPImageDecoder.cpp: (WebCore::BMPImageDecoder::encodedDataStatus): * platform/image-decoders/gif/GIFImageDecoder.cpp: (WebCore::GIFImageDecoder::encodedDataStatus): * platform/image-decoders/ico/ICOImageDecoder.cpp: (WebCore::ICOImageDecoder::encodedDataStatus): * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: (WebCore::JPEGImageDecoder::encodedDataStatus): * platform/image-decoders/png/PNGImageDecoder.cpp: (WebCore::PNGImageDecoder::encodedDataStatus): * platform/image-decoders/webp/WEBPImageDecoder.cpp: (WebCore::WEBPImageDecoder::encodedDataStatus): 2017-04-10 Alex Christensen Revert r215217 https://bugs.webkit.org/show_bug.cgi?id=170703 * Configurations/FeatureDefines.xcconfig: 2017-04-10 Chris Dumez Fix bad change in r215167. https://bugs.webkit.org/show_bug.cgi?id=170656 Reviewed by Yusuke Suzuki. Revert mistake made in r215167. * rendering/RenderThemeGtk.cpp: (WebCore::RenderThemeGtk::caretBlinkInterval): 2017-04-10 Alex Christensen Continue enabling WebRTC https://bugs.webkit.org/show_bug.cgi?id=170703 Reviewed by Youenn Fablet. * Configurations/FeatureDefines.xcconfig: 2017-04-10 Jeremy Jones PlayerLayerView +layerClass methods should use return type Class. https://bugs.webkit.org/show_bug.cgi?id=165406 Reviewed by Sam Weinig. No new tests because not behavior change. * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: (WebAVPictureInPicturePlayerLayerView_layerClass): (WebAVPlayerLayerView_layerClass): 2017-04-10 Said Abou-Hallawa CachedImage should stop decoding images when unknown type is detected https://bugs.webkit.org/show_bug.cgi?id=170530 Reviewed by Tim Horton. If the status of the encoded data is "unknown type", WebKit should stop decoding the rest of the data. Ideally WebKit should also cancel loading the rest of the encoded data. To do that we need to add a function to the ImageDecoder to return the encodedDataStatus(). We also need to change the return type of Image::setData() and Image::dataChanged() form bool to EncodedDataStatus. * WebCore.xcodeproj/project.pbxproj: Add ImageTypes.h to the WebCore project. * loader/cache/CachedImage.cpp: (WebCore::CachedImage::addIncrementalDataBuffer): Replace checking !sizeAvailable by checking if encodedDataStatus isn't an error but it has not reached sizeAvailable state * loader/cache/CachedResourceClientWalker.h: (WebCore::CachedResourceClientWalker::CachedResourceClientWalker): Unrelated clean-up. (WebCore::CachedResourceClientWalker::next): Ditto. * loader/icon/IconRecord.cpp: (WebCore::IconRecord::setImageData): Image::setData() used to return a bool. Now it returns an EncodedDataStatus. !setData() now means setData() < EncodedDataStatus::SizeAvailable. * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::dataChanged): Replace the return of dataChanged() from bool by EncodedDataStatus. * platform/graphics/BitmapImage.h: Replace isSizeAvailable() by a new function named encodedDataStatus(). * platform/graphics/Image.cpp: (WebCore::Image::setData): Code clean-up and adding a clarification comment. * platform/graphics/Image.h: Change the return of setData() and dataChanged() to be EncodedDataStatus. (WebCore::Image::dataChanged): Return EncodedDataStatus::Unknown as an indication the size is not available but we do not have an error. * platform/graphics/ImageTypes.h: Added. Image definitions which are shared among Image, ImageDecoder, ImageSource, ImageFrameCache and ImageFrame used to be added to ImageFrame.h. This has been annoying since these definitions aren't related to ImageFrame only. A new header file named ImageTypes.h is to the to include such definitions. (WebCore::operator++): * platform/graphics/ImageFrame.h: (WebCore::operator++): Deleted. * platform/graphics/ImageFrameCache.cpp: (WebCore::ImageFrameCache::ImageFrameCache): This is the case of a BitmapImage without a decoder but with a NativeImage. The status has to be EncodedDataStatus::Complete. (WebCore::ImageFrameCache::growFrames): Replace if (isSizeAvailable()) by if (encodedDataStatus() >= EncodedDataStatus::SizeAvailable). (WebCore::ImageFrameCache::metadata): Ditto. (WebCore::ImageFrameCache::encodedDataStatus): This is a replacement for isSizeAvailable(). Don't cache the EncodedDataStatus until it is Complete. Don't call didDecodeProperties() until the status >= EncodedDataStatus::SizeAvailable. (WebCore::ImageFrameCache::isSizeAvailable): Deleted. * platform/graphics/ImageFrameCache.h: Replace isSizeAvailable() by encodedDataStatus(). * platform/graphics/ImageSource.cpp: (WebCore::ImageSource::dataChanged): Make return an EncodedDataStatus instead of returning a bool for isSizeAvailable. * platform/graphics/ImageSource.h: (WebCore::ImageSource::encodedDataStatus): Replace isSizeAvailable() by encodedDataStatus(). (WebCore::ImageSource::isSizeAvailable): Deleted. * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::ImageDecoder::encodedDataStatus): Replace isSizeAvailable() by encodedDataStatus(). The logic of this function is the following: -- CGImageSourceGetStatus() can return kCGImageStatusUnexpectedEOF, kCGImageStatusInvalidData or kCGImageStatusReadingHeader even if CG will end up recovering form the error and drawing the image. Actually CG initializes the status of CGImageSource before receiving any data with kCGImageStatusInvalidData. So the status will be considered an error only if all the data is received but CG does not move the status of this CGImageSource to Complete. -- If CGImageSourceGetStatus() returns Incomplete, this means CG already created the image reader and therefore the image type is known. -- If CGImageSourceGetStatus() returns UnknownType, this means CG could not create the image reader and this should be considered an error. (WebCore::ImageDecoder::isSizeAvailable): Deleted. * platform/graphics/cg/ImageDecoderCG.h: Replace isSizeAvailable() by encodedDataStatus(). * platform/graphics/cg/PDFDocumentImage.cpp: (WebCore::PDFDocumentImage::dataChanged): The PDFDocument is created only when allDataReceived. * platform/graphics/cg/PDFDocumentImage.h: Change the return type from bool to EncodedDataStatus. * platform/image-decoders/ImageDecoder.h: (WebCore::ImageDecoder::encodedDataStatus): Add a new function encodedDataStatus(). Deduce the status of the encoded data from the flags m_failed, m_isAllDataReceived and m_sizeAvailable in this order. (WebCore::ImageDecoder::isSizeAvailable): Make this function uses encodedDataStatus(). * platform/image-decoders/bmp/BMPImageDecoder.cpp: (WebCore::BMPImageDecoder::encodedDataStatus): Replace isSizeAvailable() by encodedDataStatus(). (WebCore::BMPImageDecoder::isSizeAvailable): Deleted. * platform/image-decoders/bmp/BMPImageDecoder.h: * platform/image-decoders/gif/GIFImageDecoder.cpp: (WebCore::GIFImageDecoder::encodedDataStatus): Ditto. (WebCore::GIFImageDecoder::isSizeAvailable): Deleted. * platform/image-decoders/gif/GIFImageDecoder.h: * platform/image-decoders/ico/ICOImageDecoder.cpp: (WebCore::ICOImageDecoder::encodedDataStatus): Ditto. (WebCore::ICOImageDecoder::isSizeAvailable): Deleted. * platform/image-decoders/ico/ICOImageDecoder.h: * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: (WebCore::JPEGImageDecoder::encodedDataStatus): Ditto. (WebCore::JPEGImageDecoder::isSizeAvailable): Deleted. * platform/image-decoders/jpeg/JPEGImageDecoder.h: * platform/image-decoders/png/PNGImageDecoder.cpp: (WebCore::PNGImageDecoder::encodedDataStatus): Ditto. (WebCore::PNGImageDecoder::isSizeAvailable): Deleted. * platform/image-decoders/png/PNGImageDecoder.h: * platform/image-decoders/webp/WEBPImageDecoder.cpp: (WebCore::WEBPImageDecoder::encodedDataStatus): Ditto. (WebCore::WEBPImageDecoder::isSizeAvailable): Deleted. * platform/image-decoders/webp/WEBPImageDecoder.h: * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::dataChanged): m_page is created only when allDataReceived is true. * svg/graphics/SVGImage.h: 2017-04-10 Myles C. Maxfield Mark SVG-Within-OpenType as "Under Consideration" https://bugs.webkit.org/show_bug.cgi?id=170706 Reviewed by Brady Eidson. * features.json: 2017-04-10 Jeremy Jones Add CoreAudioCaptureSource. https://bugs.webkit.org/show_bug.cgi?id=170112 rdar://problem/30293338 Reviewed by Eric Carlson. No new tests because this provides the same funcitonality as AVAudioCaptureSource. Funcionality is covered by existing test cases. Add CoreAudioCaptureSource for audio capture. And use it by default in AVCaptureDeviceManager. Add UseAVFoundationAudioCapture setting to switch back to AVFoundation for audio capture. * WebCore.xcodeproj/project.pbxproj: * page/Settings.cpp: (WebCore::Settings::useAVFoundationAudioCapture): (WebCore::Settings::setUseAVFoundationAudioCapture): * page/Settings.h: * platform/mediastream/mac/AVCaptureDeviceManager.h: * platform/mediastream/mac/AVCaptureDeviceManager.mm: (WebCore::AVCaptureDeviceManager::setUseAVFoundationAudioCapture): * platform/mediastream/mac/CoreAudioCaptureSource.cpp: Added. (WebCore::CoreAudioCaptureSource::create): (WebCore::CoreAudioCaptureSource::factory): (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::preferredSampleRate): (WebCore::CoreAudioCaptureSource::preferredIOBufferDuration): (WebCore::CoreAudioCaptureSource::configureMicrophoneProc): (WebCore::CoreAudioCaptureSource::configureSpeakerProc): (WebCore::CoreAudioCaptureSource::addMicrophoneDataConsumer): (WebCore::CoreAudioCaptureSource::removeMicrophoneDataConsumer): (WebCore::CoreAudioCaptureSource::addEchoCancellationSource): (WebCore::CoreAudioCaptureSource::removeEchoCancellationSource): (WebCore::CoreAudioCaptureSource::checkTimestamps): (WebCore::CoreAudioCaptureSource::provideSpeakerData): (WebCore::CoreAudioCaptureSource::speakerCallback): (WebCore::CoreAudioCaptureSource::processMicrophoneSamples): (WebCore::CoreAudioCaptureSource::microphoneCallback): (WebCore::CoreAudioCaptureSource::defaultOutputDevice): (WebCore::CoreAudioCaptureSource::defaultInputDevice): (WebCore::CoreAudioCaptureSource::setupAudioUnits): (WebCore::CoreAudioCaptureSource::startProducingData): (WebCore::CoreAudioCaptureSource::stopProducingData): (WebCore::CoreAudioCaptureSource::suspend): (WebCore::CoreAudioCaptureSource::resume): (WebCore::CoreAudioCaptureSource::capabilities): (WebCore::CoreAudioCaptureSource::settings): * platform/mediastream/mac/CoreAudioCaptureSource.h: Added. * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: (WebCore::RealtimeMediaSourceCenterMac::RealtimeMediaSourceCenterMac): (WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory): 2017-04-10 Youenn Fablet Wrap legacy MediaStream API in runtime flag https://bugs.webkit.org/show_bug.cgi?id=169877 Reviewed by Alex Christensen. Covered by binding tests. Marking navigator.getUserMedia and MediaStreamEvent as runtime enabled if mediastream and webrtclegacy api flags are on. Updated binding generator to support multiple runtime flags. * Modules/mediastream/MediaStreamEvent.idl: * Modules/mediastream/NavigatorUserMedia.idl: * bindings/scripts/CodeGeneratorJS.pm: (GetRuntimeEnableFunctionName): (GenerateImplementation): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjPrototype::finishCreation): * bindings/scripts/test/TestObj.idl: 2017-04-10 Youenn Fablet Remove deprecated parts of media stream spec https://bugs.webkit.org/show_bug.cgi?id=169879 Reviewed by Jon Lee. Removing MediaStreamTrackState 'new' value which was unused. Removing MediaStreamTrack _readonly attribute which was unused. * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::readonly): Deleted. * Modules/mediastream/MediaStreamTrack.h: * Modules/mediastream/MediaStreamTrack.idl: * platform/mediastream/MediaStreamTrackPrivate.cpp: (WebCore::MediaStreamTrackPrivate::readonly): Deleted. * platform/mediastream/MediaStreamTrackPrivate.h: * platform/mediastream/RealtimeMediaSource.h: 2017-04-10 Ryan Haddad Unreviewed, rolling out r215175. This change caused a flaky crash in existing media tests. Reverted changeset: "Add fallback fonts to video captions stylesheet." https://bugs.webkit.org/show_bug.cgi?id=170495 http://trac.webkit.org/changeset/215175 2017-04-10 Wenson Hsieh Data interaction on an image enclosed by an anchor should vend the anchor's URL https://bugs.webkit.org/show_bug.cgi?id=170660 Reviewed by Tim Horton. When writing an image embedded inside an anchor to the pasteboard, actually use the enclosing anchor's href if it exists. Previously, we were simply dropping this argument on the floor. Covered by 2 new DataInteractionTests: ImageInLinkToInput and ImageInLinkWithoutHREFToInput. * editing/ios/EditorIOS.mm: (WebCore::Editor::writeImageToPasteboard): 2017-04-10 Jon Lee Update localizable strings to "full screen" from "fullscreen" https://bugs.webkit.org/show_bug.cgi?id=170675 rdar://problem/28207034 Reviewed by Antoine Quint. For localizable strings, it should consistently be "full screen" instead of "fullscreen". * English.lproj/Localizable.strings: * English.lproj/modern-media-controls-localized-strings.js: * platform/LocalizedStrings.cpp: (WebCore::contextMenuItemTagExitVideoFullscreen): (WebCore::localizedMediaControlElementString): * platform/cocoa/LocalizedStringsCocoa.mm: (WebCore::exitFullScreenButtonAccessibilityTitle): 2017-04-10 Andreas Kling Don't generate extra scrolling tiles for non-visible pages. https://bugs.webkit.org/show_bug.cgi?id=167213 Reviewed by Antti Koivisto. Reduce the tiling coverage to a minimum when the page is non-visible. On macOS, this means that fully occluded web views can maintain a smaller set of tiles in non-volatile surfaces, reducing net footprint. Test: compositing/tiling/non-visible-window-tile-coverage.html * rendering/RenderLayerBacking.cpp: (WebCore::computePageTiledBackingCoverage): If the page's activity state is non-visible, use minimal tile coverage. * platform/ScrollView.h: * page/FrameView.h: * page/FrameView.cpp: (WebCore::FrameView::hide): Call adjustTiledBackingCoverage() in hide() since it now takes page visibility into account. (WebCore::FrameView::enableSpeculativeTilingIfNeeded): * testing/Internals.cpp: (WebCore::Internals::setSpeculativeTilingDelayDisabledForTesting): * testing/Internals.h: * testing/Internals.idl: Add an internals API for disabling the 500ms delay before speculative tiling begins after the main frame load finishes. This is needed for reliably testing this change. 2017-04-10 Per Arne Vollan Add fallback fonts to video captions stylesheet. https://bugs.webkit.org/show_bug.cgi?id=170495 Reviewed by Myles C. Maxfield. The kCTFontCascadeListAttribute key is used to obtain the cascade list for a font reference. I have not added a test, since CaptionUserPreferences::testingMode() returns true when running tests, preventing this code path from being executed. * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS): 2017-04-10 Chris Dumez Drop Timer::startOneShot() overload taking a double https://bugs.webkit.org/show_bug.cgi?id=170659 Reviewed by Yusuke Suzuki. Drop Timer::startOneShot() overload taking a double as people should use Seconds type now. * Modules/geolocation/GeoNotifier.cpp: (WebCore::GeoNotifier::startTimerIfNeeded): * Modules/mediasession/WebMediaSessionManager.cpp: (WebCore::WebMediaSessionManager::configureWatchdogTimer): * Modules/mediasession/WebMediaSessionManager.h: * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp: (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): * Modules/vibration/Vibration.cpp: (WebCore::Vibration::timerFired): * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::close): * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::enqueuePasswordValueChangeNotification): (WebCore::AXObjectCache::postLiveRegionChangeNotification): (WebCore::AXObjectCache::focusAriaModalNode): * css/CSSFontFace.cpp: (WebCore::CSSFontFace::setStatus): * css/StyleResolver.cpp: (WebCore::StyleResolver::addToMatchedPropertiesCache): * dom/Document.cpp: (WebCore::Document::setVisualUpdatesAllowed): (WebCore::Document::finishedParsing): * dom/ScriptedAnimationController.cpp: * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::startAlternativeTextUITimer): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::addBehaviorRestrictionsOnEndIfNecessary): (WebCore::HTMLMediaElement::handleSeekToPlaybackPosition): * html/SearchInputType.cpp: (WebCore::SearchInputType::startSearchEventTimer): * html/ValidationMessage.cpp: (WebCore::ValidationMessage::setMessageDOMAndStartTimer): * html/canvas/WebGLRenderingContextBase.cpp: * html/shadow/MediaControlElements.cpp: (WebCore::MediaControlPanelElement::startTimer): (WebCore::MediaControlPanelElement::makeTransparent): * html/track/VTTRegion.cpp: (WebCore::VTTRegion::startTimer): * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::frameScheduledNavigationImpl): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::frameScheduledNavigation): * inspector/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::frameScheduledNavigation): * inspector/InspectorPageAgent.h: * loader/NavigationScheduler.cpp: (WebCore::NavigationScheduler::startTimer): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::documentDidFinishLoadEvent): * loader/icon/IconDatabase.cpp: * page/EventHandler.cpp: * page/EventSource.cpp: (WebCore::EventSource::scheduleReconnect): * page/FocusController.cpp: (WebCore::FocusController::setFocusedElementNeedsRepaint): * page/FrameView.cpp: (WebCore::FrameView::scrollPositionChanged): (WebCore::FrameView::enableSpeculativeTilingIfNeeded): * page/Settings.cpp: (WebCore::Settings::Settings): * page/Settings.h: (WebCore::Settings::setTimeWithoutMouseMovementBeforeHidingControls): (WebCore::Settings::timeWithoutMouseMovementBeforeHidingControls): * page/SuspendableTimer.h: * page/animation/CSSAnimationController.cpp: * page/mac/EventHandlerMac.mm: * page/mac/TextIndicatorWindow.mm: (WebCore::TextIndicatorWindow::setTextIndicator): * platform/HysteresisActivity.h: (WebCore::HysteresisActivity::stop): * platform/ScrollAnimationSmooth.cpp: (WebCore::getAnimationParametersForGranularity): (WebCore::ScrollAnimationSmooth::updatePerAxisData): (WebCore::ScrollAnimationSmooth::animateScroll): (WebCore::ScrollAnimationSmooth::animationTimerFired): (WebCore::ScrollAnimationSmooth::startNextTimer): * platform/ScrollAnimationSmooth.h: * platform/Timer.h: (WebCore::TimerBase::startRepeating): * platform/audio/PlatformMediaSession.cpp: (WebCore::PlatformMediaSession::scheduleClientDataBufferingCheck): * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::scheduleStatelessScrollSnap): * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::gamepadHadInput): * platform/gamepad/mac/HIDGamepadProvider.cpp: (WebCore::HIDGamepadProvider::openAndScheduleManager): (WebCore::HIDGamepadProvider::valuesChanged): * platform/glib/MainThreadSharedTimerGLib.cpp: (WebCore::MainThreadSharedTimer::setFireInterval): * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::startTimer): (WebCore::BitmapImage::internalStartAnimation): (WebCore::BitmapImage::advanceAnimation): (WebCore::BitmapImage::resetAnimation): * platform/graphics/BitmapImage.h: * platform/graphics/MediaPlaybackTargetPicker.cpp: * platform/graphics/ShadowBlur.cpp: (WebCore::ScratchBuffer::scheduleScratchBufferPurge): * platform/graphics/ca/LayerPool.cpp: (WebCore::LayerPool::schedulePrune): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::changePipelineState): * platform/graphics/mac/GraphicsContext3DMac.mm: (WebCore::GraphicsContext3DManager::updateHighPerformanceState): * platform/graphics/texmap/BitmapTexturePool.cpp: (WebCore::BitmapTexturePool::scheduleReleaseUnusedTextures): (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired): * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp: (WebCore::TextureMapperPlatformLayerProxy::scheduleReleaseUnusedBuffers): (WebCore::TextureMapperPlatformLayerProxy::releaseUnusedBuffersTimerFired): * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp: * platform/gtk/ScrollAnimatorGtk.cpp: (WebCore::ScrollAnimatorGtk::overlayScrollbarAnimationTimerFired): (WebCore::ScrollAnimatorGtk::showOverlayScrollbars): (WebCore::ScrollAnimatorGtk::hideOverlayScrollbars): * platform/gtk/ScrollAnimatorGtk.h: * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): * platform/mac/ScrollAnimatorMac.mm: (WebCore::ScrollAnimatorMac::startScrollbarPaintTimer): * platform/mock/MediaPlaybackTargetPickerMock.cpp: * platform/mock/PlatformSpeechSynthesizerMock.cpp: (WebCore::PlatformSpeechSynthesizerMock::speak): * platform/mock/TimerEventBasedMock.h: (WebCore::TimerEvent::TimerEvent): * platform/network/DNSResolveQueue.cpp: (WebCore::DNSResolveQueue::add): (WebCore::DNSResolveQueue::timerFired): * platform/network/PingHandle.h: * platform/network/curl/ResourceHandleManager.cpp: (WebCore::ResourceHandleManager::downloadTimerCallback): (WebCore::ResourceHandleManager::add): (WebCore::ResourceHandleManager::cancel): * platform/network/mac/NetworkStateNotifierMac.cpp: * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::ResourceHandle::sendPendingRequest): * rendering/ImageQualityController.cpp: (WebCore::ImageQualityController::restartTimer): * rendering/RenderLayerCompositor.cpp: * rendering/RenderProgress.cpp: (WebCore::RenderProgress::RenderProgress): * rendering/RenderProgress.h: * rendering/RenderText.cpp: (WebCore::SecureTextTimer::restart): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::animationRepeatIntervalForProgressBar): * rendering/RenderTheme.h: (WebCore::RenderTheme::mediaControlsFadeOutDuration): * rendering/RenderThemeGtk.cpp: (WebCore::RenderThemeGtk::animationRepeatIntervalForProgressBar): * rendering/RenderThemeGtk.h: * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::animationRepeatIntervalForProgressBar): * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::animationRepeatIntervalForProgressBar): (WebCore::RenderThemeMac::animationDurationForProgressBar): * replay/EventLoopInputDispatcher.cpp: (WebCore::EventLoopInputDispatcher::dispatchInputSoon): * svg/animation/SMILTimeContainer.cpp: (WebCore::SMILTimeContainer::startTimer): * testing/InternalSettings.cpp: (WebCore::InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls): * testing/InternalSettings.h: * testing/Internals.cpp: (WebCore::Internals::setImageFrameDecodingDuration): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::createRequest): 2017-04-10 Miguel Gomez REGRESSION(r205841): [GTK] Test fast/images/animated-png.html is failing since r205841 https://bugs.webkit.org/show_bug.cgi?id=168425 Reviewed by Said Abou-Hallawa. There is a problem with animations that are blending their frames into the previous frame. Due to a change in how pixel components are premultiplied (the result is now rounded up), the parameters to the blending operation may vary in one unit, causing the result of the blending to be different from the expected result. In order to fix this, a new parameter is added to indicate whether we want to use rounding up when premultiplying or not, and ImageBackingStore uses that parameter to disable rounding up. Adjusted the expectation for fast/images/animated-png.html, as it must pass now. * platform/graphics/Color.cpp: (WebCore::premultipliedChannel): (WebCore::makePremultipliedRGBA): * platform/graphics/Color.h: * platform/graphics/ImageBackingStore.h: (WebCore::ImageBackingStore::blendPixel): (WebCore::ImageBackingStore::pixelValue): 2017-04-09 Wenson Hsieh [WK2] Add infrastructure to perform actions after an asynchronous position information request finishes https://bugs.webkit.org/show_bug.cgi?id=170658 Reviewed by Tim Horton. Minor adjustments to fix the build in the newest version of the SDK. * platform/ios/WebItemProviderPasteboard.mm: (-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]): (-[WebItemProviderPasteboard _tryToCreateAndAppendObjectOfClass:toArray:usingProvider:]): 2017-04-09 Yusuke Suzuki [WTF] Annotate Seconds' member functions and operators with constexpr https://bugs.webkit.org/show_bug.cgi?id=170662 Reviewed by Daniel Bates. * page/Frame.cpp: 2017-04-09 Chris Dumez Drop Timer::startRepeating() overload taking a double https://bugs.webkit.org/show_bug.cgi?id=170656 Reviewed by Yusuke Suzuki. Drop Timer::startRepeating() overload taking a double as people should use Seconds type now. * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp: (WebCore::CanvasCaptureMediaStreamTrack::Source::startProducingData): * editing/FrameSelection.cpp: (WebCore::FrameSelection::updateAppearance): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::startProgressEventTimer): (WebCore::HTMLMediaElement::scheduleTimeupdateEvent): * html/HTMLMediaElement.h: * html/MediaController.cpp: (MediaController::MediaController): (MediaController::scheduleTimeupdateEvent): * html/MediaController.h: * html/MediaElementSession.cpp: * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::showPaintRect): * loader/ProgressTracker.cpp: * page/AutoscrollController.cpp: * page/Frame.cpp: * page/PageOverlay.cpp: (WebCore::PageOverlay::startFadeAnimation): * page/SuspendableTimer.h: * page/WheelEventTestTrigger.cpp: (WebCore::WheelEventTestTrigger::setTestCallbackAndStartNotificationTimer): * platform/Theme.h: (WebCore::Theme::caretBlinkInterval): * platform/Timer.h: * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::startSnapRubberbandTimer): (WebCore::ScrollController::startScrollSnapTimer): * platform/graphics/ca/TileGrid.cpp: (WebCore::TileGrid::scheduleCohortRemoval): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering): * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm: (WebCore::MockRealtimeAudioSourceMac::reconfigure): * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::MockRealtimeAudioSource::startProducingData): * platform/mock/MockRealtimeAudioSource.h: (WebCore::MockRealtimeAudioSource::renderInterval): * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::startProducingData): (WebCore::MockRealtimeVideoSource::applyFrameRate): * rendering/RenderMarquee.cpp: (WebCore::RenderMarquee::start): (WebCore::RenderMarquee::updateMarqueeStyle): * rendering/RenderTheme.h: (WebCore::RenderTheme::caretBlinkInterval): * rendering/RenderThemeGtk.cpp: (WebCore::RenderThemeGtk::caretBlinkInterval): * rendering/RenderThemeGtk.h: * xml/XMLHttpRequestProgressEventThrottle.cpp: (WebCore::XMLHttpRequestProgressEventThrottle::dispatchThrottledProgressEvent): * xml/XMLHttpRequestProgressEventThrottle.h: 2017-04-09 Fujii Hironori generate-bindings-all.pl shouldn't use Perl threads https://bugs.webkit.org/show_bug.cgi?id=170106 Reviewed by Yusuke Suzuki. The use of interpreter-based threads in Perl is officially discouraged and not all Linux distributions and BSD compile Perl with threads support. Use fork instead of threads to run generate-bindings.pl in parallel. * bindings/scripts/generate-bindings-all.pl: (spawnGenerateBindingsIfNeeded): Added. (executeCommand): Removed the workaround for Cygwin Perl threads. (spawnCommand): Added. (worker): Deleted. 2017-04-09 Said Abou-Hallawa REGRESSION(r214635): Calculate image subsampling only for CG https://bugs.webkit.org/show_bug.cgi?id=170353 Reviewed by Simon Fraser. In r214635, we needed to calculate the image scaleFactor for all platforms. It was needed do the calculation: sizeForDrawing = sizeOfImage * imageScaleFactor. This made ImageSource::subsamplingLevelForScale() now returns a SubsamplingLevel not equal to SubsamplingLevel::Default if the image scaleFactor is greater than {1, 1} for all platforms. The subsamplingLevel should only be used for CG. This is also a chance to make nativeImageDrawingScale() a across platform function and move it to the GraphicsContext class. * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::draw): * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::scaleFactorForDrawing): * platform/graphics/GraphicsContext.h: * platform/graphics/ImageSource.cpp: (WebCore::ImageSource::subsamplingLevelForScaleFactor): (WebCore::ImageSource::subsamplingLevelForScale): Deleted. * platform/graphics/ImageSource.h: * platform/graphics/NativeImage.h: * platform/graphics/cairo/NativeImageCairo.cpp: (WebCore::nativeImageDrawingScale): Deleted. * platform/graphics/cg/NativeImageCG.cpp: (WebCore::nativeImageDrawingScale): Deleted. * platform/graphics/win/NativeImageDirect2D.cpp: (WebCore::nativeImageDrawingScale): Deleted. 2017-04-09 Chris Dumez Start dropping Timer API dealing with double https://bugs.webkit.org/show_bug.cgi?id=170649 Reviewed by Yusuke Suzuki. Start dropping Timer API dealing with double as people should use Seconds now. * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp: (WebCore::WebKitMediaKeySession::generateKeyRequest): (WebCore::WebKitMediaKeySession::update): * Modules/geolocation/GeoNotifier.cpp: (WebCore::GeoNotifier::setFatalError): (WebCore::GeoNotifier::setUseCachedPosition): * Modules/geolocation/Geolocation.cpp: (WebCore::Geolocation::resume): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::schedulePendingOperationTimer): (WebCore::IDBTransaction::scheduleCompletedOperationTimer): * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::rangeRemoval): (WebCore::SourceBuffer::appendBufferInternal): * Modules/mediastream/MediaStream.cpp: (WebCore::MediaStream::scheduleActiveStateChange): * Modules/mediastream/RTCDTMFSender.cpp: (WebCore::RTCDTMFSender::scheduleDispatchEvent): * Modules/mediastream/RTCDataChannel.cpp: (WebCore::RTCDataChannel::scheduleDispatchEvent): * Modules/notifications/Notification.cpp: * Modules/notifications/NotificationCenter.cpp: (WebCore::NotificationCenter::requestPermission): * Modules/vibration/Vibration.cpp: (WebCore::Vibration::vibrate): * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::resume): * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::resume): * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::postNotification): * bindings/js/GCController.cpp: (WebCore::GCController::garbageCollectOnNextRunLoop): * css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::beginLoadingFontSoon): * dom/Document.cpp: (WebCore::Document::scheduleStyleRecalc): (WebCore::Document::updateFocusAppearanceSoon): (WebCore::Document::resumeScheduledTasks): (WebCore::Document::requestFullScreenForElement): (WebCore::Document::webkitDidEnterFullScreenForElement): (WebCore::Document::webkitDidExitFullScreenForElement): (WebCore::Document::decrementLoadEventDelayCount): (WebCore::Document::didAssociateFormControl): (WebCore::Document::setCachedDOMCookies): * dom/DocumentEventQueue.cpp: (WebCore::DocumentEventQueue::enqueueEvent): * dom/EventSender.h: (WebCore::EventSender::dispatchEventSoon): * dom/Microtasks.cpp: (WebCore::MicrotaskQueue::append): * dom/ScriptRunner.cpp: (WebCore::ScriptRunner::resume): (WebCore::ScriptRunner::notifyFinished): * dom/ScriptableDocumentParser.cpp: (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheetsSoon): * editing/Editor.cpp: (WebCore::Editor::respondToChangedSelection): * editing/SpellChecker.cpp: (WebCore::SpellChecker::didCheck): * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::finishRequestAutocomplete): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::scheduleDelayedAction): (WebCore::HTMLMediaElement::beginScanning): * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::setDisplayState): * html/HTMLSourceElement.cpp: (WebCore::HTMLSourceElement::scheduleErrorEvent): (WebCore::HTMLSourceElement::resume): * html/HTMLTrackElement.cpp: (WebCore::HTMLTrackElement::scheduleLoad): * html/MediaController.cpp: (MediaController::currentTime): (MediaController::scheduleEvent): * html/MediaDocument.cpp: (WebCore::MediaDocument::mediaElementSawUnsupportedTracks): * html/MediaElementSession.cpp: (WebCore::MediaElementSession::externalOutputDeviceAvailableDidChange): * html/ValidationMessage.cpp: (WebCore::ValidationMessage::setMessage): (WebCore::ValidationMessage::requestToHideMessage): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::loseContextImpl): (WebCore::WebGLRenderingContextBase::forceRestoreContext): (WebCore::WebGLRenderingContextBase::dispatchContextLostEvent): * html/parser/HTMLParserScheduler.cpp: (WebCore::HTMLParserScheduler::continueNextChunkTimerFired): (WebCore::HTMLParserScheduler::scheduleForResume): (WebCore::HTMLParserScheduler::resume): * html/shadow/MediaControlElements.cpp: (WebCore::MediaControlTextTrackContainerElement::updateSizes): * html/track/LoadableTextTrack.cpp: (WebCore::LoadableTextTrack::scheduleLoad): * inspector/InspectorCSSAgent.cpp: (WebCore::ChangeRegionOversetTask::scheduleFor): * inspector/InspectorDOMAgent.cpp: (WebCore::RevalidateStyleAttributeTask::scheduleFor): * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorBackendDispatchTask::dispatch): (WebCore::InspectorBackendDispatchTask::timerFired): * inspector/WebHeapAgent.cpp: (WebCore::SendGarbageCollectionEventsTask::addGarbageCollection): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::startDataLoadTimer): (WebCore::DocumentLoader::deliverSubstituteResourcesAfterDelay): * loader/FrameLoader.cpp: (WebCore::FrameLoader::startCheckCompleteTimer): * loader/ImageLoader.cpp: (WebCore::ImageLoader::updatedHasPendingEvent): * loader/TextTrackLoader.cpp: (WebCore::TextTrackLoader::notifyFinished): (WebCore::TextTrackLoader::newCuesParsed): (WebCore::TextTrackLoader::fileFailedToParse): * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::scheduleReachedMaxAppCacheSizeCallback): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::Callback::Callback): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::loadDone): * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::pruneSoon): * page/CaptionUserPreferences.cpp: (WebCore::CaptionUserPreferences::notify): * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges): * page/DOMWindow.cpp: (WebCore::DOMWindow::postMessage): * page/DeviceController.cpp: (WebCore::DeviceController::addDeviceEventListener): * page/EventHandler.cpp: (WebCore::EventHandler::scheduleHoverStateUpdate): * page/EventSource.cpp: (WebCore::EventSource::scheduleInitialConnect): * page/FrameView.cpp: (WebCore::FrameView::layout): (WebCore::FrameView::performPostLayoutTasks): * page/Settings.cpp: (WebCore::Settings::setLoadsImagesAutomatically): (WebCore::Settings::setImagesEnabled): * page/SuspendableTimer.h: * page/animation/CSSAnimationController.cpp: (WebCore::CSSAnimationControllerPrivate::startUpdateStyleIfNeededDispatcher): * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::invalidateHighlightsOfType): * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll): * page/scrolling/ios/ScrollingCoordinatorIOS.mm: (WebCore::ScrollingCoordinatorIOS::scheduleTreeStateCommit): * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit): * platform/GenericTaskQueue.cpp: (WebCore::TaskDispatcher::postTask): * platform/Scrollbar.cpp: (WebCore::Scrollbar::autoscrollPressedPart): (WebCore::Scrollbar::startTimerIfNeeded): * platform/Scrollbar.h: * platform/ScrollbarTheme.h: (WebCore::ScrollbarTheme::initialAutoscrollTimerDelay): (WebCore::ScrollbarTheme::autoscrollTimerDelay): * platform/Timer.cpp: * platform/Timer.h: (WebCore::TimerBase::startRepeating): (WebCore::TimerBase::startOneShot): (WebCore::TimerBase::augmentFireInterval): (WebCore::TimerBase::augmentRepeatInterval): * platform/gamepad/mac/HIDGamepadProvider.cpp: (WebCore::HIDGamepadProvider::deviceAdded): * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::networkStateChanged): * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm: (WebCore::MediaSelectionGroupAVFObjC::updateOptions): (WebCore::MediaSelectionGroupAVFObjC::setSelectedOption): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance): * platform/graphics/ca/TileCoverageMap.cpp: (WebCore::TileCoverageMap::setNeedsUpdate): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: (VideoRenderRequestScheduler::requestRender): * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp: (WebCore::TextureMapperPlatformLayerProxy::scheduleUpdateOnCompositorThread): * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::addAnimation): * platform/gtk/ScrollAnimatorGtk.cpp: (WebCore::ScrollAnimatorGtk::showOverlayScrollbars): * platform/gtk/ScrollbarThemeGtk.h: * platform/ios/LegacyTileCache.mm: (WebCore::LegacyTileCache::finishedCreatingTiles): (WebCore::LegacyTileCache::setSpeculativeTileCreationEnabled): * platform/ios/ScrollbarThemeIOS.h: * platform/ios/ScrollbarThemeIOS.mm: (WebCore::ScrollbarThemeIOS::initialAutoscrollTimerDelay): (WebCore::ScrollbarThemeIOS::autoscrollTimerDelay): * platform/mac/ScrollAnimatorMac.mm: (WebCore::ScrollAnimatorMac::sendContentAreaScrolledSoon): * platform/mac/ScrollbarThemeMac.h: * platform/mac/ScrollbarThemeMac.mm: (WebCore::ScrollbarThemeMac::preferencesChanged): (WebCore::ScrollbarThemeMac::initialAutoscrollTimerDelay): (WebCore::ScrollbarThemeMac::autoscrollTimerDelay): * platform/mock/DeviceOrientationClientMock.cpp: (WebCore::DeviceOrientationClientMock::setOrientation): * platform/mock/GeolocationClientMock.cpp: (WebCore::GeolocationClientMock::asyncUpdatePermission): (WebCore::GeolocationClientMock::asyncUpdateController): * platform/mock/MockMediaEndpoint.cpp: (WebCore::MockMediaEndpoint::dispatchFakeIceCandidates): (WebCore::MockMediaEndpoint::iceCandidateTimerFired): (WebCore::MockMediaEndpoint::stepIceTransportStates): (WebCore::MockMediaEndpoint::iceTransportTimerFired): (WebCore::MockMediaEndpoint::unmuteRemoteSourcesByMid): (WebCore::MockMediaEndpoint::unmuteTimerFired): * platform/network/DataURLDecoder.cpp: (WebCore::DataURLDecoder::DecodingResultDispatcher::startTimer): * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::scheduleFailure): (WebCore::ResourceHandle::setDefersLoading): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::scheduleCompositingLayerUpdate): * rendering/RenderNamedFlowThread.cpp: (WebCore::RenderNamedFlowThread::dispatchRegionOversetChangeEventIfNeeded): * rendering/RenderScrollbarTheme.h: * rendering/RenderView.cpp: (WebCore::RenderView::scheduleLazyRepaint): * style/StyleScope.cpp: (WebCore::Style::Scope::scheduleUpdate): * svg/SVGElement.cpp: (WebCore::SVGElement::sendSVGLoadEventIfPossibleAsynchronously): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::prepareToSend): (WebCore::XMLHttpRequest::didFail): (WebCore::XMLHttpRequest::resume): * xml/XMLHttpRequestProgressEventThrottle.cpp: (WebCore::XMLHttpRequestProgressEventThrottle::resume): 2017-04-08 Myles C. Maxfield [Variation Fonts] Width values of GX fonts are not mapped correctly https://bugs.webkit.org/show_bug.cgi?id=170367 Reviewed by Simon Fraser. For some reason, when I performed my calculations for how to map the 'wdth' axis of GX-style variation fonts, I thought that font-stretch: 100% should map to a variation value of 0.0. Instead, this should map to 1.0. Test: fast/text/variations/gx-width.html * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::denormalizeSlope): (WebCore::denormalizeVariationWidth): (WebCore::normalizeVariationWidth): (WebCore::normalizeWidth): (WebCore::preparePlatformFont): (WebCore::variationCapabilitiesForFontDescriptor): (WebCore::denormalizeWidth): Deleted. 2017-04-08 Eric Carlson [MediaStream Mac] Revert change of Mac video capture format https://bugs.webkit.org/show_bug.cgi?id=170642 Reviewed by Sam Weinig. Revert r214968 which changed macOS video capture format to kCVPixelFormatType_420YpCbCr8BiPlanarFullRange from kCVPixelFormatType_420YpCbCr8Planar because AVSampleBufferDisplayLayer sometimes fails to display the former. * platform/mediastream/mac/AVVideoCaptureSource.mm: 2017-04-08 Said Abou-Hallawa A synchronous DecodingOptions should be compatible with any asynchronous sizeForDrawing DecodingOptions https://bugs.webkit.org/show_bug.cgi?id=170577 Reviewed by Simon Fraser. Once a synchronous decoded frame is found, there is no need to decode it again. This decoded frame is suitable for any sizeForDrawing. This will prevent double decoding if one image client wants synchronous decoded frame while the other needs an asynchronous decode frame for a specific sizeForDrawing. Test: fast/images/async-image-background-image-repeated.html * platform/graphics/DecodingOptions.h: (WebCore::DecodingOptions::DecodingOptions): (WebCore::DecodingOptions::isNone): (WebCore::DecodingOptions::isAsynchronousCompatibleWith): 2017-04-08 Simon Fraser Align the timers for throttled rAF to reduce power usage https://bugs.webkit.org/show_bug.cgi?id=170630 rdar://problem/31490620 Reviewed by Chris Dumez. Align the timers for all throttled ScriptedAnimationControllers in the process with a resolution of 30ms, which reduces process wake-ups and thus saves power. * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::scheduleAnimation): 2017-04-08 Chris Dumez Drop std::chrono support from Timer class https://bugs.webkit.org/show_bug.cgi?id=170645 Reviewed by Sam Weinig. Drop std::chrono support from Timer class now that we prefer using Seconds type. * css/CSSImageGeneratorValue.cpp: * html/HTMLPlugInImageElement.cpp: * html/canvas/WebGLRenderingContextBase.cpp: * loader/cache/CachedResource.cpp: (WebCore::deadDecodedDataDeletionIntervalForResourceType): (WebCore::CachedResource::destroyDecodedDataIfNeeded): * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::MemoryCache): * loader/cache/MemoryCache.h: (WebCore::MemoryCache::setDeadDecodedDataDeletionInterval): (WebCore::MemoryCache::deadDecodedDataDeletionInterval): * page/PerformanceMonitor.cpp: * page/SuspendableTimer.h: * page/mac/ServicesOverlayController.h: * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::selectionRectsDidChange): (WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown): (WebCore::ServicesOverlayController::determineActiveHighlight): (WebCore::ServicesOverlayController::mouseEvent): * platform/Timer.h: (WebCore::TimerBase::startRepeating): (WebCore::TimerBase::startOneShot): (WebCore::TimerBase::augmentFireInterval): (WebCore::TimerBase::augmentRepeatInterval): (WebCore::DeferrableOneShotTimer::DeferrableOneShotTimer): * platform/graphics/FontCache.cpp: (WebCore::FontCache::fontForFamily): * platform/graphics/ca/TileController.cpp: * platform/graphics/cg/IOSurfacePool.cpp: * platform/graphics/cg/SubimageCacheWithTimer.cpp: * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::setTimeout): (WebCore::XMLHttpRequest::createRequest): * xml/XMLHttpRequest.h: 2017-04-08 Simon Fraser Update CSSProperties.json with correct fill-and-stroke status, and other cleanup https://bugs.webkit.org/show_bug.cgi?id=170643 Reviewed by Chris Dumez. Structural changes: - move implementation-related "comment" blocks into "codegen-properties" - move status-related "comment" blocks into "status" Add the concept of "obsolete-category" and "obsolete-url" for properties like the text-fill-and-stroke properties that used to be specified in SVG but now have their own module shared with CSS. Update the status of paint-order, stroke-linecap, stroke-linejoin, stroke-miterlimit and stroke-width to "supported", overriding the default for css-text-fill-and-stroke which is "under consideration". Add display values "flow" and "flow-root" but mark them as unimplemented. Fix makeprop.pl to ignore comments inside codegen-properties. * css/CSSProperties.json: * css/makeprop.pl: (addProperty): 2017-04-08 Eric Carlson [MediaStream iOS] Update muted state when interrupted https://bugs.webkit.org/show_bug.cgi?id=170605 Reviewed by Youenn Fablet. * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::setMuted): Don't check both m_stopped and stopped(). Split code to notify observers out into notifyMutedObservers. (WebCore::RealtimeMediaSource::notifyMutedObservers): Split from setMuted. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/mac/AVMediaCaptureSource.h: * platform/mediastream/mac/AVMediaCaptureSource.mm: (WebCore::AVMediaCaptureSource::captureSessionIsRunningDidChange): Set m_muted directly and call notifyMutedObservers because the session has already stopped running. (WebCore::AVMediaCaptureSource::isProducingData): Move from .h file to make debugging easier. 2017-04-08 Simon Fraser Unprefix CSS cursor values grab and grabbing https://bugs.webkit.org/show_bug.cgi?id=170543 Reviewed by Jon Lee. Add support for unprefixed "grab" and "grabbing" values for cursor (retaining support for the prefixed values) which are now in Canonicalize the order of the values based on the order in the spec in the enums and switch statements. Tested by fast/css/cursor-parsing.html * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ECursor): * css/CSSProperties.json: * css/CSSValueKeywords.in: * page/EventHandler.cpp: (WebCore::EventHandler::selectCursor): * rendering/style/RenderStyleConstants.h: 2017-04-08 Youenn Fablet WebRTC tests gardening https://bugs.webkit.org/show_bug.cgi?id=170508 Reviewed by Eric Carlson. * Configurations/FeatureDefines.xcconfig: Changing webrtc enabling for ios. 2017-04-08 Youenn Fablet MediaStreamTrack id should be preserved by PeerConnection https://bugs.webkit.org/show_bug.cgi?id=170624 Reviewed by Eric Carlson. Covered by updated test. * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::createReceiverForSource): Setting track id according source id. 2017-04-08 Chris Dumez Timer's nextFireInterval() / repeatInterval() should return Seconds https://bugs.webkit.org/show_bug.cgi?id=170639 Reviewed by Simon Fraser. Timer's nextFireInterval() / repeatInterval() should return Seconds, not double. * loader/NavigationScheduler.cpp: * page/DOMTimer.cpp: (WebCore::DOMTimer::updateTimerIntervalIfNecessary): * page/SuspendableTimer.cpp: (WebCore::SuspendableTimer::suspend): (WebCore::SuspendableTimer::repeatInterval): * page/SuspendableTimer.h: * page/animation/AnimationBase.cpp: (WebCore::AnimationBase::timeToNextService): (WebCore::AnimationBase::getTimeToNextEvent): (WebCore::AnimationBase::goIntoEndingOrLoopingState): * page/animation/AnimationBase.h: * page/animation/CSSAnimationController.cpp: (WebCore::CSSAnimationControllerPrivate::updateAnimations): (WebCore::CSSAnimationControllerPrivate::updateAnimationTimerForRenderer): (WebCore::CSSAnimationControllerPrivate::updateAnimationTimer): (WebCore::CSSAnimationControllerPrivate::animationFrameCallbackFired): * page/animation/CSSAnimationControllerPrivate.h: * page/animation/CompositeAnimation.cpp: (WebCore::CompositeAnimation::timeToNextService): * page/animation/CompositeAnimation.h: * page/animation/ImplicitAnimation.cpp: (WebCore::ImplicitAnimation::timeToNextService): * page/animation/ImplicitAnimation.h: * page/animation/KeyframeAnimation.cpp: (WebCore::KeyframeAnimation::timeToNextService): * page/animation/KeyframeAnimation.h: * platform/ThreadTimers.cpp: (WebCore::ThreadTimers::sharedTimerFiredInternal): * platform/Timer.cpp: (WebCore::TimerBase::nextFireInterval): * platform/Timer.h: (WebCore::TimerBase::repeatInterval): * platform/graphics/ca/TileController.cpp: (WebCore::TileController::setIsInWindow): (WebCore::TileController::scheduleTileRevalidation): * platform/graphics/ca/TileController.h: * platform/graphics/ca/TileGrid.cpp: (WebCore::TileGrid::revalidateTiles): 2017-04-08 Csaba Osztrogonác Unreviewed Mac cmake buildfix after r215051, just for fun. https://bugs.webkit.org/show_bug.cgi?id=169761 * PlatformMac.cmake: 2017-04-07 Simon Fraser Build fix: TimerBase::start(double, double) can't be inline and exported, so make it non-inline. * platform/Timer.cpp: (WebCore::TimerBase::start): * platform/Timer.h: (WebCore::TimerBase::start): Deleted. 2017-04-07 Chris Dumez REGRESSION (r203941): iAd Producer widgets fail to play in iBooks https://bugs.webkit.org/show_bug.cgi?id=170635 Reviewed by Daniel Bates. Extend the MouseEvent::initMouseEvent() workaround we added for iAd Producer to iBooks since the iBooks widgets generated by iAd Producer contain the same bug. * dom/MouseEvent.cpp: (WebCore::MouseEvent::initMouseEventQuirk): 2017-04-07 Chris Dumez Start using MonotonicTime / Seconds in Timer class https://bugs.webkit.org/show_bug.cgi?id=170625 Reviewed by Simon Fraser. Start using MonotonicTime / Seconds in Timer class. More work will be needed for the transition to be complete. I plan to do this in a follow-up. * page/DOMTimer.cpp: (WebCore::DOMTimer::alignedFireTime): * page/DOMTimer.h: * page/SuspendableTimer.cpp: (WebCore::SuspendableTimer::suspend): (WebCore::SuspendableTimer::startRepeating): (WebCore::SuspendableTimer::startOneShot): (WebCore::SuspendableTimer::repeatInterval): (WebCore::SuspendableTimer::augmentFireInterval): (WebCore::SuspendableTimer::augmentRepeatInterval): * page/SuspendableTimer.h: (WebCore::SuspendableTimer::startRepeating): (WebCore::SuspendableTimer::startOneShot): (WebCore::SuspendableTimer::augmentFireInterval): (WebCore::SuspendableTimer::augmentRepeatInterval): * platform/ThreadTimers.cpp: (WebCore::ThreadTimers::ThreadTimers): (WebCore::ThreadTimers::setSharedTimer): (WebCore::ThreadTimers::updateSharedTimer): (WebCore::ThreadTimers::sharedTimerFiredInternal): (WebCore::ThreadTimers::fireTimersInNestedEventLoop): * platform/ThreadTimers.h: * platform/Timer.cpp: (WebCore::TimerHeapLessThanFunction::operator()): (WebCore::TimerBase::TimerBase): (WebCore::TimerBase::start): (WebCore::TimerBase::stop): (WebCore::TimerBase::nextFireInterval): (WebCore::TimerBase::heapPop): (WebCore::TimerBase::updateHeapIfNeeded): (WebCore::TimerBase::setNextFireTime): (WebCore::TimerBase::nextUnalignedFireInterval): * platform/Timer.h: (WebCore::TimerBase::start): (WebCore::TimerBase::startOneShot): (WebCore::TimerBase::repeatInterval): (WebCore::TimerBase::repeatIntervalSeconds): (WebCore::TimerBase::augmentFireInterval): (WebCore::TimerBase::augmentRepeatInterval): (WebCore::TimerBase::alignedFireTime): (WebCore::TimerBase::isActive): * testing/Internals.cpp: (WebCore::Internals::isTimerThrottled): 2017-04-07 Yuichiro Kikura WebGPU: implement ComputeCommandEncoder and related components https://bugs.webkit.org/show_bug.cgi?id=170444 Reviewed by Alex Christensen. I implemented WebGPUComputeCommandEncoder and related components based on the WebGPU proposal. https://webkit.org/wp-content/uploads/webgpu-api-proposal.html Test: fast/canvas/webgpu/webgpu-dispatch.html * CMakeLists.txt: * DerivedSources.make: * PlatformMac.cmake: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSWebGPUCommandBufferCustom.cpp: Added. (WebCore::JSWebGPUCommandBuffer::completed): * html/canvas/WebGPUCommandBuffer.cpp: (WebCore::WebGPUCommandBuffer::createComputeCommandEncoder): * html/canvas/WebGPUCommandBuffer.h: * html/canvas/WebGPUCommandBuffer.idl: * html/canvas/WebGPUComputeCommandEncoder.cpp: Added. (WebCore::GPUSizeMake): (WebCore::WebGPUComputeCommandEncoder::create): (WebCore::WebGPUComputeCommandEncoder::WebGPUComputeCommandEncoder): (WebCore::WebGPUComputeCommandEncoder::~WebGPUComputeCommandEncoder): (WebCore::WebGPUComputeCommandEncoder::setComputePipelineState): (WebCore::WebGPUComputeCommandEncoder::setBuffer): (WebCore::WebGPUComputeCommandEncoder::dispatch): (WebCore::WebGPUComputeCommandEncoder::endEncoding): * html/canvas/WebGPUComputeCommandEncoder.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.h. (WebCore::WebGPUComputeCommandEncoder::computeCommandEncoder): * html/canvas/WebGPUComputeCommandEncoder.idl: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl. * html/canvas/WebGPUComputePipelineState.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.cpp. (WebCore::WebGPUComputePipelineState::create): (WebCore::WebGPUComputePipelineState::WebGPUComputePipelineState): (WebCore::WebGPUComputePipelineState::~WebGPUComputePipelineState): * html/canvas/WebGPUComputePipelineState.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.h. (WebCore::WebGPUComputePipelineState::computePipelineState): * html/canvas/WebGPUComputePipelineState.idl: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl. * html/canvas/WebGPURenderingContext.cpp: (WebCore::WebGPURenderingContext::createComputePipelineState): * html/canvas/WebGPURenderingContext.h: * html/canvas/WebGPURenderingContext.idl: * html/canvas/WebGPUSize.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl. * html/canvas/WebGPUSize.idl: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl. * platform/graphics/cocoa/GPUCommandBufferMetal.mm: (WebCore::GPUCommandBuffer::completed): * platform/graphics/cocoa/GPUComputeCommandEncoderMetal.mm: Added. (WebCore::MTLSizeMake): (WebCore::GPUComputeCommandEncoder::GPUComputeCommandEncoder): (WebCore::GPUComputeCommandEncoder::setComputePipelineState): (WebCore::GPUComputeCommandEncoder::setBuffer): (WebCore::GPUComputeCommandEncoder::dispatch): (WebCore::GPUComputeCommandEncoder::endEncoding): (WebCore::GPUComputeCommandEncoder::platformComputeCommandEncoder): * platform/graphics/cocoa/GPUComputePipelineStateMetal.mm: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.cpp. (WebCore::GPUComputePipelineState::GPUComputePipelineState): (WebCore::GPUComputePipelineState::platformComputePipelineState): * platform/graphics/gpu/GPUCommandBuffer.cpp: (WebCore::GPUCommandBuffer::createComputeCommandEncoder): * platform/graphics/gpu/GPUCommandBuffer.h: * platform/graphics/gpu/GPUComputeCommandEncoder.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.cpp. (WebCore::GPUComputeCommandEncoder::create): (WebCore::GPUComputeCommandEncoder::~GPUComputeCommandEncoder): (WebCore::GPUComputeCommandEncoder::setComputePipelineState): (WebCore::GPUComputeCommandEncoder::setBuffer): (WebCore::GPUComputeCommandEncoder::endEncoding): * platform/graphics/gpu/GPUComputeCommandEncoder.h: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h. * platform/graphics/gpu/GPUComputePipelineState.cpp: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl. (WebCore::GPUComputePipelineState::create): (WebCore::GPUComputePipelineState::~GPUComputePipelineState): * platform/graphics/gpu/GPUComputePipelineState.h: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h. * platform/graphics/gpu/GPUSize.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl. 2017-04-07 Alex Christensen Private browsing sessions should not look in keychain for client certificates https://bugs.webkit.org/show_bug.cgi?id=170618 Reviewed by Dan Bernstein. Our client certificate testing in WebKit leaves much to be desired. See rdar://problem/17694210 for reproduction steps. * platform/spi/cf/CFNetworkSPI.h: Add some new SPI. 2017-04-07 Zalan Bujtas Simple line layout: FlowContents::segmentIndexForRunSlow skips empty runs. https://bugs.webkit.org/show_bug.cgi?id=170552 Reviewed by Antti Koivisto. The compare function passed to std::lower_bound completely misses empty runs. Test: fast/text/simple-line-layout-hover-over-subsequent-linebreaks.html * rendering/SimpleLineLayoutFlowContents.cpp: (WebCore::SimpleLineLayout::FlowContents::segmentIndexForRunSlow): 2017-04-07 Chris Dumez We should log how much CPU a background process was using when killing it due to CPU limiting https://bugs.webkit.org/show_bug.cgi?id=170619 Reviewed by Andreas Kling. CPUMonitor now passes the CPU usage to the callback when it exceeds the threashold. * platform/CPUMonitor.cpp: (WebCore::CPUMonitor::timerFired): * platform/CPUMonitor.h: 2017-04-07 Chris Dumez Audible autoplay videos should not get paused when outside the viewport https://bugs.webkit.org/show_bug.cgi?id=170610 Reviewed by Eric Carlson. Audible autoplay videos should not get paused when outside the viewport as this would be observable by the user. Test: media/video-restricted-invisible-autoplay-allowed-if-audible.html * html/MediaElementSession.cpp: (WebCore::MediaElementSession::autoplayPermitted): 2017-04-07 Myles C. Maxfield REGRESSION(r211382): Complex text with justification erroneously overflows containers https://bugs.webkit.org/show_bug.cgi?id=170399 Reviewed by Simon Fraser. When we perform justification, we adjust glyphs' advances to add extra space between words. ComplexTextController maintains an invariant where m_totalWidth is equal to the sum of these advances. However, in RTL text, inserting extra justification space to the left of a glyph would break that invariant, and would increase the advances of two glyphs instead of just one. Then, when we go to draw the text, the sum of the advances is wider than m_totalWidth, which means the glyphs would be drawn outside of their container. This regressed in r211382 simply because of an oversight and because there were no tests for this codepath. Test: ComplexTextControllerTest.TotalWidthWithJustification * platform/graphics/ComplexTextController.cpp: (WebCore::ComplexTextController::adjustGlyphsAndAdvances): * rendering/InlineBox.h: (WebCore::InlineBox::InlineBox): 2017-04-07 Chris Dumez Throttle / Align DOM Timers in cross-origin iframes to 30fps https://bugs.webkit.org/show_bug.cgi?id=170613 Reviewed by Simon Fraser. Throttle / Align DOM Timers in cross-origin iframes to 30fps unless the user has interacted with them, in order to reduce power use. Test: http/tests/frame-throttling/timer-throttle-in-cross-origin-subframe.html * dom/Document.cpp: (WebCore::Document::domTimerAlignmentInterval): (WebCore::Document::updateLastHandledUserGestureTimestamp): * page/DOMTimer.h: 2017-04-07 John Wilander Follow-up fix for Soup platform. https://bugs.webkit.org/show_bug.cgi?id=170322 Unreviewed build fix. Error introduced by me in https://trac.webkit.org/changeset/215104/webkit. No new tests. * platform/network/soup/SocketStreamHandleImpl.h: Move parameter change to the right SocketStreamHandleImpl::create() function. 2017-04-07 John Wilander WebSocket streams should have network usage attributed to correct process https://bugs.webkit.org/show_bug.cgi?id=170322 Reviewed by Alex Christensen. Tested manually since it requires a per-app VPN. * page/SocketProvider.cpp: (WebCore::SocketProvider::createSocketStreamHandle): Sends in an empty struct since it doesn't have access to platform dependent sourceApplicationAuditData. * platform/network/SocketStreamHandle.h: Declaration of a per-platform struct to hold CF data for Cocoa platforms. * platform/network/cf/SocketStreamHandleImpl.h: (WebCore::SocketStreamHandleImpl::create): Now takes WebCore::SourceApplicationAuditToken which is passed on to the constructor. * platform/network/cf/SocketStreamHandleImplCFNet.cpp: (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl): Now takes WebCore::SourceApplicationAuditToken which is passed on to the streams once created. (WebCore::SocketStreamHandleImpl::createStreams): Now sets kCFStreamPropertySourceApplication for the two streams. * platform/network/curl/SocketStreamHandleImpl.h: (WebCore::SocketStreamHandleImpl::create): Added unused WebCore::SourceApplicationAuditToken parameter. * platform/network/soup/SocketStreamHandleImpl.h: * platform/network/soup/SocketStreamHandleImplSoup.cpp: (WebCore::SocketStreamHandleImpl::create): Added unused WebCore::SourceApplicationAuditToken parameter. 2017-04-07 Alex Christensen REGRESSION(r204512): WebSocket errors with "Failed to send WebSocket frame." if too much data is sent https://bugs.webkit.org/show_bug.cgi?id=170463 Reviewed by Michael Catanzaro. This only reproduces when using WebSockets to communicate with an external server. When communicating with a local server, CFWriteStreamWrite succeeds too reliably, so CFWriteStreamCanAcceptBytes returns true, when sometimes it doesn't when communicating across the real internet. * platform/network/cf/SocketStreamHandleImplCFNet.cpp: (WebCore::SocketStreamHandleImpl::platformSendInternal): * platform/network/soup/SocketStreamHandleImplSoup.cpp: (WebCore::SocketStreamHandleImpl::platformSendInternal): Returning std::nullopt means there was an error, which is not true when the socket stream is in a state where it cannot be written to because it is actively communicating. Returning 0 means 0 new bytes were sent, so we will try again later. 2017-04-07 Eric Carlson MediaSample should store video sample rotation instead of orientation https://bugs.webkit.org/show_bug.cgi?id=170598 Reviewed by Youenn Fablet. No new tests, no functional change. * platform/MediaSample.h: (WebCore::MediaSample::videoRotation): (WebCore::MediaSample::videoOrientation): Deleted. * platform/graphics/avfoundation/MediaSampleAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayLayer): * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::processNewFrame): * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp: (WebCore::RealtimeIncomingVideoSource::OnFrame): (WebCore::RealtimeIncomingVideoSource::processNewSample): * platform/mediastream/mac/RealtimeIncomingVideoSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable): 2017-04-07 Brent Fulgham WebKit should percent encode single quotes in query strings https://bugs.webkit.org/show_bug.cgi?id=170561 Reviewed by Alex Christensen. Modify the characterClassTable to instruct the URLParser to convert the single-quote character ' to %27 in URL query strings. Tests: URLParserTest in TestWebKitAPI. fast/events/popup-blocked-from-unique-frame-via-window-open-named-sibling-frame.html fast/frames/xss-auditor-handles-file-urls.html http/tests/security/xssAuditor * platform/URLParser.cpp: 2017-04-07 Zalan Bujtas Text insertion cursor disappears after pressing enter https://bugs.webkit.org/show_bug.cgi?id=169291 Reviewed by Tim Horton. Positon upstream/downstream (as the result of VisiblePosition -> canonicalPosition) require linebox tree. In addition to regular text, we need to bail out of simple line layout on line breaks too. Test: editing/simple-line-layout-caret-is-gone.html * dom/Position.cpp: (WebCore::ensureLineBoxesIfNeeded): (WebCore::Position::upstream): (WebCore::Position::downstream): (WebCore::Position::getInlineBoxAndOffset): * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::ensureLineBoxes): (WebCore::RenderLineBreak::positionForPoint): (WebCore::RenderLineBreak::setSelectionState): (WebCore::RenderLineBreak::collectSelectionRects): (WebCore::ensureLineBoxes): Deleted. * rendering/RenderLineBreak.h: 2017-04-07 Xan Lopez [GTK] Fix codec name in OWR ASSERT https://bugs.webkit.org/show_bug.cgi?id=170600 Reviewed by Carlos Garcia Campos. * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp: (WebCore::MediaEndpointOwr::prepareMediaSession): uppercase the codec name we are looking for, that's how they appear in the vector. 2017-04-07 Per Arne Vollan Add hasVideo property to WebAVPlayerController. https://bugs.webkit.org/show_bug.cgi?id=170545 rdar://problem/31325182 Reviewed by Eric Carlson. Add a new "hasVideo" property which can be used to discover if any video content is present in the playback item, whether video content is currently enabled or not. * platform/ios/WebAVPlayerController.h: * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: (WebVideoFullscreenInterfaceAVKit::hasVideoChanged): 2017-04-07 Miguel Gomez [GTK+] Animations not played properly when using synchronous decoding https://bugs.webkit.org/show_bug.cgi?id=170591 Reviewed by Carlos Garcia Campos. Fix an index error when destroying decoded frames that was sometimes deleting the frame we wanted to keep. Covered by exitent tests. * platform/graphics/ImageFrameCache.cpp: (WebCore::ImageFrameCache::destroyDecodedData): 2017-04-07 Xan Lopez [GTK] Add message about missing codecs to ASSERT in OWR https://bugs.webkit.org/show_bug.cgi?id=170596 Reviewed by Carlos Garcia Campos. * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp: (WebCore::MediaEndpointOwr::prepareMediaSession): add a message about the missing coded to the ASSERT. 2017-04-07 Tomas Popela AX: Don't crash if no renderer is available for AccessibilityRenderObject https://bugs.webkit.org/show_bug.cgi?id=170448 Reviewed by Chris Fleizach. Don't crash or assert if no renderer is available, but early return gracefully (as in other places in the AccessibilityRenderObject.cpp). Spotted by running some tests through dogtail. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::isOffScreen): (WebCore::AccessibilityRenderObject::isUnvisited): (WebCore::AccessibilityRenderObject::isVisited): 2017-04-07 Carlos Garcia Campos [GTK] Update the priorities used in glib main loop sources https://bugs.webkit.org/show_bug.cgi?id=170457 Reviewed by Žan Doberšek. * platform/glib/MainThreadSharedTimerGLib.cpp: (WebCore::MainThreadSharedTimer::MainThreadSharedTimer): * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp: (WebCore::TextureMapperPlatformLayerProxy::TextureMapperPlatformLayerProxy): (WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread): 2017-04-07 Zan Dobersek [GCrypt] Implement AES_CBC support https://bugs.webkit.org/show_bug.cgi?id=170550 Reviewed by Michael Catanzaro. Implement the CryptoAlgorithmAES_CBC::platform{Encrypt,Decrypt} functionality for configurations that use libgcrypt. This is done by leveraging the gcry_cipher_* APIs for the AES algorithm that's deduced appropriately from the key size and the CBC cipher mode. Additionally, the PKCS#7 padding is implemented for each operation, as demanded by the Web Crypto specification. No new tests -- current ones cover this sufficiently, but are not yet enabled due to missing platform-specific SUBTLE_CRYPTO implementations. * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: (WebCore::gcryptEncrypt): (WebCore::gcryptDecrypt): (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt): (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt): 2017-04-07 Zan Dobersek [GCrypt] Implement raw and JWK imports and exports for EC keys https://bugs.webkit.org/show_bug.cgi?id=170546 Reviewed by Michael Catanzaro. Implement import and export operations for EC keys, covering the raw and JWK import/export types. CryptoKeyEC::platformImportRaw() builds a public-key s-expression, providing the curve name and the key data, and yields the gcry_sexp_t object to the new CryptoKeyEC. CryptoKeyEC::platformImportJWKPublic() first constructs a Vector object that contains the EC point in the uncompressed format. It then puts that data into a newly-constructed public-key s-expression that is then used to construct the new CryptoKeyEC object. CryptoKeyEC::platformImportJWKPrivate() constructs the EC point data just the same, but it also lays out the private key field element data into the private-key s-expression that's then handed off to the CryptoKeyEC object. CryptoKeyEC::platformExportRaw() constructs a new EC operations context and then uses it to retrieve the q parameter as an MPI. A Vector is retrieved from the MPI data through the extractMPIData() helper function. CryptoKeyEC::platformAddFieldElements() similarly uses the EC operations context to retrieve the q parameter data, which it then splits into the x and y field elements and Base64 URL-encodes them into a form that can be placed in a JsonWebKey. If the key is private, the d parameter is retrieved in the same fashion and again Base64 URL-encoded and stored in the JsonWebKey object. No new tests -- current ones cover this sufficiently, but are not yet enabled due to other missing platform-specific SUBTLE_CRYPTO implementations. * crypto/gcrypt/CryptoKeyECGCrypt.cpp: (WebCore::uncompressedPointSizeForCurve): (WebCore::uncompressedFieldElementSizeForCurve): (WebCore::extractMPIData): (WebCore::CryptoKeyEC::platformImportRaw): (WebCore::CryptoKeyEC::platformImportJWKPublic): (WebCore::CryptoKeyEC::platformImportJWKPrivate): (WebCore::CryptoKeyEC::platformExportRaw): (WebCore::CryptoKeyEC::platformAddFieldElements): 2017-04-07 Zan Dobersek [GCrypt] Implement CryptoKeyRSA::generatePair() https://bugs.webkit.org/show_bug.cgi?id=170350 Reviewed by Michael Catanzaro. Start implementing the libgcrypt-based platform bits of CryptoKeyRSA. Implement generatePair() by constructing a genkey s-expression that requests a generation of an RSA key that should use a modulus of the specified bit-length and the specified exponent. The exponent is extracted from an uint8_t array through a helper function. The modulus length value is checked to be at least 16, since libgcrypt does not support generating primes of less than that length in bits. The returned s-expression upon request will contain the data for both the public and the private key. gcry_sexp_t handles representing those s-expressions are then passed to CryptoKeyRSA::create() before invoking the success callback with a new CryptoKeyPair object in a separate ScriptExecutionContext task. The CryptoKeyRSA constructor simply has the notImplemented() call removed. The destructor now invokes the HandleDeleter object instance to destroy the object represented by the m_platformKey handle. The methods in CryptoKeyRSA.cpp are also reordered to follow the declaration order used in the header. No new tests -- current ones cover this sufficiently, but are not yet enabled due to other missing platform-specific SUBTLE_CRYPTO implementations. * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: (WebCore::CryptoKeyRSA::CryptoKeyRSA): (WebCore::CryptoKeyRSA::~CryptoKeyRSA): (WebCore::exponentVectorToUInt32): (WebCore::CryptoKeyRSA::generatePair): (WebCore::CryptoKeyRSA::importSpki): (WebCore::CryptoKeyRSA::importPkcs8): (WebCore::CryptoKeyRSA::exportPkcs8): (WebCore::CryptoKeyRSA::buildAlgorithm): (WebCore::CryptoKeyRSA::exportData): * crypto/keys/CryptoKeyRSA.h: 2017-04-06 Youenn Fablet [Debug] ASSERT(!throwScope.exception()) on imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html https://bugs.webkit.org/show_bug.cgi?id=170395 Reviewed by Mark Lam. * bindings/js/JSDOMPromise.cpp: (WebCore::DeferredPromise::reject): Exiting early in case of scope having an exception. Adding an assertion to ensure this is a worker termination exception. 2017-04-06 Andreas Kling Inaudible background tabs should become eligible for memory kill after 8 minutes https://bugs.webkit.org/show_bug.cgi?id=170574 Reviewed by Gavin Barraclough. Lower the delay for potentially marking background tabs as inactive from 60 minutes to 8 minutes. Letting a tab misbehave in the background for an entire hour was overly charitable. * page/PerformanceMonitor.cpp: 2017-04-06 Wenson Hsieh Scroll offset jumps after a programmatic scroll in an overflow container with scroll snapping https://bugs.webkit.org/show_bug.cgi?id=170560 Reviewed by Tim Horton. Test: css3/scroll-snap/scroll-snap-programmatic-overflow-scroll.html Logic for maintaining the scroll snap state in ScrollController was previously removed from iOS when refactoring ScrollController. This was done because scroll snapping on iOS is driven not by the ScrollController (as it is on Mac) but rather by sending scroll snap offsets to the UI process and hooking into UIScrollView delegates to handle retargeted scrolling. However, on iOS, this ScrollController state is still important for the purposes of keeping the last active snap point index in sync with the UI process when the scroll offset changes outside of a user gesture (i.e. programmatic scrolling). Since the UI process does not get a chance to update the active snap offset during a programmatic scroll, our last active snap offset state was only being updated to the last snap position that the user manually scrolled to, making programmatic scrolling jump to this offset. To fix this, we need to update scroll snap state on iOS within ScrollController. Also adds a new Layout test that exercises programmatic scrolling in an overflow scrolling container on all platforms. * platform/cocoa/ScrollController.mm: (WebCore::otherScrollEventAxis): (WebCore::ScrollController::updateScrollSnapState): (WebCore::ScrollController::updateScrollSnapPoints): 2017-04-05 Simon Fraser Throttle requestAnimationFrame in cross-origin iframes to 30fps https://bugs.webkit.org/show_bug.cgi?id=170534 Reviewed by Dan Bates. Add a throttling reason to ScriptedAnimationController which is NonInteractedCrossOriginFrame, set on cross-origin iframes whose documents have never seen a user interaction. It's cleared as soon as an interaction on this frame or a child frame is detected. Move the initialization of the LowPowerMode throttling reason to Document::requestAnimationFrame(), since it's more appropriate to compute NonInteractedCrossOriginFrame here than down in ScriptedAnimationController, and best to do both in the same place. Tests: http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe.html * dom/Document.cpp: (WebCore::Document::requestAnimationFrame): (WebCore::Document::updateLastHandledUserGestureTimestamp): * dom/Document.h: (WebCore::Document::hasHadUserInteraction): * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::ScriptedAnimationController): (WebCore::throttlingReasonToString): (WebCore::ScriptedAnimationController::interval): * dom/ScriptedAnimationController.h: * loader/FrameLoader.cpp: (WebCore::shouldAskForNavigationConfirmation): 2017-04-05 Simon Fraser Use the Accelerate framework to optimize FEColorMatrix operations https://bugs.webkit.org/show_bug.cgi?id=170518 Reviewed by Tim Horton. On macOS and iOS, we can use the Accelerate framework (vImage) to do color matrix math to optimize color matrix, hue rotate, saturation and luminosity to alpha filters. Change ImageBuffer::getUnmultipliedImageData() and getPremultipliedImageData() to return the size of the returned Uint8ClampedArray in physical pixels, because we need to pass that to vImage. * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::getImageData): * platform/graphics/ImageBuffer.h: * platform/graphics/cairo/ImageBufferCairo.cpp: (WebCore::ImageBuffer::getUnmultipliedImageData): (WebCore::ImageBuffer::getPremultipliedImageData): * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::ImageBuffer::getUnmultipliedImageData): (WebCore::ImageBuffer::getPremultipliedImageData): * platform/graphics/filters/FEColorMatrix.cpp: (WebCore::effectApplyAccelerated): (WebCore::effectType): (WebCore::FEColorMatrix::platformApplySoftware): * platform/graphics/filters/FEDropShadow.cpp: (WebCore::FEDropShadow::platformApplySoftware): * platform/graphics/win/ImageBufferDirect2D.cpp: (WebCore::ImageBuffer::getUnmultipliedImageData): (WebCore::ImageBuffer::getPremultipliedImageData): 2017-04-04 Simon Fraser Do some minor FEColorMatrix code cleanup and optimization https://bugs.webkit.org/show_bug.cgi?id=170474 Reviewed by Dean Jackson. Don't switch inside of a pixel processing loop; repeat the loop inside switch (filterType). Change matrix() and saturateAndHueRotate() to dereference the source pixels once, instead of multiple times, which is faster. This kind of code benefits from aligning things with spaces for readability, so do so, violating webkit style. Add some off-by-default performance logging code. Increases pixel processing performance from about 86ms per megapixel to 65ms per megapixel. * platform/graphics/filters/FEColorMatrix.cpp: (WebCore::matrix): (WebCore::saturateAndHueRotate): (WebCore::effectType): (WebCore::FEColorMatrix::platformApplySoftware): 2017-04-06 Ryan Haddad Unreviewed, rolling out r215041. The LayoutTest for this change is failing on ios-simulator. Reverted changeset: "Rendering flexbox children across columns" https://bugs.webkit.org/show_bug.cgi?id=164166 http://trac.webkit.org/changeset/215041 2017-04-06 Ryan Haddad Unreviewed, rolling out r215046. This change broke internal builds. Reverted changeset: "WebRTC tests gardening" https://bugs.webkit.org/show_bug.cgi?id=170508 http://trac.webkit.org/changeset/215046 2017-04-06 Joseph Pecoraro Web Inspector: Only Capture Extra Network Load Metrics when there is a Web Inspector Frontend https://bugs.webkit.org/show_bug.cgi?id=170525 Reviewed by Youenn Fablet. Covered by existing tests that when Web Inspector is open we enable collecting the extra data. * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::firstFrontendCreated): (WebCore::InspectorInstrumentation::lastFrontendDeleted): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::frontendCreated): (WebCore::InspectorInstrumentation::frontendDeleted): When the first frontend is created enable a new loader strategy to collect extra network load metrics. When the last frontend is closed disable the extra metrics. * loader/LoaderStrategy.h: * platform/PlatformStrategies.h: New load strategy to enable/disable new metrics. 2017-04-06 Joseph Pecoraro Web Inspector: Show all headers in the Request Headers section of the Resource details sidebar https://bugs.webkit.org/show_bug.cgi?id=16531 Reviewed by Timothy Hatcher. Test: http/tests/inspector/network/resource-request-headers.html * loader/ResourceTiming.cpp: (WebCore::ResourceTiming::ResourceTiming): Eliminate unnecessary data from the NetworkLoadTiming object when it is used for ResourceTiming. This clears up some memory that will otherwise never be used. * platform/network/NetworkLoadMetrics.h: (WebCore::NetworkLoadMetrics::isolatedCopy): (WebCore::NetworkLoadMetrics::reset): (WebCore::NetworkLoadMetrics::clearNonTimingData): (WebCore::NetworkLoadMetrics::operator==): (WebCore::NetworkLoadMetrics::encode): (WebCore::NetworkLoadMetrics::decode): Include an optional HTTPHeaderMap for a refined list of request headers for this network load. * inspector/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::buildObjectForMetrics): Include request headers with other optional metrics data when the load is completed. 2017-04-06 Tim Horton Follow up to r209304, remove line numbers from one more StyleRule construction https://bugs.webkit.org/show_bug.cgi?id=170564 Reviewed by Simon Fraser. * css/StyleRule.cpp: (WebCore::StyleRuleViewport::StyleRuleViewport): This one was missed in r209304. 2017-04-06 Timothy Horton Remove an unused member and constructor parameter from CSSPropertyParser https://bugs.webkit.org/show_bug.cgi?id=170562 Reviewed by Simon Fraser. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseSingleValue): (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::consumeDeclarationValue): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::CSSPropertyParser): (WebCore::CSSPropertyParser::parseValue): (WebCore::CSSPropertyParser::parseSingleValue): * css/parser/CSSPropertyParser.h: It is possible to get Clang to complain about the unused member, though I'm not sure why it doesn't in the build today. 2017-04-06 Zalan Bujtas Simple line layout: Hittest always returns the first renderer in the block. https://bugs.webkit.org/show_bug.cgi?id=170520 Reviewed by Antti Koivisto. This is incorrect now with
      support (multiple renderers within the same block flow). Test: fast/dom/Document/CaretRangeFromPoint/simple-line-layout-hittest-with-caret-range-from-point.html * rendering/RenderText.cpp: (WebCore::RenderText::positionForPoint): Related fix. We don't yet support positionForPoint with multiple renderes. * rendering/SimpleLineLayoutFlowContents.h: (WebCore::SimpleLineLayout::FlowContents::segmentForRun): Empty runs are all valid. * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::hitTestFlow): (WebCore::SimpleLineLayout::collectFlowOverflow): * rendering/SimpleLineLayoutResolver.cpp: (WebCore::SimpleLineLayout::LineResolver::Iterator::operator*): This should eventually return a list of renderes. * rendering/SimpleLineLayoutResolver.h: (WebCore::SimpleLineLayout::RunResolver::flowContents): 2017-04-06 Jon Davis Updates feature status for recently shipped features https://bugs.webkit.org/show_bug.cgi?id=170359 Reviewed by Brian Burg. Added missing Gamepad entry. Changed "Done" status to "Supported". Also changed status from "In Development" to "Supported" for: - CSS Grid Layout Level 1 - CSS Inline Layout Module Level 3 - CSS Scroll Snap Points Module Level 1 - CSS Color Level 4 - Fetch API - Indexed Database 2.0 - Media Capture and Streams - Pointer Lock - Preload - Input Events * features.json: 2017-03-31 Jiewen Tan [WebCrypto] Add support for AES-CTR https://bugs.webkit.org/show_bug.cgi?id=169761 Reviewed by Brent Fulgham. This patch adds support for AES-CTR. Operations of AES-CTR include: encrypt, decrypt, generateKey, importKey, exportKey, wrapKey, and unwrapKey. This implementation follows the latest WebCryptoAPI spec: https://www.w3.org/TR/WebCryptoAPI/#aes-ctr. Tests: crypto/subtle/aes-ctr-encrypt-malformed-parameters.html crypto/subtle/aes-ctr-encrypt-overflow.html crypto/subtle/aes-ctr-generate-export-key-jwk-length-128.html crypto/subtle/aes-ctr-generate-export-key-jwk-length-192.html crypto/subtle/aes-ctr-generate-export-key-jwk-length-256.html crypto/subtle/aes-ctr-generate-export-raw-key.html crypto/subtle/aes-ctr-generate-key-encrypt-decrypt.html crypto/subtle/aes-ctr-generate-key.html crypto/subtle/aes-ctr-import-jwk-key-length-128.html crypto/subtle/aes-ctr-import-jwk-key-length-192.html crypto/subtle/aes-ctr-import-jwk-key-length-256.html crypto/subtle/aes-ctr-import-key-decrypt.html crypto/subtle/aes-ctr-import-key-encrypt.html crypto/subtle/aes-ctr-import-key-unwrap-jwk-key.html crypto/subtle/aes-ctr-import-key-unwrap-raw-key.html crypto/subtle/aes-ctr-import-key-wrap-jwk-key.html crypto/subtle/aes-ctr-import-key-wrap-raw-key.html crypto/subtle/aes-ctr-import-raw-key.html crypto/workers/subtle/aes-ctr-import-key-decrypt.html crypto/workers/subtle/aes-ctr-import-key-encrypt.html crypto/workers/subtle/aes-ctr-import-key-unwrap-key.html crypto/workers/subtle/aes-ctr-import-key-wrap-key.html * CMakeLists.txt: * DerivedSources.make: * PlatformGTK.cmake: * PlatformMac.cmake: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSSubtleCryptoCustom.cpp: (WebCore::normalizeCryptoAlgorithmParameters): * crypto/CryptoAlgorithmParameters.h: * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp: Added. (WebCore::usagesAreInvalidForCryptoAlgorithmAES_CTR): (WebCore::parametersAreValid): (WebCore::CryptoAlgorithmAES_CTR::create): (WebCore::CryptoAlgorithmAES_CTR::identifier): (WebCore::CryptoAlgorithmAES_CTR::encrypt): (WebCore::CryptoAlgorithmAES_CTR::decrypt): (WebCore::CryptoAlgorithmAES_CTR::generateKey): (WebCore::CryptoAlgorithmAES_CTR::importKey): (WebCore::CryptoAlgorithmAES_CTR::exportKey): (WebCore::CryptoAlgorithmAES_CTR::getKeyLength): * crypto/algorithms/CryptoAlgorithmAES_CTR.h: Added. * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp: Added. (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt): (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt): * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp: Added. (WebCore::bigIntegerToSize): (WebCore::transformAES_CTR): (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt): (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt): * crypto/mac/CryptoAlgorithmRegistryMac.cpp: (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): * crypto/parameters/AesCtrParams.idl: Added. * crypto/parameters/CryptoAlgorithmAesCtrParams.h: Added. 2017-04-06 Youenn Fablet WebRTC tests gardening https://bugs.webkit.org/show_bug.cgi?id=170508 Reviewed by Eric Carlson. * Configurations/FeatureDefines.xcconfig: Changing webrtc enabling for ios. 2017-04-06 Andreas Kling Stop forcing CA commit when memory pressure changes. https://bugs.webkit.org/show_bug.cgi?id=170522 Reviewed by Antti Koivisto. Don't force a CA commit when reaching critical memory pressure. We're already doing a ton of work in response to the pressure, and this was really a hack to try to react quickly on 512 MB devices which we don't support anymore. * page/MemoryRelease.cpp: (WebCore::releaseCriticalMemory): 2017-04-06 Romain Bellessort [Readable Streams API] Implement ReadableStreamBYOBRequest respondWithNewView() https://bugs.webkit.org/show_bug.cgi?id=170339 Reviewed by Youenn Fablet. Implemented ReadableStreamBYOBRequest respondWithNewView(). Added new tests to check respondWithNewView() behaviour. * Modules/streams/ReadableByteStreamInternals.js: (readableByteStreamControllerRespondWithNewView): Added. * Modules/streams/ReadableStreamBYOBRequest.js: (respondWithNewView): Updated. 2017-04-06 Eric Carlson [MediaStream] Host application should be able to mute and unmute media streams https://bugs.webkit.org/show_bug.cgi?id=170519 Unreviewed, fix crash introduced in r214980. * Modules/mediastream/MediaStream.cpp: (WebCore::MediaStream::MediaStream): NULL-check page. 2017-04-06 Dave Hyatt Rendering flexbox children across columns https://bugs.webkit.org/show_bug.cgi?id=164166 Reviewed by Zalan Bujtas. Added fast/multicol/flexbox-rows.html. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::adjustForUnsplittableChild): Treat block-level flexboxes that occur inside block flows the same as replaced and unsplittable elements and push them to the next page if they don't fit. We don't update the minimum page height though, since the flexbox is not really unsplittable. 2017-04-05 Simon Fraser Set lastHandledUserGestureTimestamp on all ancestor documents, not just the top document https://bugs.webkit.org/show_bug.cgi?id=170479 Reviewed by Sam Weinig. When interacting with a subframe document, set lastHandledUserGestureTimestamp on all ancestor documents up to the root. This will be used in future for requestAnimationFrame throttling. Test: fast/frames/user-gesture-timestamp-propagation.html * dom/Document.cpp: (WebCore::Document::updateLastHandledUserGestureTimestamp): * dom/Document.h: * dom/UserGestureIndicator.cpp: (WebCore::UserGestureIndicator::UserGestureIndicator): * testing/Internals.cpp: (WebCore::Internals::lastHandledUserGestureTimestamp): * testing/Internals.h: * testing/Internals.idl: 2017-04-05 Eric Carlson [MediaStream] Host application should be able to mute and unmute media streams https://bugs.webkit.org/show_bug.cgi?id=170519 Unreviewed, address review comments missed in the initial checkin. * Modules/mediastream/MediaStream.cpp: (WebCore::MediaStream::MediaStream): Mute the private stream if the page doesn't allow capture. (WebCore::MediaStream::pageMutedStateDidChange): setMuted -> setCaptureTracksMuted. * platform/mediastream/MediaStreamPrivate.cpp: (WebCore::MediaStreamPrivate::addTrack): Don't track muted state, the capture source already does. (WebCore::MediaStreamPrivate::startProducingData): Ditto. (WebCore::MediaStreamPrivate::setCaptureTracksMuted): Renamed from setMuted. (WebCore::MediaStreamPrivate::setMuted): Deleted. * platform/mediastream/MediaStreamPrivate.h: 2017-04-05 Eric Carlson [MediaStream] Host application should be able to mute and unmute media streams https://bugs.webkit.org/show_bug.cgi?id=170519 Reviewed by Youenn Fablet. No new tests, fast/mediastream/MediaStream-page-muted.html was updated. * Modules/mediastream/MediaStream.cpp: (WebCore::MediaStream::~MediaStream): Fix a typo. (WebCore::MediaStream::pageMutedStateDidChange): Don't store muted state, let the private stream store it. (WebCore::MediaStream::mediaState): Deal with new muted state flags. * Modules/mediastream/MediaStream.h: * dom/Document.cpp: (WebCore::Document::prepareForDestruction): Clear media state before the frame is cleared. * page/MediaProducer.h: Add muted flags. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack): The display layer should not be visible when the video track is muted. * platform/mediastream/MediaStreamPrivate.cpp: (WebCore::MediaStreamPrivate::addTrack): Mute the new track if necessary. (WebCore::MediaStreamPrivate::startProducingData): Do nothing when muted. (WebCore::MediaStreamPrivate::setExternallyMuted): New, mute/unmute tracks. * platform/mediastream/MediaStreamPrivate.h: * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::setMuted): Start/stop producing data. * testing/Internals.cpp: (WebCore::Internals::pageMediaState): Support new media stream muted flags. 2017-04-05 Andreas Kling Make inactive web processes behave as though under memory pressure. https://bugs.webkit.org/show_bug.cgi?id=170042 Reviewed by Antti Koivisto. Prevent PerformanceMonitor from marking the process as inactive at startup. This fixes the API test failure that caused this patch to get rolled out. * page/PerformanceMonitor.h: 2017-04-05 Youenn Fablet Switch to kCVPixelFormatType_420YpCbCr8BiPlanarFullRange for Mac video capture format https://bugs.webkit.org/show_bug.cgi?id=170509 Reviewed by Eric Carlson. Covered by existing tests. * platform/mediastream/mac/AVVideoCaptureSource.mm: 2017-04-05 Javier Fernandez [css-align] Implement the place-items shorthand https://bugs.webkit.org/show_bug.cgi?id=168847 Reviewed by David Hyatt. The CSS Box Alignment specification defines a new shorthand to set the Content Alignment properties (align-items and justify-items) at the same time. This patch provides the implementation of the CSS parsing logic and the required regression tests. For the time being, as it happens with the rest of the new alignment properties, the new parsing logic is implemented behind the CSS Grid Layout runtime flag. Test: css3/parse-place-items.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/CSSProperties.json: * css/StyleProperties.cpp: (WebCore::StyleProperties::getPropertyValue): (WebCore::StyleProperties::getAlignmentShorthandValue): * css/StyleProperties.h: * css/parser/CSSPropertyParser.cpp: (WebCore::isAutoOrNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeSimplifiedItemPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): * css/parser/CSSPropertyParser.h: 2017-04-05 Ryan Haddad Unreviewed, rolling out r214932. This change broke an internal build. Reverted changeset: "[ios-simulator] API test WebKit2.DataDetectionReferenceDate timing out" https://bugs.webkit.org/show_bug.cgi?id=161967 http://trac.webkit.org/changeset/214932 2017-04-05 Ryan Haddad Unreviewed, rolling out r214962. Roll r214937 back in because it wasn't at fault for the build breakage. Reverted changeset: "Unreviewed, rolling out r214937." https://bugs.webkit.org/show_bug.cgi?id=170365 http://trac.webkit.org/changeset/214962 2017-04-05 Ryan Haddad Unreviewed, rolling out r214937. This change broke an internal build. Reverted changeset: "REGRESSION (r202472): Data Detection overwrites existing links in detected ranges" https://bugs.webkit.org/show_bug.cgi?id=170365 http://trac.webkit.org/changeset/214937 2017-04-05 Carlos Alberto Lopez Perez [WebRTC][OpenWebRTC] Add support for SDP BUNDLE ("a:group:BUNDLE" and "a=bundle-only" lines) https://bugs.webkit.org/show_bug.cgi?id=170157 Reviewed by Alejandro G. Castro. This implements support on the SDPProcessor for generating an "a=group:BUNDLE" attribute with the MID identifiers specified in the bundle group in the most recent answer. It also implements support for generating "a=bundle-only" attributes on the "m=" sections of the SDP according to the bundlePolicy defined. Test: fast/mediastream/RTCPeerConnection-inspect-offer-bundlePolicy-bundle-only.html * Modules/mediastream/MediaEndpointPeerConnection.cpp: (WebCore::MediaEndpointPeerConnection::createOfferTask): (WebCore::MediaEndpointPeerConnection::createAnswerTask): * Modules/mediastream/SDPProcessor.cpp: (WebCore::getBundlePolicyName): (WebCore::configurationToJSON): * Modules/mediastream/sdp.js: (SDP.generate): * platform/mediastream/MediaEndpointSessionConfiguration.h: (WebCore::MediaEndpointSessionConfiguration::bundlePolicy): (WebCore::MediaEndpointSessionConfiguration::setBundlePolicy): (WebCore::MediaEndpointSessionConfiguration::clone): 2017-04-05 Jer Noble [MSE] Seeks to currentTime=0 will fail if currentTime is already 0. https://bugs.webkit.org/show_bug.cgi?id=170510 Reviewed by Eric Carlson. Test: media/media-source/media-source-unnecessary-seek-seeked.html The AVSampleBufferRenderSynchronizer won't fire a time jumped notification if no seek is actully necessary. So short circuit the seek logic if the seek time is identical to the current synchronizer time. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): 2017-04-05 Chris Dumez changing to disabled while active breaks all pointer events https://bugs.webkit.org/show_bug.cgi?id=170447 Reviewed by Geoffrey Garen. When a range's slider is being moved, we set SliderThumbElement's m_inDragMode flag to true and mark the range elements as the CapturingMouseEventsElement. When we get the mouseUp event, we are supposed to exit drag mode. However, when the range element gets disabled while dragging, we do not get the mouseUp event and we need to make sure we exit dragging mode anyway. r112547 tried to fix this by calling stopDragging() in SliderThumbElement::defaultEventHandler() when the input element is disabled. While this often works, this is fragile and we sometimes fail to exit dragging mode when we should. This patch addressed the issue by calling stopDragging() in SliderThumbElement::disabledAttributeChanged() instead. This is much safer as we guarantee will exit dragging mode whenever the range element gets disabled, even if SliderThumbElement::defaultEventHandler() does not get called after that. Test: fast/forms/range/disabled-while-dragging.html * html/RangeInputType.cpp: (WebCore::RangeInputType::disabledAttributeChanged): * html/RangeInputType.h: * html/shadow/SliderThumbElement.cpp: (WebCore::SliderThumbElement::defaultEventHandler): (WebCore::SliderThumbElement::disabledAttributeChanged): * html/shadow/SliderThumbElement.h: 2017-04-05 Eric Carlson [MediaStream] Video doesn't render in fullscreen on iOS https://bugs.webkit.org/show_bug.cgi?id=170404 Reviewed by Youenn Fablet. No new tests, filed https://bugs.webkit.org/show_bug.cgi?id=170512. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Include video fullscreen manager on iOS too. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix): Add paramater to force transform recalculation. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): Restructure code since the display layer resize happens elsewhere. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): Include video fullscreen manager on iOS too. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers): Ditto. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Ditto. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer): Ditto. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::backgroundLayerBoundsChanged): Change the display layer size and position immediately instead of waiting for the next sample buffer so the display is correct when fullscreen mode changes when paused. 2017-04-05 Youenn Fablet Deprecate and remove URL.createObjectURL(mediastream) https://bugs.webkit.org/show_bug.cgi?id=167518 Reviewed by Eric Carlson. Covered by updated tests. * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * Modules/mediastream/DOMURLMediaStream.cpp: Removed. * Modules/mediastream/DOMURLMediaStream.h: Removed. * Modules/mediastream/DOMURLMediaStream.idl: Removed. * WebCore.xcodeproj/project.pbxproj: * html/DOMURL.idl: 2017-04-05 Alejandro G. Castro [Webrtc] Mock realtime sources factories should be static after r213941 https://bugs.webkit.org/show_bug.cgi?id=170282 Reviewed by Alex Christensen. If we don't make the variables static we would be returning a local variable. * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::MockRealtimeAudioSource::factory): * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::factory): 2017-04-05 Alex Christensen Fix CMake build. * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: Some JavaScript inline functions were not being accessed from this file with different enable flags. * platform/spi/cf/CFNetworkSPI.h: * platform/spi/cocoa/NSURLConnectionSPI.h: Moved NSURLSession-specific SPI from NSURLConnectionSPI.h to CFNetworkSPI.h. 2017-04-05 Chris Dumez _blank / _self / _parent / _top browsing context names should be case-insensitive https://bugs.webkit.org/show_bug.cgi?id=169747 Reviewed by Alex Christensen. _blank / _self / _parent / _top browsing context names should be case-insensitive as per the HTML specification: - https://html.spec.whatwg.org/#browsing-context-names This aligns our behavior with Firefox as well. See discussion at: - https://github.com/whatwg/html/issues/2443 Tests: imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank.html imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001.html imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002.html imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): (WebCore::createWindow): * page/DOMWindow.cpp: (WebCore::DOMWindow::open): * page/FrameTree.cpp: (WebCore::FrameTree::uniqueChildName): (WebCore::FrameTree::find): 2017-04-05 Miguel Gomez [GTK+] PNG animations that should run once are not played at all https://bugs.webkit.org/show_bug.cgi?id=170499 Reviewed by Carlos Garcia Campos. The repetition count reported bu the PNGImageDecoder is wrong. It's returning m_playCount - 1, which means 0 for the animations that need to be played once. Change it to return an appropriate value. Covered by existent tests. * platform/image-decoders/png/PNGImageDecoder.cpp: (WebCore::PNGImageDecoder::repetitionCount): * platform/image-decoders/png/PNGImageDecoder.h: 2017-04-05 Andy Estes REGRESSION (r202472): Data Detection overwrites existing links in detected ranges https://bugs.webkit.org/show_bug.cgi?id=170365 Reviewed by Tim Horton. r202472 changed the node traversal in searchForLinkRemovingExistingDDLinks() to only consider nodes that are descendants of startNode, but we need to traverse all nodes between startNode and endNode to find existing non-DD links. As a result, we'd add a Data Detector link to the following snippet and make the original links un-clickable: tomorrow night Fix this by not specifying a stayWithin node when calling NodeTraversal::next(). The loop will terminate when we reach endNode. Updated WebKit2.DataDetectionReferenceDate API test. * editing/cocoa/DataDetection.mm: (WebCore::searchForLinkRemovingExistingDDLinks): 2017-04-04 Carlos Garcia Campos Move WebErrors from WebProcess to Shared and get rid of ErrorsGtk in WebCore https://bugs.webkit.org/show_bug.cgi?id=156974 Reviewed by Sam Weinig. Remove ErrorsGtk. * PlatformGTK.cmake: * platform/gtk/ErrorsGtk.cpp: Removed. * platform/gtk/ErrorsGtk.h: Removed. 2017-04-05 Andy Estes [ios-simulator] API test WebKit2.DataDetectionReferenceDate timing out https://bugs.webkit.org/show_bug.cgi?id=161967 Reviewed by Alexey Proskuryakov. DataDetectorsCoreSPI.h defined DDQueryOffset as a struct of two CFIndexes, which is 16 bytes on LP64, but the struct is actually defined as two CFIndex-typed 32-bit bitfields, which is 8 bytes on LP64. This breaks the ABI on Public SDK builds when calling functions that take or return DDQueryOffsets. * platform/spi/cocoa/DataDetectorsCoreSPI.h: Updated the DDQueryOffset definition for Public SDK builds, and added a static_assert to detect future size changes at compile time. 2017-04-04 Jer Noble Move AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h https://bugs.webkit.org/show_bug.cgi?id=170471 Reviewed by Eric Carlson. Move the declaration of AVSampleBufferDisplayLayer (and related classes) into AVFoundationSPI. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: * platform/spi/mac/AVFoundationSPI.h: 2017-04-04 Youenn Fablet Canvas is tainted when painting a video with MediaStreamTrack https://bugs.webkit.org/show_bug.cgi?id=170486 Reviewed by Eric Carlson. Test: http/tests/media/media-stream/getusermedia-with-canvas.html Adding the notion of isolated source so that we can later on implement WebRTC isolated tracks. For now, canvas will not be tainted if painted from a MediaStreamTrack. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didPassCORSAccessCheck): * platform/mediastream/MediaStreamTrackPrivate.h: (WebCore::MediaStreamTrackPrivate::isIsolated): * platform/mediastream/RealtimeMediaSource.h: 2017-04-04 Commit Queue Unreviewed, rolling out r214894, r214895, r214907, r214912, and r214918. https://bugs.webkit.org/show_bug.cgi?id=170491 Caused build failures on Mac (Requested by rniwa on #webkit). Reverted changesets: "Build fix." http://trac.webkit.org/changeset/214894 "Rolling back the build fix, as it broke other builds." http://trac.webkit.org/changeset/214895 "Move AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h" https://bugs.webkit.org/show_bug.cgi?id=170471 http://trac.webkit.org/changeset/214907 "Unreviewed build fix: fix compilation error on Sierra." http://trac.webkit.org/changeset/214912 "More build fixing." http://trac.webkit.org/changeset/214918 2017-04-04 Youenn Fablet [Mac] Add back web audio support for getUserMedia MediaStreamTrack https://bugs.webkit.org/show_bug.cgi?id=170482 Reviewed by Eric Carlson. ´Covered by reenabled test. Exporting method and class used in WebKit2. * WebCore.xcodeproj/project.pbxproj: * platform/audio/mac/CAAudioStreamDescription.h: * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h: 2017-04-04 Alexey Proskuryakov More build fixing. * platform/spi/mac/AVFoundationSPI.h: 2017-04-04 Simon Fraser Do some minor FEColorMatrix code cleanup and optimization https://bugs.webkit.org/show_bug.cgi?id=170474 Reviewed by Dean Jackson. Don't switch inside of a pixel processing loop; repeat the loop inside switch (filterType). Change matrix() and saturateAndHueRotate() to dereference the source pixels once, instead of multiple times, which is faster. This kind of code benefits from aligning things with spaces for readability, so do so, violating webkit style. Add some off-by-default performance logging code. Increases pixel processing performance from about 86ms per megapixel to 65ms per megapixel. * platform/graphics/filters/FEColorMatrix.cpp: (WebCore::matrix): (WebCore::saturateAndHueRotate): (WebCore::effectType): (WebCore::FEColorMatrix::platformApplySoftware): 2017-04-04 Brent Fulgham Do not assert when CharacterData representing an Attr fires events https://bugs.webkit.org/show_bug.cgi?id=170454 Reviewed by Ryosuke Niwa. Make the NoEventDispatchAssertion in CharacterData::notifyParentAfterChange conditional since Attr elements should be allowed to fire events. Tests: fast/dom/no-assert-for-malformed-js-url-attribute.html * dom/CharacterData.cpp: (WebCore::CharacterData::notifyParentAfterChange): 2017-04-04 Youenn Fablet LayoutTest webrtc/libwebrtc/descriptionGetters.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=169481 Reviewed by Eric Carlson. No need to enumerate all network interfaces in most layout tests. Adding an Internals API for that in case we want to use TCP localhost candidates. * testing/Internals.cpp: (WebCore::Internals::Internals): (WebCore::Internals::setEnumeratingAllNetworkInterfacesEnabled): * testing/Internals.h: * testing/Internals.idl: 2017-04-04 Jer Noble Unreviewed build fix: fix compilation error on Sierra. * platform/spi/mac/AVFoundationSPI.h: 2017-04-04 Jer Noble Move AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h https://bugs.webkit.org/show_bug.cgi?id=170471 Reviewed by Eric Carlson. Move the declaration of AVSampleBufferDisplayLayer (and related classes) into AVFoundationSPI. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeDisplayLayer): Deleted. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: * platform/spi/mac/AVFoundationSPI.h: 2017-04-04 Saam Barati WebAssembly: JSWebAssemblyCallee should not be a JSCell https://bugs.webkit.org/show_bug.cgi?id=170135 Reviewed by Michael Saboff. * bindings/js/JSDOMWindowBase.cpp: (WebCore::callerDOMWindow): 2017-04-04 Simon Fraser Change Document's lastHandledUserGestureTimestamp to be a MonotonicTime https://bugs.webkit.org/show_bug.cgi?id=170468 Reviewed by Zalan Bujtas. Change the double to MonotonicTime. No behavior change. * dom/Document.cpp: (WebCore::Document::updateLastHandledUserGestureTimestamp): * dom/Document.h: (WebCore::Document::lastHandledUserGestureTimestamp): * html/HTMLPlugInImageElement.cpp: (WebCore::documentHadRecentUserGesture): * loader/FrameLoader.cpp: (WebCore::shouldAskForNavigationConfirmation): 2017-04-04 Youenn Fablet [Debug] ASSERT(!throwScope.exception()) on imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html https://bugs.webkit.org/show_bug.cgi?id=170395 Reviewed by Mark Lam. No change of behavior. * bindings/js/JSDOMPromise.cpp: (WebCore::DeferredPromise::reject): Adding early ASSERT that creating an exception is happening correctly. 2017-04-04 Alexey Proskuryakov Rolling back the build fix, as it broke other builds. * platform/spi/mac/AVFoundationSPI.h: 2017-04-04 Alexey Proskuryakov Build fix. Rubber-stamped by Jer Noble. * platform/spi/mac/AVFoundationSPI.h: 2017-04-04 Tim Horton [Mac] -[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:] invokes the resultCollector with didWrap = NO even when it wraps https://bugs.webkit.org/show_bug.cgi?id=165801 Reviewed by Wenson Hsieh. New API tests: WebKit2.FindInPageWrapping* * page/FrameTree.cpp: (WebCore::FrameTree::traverseNextWithWrap): (WebCore::FrameTree::traversePreviousWithWrap): (WebCore::FrameTree::traverseNextInPostOrderWithWrap): * page/FrameTree.h: Add CanWrap and DidWrap boolean enums, and add an optional out argument to traverse*WithWrap indicating whether a wrap actually occurred. * history/CachedPage.cpp: (WebCore::firePageShowAndPopStateEvents): * history/PageCache.cpp: (WebCore::destroyRenderTree): Adjust to the new CanWrap enum. * page/Page.cpp: (WebCore::incrementFrame): (WebCore::Page::findString): (WebCore::Page::findStringMatchingRanges): (WebCore::Page::rangeOfString): (WebCore::Page::findMatchesForText): (WebCore::Page::unmarkAllTextMatches): * page/Page.h: Adjust to the new CanWrap enum, and optionally plumb DidWrap through to callers of findString(). 2017-04-04 Carlos Garcia Campos [GTK] PLATFORM(GTK) && !USE(COORDINATED_GRAPHICS_THREADED) is no longer possible https://bugs.webkit.org/show_bug.cgi?id=170458 Reviewed by Carlos Alberto Lopez Perez. That is not supported anymore, so we can remove dead code from VideoSinkGStreamer.cpp * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: (VideoRenderRequestScheduler::VideoRenderRequestScheduler): 2017-04-04 Per Arne Vollan Unreviewed Windows build fix. * bindings/js/JSDOMGuardedObject.h: 2017-04-03 Wenson Hsieh Data interaction should register type identifiers in order of priority https://bugs.webkit.org/show_bug.cgi?id=170428 Reviewed by Tim Horton. Currently, due to the shared logic for writing to a UIPasteboard (in the case of copy/paste) and the shared UIItemProvider-based pasteboard wrapper (in the case of data interaction), we don't enforce any particular ordering in which type identifiers are registered in the generated item provider. This is because -[UIPasteboard setItems:] only takes an unordered mapping of type identifiers to objects. To fix this, we introduce a separate way to set pasteboard data that first writes a list of object representations in order of priority (which is dependent on the content being interacted with) and then register individual type-data mappings at the end. Augmented existing API tests in DataInteractionTests to check for the existence and priority of type identifiers in the UIItemProviders created upon starting data interaction. Also adds a new unit test: DataInteractionTests.TextAreaToInput. * WebCore.xcodeproj/project.pbxproj: * editing/cocoa/EditorCocoa.mm: (WebCore::archivedDataForAttributedString): (WebCore::Editor::writeSelectionToPasteboard): (WebCore::Editor::writeSelection): * platform/Pasteboard.h: * platform/PasteboardWriterData.h: * platform/PlatformPasteboard.h: * platform/ios/AbstractPasteboard.h: * platform/ios/AbstractPasteboard.mm: Copied from Source/WebCore/platform/ios/AbstractPasteboard.h. Introduce WebPasteboardItemData, a wrapper around a list of objects representating the pasteboard data in order of priority, and a dictionary containing additional NSData blobs that contain data useful for private clients. (+[WebPasteboardItemData itemWithRepresentingObjects:additionalData:]): (-[WebPasteboardItemData initWithRepresentingObjects:additionalData:]): (-[WebPasteboardItemData representingObjects]): (-[WebPasteboardItemData additionalData]): * platform/ios/PlatformPasteboardIOS.mm: (WebCore::richTextRepresentationsForPasteboardWebContent): (WebCore::PlatformPasteboard::writeObjectRepresentations): (WebCore::PlatformPasteboard::write): Tweaked to check whether the pasteboard responds to -setItemsFromObjectRepresentations:. If so, uses the PlatformPasteboard::writeObjectRepresentations codepath to write data to the pasteboard, respecting type priority. * platform/ios/WebItemProviderPasteboard.mm: (-[WebItemProviderPasteboard pasteboardTypes]): (-[WebItemProviderPasteboard setItemProviders:]): (-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]): Replaces -setItems: with -setItemsFromObjectRepresentations:, which respects the priority of each object representation of the data in the pasteboard. (-[WebItemProviderPasteboard setItems:]): Deleted. 2017-04-03 Javier Fernandez [css-align] Adapt place-content alignment shorthand to the new baseline syntax https://bugs.webkit.org/show_bug.cgi?id=170340 Reviewed by David Hyatt. Now that the align-content and justify-content CSS properties are adapted to the new baseline-position CSS values syntax we can adapt the shorthand that controls such properties to the new syntax as well. No new tests, just adding some additional cases to the tests we already have. * css/StyleProperties.cpp: (WebCore::StyleProperties::getPropertyValue): (WebCore::StyleProperties::placeContentPropertyValue): * css/StyleProperties.h: * css/parser/CSSPropertyParser.cpp: (WebCore::isContentDistributionKeyword): (WebCore::isContentPositionKeyword): (WebCore::isOverflowKeyword): (WebCore::getBaselineKeyword): (WebCore::consumeContentDistributionOverflowPosition): (WebCore::consumeSimplifiedContentPosition): 2017-04-03 Nan Wang AX: Expose link children when doing search predication on iOS https://bugs.webkit.org/show_bug.cgi?id=170424 The children of links are accessible elements on iOS instead of the link itself, so we should expose the children when doing predicated searches as well. Reviewed by Chris Fleizach. Test: accessibility/ios-simulator/ios-search-predicate-link-children.html * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex): 2017-04-03 Jer Noble No audio output for MediaStream-backed audio elements on iOS https://bugs.webkit.org/show_bug.cgi?id=170427 Reviewed by Eric Carlson. The logic for setting the output timestamp offset in AudioSampleDataSource was reversed; instead of subtracting out the timestamp of the first pull request, it effectively doubled it. * platform/audio/mac/AudioSampleDataSource.mm: (WebCore::AudioSampleDataSource::pullSamplesInternal): 2017-04-03 Dave Hyatt Japanese fonts in vertical text should support synthesized italics https://bugs.webkit.org/show_bug.cgi?id=169301 Reviewed by Simon Fraser. Updated test in fast/text/international. * platform/graphics/Font.cpp: (WebCore::Font::nonSyntheticItalicFont): Deleted. * platform/graphics/Font.h: Removed the non-synthetic italic font member, since it's not used. * platform/graphics/FontCascadeFonts.cpp: (WebCore::glyphDataForNonCJKCharacterWithGlyphOrientation): Patched to ensure that a text-orientation-fallback font data is always returned in the synthetic oblique case, so that non-CJK and CJK are guaranteed to be broken up so that their slants can be applied differently. (WebCore::FontCascadeFonts::glyphDataForSystemFallback): (WebCore::FontCascadeFonts::glyphDataForNormalVariant): (WebCore::glyphDataForCJKCharacterWithoutSyntheticItalic): Deleted. Patched to no longer turn off synthetic oblique for CJK. * platform/graphics/cocoa/FontCascadeCocoa.mm: (WebCore::FontCascade::drawGlyphs): Apply the correct italic transform to CJK when in vertical text. 2017-04-03 Chris Dumez REGRESSION (r206744): CSS background-image in style attribute ignored when using createHTMLDocument method of DOM parsing https://bugs.webkit.org/show_bug.cgi?id=170285 Reviewed by Andy Estes. r206744 caused up to stop trying to resolve relative URLs when trying to load an image referred to by CSS. We already try to resolve the relative URL when parsing the CSS property so this will usually work fine. However, in the case when the CSS property is parsed in detached document and then moved to another document, we will not have the complete URL. Test: fast/images/background-image-relative-url-changes-document.html * css/CSSImageValue.cpp: (WebCore::CSSImageValue::loadImage): 2017-04-03 Jeremy Jones Do not set WebAVPlayerLayerView background to black in fullscreen. https://bugs.webkit.org/show_bug.cgi?id=170132 rdar://problem/30839278 Reviewed by Tim Horton. No new tests because no behavior change. The black background on WebAVPlayerLayerView interferes with the fullscreen animation and has been removed. * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: (WebVideoFullscreenInterfaceAVKit::enterFullscreen): (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): 2017-04-03 Antti Koivisto REGRESSION (r207669): FileMaker Pro Help pages do not render correctly https://bugs.webkit.org/show_bug.cgi?id=170402 Reviewed by Simon Fraser. If a new stylesheet load is started from the load event the document.styleSheets does not always reflect the already loaded stylesheets. Test: fast/css/document-stylesheets-dynamic.html * style/StyleScope.cpp: (WebCore::Style::Scope::updateActiveStyleSheets): Remove an old optimization where we would not update active stylesheets if there were pending (head) stylesheet loads and they had not been updated already. This is probably not a valuable optimization anymore with the new lazy stylesheet update strategy. * style/StyleScope.h: 2017-04-03 Anders Carlsson Tweak ApplePaySession API https://bugs.webkit.org/show_bug.cgi?id=170409 rdar://problem/31405459 Reviewed by Tim Horton. Rename "address" to "addressLines". Add "postalAddress". Reorder the ApplePayError constructor parameters. * Modules/applepay/ApplePayError.cpp: (WebCore::ApplePayError::create): (WebCore::ApplePayError::ApplePayError): * Modules/applepay/ApplePayError.h: * Modules/applepay/ApplePayError.idl: * Modules/applepay/PaymentRequest.h: 2017-04-03 Zan Dobersek [GCrypt] Implement CryptoKeyEC::keySizeInBits(), ::platformGeneratePair() https://bugs.webkit.org/show_bug.cgi?id=170345 Reviewed by Michael Catanzaro. Start implementing the libgcrypt-based platform bits of CryptoKeyEC. Implement keySizeInBits() by returning the appropriate size for this object's curve type. An assertion is added to ensure that this size matches the one that's returned by gcry_pk_get_nbits() for this object's EC key as represented by the m_platformKey gcry_sexp_t object. Implement platformGeneratePair() by constructing a genkey s-expression that requests a generation of an EC key for the specified curve type. The s-expression is then passed to gcry_pk_genkey(), and the public and private key data is then retrieved from the returned s-expression upon success and used to create the public and private CryptoKeyEC objects. The PlatformECKey type alias is changed to match gcry_sexp_t. The CryptoKeyEC destructor releases the gcry_sexp_t object through a PAL::GCrypt::HandleDeleter instance. The method definitions in the CryptoKeyECGCrypt.cpp file are also sorted to match the declaration order in the header. No new tests -- current ones cover this sufficiently, but are not yet enabled due to other missing platform-specific SUBTLE_CRYPTO implementations. * crypto/gcrypt/CryptoKeyECGCrypt.cpp: (WebCore::curveSize): (WebCore::curveName): (WebCore::CryptoKeyEC::~CryptoKeyEC): (WebCore::CryptoKeyEC::keySizeInBits): (WebCore::CryptoKeyEC::platformGeneratePair): (WebCore::CryptoKeyEC::platformImportSpki): (WebCore::CryptoKeyEC::platformImportPkcs8): (WebCore::CryptoKeyEC::platformExportRaw): (WebCore::CryptoKeyEC::platformAddFieldElements): (WebCore::CryptoKeyEC::platformExportSpki): * crypto/keys/CryptoKeyEC.h: 2017-04-03 Zan Dobersek [GCrypt] Implement AES_KW support https://bugs.webkit.org/show_bug.cgi?id=170274 Reviewed by Michael Catanzaro. Implement the CryptoAlgorithmAES_KW::platform{Wrap,Unwrap}Key() functionality for configurations that use libgcrypt. This is done by leveraging the gcry_cipher_* APIs for the AES algorithm that's deducted appropriately from the key size and the AESWRAP cipher mode. No new tests -- current ones cover this sufficiently, but are not yet enabled due to other missing platform-specific SUBTLE_CRYPTO implementations. * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp: (WebCore::gcryptWrapKey): (WebCore::gcryptUnwrapKey): (WebCore::CryptoAlgorithmAES_KW::platformWrapKey): (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey): 2017-04-03 Zan Dobersek [GCrypt] Implement AES_GCM support https://bugs.webkit.org/show_bug.cgi?id=170271 Reviewed by Michael Catanzaro. Implement the CryptoAlgorithmAES_GCM::platform{Encrypt,Decrypt} functionality for configurations that use libgcrypt. This is done by leveraging the gcry_cipher_* APIs for the AES algorithm that's deducted appropriately from the key size and the GCM cipher mode. No new tests -- current ones cover this sufficiently, but are not yet enabled due to other missing platform-specific SUBTLE_CRYPTO implementations. * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp: (WebCore::gcryptEncrypt): (WebCore::gcryptDecrypt): (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt): (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt): 2017-04-03 Zan Dobersek [GCrypt] Implement PBKDF2 support https://bugs.webkit.org/show_bug.cgi?id=170270 Reviewed by Michael Catanzaro. Implement the CryptoAlgorithmPBKDF2::platformDeriveBits() functionality for configurations that use libgcrypt. This is done by leveraging the gcry_kdf_derive() API, using GCRY_KDF_PBKDF2 as the preferred KDF along with the properly deducted SHA algorithm. No new tests -- current ones cover this sufficiently, but are not yet enabled due to other missing platform-specific SUBTLE_CRYPTO implementations. * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp: (WebCore::gcryptDeriveBits): (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits): 2017-04-01 Simon Fraser Clean up touch event handler registration when moving nodes between documents https://bugs.webkit.org/show_bug.cgi?id=170384 rdar://problem/30816694 Reviewed by Chris Dumez. Make sure that Node::didMoveToNewDocument() does the correct unregistration on the old document, and registration on the new document for nodes with touch event listeners, and gesture event listeners. Touch "handler" nodes (those for overflow and sliders) are already correctly moved via renderer-related teardown. Add assertions that fire when removal was not complete. Use references in more places. Tests: fast/events/touch/ios/gesture-node-move-between-documents.html fast/events/touch/ios/overflow-node-move-between-documents.html fast/events/touch/ios/slider-node-move-between-documents.html fast/events/touch/ios/touch-node-move-between-documents.html * dom/EventNames.h: (WebCore::EventNames::gestureEventNames): * dom/Node.cpp: (WebCore::Node::willBeDeletedFrom): (WebCore::Node::didMoveToNewDocument): (WebCore::tryAddEventListener): (WebCore::tryRemoveEventListener): * html/shadow/SliderThumbElement.cpp: (WebCore::SliderThumbElement::registerForTouchEvents): (WebCore::SliderThumbElement::unregisterForTouchEvents): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::registerAsTouchEventListenerForScrolling): (WebCore::RenderLayer::unregisterAsTouchEventListenerForScrolling): 2017-04-03 Youenn Fablet captureStream is getting black frames with webgl canvas https://bugs.webkit.org/show_bug.cgi?id=170325 Reviewed by Dean Jackson. Test: fast/mediastream/captureStream/canvas3d.html Changing the webgl context to save buffers in case the canvas is captured. Adding a canvas changed notification in case of clear. In the future, we might want to change this notification and do it when endPaint or similar is called. Adding an Internals API to grab the RGBA equivalent of the next track frame. For that purpose, adding a bunch of WEBCORE_EXPORT. * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp: (WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Adding constraints support so that track settings getter actually transmits the width and height of the source. (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): ensuring webgl canvas context keep their drawing buffer. * Modules/mediastream/MediaStreamTrack.h: * bindings/js/JSDOMGuardedObject.h: * bindings/js/JSDOMPromise.h: (WebCore::DeferredPromise::resolve): (WebCore::DeferredPromise::reject): * dom/ActiveDOMCallback.h: * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::captureStream): * html/ImageData.h: * html/ImageData.idl: * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::clear): ensuring canvas observers get notified in case of clear calls. * html/canvas/WebGLRenderingContextBase.h: (WebCore::WebGLRenderingContextBase::preserveDrawingBuffer): Added to allow canvas capture to update this property. * platform/MediaSample.h: (WebCore::MediaSample::getRGBAImageData): Added for internals API. * platform/graphics/avfoundation/MediaSampleAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::MediaSampleAVFObjC::getRGBAImageData): * platform/graphics/cv/PixelBufferConformerCV.cpp: (WebCore::PixelBufferConformerCV::convert): Helper routine for getRGBAImageData. * platform/graphics/cv/PixelBufferConformerCV.h: * platform/mediastream/RealtimeMediaSourceSettings.h: (WebCore::RealtimeMediaSourceSettings::setSupportedConstraints): (WebCore::RealtimeMediaSourceSettings::setSupportedConstraits): Deleted. * platform/mediastream/mac/AVMediaCaptureSource.mm: (WebCore::AVMediaCaptureSource::initializeSettings): * platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h: * platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h: * platform/mock/MockRealtimeMediaSource.cpp: (WebCore::MockRealtimeMediaSource::initializeSettings): * testing/Internals.cpp: (WebCore::Internals::grabNextMediaStreamTrackFrame): (WebCore::Internals::videoSampleAvailable): * testing/Internals.h: * testing/Internals.idl: 2017-04-03 Per Arne Vollan Implement stroke-miterlimit. https://bugs.webkit.org/show_bug.cgi?id=169078 Reviewed by Dean Jackson. Support stroke-miterlimit for text rendering, see https://drafts.fxtf.org/paint/. Tests: fast/css/stroke-miterlimit-default.html fast/css/stroke-miterlimit-large.html fast/css/stroke-miterlimit-zero.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/CSSProperties.json: * css/SVGCSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::svgPropertyValue): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): (WebCore::updateGraphicsContext): * rendering/TextPaintStyle.h: * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::diff): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::strokeMiterLimit): (WebCore::RenderStyle::setStrokeMiterLimit): (WebCore::RenderStyle::initialStrokeMiterLimit): (WebCore::RenderStyle::setStrokeDashOffset): * rendering/style/RenderStyleConstants.cpp: * rendering/style/RenderStyleConstants.h: * rendering/style/SVGRenderStyle.cpp: (WebCore::SVGRenderStyle::diff): * rendering/style/SVGRenderStyle.h: (WebCore::SVGRenderStyle::initialStrokeDashArray): (WebCore::SVGRenderStyle::strokeDashArray): (WebCore::SVGRenderStyle::initialStrokeMiterLimit): Deleted. (WebCore::SVGRenderStyle::strokeMiterLimit): Deleted. (WebCore::SVGRenderStyle::setStrokeMiterLimit): Deleted. * rendering/style/SVGRenderStyleDefs.cpp: (WebCore::StyleStrokeData::StyleStrokeData): (WebCore::StyleStrokeData::operator==): * rendering/style/SVGRenderStyleDefs.h: * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): (WebCore::StyleRareInheritedData::operator==): * rendering/style/StyleRareInheritedData.h: * rendering/svg/RenderSVGShape.cpp: (WebCore::RenderSVGShape::hasSmoothStroke): * rendering/svg/SVGRenderSupport.cpp: (WebCore::SVGRenderSupport::applyStrokeStyleToContext): * rendering/svg/SVGRenderTreeAsText.cpp: (WebCore::writeStyle): 2017-04-03 Alejandro G. Castro [OWR] Fix class structure for the OWR mock classes after last modifications https://bugs.webkit.org/show_bug.cgi?id=170173 Reviewed by Youenn Fablet. In case of OWR MockRealtimeMediaSource inherits from RealtimeMediaSourceOwr, so we have to change some of the function interfaces. * platform/mock/MockRealtimeMediaSource.h: 2017-04-02 Alexey Proskuryakov Build fix for Add missing text styles https://bugs.webkit.org/show_bug.cgi?id=170295 * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::cachedSystemFontDescription): (WebCore::RenderThemeIOS::updateCachedSystemFontDescription): 2017-04-01 Zalan Bujtas Long Arabic text in ContentEditable with css white-space=pre hangs Safari https://bugs.webkit.org/show_bug.cgi?id=170245 Reviewed by Myles C. Maxfield. While searching for mid-word break, we measure the text by codepoints in a loop until the accumulated width > available width. When we see that the accumulated width for the individual codepoints overflows, we join the codepoints and re-measure them. These 2 widths could be considerably different for number of reasons (ligatures is a prime example). When we figure that the run still fits, we go back to the main loop (since we are not supposed to wrap the line here) and take the next codepoint. However this time we start the measurement from the last whitespace, so we end up remeasuring a potentially long chuck of text until we hit the wrapping point. This is way too expensive. This patch changes the logic so that we just go back to measuring individual codepoints until we hit the constrain again. Covered by existing tests. * rendering/line/BreakingContext.h: (WebCore::BreakingContext::handleText): canUseSimpleFontCodePath() is just to mitigate the potential risk of regression and complex text is more likely to fall into this category. 2017-04-01 Jon Lee Add missing text styles https://bugs.webkit.org/show_bug.cgi?id=170295 rdar://problem/30219503 Reviewed by Dean Jackson. Updated existing test to include new text styles. * css/CSSValueKeywords.in: Add title0 and title4. * platform/spi/cocoa/CoreTextSPI.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::cachedSystemFontDescription): (WebCore::RenderThemeIOS::updateCachedSystemFontDescription): 2017-04-01 Dan Bernstein [iOS] label should be specified using plural rules https://bugs.webkit.org/show_bug.cgi?id=170388 Reviewed by Alexey Proskuryakov. * English.lproj/Localizable.strings: Updated using update-webkit-localizable-strings. * English.lproj/Localizable.stringsdict: Added an entry for the new key "%lu photo(s) and %lu video(s)", with plural rules covering all the different combinations in English. Other localizations may specify additional combinations as needed. 2017-04-01 Alexey Proskuryakov Rolling back , as it made WebKit2.DataDetectionReferenceDate time out. Was REGRESSION (r202472): Data Detection overwrites existing links in detected ranges https://bugs.webkit.org/show_bug.cgi?id=170365 * editing/cocoa/DataDetection.mm: (WebCore::searchForLinkRemovingExistingDDLinks): 2017-04-01 Chris Dumez We should pause silent WebAudio rendering in background tabs https://bugs.webkit.org/show_bug.cgi?id=170299 Reviewed by Eric Carlson. We should pause silent WebAudio rendering in background tabs since it uses CPU and is not observable by the user. Such silent WebAudio rendering seems to be used by doubleclick ads. Test: webaudio/silent-audio-interrupted-in-background.html * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::lazyInitialize): (WebCore::AudioContext::uninitialize): Have AudioContext register / unregister itself with the Document to get visibility change notifications, similarly to what HTMLMediaElement was already doing. (WebCore::AudioContext::visibilityStateChanged): Begin / End session interruption whenever the page visiblity changes. * Modules/webaudio/AudioContext.h: * WebCore.xcodeproj/project.pbxproj: * dom/Document.cpp: (WebCore::Document::registerForVisibilityStateChangedCallbacks): (WebCore::Document::unregisterForVisibilityStateChangedCallbacks): (WebCore::Document::visibilityStateChanged): * dom/Document.h: * dom/Element.h: * dom/VisibilityChangeClient.h: Added. (WebCore::VisibilityChangeClient::~VisibilityChangeClient): * html/HTMLMediaElement.h: Introduce a new VisibilityChangeClient interface and have both AudioContext and HTMLMediaElement subclass it. Previously, the visibilityStateChanged() function was on Element but this prevented AudioContext from registering itself since AudioContext is not an Element. 2017-04-01 Dan Bernstein [Cocoa] A couple of UI strings use three periods instead of an ellipsis https://bugs.webkit.org/show_bug.cgi?id=170386 Reviewed by Tim Horton. * English.lproj/Localizable.strings: Updated using update-webkit-localizable-strings. * platform/LocalizedStrings.cpp: (WebCore::mediaElementLoadingStateText): Changed "Loading..." to "Loading…". * platform/cocoa/LocalizedStringsCocoa.mm: (WebCore::contextMenuItemTagStyles): Changed "Styles..." to "Styles…". 2017-04-01 Dan Bernstein Localizable strings files are out of date https://bugs.webkit.org/show_bug.cgi?id=170383 Reviewed by Tim Horton. Ran update-webkit-localizable-strings. * English.lproj/Localizable.strings: 2017-04-01 Dan Bernstein [Xcode] In engineering builds, linker warns about libwebrtc.dylib’s install name being invalid https://bugs.webkit.org/show_bug.cgi?id=170385 Reviewed by Tim Horton. * Configurations/DebugRelease.xcconfig: Set WK_RELOCATABLE_FRAMEWORKS to YES like we do in some other projects’ DebugRelease.xcconfig. Engineering builds are always relocatable. * Configurations/WebCore.xcconfig: When WebCore is relocatable, tell the linker that it’s not going to be in the shared cache, even if its install name implies that it might be. 2017-04-01 Alexey Proskuryakov Rolling back http://trac.webkit.org/r214663 - memory corruption * Modules/streams/ReadableByteStreamInternals.js: (cloneArrayBuffer): * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::addBuiltinGlobals): * bindings/js/StructuredClone.cpp: (WebCore::structuredCloneArrayBuffer): (WebCore::cloneArrayBufferImpl): Deleted. (WebCore::cloneArrayBuffer): Deleted. * bindings/js/StructuredClone.h: * bindings/js/WebCoreBuiltinNames.h: * testing/Internals.cpp: (WebCore::markerTypeFrom): (WebCore::Internals::resetToConsistentState): (WebCore::Internals::isLoadingFromMemoryCache): (WebCore::Internals::setImageFrameDecodingDuration): (WebCore::deferredStyleRulesCountForList): (WebCore::deferredGroupRulesCountForList): (WebCore::deferredKeyframesRulesCountForList): (WebCore::Internals::eventThrottlingBehaviorOverride): (WebCore::Internals::enableMockSpeechSynthesizer): (WebCore::Internals::rangeForDictionaryLookupAtLocation): (WebCore::Internals::nodesFromRect): (WebCore::Internals::layerIDForElement): (WebCore::Internals::setElementUsesDisplayListDrawing): (WebCore::Internals::setElementTracksDisplayListReplay): (WebCore::Internals::styleRecalcCount): (WebCore::Internals::compositingUpdateCount): (WebCore::Internals::setCaptionDisplayMode): (WebCore::Internals::endMediaSessionInterruption): (WebCore::Internals::postRemoteControlCommand): (WebCore::appendOffsets): (WebCore::Internals::scrollSnapOffsets): (WebCore::Internals::setShowAllPlugins): (WebCore::Internals::cloneArrayBuffer): Deleted. * testing/Internals.h: * testing/Internals.idl: 2017-03-31 Zalan Bujtas : Including or causes clipping across page breaks https://bugs.webkit.org/show_bug.cgi?id=170348 Reviewed by David Hyatt. 1. In RenderFlowThread::offsetFromLogicalTopOfFirstRegion() we need to take table section offset into account (they are skipped during the containing block traversal). 2. Trigger paginated relayout when body is moved vertically due to caption/thead etc. Test: fast/multicol/table-section-page-break.html * rendering/RenderFlowThread.cpp: (WebCore::RenderFlowThread::offsetFromLogicalTopOfFirstRegion): * rendering/RenderTable.cpp: (WebCore::RenderTable::layout): 2017-03-31 Simon Fraser Rename DOMWindow's m_touchEventListenerCount to m_touchAndGestureEventListenerCount https://bugs.webkit.org/show_bug.cgi?id=170371 Reviewed by Tim Horton. This count tracks touch and gesture event listeners, so name it appropriately. * page/DOMWindow.cpp: (WebCore::DOMWindow::addEventListener): (WebCore::DOMWindow::removeEventListener): (WebCore::DOMWindow::removeAllEventListeners): * page/DOMWindow.h: 2017-03-31 Simon Fraser When destroying a Node, assert that it's been removed from all the touch handler maps https://bugs.webkit.org/show_bug.cgi?id=170363 rdar://problem/31377469 Reviewed by Tim Horton. Assert that the Node has been removed from the touch handler maps in all documents on destruction. * dom/Document.h: (WebCore::Document::hasTouchEventHandlers): (WebCore::Document::touchEventTargetsContain): * dom/Node.cpp: (WebCore::Node::~Node): 2017-03-31 Alexey Proskuryakov Rolling back https://trac.webkit.org/r214689, as it caused many crashes. Was: Fix memory leak in CreateSessionDescriptionObserver::OnSuccess https://bugs.webkit.org/show_bug.cgi?id=170357 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded): 2017-03-31 Youenn Fablet Fix memory leak in RealtimeVideoIncomingSource https://bugs.webkit.org/show_bug.cgi?id=170356 Reviewed by Eric Carlson. No change of behavior. * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp: (WebCore::RealtimeIncomingVideoSource::OnFrame): Adopting the newly created pointer. 2017-03-31 Andy Estes REGRESSION (r202472): Data Detection overwrites existing links in detected ranges https://bugs.webkit.org/show_bug.cgi?id=170365 Reviewed by Tim Horton. r202472 changed the node traversal in searchForLinkRemovingExistingDDLinks() to only consider nodes that are descendants of startNode, but we need to traverse all nodes between startNode and endNode to find existing non-DD links. As a result, we'd add a Data Detector link to the following snippet and make the original links un-clickable: tomorrow night Fix this by not specifying a stayWithin node when calling NodeTraversal::next(). The loop will terminate when we reach endNode. Updated WebKit2.DataDetectionReferenceDate API test. * editing/cocoa/DataDetection.mm: (WebCore::searchForLinkRemovingExistingDDLinks): 2017-03-31 Eric Carlson Incoming video source doesn't propogate frame rotation https://bugs.webkit.org/show_bug.cgi?id=170364 Reviewed by Youenn Fablet. No new tests, the mock video source doesn't support rotation. Test will be added when this is fixed in https://bugs.webkit.org/show_bug.cgi?id=169822. The changes were verified manually. * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp: (WebCore::RealtimeIncomingVideoSource::OnFrame): Convert frame rotation to sample orientation and swap width and height when necessary. (WebCore::RealtimeIncomingVideoSource::processNewSample): * platform/mediastream/mac/RealtimeIncomingVideoSource.h: 2017-03-31 Chris Dumez Possible null dereference under SourceBuffer::sourceBufferPrivateDidReceiveSample() https://bugs.webkit.org/show_bug.cgi?id=159639 Reviewed by Eric Carlson. Add a null check for trackBuffer.description before dereferencing as it seems it can be null. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): 2017-03-31 Youenn Fablet Fix memory leak in CreateSessionDescriptionObserver::OnSuccess https://bugs.webkit.org/show_bug.cgi?id=170357 Reviewed by Geoffrey Garen. No change of behavior. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded): Adopting the raw pointer parameter. 2017-03-31 Fujii Hironori [WinCairo] WebCore::PlatformDisplay::terminateEGLDisplay causes a crash in libGLESv2.dll while processing atexit https://bugs.webkit.org/show_bug.cgi?id=170331 Reviewed by Michael Catanzaro. WebCore::PlatformDisplay uses atexit to destruct EGL displays while exiting process. But, when the atexit will be processed, heap of libGLESv2.dll would be already destructed and causing a crash on Windows. Do not use atexit for Windows. AppleWin port does not use PlatformDisplay. Thus, it does not have this bug. * platform/graphics/PlatformDisplay.cpp: (WebCore::PlatformDisplay::initializeEGLDisplay): Do not use atexit for Windows. (WebCore::PlatformDisplay::shutDownEglDisplays): Added. * platform/graphics/PlatformDisplay.h: Added a declaration of shutDownEglDisplays. 2017-03-31 Yoav Weiss Remove PRELOAD_DEBUG related code. https://bugs.webkit.org/show_bug.cgi?id=170352 Reviewed by Youenn Fablet. As the PRELOAD_DEBUG related code stopped building and it seems like no one noticed, it seems safe to assume that we can remove that code. This patch removes it. No new tests as there's no functional change. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::preload): (WebCore::CachedResourceLoader::clearPreloads): (WebCore::CachedResourceLoader::printPreloadStats): Deleted. 2017-03-31 Brady Eidson Clean up the "StorageType" enum. https://bugs.webkit.org/show_bug.cgi?id=170349 Reviewed by Tim Horton. - Make this `enum` into an `enum class` - Add a new type specific for "transient local storage" No new tests (No behavior change). * WebCore.xcodeproj/project.pbxproj: * inspector/InspectorDOMStorageAgent.cpp: (WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent): * inspector/InspectorInstrumentation.h: * loader/EmptyClients.cpp: * storage/Storage.cpp: (WebCore::Storage::isDisabledByPrivateBrowsing): * storage/StorageArea.h: (): Deleted. * storage/StorageEventDispatcher.cpp: (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames): (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames): * storage/StorageType.h: (WebCore::isLocalStorage): 2017-03-31 Chris Dumez Unreviewed, Mark "HTML interactive form validation" as done. It is shipping in Safari 10.1. * features.json: 2017-03-31 Csaba Osztrogonác Mac cmake buildfix after r214666 https://bugs.webkit.org/show_bug.cgi?id=170342 Unreviewed buildfix. * PlatformMac.cmake: * testing/MockPreviewLoaderClient.h: 2017-03-31 Sam Weinig Remove unneeded custom constructors include. * WebCore.xcodeproj/project.pbxproj: * bindings/js/ios: Removed. * bindings/js/ios/TouchConstructors.cpp: Removed. 2017-03-31 John Wilander Resource Load Statistics: Check if the store exists before clearing it https://bugs.webkit.org/show_bug.cgi?id=170324 Reviewed by Brent Fulgham. No new tests. Added a null check. * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore): Added a null check. 2017-03-31 Romain Bellessort [Readable Streams API] Implement cloneArrayBuffer in WebCore https://bugs.webkit.org/show_bug.cgi?id=170008 Reviewed by Youenn Fablet. Implemented cloneArrayBuffer based on existing structuredCloneArrayBuffer implementation. The code has been factorized so that both cloneArrayBuffer and structuredCloneArrayBuffer rely on the same code (which is basically the previous implementation of structuredCloneArrayBuffer + the ability to clone only a part of considered buffer). Added test to check cloneArrayBuffer behaviour. * Modules/streams/ReadableByteStreamInternals.js: Deleted cloneArrayBuffer JS implementation. * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::addBuiltinGlobals): Add cloneArrayBuffer private declaration. * bindings/js/StructuredClone.cpp: (WebCore::cloneArrayBufferImpl): Added (mostly based on previous structuredCloneArrayBuffer). (WebCore::cloneArrayBuffer): Added. (WebCore::structuredCloneArrayBuffer): Updated. * bindings/js/StructuredClone.h: Added cloneArrayBuffer declaration. * bindings/js/WebCoreBuiltinNames.h: Added cloneArrayBuffer declaration. * testing/Internals.cpp: Added support for testing cloneArrayBuffer. * testing/Internals.h: Added support for testing cloneArrayBuffer. * testing/Internals.idl: Added support for testing cloneArrayBuffer. 2017-03-31 Antoine Quint [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout https://bugs.webkit.org/show_bug.cgi?id=168409 Unreviewed. Yet more logging to determine under what circumstance ScriptedAnimationController gets suspended. * dom/Document.cpp: (WebCore::Document::requestAnimationFrame): 2017-03-30 Zan Dobersek Unreviewed GTK+ build fix. Add missing ANGLE build targets to the build. * CMakeLists.txt: 2017-03-30 Simon Fraser Ensure that Node::willBeDeletedFrom() always removes touch event handlers from the document https://bugs.webkit.org/show_bug.cgi?id=170323 rdar://problem/23647630 Reviewed by Chris Dumez. There are two instances where nodes are registered as touch event handlers without having normal touch event listeners: slider thumb elements, and elements with overflow scrolling, on iOS. For such nodes, hasEventTargetData() will be false, but we want to ensure that they are removed from the Document's touchEventHandler set, so move the call to document.removeTouchEventHandler() outside of the conditional block. This should be cheap in most cases when the touchEventHandler is empty. * dom/Node.cpp: (WebCore::Node::willBeDeletedFrom): 2017-03-30 Simon Fraser Minor cleanup checking for gesture event names https://bugs.webkit.org/show_bug.cgi?id=170319 Reviewed by Tim Horton. Just use isGestureEventType() in a couple of places. * dom/Node.cpp: (WebCore::tryAddEventListener): (WebCore::tryRemoveEventListener): 2017-03-30 Simon Fraser Rename a touch event function, and new touch region test results https://bugs.webkit.org/show_bug.cgi?id=170309 rdar://problem/31329520 Reviewed by Chris Dumez. Adapt to a naming change in WebKitAdditions. * dom/Document.cpp: (WebCore::Document::removeAllEventListeners): * page/FrameView.cpp: (WebCore::FrameView::layout): * rendering/RenderElement.cpp: (WebCore::RenderElement::styleWillChange): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollTo): (WebCore::RenderLayer::calculateClipRects): 2017-03-30 Matt Rajca YouTube sometimes does not respect "user gesture" restriction for videos. https://bugs.webkit.org/show_bug.cgi?id=170297 I discovered a code path that does not honor the "user gesture" requirement and playback is able to begin even though we have a restriction in place. When using Media Source Extensions, which YouTube does, we transition from a "Have Metadata" to a "Future Data" state that causes playback to begin, however, we never check if we have a playback restriction in place. Reviewed by Eric Carlson. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::setReadyState): 2017-03-30 Said Abou-Hallawa REGRESSION (r213764): Background image from sprite sheet incorrectly scaled https://bugs.webkit.org/show_bug.cgi?id=169547 Reviewed by Simon Fraser. The bug happens when drawing only a rectangle of an image not the whole image. In BitmapImage::draw(), sizeForDrawing was calculated as the destRect scaled by the transformation which is applied to the GraphicsContext. Two problems with this approach. The first one is destRect can be only part of the image. The second problem is, the ratio destRect / srcRect is another scaling that needs to be considered. To fix this issue, first the base size has to be size of the image and not destRect.size(). Secondly, we need to scale this base size with the context transformation multiplied by the ratio destRect / srcRect. This scaling is exactly the same scaling which is calculated in subsamplingScale(). Finally we use this scaled size as the sizeForDrawing to send to the ImageDecoder. Test: fast/images/sprite-sheet-image-draw.html * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::draw): Fix the bug. (WebCore::BitmapImage::stopAnimation): Stops the async image decoding for animated images only. The decoding for large images will be stopped when BitmapImage::newFrameNativeImageAvailableAtIndex() is called and the decoding queue is idle. (WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex): Add image logging. * platform/graphics/BitmapImage.h: Move sourceURL() to the Image class. * platform/graphics/GraphicsContext.cpp: Pass imagePaintingOptions.m_decodingMode to Image::drawTiled(). (WebCore::GraphicsContext::drawTiledImage): Pass imagePaintingOptions.m_decodingMode) to Image::drawTiled(). * platform/graphics/Image.cpp: (WebCore::Image::sourceURL): Moved from BitmapImage. (WebCore::Image::drawTiled): Add a DecodingMode argument instead of calling always with DecodingMode::Synchronous. * platform/graphics/Image.h: * platform/graphics/ImageFrameCache.cpp: (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): Add image logging. (WebCore::ImageFrameCache::startAsyncDecodingQueue): Ditto, (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Ditto. (WebCore::ImageFrameCache::stopAsyncDecodingQueue): Ditto. (WebCore::ImageFrameCache::sourceURL): A helper function to avoid checking the value of m_image. * platform/graphics/ImageFrameCache.h: * platform/graphics/NativeImage.h: Rename subsamplingScale() to nativeImageDrawingScale() and return image scaling instead. * platform/graphics/cairo/NativeImageCairo.cpp: (WebCore::nativeImageDrawingScale): Ditto. (WebCore::subsamplingScale): Deleted. * platform/graphics/cg/NativeImageCG.cpp: (WebCore::nativeImageDrawingScale): Ditto. (WebCore::subsamplingScale): Deleted. * platform/graphics/win/NativeImageDirect2D.cpp: (WebCore::nativeImageDrawingScale): Ditto. (WebCore::subsamplingScale): Deleted. 2017-03-30 Matt Baker Web Inspector: Assertion failure in InspectorStyleProperty::setRawTextFromStyleDeclaration https://bugs.webkit.org/show_bug.cgi?id=170279 Reviewed by David Hyatt. The SourceRange for a CSSPropertySourceData should be relative to the start of the declaration body, not the start of the StyleSheetHandler’s parsed text. This only affected the ranges of unparsed (parsedOK == false) properties lacking a trailing semi-colon. This patch doesn't change the behavior of InspectorStyleSheet other than silencing an irksome assert, as String::substring does a safety check on the passed in length. * inspector/InspectorStyleSheet.cpp: (WebCore::fixUnparsedProperties): 2017-03-30 Youenn Fablet and Jon Lee Clean up RTCDataChannel https://bugs.webkit.org/show_bug.cgi?id=169732 Reviewed by Chris Dumez. Test: webrtc/datachannel/datachannel-event.html webrtc/datachannel/bufferedAmountLowThreshold.html Making RTCDataChannel interface closer to the spec updating implementation accordingly. See https://w3c.github.io/webrtc-pc/#rtcdatachannel. In particular adding RTCDataChannelEvent constructor, and missing bufferedAmount related attributes. Doing some additional cleaning refactoring. Making bufferedAmountIsDecreasing take a bufferedAmount argument so that we get the actual value passed by libwebrtc without needing to get it from the libwebrtc network thread again. In the future, we should store the bufferedAmount value in RTCDataChannel and update its value on each libwebrtc OnBufferedAmountChange. Special treatment may be needed when the data channel is closed, in which case the bufferedAmount should just be updated to increase in the send method. Added some FIXMEs as RTCDataChannel is not aligned with the spec related to send and bufferedAmount. * Modules/mediastream/RTCDataChannel.cpp: (WebCore::RTCDataChannel::send): (WebCore::RTCDataChannel::close): (WebCore::RTCDataChannel::didChangeReadyState): (WebCore::RTCDataChannel::bufferedAmountIsDecreasing): * Modules/mediastream/RTCDataChannel.h: * Modules/mediastream/RTCDataChannel.idl: * Modules/mediastream/RTCDataChannelEvent.cpp: (WebCore::RTCDataChannelEvent::create): (WebCore::RTCDataChannelEvent::RTCDataChannelEvent): (WebCore::RTCDataChannelEvent::channel): * Modules/mediastream/RTCDataChannelEvent.h: * Modules/mediastream/RTCDataChannelEvent.idl: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp: (WebCore::LibWebRTCDataChannelHandler::OnStateChange): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::addDataChannel): * WebCore.xcodeproj/project.pbxproj: * dom/EventNames.h: * platform/mediastream/RTCDataChannelHandler.h: * platform/mediastream/RTCDataChannelHandlerClient.h: * platform/mediastream/RTCDataChannelState.h: Added. * platform/mediastream/RTCPeerConnectionHandlerClient.h: * platform/mock/RTCDataChannelHandlerMock.cpp: (WebCore::RTCDataChannelHandlerMock::setClient): (WebCore::RTCDataChannelHandlerMock::close): * platform/mock/RTCNotifiersMock.cpp: (WebCore::IceConnectionNotifier::IceConnectionNotifier): (WebCore::SignalingStateNotifier::SignalingStateNotifier): (WebCore::DataChannelStateNotifier::DataChannelStateNotifier): * platform/mock/RTCNotifiersMock.h: 2017-03-30 Javier Fernandez [css-align] Adapt content-alignment properties to the new baseline syntax https://bugs.webkit.org/show_bug.cgi?id=170262 Reviewed by David Hyatt. The baseline-position syntax has changed recently, so we need to update the CSS properties using the old syntax. This patch address only the content-alignment (align-content and justify-content). I used this patch to adapt the implementation of the parsing logic for these properties to the new Blink's CSS Parsing Design. The new baseline syntax is "[first | last ]? baseline" which implies modifying the parsing and computed value logic. There are several layout tests affected by this change, so I'll update them accordingly. No new tests, just added/modified some cases to the tests we already have using the new baseline values. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment): * css/CSSContentDistributionValue.cpp: (WebCore::CSSContentDistributionValue::customCSSText): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::operator ItemPosition): (WebCore::CSSPrimitiveValue::operator ContentPosition): * css/CSSValueKeywords.in: * css/parser/CSSPropertyParser.cpp: (WebCore::isBaselineKeyword): (WebCore::consumeBaselineKeyword): (WebCore::consumeContentDistributionOverflowPosition): (WebCore::consumeSelfPositionOverflowPosition): 2017-03-30 James Craig AX: Expose a new AXSubrole for explicit ARIA "group" role https://bugs.webkit.org/show_bug.cgi?id=169810 Reviewed by Chris Fleizach. Split GroupRole into generics (GroupRole) and explicit groups (ApplicationGroupRole) so we can expose a subrole on the explicit groups. Account for the change in ARIA Tree and Menu hierachies. Update the computedRoleValue for WebKit Inspector usage, too. Updated existing tests. Test: accessibility/list-detection2.html: Test: accessibility/roles-computedRoleString.html: Test: inspector/dom/getAccessibilityPropertiesForNode.html: Test: inspector/dom/highlightFrame.html: Test: inspector/dom/highlightSelector.html: * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::helpText): (WebCore::AccessibilityNodeObject::hierarchicalLevel): (WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::accessibleNameDerivesFromContent): (WebCore::AccessibilityObject::ariaTreeItemContent): (WebCore::initializeRoleMap): (WebCore::AccessibilityObject::computedRoleString): * accessibility/AccessibilityObject.h: * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (atkRole): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (createAccessibilityRoleMap): (-[WebAccessibilityObjectWrapper subrole]): 2017-03-30 Chris Dumez We are spending a lot of time bzero'ing AudioChannel buffers on uni-watch.com https://bugs.webkit.org/show_bug.cgi?id=170288 Reviewed by Eric Carlson. We are spending a lot of time bzero'ing AudioChannel buffers on uni-watch.com due to doubleclick ads using WebAudio with a 0-gain GainNode. We should optimize the 0-gain case as much as possible. No new tests, only an optimization. * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::processIfNecessary): Drop call to unsilenceOutputs() before calling AudioNode::process(). The AudioChannel API already takes care of clearing its 'silent' flag whenever its buffer changes so there should be no need to explicitly clearing the 'silent' flag before calling process(). This was causing us to zero out buffers that were already filled with zeros because AudioChannel::zero() would no longer return early, not knowing the channel is already silent. This reduces the number of bzero() calls by ~3.5x on uni-watch.com (from 100 calls every ~20ms to 100 calls every ~70ms. * Modules/webaudio/AudioNode.h: * platform/audio/mac/AudioDestinationMac.cpp: (WebCore::AudioDestinationMac::render): Avoid clamping the values in the channel buffer if the channel is silent since this will have no effect (given that the buffer only contains zeros). 2017-03-30 Eric Carlson [Crash] WebCore::AudioBuffer::AudioBuffer don't checking illegal value https://bugs.webkit.org/show_bug.cgi?id=169956 Reviewed by Youenn Fablet. Test: webaudio/audiobuffer-crash.html * Modules/webaudio/AudioBuffer.cpp: (WebCore::AudioBuffer::AudioBuffer): Invalidate the object and return early if the channel array allocation fails. (WebCore::AudioBuffer::AudioBuffer): Ditto. (WebCore::AudioBuffer::invalidate): Invalidate the object. * Modules/webaudio/AudioBuffer.h: 2017-03-30 Antoine Quint [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout https://bugs.webkit.org/show_bug.cgi?id=168409 Unreview. Print the backtrace when we suspend scripted animations. * page/Page.cpp: (WebCore::Page::suspendScriptedAnimations): 2017-03-30 Antoine Quint [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout https://bugs.webkit.org/show_bug.cgi?id=168409 Unreview. Pring the backtrace when we suspend ScriptedAnimationController. * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::suspend): 2017-03-30 Antoine Quint [Modern Media Controls] Invalid placard icon is not visible for short video https://bugs.webkit.org/show_bug.cgi?id=170277 Reviewed by Eric Carlson. Make the minimum dimension needed to display a placard icon configurable and let the invalid placard use a 50pt dimension. We also make a drive-by fix to reset "text-align" for media controls as having a "text-align: center" inherited value would mess up positioning of the placard icon and make it flush to the right of the placard. Test: media/modern-media-controls/invalid-placard/invalid-placard-constrained-metrics.html * Modules/modern-media-controls/controls/invalid-placard.js: (InvalidPlacard): * Modules/modern-media-controls/controls/media-controls.css: (.media-controls): * Modules/modern-media-controls/controls/placard.js: (Placard.prototype.layout): 2017-03-30 Zan Dobersek [GCrypt] Register missing algorithms in CryptoAlgorithmRegistry::platformRegisterAlgoritmhs() https://bugs.webkit.org/show_bug.cgi?id=170273 Reviewed by Michael Catanzaro. * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp: (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): Add registerAlgorithm<> calls for AES_CFB, AES_GCM, ECDH and PBKDF2 algorithms. 2017-03-30 Brent Fulgham Remove unused MediaControlsApple implementation https://bugs.webkit.org/show_bug.cgi?id=170258 Reviewed by Eric Carlson. Remove dead code related to old media controls. We switched to HTML5-based media controls several years ago. No new tests. Removing this dead code should have no change in behavior. * WebCore.xcodeproj/project.pbxproj: Remove unused files. * dom/EventListener.h: Remove unused event type. * html/shadow/MediaControlsApple.cpp: Removed. * html/shadow/MediaControlsApple.h: Removed. 2017-03-30 Fujii Hironori [WinCairo] ImageCairoWin.cpp: error C2660: 'WebCore::BitmapImage::draw': function does not take 6 arguments https://bugs.webkit.org/show_bug.cgi?id=170275 Reviewed by Said Abou-Hallawa. Apply the similar change of ImageCGWin.cpp of r214450 to ImageCairoWin.cpp. * platform/graphics/win/ImageCairoWin.cpp: (WebCore::BitmapImage::getHBITMAPOfSize): Pass DecodingMode::Synchronous to Image::draw(). (WebCore::BitmapImage::drawFrameMatchingSourceSize): Ditto. 2017-03-27 Sergio Villar Senin [css-grid] Clamp the number of autorepeat tracks https://bugs.webkit.org/show_bug.cgi?id=170120 Reviewed by Manuel Rego Casasnovas. As suggested by the specs we do clamp the maximum number of tracks per grid in order to minimize potential OOM situations. However we were not considering the case of the recently added auto repeat syntax. Abnormally huge values for the width/height on the grid container could lead to a number of auto repeat tracks higher than the maximum. A new API was added to Internals in order to test limits without having to create huge grids. This new API allows clients to set an arbitrary limit to the number of tracks. The addition of this new API forced us to add GridPosition.cpp to the project to define the global variable we use for testing. We took the chance to move part of the implementation from the header file to the source file. Last but not least, several new ASSERTs were added to Grid.cpp implementation to ensure that we do not surpass the grid track limits. Test: fast/css-grid-layout/grid-auto-repeat-huge-grid.html * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * css/parser/CSSPropertyParser.cpp: (WebCore::consumeGridTrackRepeatFunction): * rendering/Grid.cpp: (WebCore::Grid::ensureGridSize): Added ASSERT. (WebCore::Grid::setSmallestTracksStart): Ditto. (WebCore::Grid::setAutoRepeatTracks): Ditto. (WebCore::Grid::setAutoRepeatEmptyColumns): Ditto. (WebCore::Grid::setAutoRepeatEmptyRows): Ditto. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::clampAutoRepeatTracks): New method. (WebCore::RenderGrid::placeItemsOnGrid): Clamp the number of auto repeat tracks before passing them to the Grid. * rendering/RenderGrid.h: * rendering/style/GridArea.h: (WebCore::GridSpan::GridSpan): * rendering/style/GridPosition.cpp: Added. (WebCore::GridPosition::setExplicitPosition): (WebCore::GridPosition::setAutoPosition): (WebCore::GridPosition::setSpanPosition): (WebCore::GridPosition::setNamedGridArea): (WebCore::GridPosition::integerPosition): (WebCore::GridPosition::namedGridLine): (WebCore::GridPosition::spanPosition): (WebCore::GridPosition::operator==): * rendering/style/GridPosition.h: (WebCore::GridPosition::shouldBeResolvedAgainstOppositePosition): (WebCore::GridPosition::max): (WebCore::GridPosition::min): (WebCore::GridPosition::setMaxPositionForTesting): (WebCore::GridPosition::setExplicitPosition): Deleted. (WebCore::GridPosition::setAutoPosition): Deleted. (WebCore::GridPosition::setSpanPosition): Deleted. (WebCore::GridPosition::setNamedGridArea): Deleted. (WebCore::GridPosition::integerPosition): Deleted. (WebCore::GridPosition::namedGridLine): Deleted. (WebCore::GridPosition::spanPosition): Deleted. (WebCore::GridPosition::operator==): Deleted. * rendering/style/GridPositionsResolver.cpp: (WebCore::GridPositionsResolver::explicitGridColumnCount): (WebCore::GridPositionsResolver::explicitGridRowCount): * testing/Internals.cpp: (WebCore::Internals::setGridMaxTracksLimit): * testing/Internals.h: * testing/Internals.idl: 2017-03-29 Ryosuke Niwa Disconnecting a HTMLObjectElement does not always unload its content document https://bugs.webkit.org/show_bug.cgi?id=169606 Reviewed by Andy Estes. When removing a node, we first disconnect all subframes then update the focused element as we remove each child. However, when the removed element is a focused object element with a content document, removeFocusedNodeOfSubtree can update the style tree synchronously inside Document::setFocusedElement, and reload the document. Avoid this by instantiating a SubframeLoadingDisabler on the parent of the focused element. Test: fast/dom/removing-focused-object-element.html * dom/Document.cpp: (WebCore::Document::removeFocusedNodeOfSubtree): 2017-03-29 Myles C. Maxfield Migrate to kCTFontCSSWidthAttribute https://bugs.webkit.org/show_bug.cgi?id=170265 Reviewed by Darin Adler. Previously, we were mapping from Core Text widths to CSS widths in WebKit. However, on some OSes, Core Text can directly tell us what the CSS width value is. No new tests because there is no behavior change. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::getCSSAttribute): (WebCore::capabilitiesForFontDescriptor): * platform/spi/cocoa/CoreTextSPI.h: 2017-03-28 Simon Fraser Make it possible to dump touch event regions for testing https://bugs.webkit.org/show_bug.cgi?id=170209 Reviewed by Tim Horton. Expose internals.touchEventRectsForEvent() and internals.passiveTouchEventListenerRects(), which fetch data via Page. Because the regions are normally updated on a timer, we have to force an eager update via Document::updateTouchEventRegions(). Test: fast/events/touch/ios/touch-event-regions.html * page/Page.cpp: (WebCore::Page::nonFastScrollableRects): (WebCore::Page::touchEventRectsForEvent): (WebCore::Page::passiveTouchEventListenerRects): * page/Page.h: * testing/Internals.cpp: (WebCore::Internals::touchEventRectsForEvent): (WebCore::Internals::passiveTouchEventListenerRects): * testing/Internals.h: * testing/Internals.idl: 2017-03-29 Zalan Bujtas RenderBlockFlow::addFloatsToNewParent should check if float is already added to the object list. https://bugs.webkit.org/show_bug.cgi?id=170259 Reviewed by Simon Fraser. r210145 assumed that m_floatingObjects would simply ignore the floating box if it was already in the list. Test: fast/block/float/placing-multiple-floats-crash.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::addFloatsToNewParent): 2017-03-29 Myles C. Maxfield Try to normalize variation ranges https://bugs.webkit.org/show_bug.cgi?id=170119 Unreviewed. Addressing post-review comment. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::isGXVariableFont): 2017-03-29 Myles C. Maxfield Try to normalize variation ranges https://bugs.webkit.org/show_bug.cgi?id=170119 Reviewed by Simon Fraser. TrueType GX-style variation fonts use one particular scale for values on their weight/width/slope axes - usually the values lie between -1 and 1 on that scale. However, OpenType 1.8-style fonts use the CSS scale for values on these axes. For the purposes of font selection, these values need to lie on the same scale. However, when font selection is completed and the variation values are actually being applied to the fonts, values which lie on the font's actual scale need to be applied. This patch adds normalize*() and denormalize*() functions to perform both of these operations. The conversion itself between the two scales isn't an exact mapping. Mapping slope is just a linear relationship with 0deg <=> 0 and 20deg <=> 1 (as per the CSS Fonts spec). Mapping widths is similar, it uses a 2-component piecewise linear relationship which includes the values given in the Microsoft OpenType spec for the OS/2 table's usWidthClass field. Weights are more difficult, so I plotted the CSS weights and the GX-style weights for every style of San Francisco, saw that the relationship appears to be linear, and ran a linear regression to compute the line equation. As for the actual discrimination of determining whether a font is a GX-style font or not, we can use the presence of the 'STAT' table. This table didn't exist when GX fonts were being created, and OpenType 1.8 variable fonts are required to have this table. Facebook uses the string ".SFNSText" in their @font-face blocks. This font is a variation font, but uses the GX-style values. Facebook asks us to create this font with a weight of 700, and because the values in the font are around 1.0, we were erroneously thinking that the font wasn't bold, so we were then applying synthetic bold. This was causing text on facebook to look fuzzy and ugly. Test: fast/text/variations/font-selection-properties-expected.html * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::isGXVariableFont): (WebCore::normalizeWeight): (WebCore::normalizeSlope): (WebCore::denormalizeWeight): (WebCore::denormalizeWidth): (WebCore::denormalizeSlope): (WebCore::normalizeWidth): (WebCore::preparePlatformFont): Instead of using FontSelectionValues for the intermediate values, we should use floats instead. This is because FontSelectionValues are fixed-point numbers with the denominator having 2 bits. When using this data type to represent values on the GX scale, which are usually between 0 and 1, you lose a lot of fidelity. Instead, our intermediate calculations should be done with floats, and converted to FontSelectionValues at the end when they are representative of values on the CSS scale. (WebCore::stretchFromCoreTextTraits): (WebCore::fontWeightFromCoreText): (WebCore::extractVariationBounds): (WebCore::variationCapabilitiesForFontDescriptor): (WebCore::capabilitiesForFontDescriptor): 2017-03-29 Saam Barati LinkBuffer and ExecutableAllocator shouldn't have anything to do with VM https://bugs.webkit.org/show_bug.cgi?id=170210 Reviewed by Mark Lam. * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::compileSelector): (WebCore::SelectorCompiler::SelectorCodeGenerator::compile): 2017-03-29 Javier Fernandez [css-align] Adapt self-alignment properties to the new baseline syntax https://bugs.webkit.org/show_bug.cgi?id=170235 Reviewed by David Hyatt. The baseline-position syntax has changed recently, so we need to update the CSS properties using the old syntax. This patch address only the self-alignment (align-self and justify-self) and default-alignment (align-items and justify-items). The content-distribution properties (align-content and justify-content) will be updated in a follow up patch. The new baseline syntax is "[first | last ]? baseline" which implies modifying the parsing and computed value logic. There are several layout tests affected by this change, so I'll update them accordingly. No new tests, just added/modified some cases to the tests we already have using the new baseline values. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): * css/CSSValueKeywords.in: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData): * css/parser/CSSPropertyParser.cpp: (WebCore::consumeBaselineKeyword): (WebCore::consumeSelfPositionOverflowPosition): 2017-03-29 Chris Dumez Animated SVG images are not paused in pages loaded in the background https://bugs.webkit.org/show_bug.cgi?id=170043 Reviewed by Simon Fraser. Animated SVG images are not paused in pages loaded in the background. We rely on FrameView::isOffscreen() to stop images animations in background tab (See logic in RenderElement's shouldRepaintForImageAnimation()). This works fine if a tab is visble and then becomes hidden (i.e. by switching to another tab). However, in the case where the tab gets loaded while in the background (e.g. opening link in new background tab, or session restore), then the animations would not be paused, due to FrameView::isOffscreen() erroneously returning false in this case. Normally, the following chain of events happens: - Page is visible, we construct a main frame and its FrameView for loading the page. When a FrameView is constructed, we call FrameView::show() to make it visible. Then, if the page becomes non-visible, we call Page::setIsVisibleInternal(false) which calls FrameView::hide(). After that, FrameView::isOffscreen() correctly returns true because we properly called FrameView::hide(). However, when doing a load while the Page is hidden, the following was happening: - Page is not visible, we call Page::setIsVisibleInternal(false) which tries to call FrameView::hide() for the main frame but it does not have a FrameView yet (because the load has not started). We start the load and end up creating a FrameView. The FrameView constructor was calling FrameView::show() unconditionally, thus making the FrameView think is visible, even though its page isn't. At this point, FrameView::isOffscreen() was returning false and animations would keep running, even though the page is not visible. To address the issue, we now call FrameView::show() in FrameView::create() only if the Page is actually visible, instead of calling it unconditionally. If the page ever becomes visible, Page::setIsVisibleInternal(true) will be called and it will take care of calling FrameView::show() then. Tests: svg/animations/animations-paused-in-background-page-iframe.html svg/animations/animations-paused-in-background-page.html * page/FrameView.cpp: (WebCore::FrameView::create): 2017-03-29 Wenson Hsieh Links with empty hrefs should not be drag sources https://bugs.webkit.org/show_bug.cgi?id=170241 Reviewed by Tim Horton. The m_dragSouceAction member of DragController represents the drag source actions that are available to the document, rather than the available actions given the dragging element. Thus, it is not correct to only check that (m_dragSourceAction & DragSourceActionAttachment) before proceeding down the attachment dragging codepath. This should be additionally guarded with a check that the element being dragged is, in fact, an attachment element. New API test (see Tools/ChangeLog). * page/DragController.cpp: (WebCore::DragController::startDrag): 2017-03-29 Jeremy Jones WebVideoFullscreenInterfaceAVKit needs a strong self ref before dispatching to the main thread. https://bugs.webkit.org/show_bug.cgi?id=170129 Reviewed by David Kilzer. No new tests becuase no new behavior. Hold a strong reference to WebVideoFullscreenInterfaceAVKit when dispatching to the main thread. Make WebVideoFullscreenInterfaceAVKit safe to retain from non-main thread. * platform/ios/WebVideoFullscreenInterfaceAVKit.h: * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: (WebVideoFullscreenInterfaceAVKit::exitFullscreen): 2017-03-29 Zan Dobersek [GCrypt] Add a Handle<> class to help with GCrypt object lifetime control https://bugs.webkit.org/show_bug.cgi?id=170238 Reviewed by Michael Catanzaro. The platform-specific CryptoAlgorithmHMAC implementation is modified to showcase the GCrypt::Handle<> use. HandleDeleter is added accordingly. * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp: (WebCore::calculateSignature): 2017-03-29 Myles C. Maxfield Variation fonts: Make sure that feature detection and preprocessor macros are right https://bugs.webkit.org/show_bug.cgi?id=169518 Reviewed by Simon Fraser. When I added variable fonts support, I made all OSes parse the newly accepted values, instead of just the OSes which support variable fonts. Test: fast/text/font-variations-feature-detection.html * css/parser/CSSPropertyParser.cpp: (WebCore::consumeFontStretch): (WebCore::consumeFontStyle): * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::divisibleBy100): (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber): 2017-03-29 Antoine Quint [Modern Media Controls] Controls bar may disappear while captions menu is visible (redux) https://bugs.webkit.org/show_bug.cgi?id=170239 Reviewed by Dean Jackson. We did some work in webkit.org/b/168751 to prevent the controls bar from disappearing while the captions menu is visible. But there were two cases where the behavior was not as intended: 1. the controls bar would hide upon exiting the video. 2. clicking on the controls bar while the caption panel is up would hide the controls bar as well as the captions panel. Instead of determining that the "userInteractionEnabled" property being set to "false" is indicative of secondary UI, such as the tracks panel, being attached to the controls bar, we now have an explicit property to specify this. Now, when "hasSecondaryUIAttached" is "true", we prevent the controls bar from fading when exiting the media. Additionally, when dismissing the tracks panel, we check whether a mouse event lead to this and check if the mouse was positioned over the controls bar. If that is the case, we no longer hide the controls bar and only dismiss the tracks panel. Test: media/modern-media-controls/tracks-panel/tracks-panel-controls-bar-remains-visible-after-clicking-over-it.html * Modules/modern-media-controls/controls/controls-bar.js: (ControlsBar.prototype.set userInteractionEnabled): (ControlsBar.prototype.handleEvent): (ControlsBar.prototype._autoHideTimerFired): * Modules/modern-media-controls/controls/macos-media-controls.js: (MacOSMediaControls.prototype.showTracksPanel): (MacOSMediaControls.prototype.hideTracksPanel): 2017-03-29 Antoine Quint [Modern Media Controls] Volume slider is initially empty https://bugs.webkit.org/show_bug.cgi?id=170237 Reviewed by Dean Jackson. Fixing fallout from https://bugs.webkit.org/show_bug.cgi?id=167935 where we changed the behavior of layout() to happen prior to a commit. In this one instance, we were overriding layout() to run after a commit, so we now override commit(). Otherwise, the that we draw the volume slider into would have its "width" and "height" properties set after we drew, which would clear the . * Modules/modern-media-controls/controls/slider.js: (Slider.prototype.commit): (Slider.prototype.layout): Deleted. 2017-03-29 Zan Dobersek [GCrypt] Move over empty GnuTLS-based SUBTLE_CRYPTO implementation files https://bugs.webkit.org/show_bug.cgi?id=170232 Reviewed by Michael Catanzaro. Migrate the GnuTLS SUBTLE_CRYPTO implementation files to the gcrypt/ directory. The implementation files themselves are no-op, so this is a simple move-and-rename operation that will enable proceeding with the libgcrypt-based implementation of SUBTLE_CRYPTO functionality. No change in behavior. The SUBTLE_CRYPTO feature should build as it did before, and the implementations are empty anyway. * PlatformGTK.cmake: * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp. * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_CFBGnuTLS.cpp. * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_GCMGnuTLS.cpp. * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp. * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmECDHGnuTLS.cpp. * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmPBKDF2GnuTLS.cpp. * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp. * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp: This one already exists. * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp. * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRegistryGnuTLS.cpp. * crypto/gcrypt/CryptoKeyECGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoKeyECGnuTLS.cpp. * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoKeyRSAGnuTLS.cpp. * crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/SerializedCryptoKeyWrapGnuTLS.cpp. * crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp: Removed. 2017-03-29 Zan Dobersek [GnuTLS] Remove unused CryptoDigestGnuTLS, CryptoAlgorithmHMACGnuTLS implementation files https://bugs.webkit.org/show_bug.cgi?id=170231 Reviewed by Michael Catanzaro. * crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp: Removed. The GCrypt counterpart is already in use, and this file wasn't even being built. 2017-03-29 Youenn Fablet Move DTMF WebRTC extension behind its own compile flag https://bugs.webkit.org/show_bug.cgi?id=170226 Reviewed by Eric Carlson. Moving RTCDTMFSender and RTCDTMFToneChangeEvent behinf a WEB_RTC_DTMF compile flag. This compile flag is not set on any supported platform yet. Disabling related test and updated test expectations. * Modules/mediastream/RTCDTMFSender.cpp: * Modules/mediastream/RTCDTMFSender.h: * Modules/mediastream/RTCDTMFSender.idl: * Modules/mediastream/RTCDTMFToneChangeEvent.cpp: * Modules/mediastream/RTCDTMFToneChangeEvent.h: * Modules/mediastream/RTCDTMFToneChangeEvent.idl: * dom/EventNames.in: * dom/EventTargetFactory.in: * platform/mediastream/RTCDTMFSenderHandler.h: * platform/mediastream/RTCDTMFSenderHandlerClient.h: 2017-03-29 Antoine Quint [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout https://bugs.webkit.org/show_bug.cgi?id=168409 Reviewed by Dean Jackson. Add a new internals setting to opt into ScriptedAnimationController logging through DOM events dispatched through the document. This should allow this flaky test to get information as to why the frame isn't firing when it times out. * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::suspend): (WebCore::ScriptedAnimationController::resume): (WebCore::ScriptedAnimationController::addThrottlingReason): (WebCore::ScriptedAnimationController::removeThrottlingReason): (WebCore::ScriptedAnimationController::registerCallback): (WebCore::ScriptedAnimationController::cancelCallback): (WebCore::ScriptedAnimationController::serviceScriptedAnimations): (WebCore::ScriptedAnimationController::scheduleAnimation): (WebCore::ScriptedAnimationController::dispatchLoggingEventIfRequired): * dom/ScriptedAnimationController.h: * page/Settings.in: * testing/InternalSettings.cpp: (WebCore::InternalSettings::resetToConsistentState): (WebCore::InternalSettings::shouldDispatchRequestAnimationFrameEvents): (WebCore::InternalSettings::setShouldDispatchRequestAnimationFrameEvents): * testing/InternalSettings.h: * testing/InternalSettings.idl: 2017-03-28 Youenn Fablet [WebRTC] After r214441 addIceCandidate no longer accepts an RTCIceCandidateInit dictionary https://bugs.webkit.org/show_bug.cgi?id=170192 Reviewed by Jon Lee. Covered by updated tests. * Modules/mediastream/RTCIceCandidate.idl: Candidate is no longer a required field in RTCIceCandidateInit. * Modules/mediastream/RTCPeerConnectionInternals.js: Reworking defaultsToNull to handle both undefined and null cases. 2017-03-28 Youenn Fablet LibWebRTCProvider should allow setting encoder and decoder factories https://bugs.webkit.org/show_bug.cgi?id=170212 Reviewed by Eric Carlson. No change of behavior. Adding the ability to set encoder/decoder libwebrtc factory getters. Setting default cocoa factory getters. * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::staticFactoryAndThreads): (WebCore::initializePeerConnectionFactoryAndThreads): (WebCore::LibWebRTCProvider::setDecoderFactoryGetter): (WebCore::LibWebRTCProvider::setEncoderFactoryGetter): (WebCore::LibWebRTCProvider::setPeerConnectionFactory): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: 2017-03-27 Brent Fulgham Only attach Attributes to a given element one time https://bugs.webkit.org/show_bug.cgi?id=170125 Reviewed by Chris Dumez. Attach the attribute node to the Element before calling 'setAttributeInternal', since that method may cause arbitrary JavaScript events to fire. Test: fast/dom/Attr/only-attach-attr-once.html * dom/Element.cpp: (WebCore::Element::attachAttributeNodeIfNeeded): Added. (WebCore::Element::setAttributeNode): Use new method. Revise to attach attribute before calling 'setAttributeInternal'. (WebCore::Element::setAttributeNodeNS): Ditto. * dom/Element.h: 2017-03-28 Youenn Fablet Stop RTCDataChannel when closing page https://bugs.webkit.org/show_bug.cgi?id=170166 Reviewed by Eric Carlson. Test: webrtc/datachannel/datachannel-gc.html Making RTCDataChannel an ActiveDOMObject. Closing the data channel backend and freeing upon close and stop. * Modules/mediastream/RTCDataChannel.cpp: (WebCore::RTCDataChannel::create): (WebCore::RTCDataChannel::RTCDataChannel): (WebCore::RTCDataChannel::close): (WebCore::RTCDataChannel::stop): * Modules/mediastream/RTCDataChannel.h: * Modules/mediastream/RTCDataChannel.idl: * Modules/mediastream/RTCPeerConnection.h: 2017-03-28 Myles C. Maxfield Ranges for variation font properties are not enforced https://bugs.webkit.org/show_bug.cgi?id=169979 Reviewed by David Hyatt. The spec specifies that: - Font weights less than or equal to 0, or greater than or equal to 1000 are parse errors - Font stretch values less than or equal to 0% are parse errors - Font style values less than or equal to -90deg or greater than or equal to 90deg are parse errors Test: fast/text/variations/out-of-bounds-selection-properties.html * css/parser/CSSPropertyParser.cpp: (WebCore::consumeFontWeightRange): (WebCore::fontStretchIsWithinRange): (WebCore::consumeFontStretch): (WebCore::consumeFontStretchRange): (WebCore::fontStyleIsWithinRange): (WebCore::consumeFontStyle): (WebCore::consumeFontStyleRange): 2017-03-28 Andy Estes [iOS] Crash in -[WebPreviewLoader failed] when running http/tests/multipart/policy-ignore-crash.php https://bugs.webkit.org/show_bug.cgi?id=170197 Reviewed by Brady Eidson. If QuickLook conversion fails, we call ResourceLoader::didFail() with the NSError from QuickLook, which will call back into PreviewLoader::didFail(). We only care about network failures in PreviewLoader, not conversion failures, so check if m_finishedLoadingDataIntoConverter is set before continuing (like we do in PreviewLoader::didFinishLoading()). Fixes crash in http/tests/multipart/policy-ignore-crash.php. * loader/ios/PreviewLoader.mm: (WebCore::PreviewLoader::didFail): 2017-03-28 Chris Dumez Audio indicator is visible on uni-watch.com but there is no audible audio https://bugs.webkit.org/show_bug.cgi?id=170200 Reviewed by Eric Carlson. Cherry-pick the following patch from Blink by : - https://chromium.googlesource.com/chromium/src.git/+/439de5bb2a31384666db1a0e2dadb2b97d2f3ce4 When the gain of a GainNode is 0 or 1, the operation of the node can be optimized. When gain = 1, just copy the input to the output. When gain = 0; just zero out the output. Currently, the input is multiplied by the gain to produce the output. This just optimizes the multiplication away for the two special cases. Also, have the GainNode set the silence hint if the gain is 0. And fix a bug in processIfNecessary when unsilenceOutputs was causing the silence hint to be cleared after the node's process method was finished and may have set the silence hint. The processing should come after unsilenceOutputs to preserve any hints from processing the node. * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::processIfNecessary): * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::process): * platform/audio/AudioBus.cpp: (WebCore::AudioBus::copyWithGainFrom): 2017-03-28 Chris Dumez Animated SVG images are not paused when outside viewport https://bugs.webkit.org/show_bug.cgi?id=170155 Reviewed by Antti Koivisto. Make sure animated SVG images get paused when outside the viewport, similarly to what was already done for animated GIF images. Also make sure they are paused when they no longer have any renderers using them. Tests: svg/animations/animated-svg-image-outside-viewport-paused.html svg/animations/animated-svg-image-removed-from-document-paused.html * loader/cache/CachedImage.cpp: (WebCore::CachedImage::didAddClient): Restart the animation whenever a new CachedImage client is added. This will cause us the re-evaluate if the animation should run. The animation will pause again if the new renderer is not inside the viewport. (WebCore::CachedImage::animationAdvanced): Add a flag to newImageAnimationFrameAvailable() so that the renderers can let us know if we can pause the animation. Pause the animation if all no renderer requires it (i.e. they are all outside the viewport, or there are no renderers). * loader/cache/CachedImageClient.h: (WebCore::CachedImageClient::newImageAnimationFrameAvailable): By default, the CachedImageClients allow pausing. Only renderer will potentially prevent pausing if they are inside the viewport. * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::isAnimating): * platform/graphics/BitmapImage.h: * platform/graphics/Image.h: (WebCore::Image::isAnimating): Add isAnimating() flag on Image for layout testing purposes. * rendering/RenderElement.cpp: (WebCore::RenderElement::newImageAnimationFrameAvailable): Set canPause flag to true if the renderer is not inside the viewport. (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded): Call startAnimation() if the renderer is now visible to resume SVG animations. Repainting is enough for GIF animations but not for SVG animations, we have to explicitly resume them. * rendering/RenderElement.h: * rendering/RenderView.cpp: (WebCore::RenderView::addRendererWithPausedImageAnimations): (WebCore::RenderView::removeRendererWithPausedImageAnimations): (WebCore::RenderView::resumePausedImageAnimationsIfNeeded): * rendering/RenderView.h: Store CachedImages with the renderers that have paused animations. This is required for SVG where we need to explicitly resume the animation on the CachedImage when the renderer becomes visible again. Having access to the Image will also allow us to do smarter visibility checks in RenderElement's shouldRepaintForImageAnimation(), in the future. * svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::hasActiveAnimation): * svg/SVGSVGElement.h: Add hasActiveAnimation() method. * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::startAnimation): Check that animations are paused before starting them. This avoid jumping due to unnecessary calls to rootElement->setCurrentTime(0). (WebCore::SVGImage::isAnimating): Add isAnimating() method for layout tests purposes. * svg/graphics/SVGImage.h: * svg/graphics/SVGImageClients.h: Call animationAdvanced() on the observer instead of the generic changedInRect() when the SVGImage is animating. This way, we go through the same code path as GIF animations and we end up calling CachedImage::animationAdvanced() which calls newImageAnimationFrameAvailable() on RenderElement, which determines if the animation should keep running or not. * testing/Internals.cpp: (WebCore::Internals::isImageAnimating): * testing/Internals.h: * testing/Internals.idl: Add layout testing infrastructure. 2017-03-28 Antti Koivisto Missing render tree position invalidation when tearing down renderers for display:contents subtree https://bugs.webkit.org/show_bug.cgi?id=170199 Reviewed by Zalan Bujtas. Test: fast/shadow-dom/slot-renderer-teardown.html * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::updateElementRenderer): Invalidate the render tree position in case we do a teardown for an element without renderer. 2017-03-28 Ryan Haddad Unreviewed, rolling out r214485. This change caused LayoutTest crashes. Reverted changeset: "Stop RTCDataChannel when closing page" https://bugs.webkit.org/show_bug.cgi?id=170166 http://trac.webkit.org/changeset/214485 2017-03-28 Anders Carlsson ApplePayShippingContactUpdate.idl shouldn't have status field https://bugs.webkit.org/show_bug.cgi?id=170202 rdar://problem/31307106 Reviewed by Beth Dakin. * Modules/applepay/ApplePaySession.cpp: (WebCore::convertAndValidate): If status isn't set, infer it based on whether there are errors present or not. * Modules/applepay/ApplePayShippingContactUpdate.h: Make status optional here; it's still used by the old code path. * Modules/applepay/ApplePayShippingContactUpdate.idl: Remove status here. 2017-03-28 Brian Burg Web Inspector: Add "Disable Caches" option that only applies to the inspected page while Web Inspector is open https://bugs.webkit.org/show_bug.cgi?id=169865 Reviewed by Joseph Pecoraro. Rewrite the network agent's command for disabling resource caching to use Page::setResourceCachingEnabled. The old implementation was doing weird stuff like setting no-cache headers and evicting the contents of the memory cache, neither of which is correct. The new approach has no side effects on the network, disk, or memory cache so it can be turned on temporarily without causing problems. New tests: - http/tests/inspector/network/set-resource-caching-disabled-disk-cache.html - http/tests/inspector/network/set-resource-caching-disabled-memory-cache.html * inspector/InspectorNetworkAgent.h: * inspector/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::setCacheDisabled): Deleted. (WebCore::InspectorNetworkAgent::setResourceCachingDisabled): Added. Implement new command. (WebCore::InspectorNetworkAgent::willSendRequest): (WebCore::InspectorNetworkAgent::mainFrameNavigated): Remove crufty attempts to break caches. I believe these are intended to defeat caching proxies and similar middlemen, but this is just as likely to cause unusual loading behavior. * page/Page.h: (WebCore::Page::isResourceCachingDisabled): (WebCore::Page::setResourceCachingDisabledOverride): Add an override setting so that Web Inspector's override does not mess up the value of isResourceCachingDisabled that may have been set by a WebKit API client. 2017-03-28 Youenn Fablet Fix addIceCandidate after r214441 https://bugs.webkit.org/show_bug.cgi?id=170146 Reviewed by Chris Dumez. Covered by rebased test. * Modules/mediastream/RTCPeerConnection.js: (addIceCandidate): Setting function length to 1 and throwing if no parameter is passed. 2017-03-28 Youenn Fablet Stop RTCDataChannel when closing page https://bugs.webkit.org/show_bug.cgi?id=170166 Reviewed by Eric Carlson. Test: webrtc/datachannel/datachannel-gc.html Making RTCDataChannel an ActiveDOMObject. Closing the data channel backend and freeing upon close and stop. * Modules/mediastream/RTCDataChannel.cpp: (WebCore::RTCDataChannel::create): (WebCore::RTCDataChannel::RTCDataChannel): (WebCore::RTCDataChannel::close): (WebCore::RTCDataChannel::stop): * Modules/mediastream/RTCDataChannel.h: * Modules/mediastream/RTCDataChannel.idl: * Modules/mediastream/RTCPeerConnection.h: 2017-03-27 Simon Fraser Enhance the touch region debug overlay to show regions for the different events https://bugs.webkit.org/show_bug.cgi?id=170162 Reviewed by Tim Horton. Have NonFastScrollableRegionOverlay use a different color for each region in EventTrackingRegions, and to draw a legend showing what the colors mean. On Mac, this overlay displays the non-fast scrollable region (which we don't keep separate from the wheel event region). * page/DebugPageOverlays.cpp: (WebCore::NonFastScrollableRegionOverlay::updateRegion): (WebCore::touchEventRegionColors): (WebCore::drawRightAlignedText): (WebCore::NonFastScrollableRegionOverlay::drawRect): (WebCore::RegionOverlay::drawRect): (WebCore::RegionOverlay::drawRegion): 2017-03-27 Simon Fraser Make sure the non-fast scrolling debug overlay is correctly updated https://bugs.webkit.org/show_bug.cgi?id=170142 Reviewed by Tim Horton. AsyncScrollingCoordinator::frameViewEventTrackingRegionsChanged() is called on a timer from Document code, so the existing DebugPageOverlays::didLayout() call at the end of FrameView::layout() wasn't sufficient to keep the non-fast scrollable region up-to-date on iOS. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::frameViewEventTrackingRegionsChanged): 2017-03-28 Antoine Quint [Modern Media Controls] AirPlay placard text looks bad on 1x displays https://bugs.webkit.org/show_bug.cgi?id=170183 Reviewed by Dean Jackson. Use subpixel antialiasing for all text in modern media controls. * Modules/modern-media-controls/controls/media-controls.css: (.media-controls-container,): 2017-03-28 Antoine Quint [Modern Media Controls] Improve appearance of tracks panel on macOS https://bugs.webkit.org/show_bug.cgi?id=168929 Reviewed by Eric Carlson. We use a solid color for the focus state that matches the style used on macOS and blend the titles the same way we blend other non-solid labels in the controls bar. * Modules/modern-media-controls/controls/tracks-panel.css: (.tracks-panel section): (.tracks-panel section > h3): (.tracks-panel section > ul > li:focus): 2017-03-28 Yoav Weiss Add a warning for unused link preloads. https://bugs.webkit.org/show_bug.cgi?id=165670 Reviewed by Youenn Fablet. Tests: http/tests/preload/single_download_preload_headers_charset.php http/tests/preload/unused_preload_warning.html * dom/Document.cpp: (WebCore::Document::prepareForDestruction): Stop the timer once the document is destructed. * loader/LinkPreloadResourceClients.h: Add shouldMarkAsReferenced overides for the LinkPreloadResourceClient classes. * loader/cache/CachedResource.cpp: (WebCore::CachedResource::addClientToSet): Make sure LinkPreloadResourceClients don't set resource to be referenced. * loader/cache/CachedResourceClient.h: (WebCore::CachedResourceClient::shouldMarkAsReferenced): Make sure that ResourceClients mark preloads as referenced by default. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::CachedResourceLoader): Initialize timer. (WebCore::CachedResourceLoader::~CachedResourceLoader): Stop timer. (WebCore::CachedResourceLoader::documentDidFinishLoadEvent): Trigger a timer if preloads weren't cleared at load time. (WebCore::CachedResourceLoader::stopUnusedPreloadsTimer): Stop the timer. (WebCore::CachedResourceLoader::warnUnusedPreloads): Iterate over m_preloads and issue a warning for non-referenced preloads. * loader/cache/CachedResourceLoader.h: * page/DOMWindow.cpp: (WebCore::DOMWindow::willDetachDocumentFromFrame): Clear Resource Timing buffer when document detaches, to avoid test flakiness. 2017-03-28 Antoine Quint REGRESSION: Double-clicking the captions button while the captions popover is open prevents the popover from being opened again https://bugs.webkit.org/show_bug.cgi?id=170171 Reviewed by Dean Jackson. We used to consider that the tracks panel was presented as long as it had a parent, but since we were using for the animated transition to complete before actually removing the panel from the node hierarchy, consecutive calls to hide then present would fail to present the panel. We now use a private instance variable to track the presented state which is set immediately as presentInParent() and hide() are called. Test: media/modern-media-controls/tracks-support/tracks-support-show-panel-then-double-click-on-tracks-button.html * Modules/modern-media-controls/controls/tracks-panel.js: (TracksPanel.prototype.get presented): (TracksPanel.prototype.presentInParent): (TracksPanel.prototype.hide): 2017-03-28 Aaron Chu AX: Media controls should be able to be re-activated after faded away https://bugs.webkit.org/show_bug.cgi?id=170048 Reviewed by Antoine Quint. Added a "foucsin" listener for the controls bar so that when an element within fires a "focusin" event, the controls bar reappears if it is faded. Test: media/modern-media-controls/media-controls/media-controls-appear-when-focus.html * Modules/modern-media-controls/controls/controls-bar.js: (ControlsBar.prototype.handleEvent): 2017-03-28 Antoine Quint [Modern Media Controls] Improve media documents across macOS, iPhone and iPad https://bugs.webkit.org/show_bug.cgi?id=169145 Reviewed by Dean Jackson. There were a variety of issues with media documents, some longstanding, and some specifically about modern media controls. One issue was that fullscreen and picture-in-picture buttons would show for audio media documents, due to using a
      ,