2020-12-02 Chris Dumez iframe with `sandbox=allow-top-navigation-by-user-activation` can navigate top frame when the user interacts with an iframe from another origin https://bugs.webkit.org/show_bug.cgi?id=219413 Reviewed by Geoffrey Garen. An iframe with `sandbox=allow-top-navigation-by-user-activation` can navigate the top frame when the user interacts with an frame from another origin. This is not strict enough and does not match the behavior of Chrome. In Chrome, the user activation is only valid for the purpose of navigation if the user interacted with either: - The iframe triggering the navigation - A descendant iframe of the iframe triggering the navigation - A frame from the same origin as the iframe triggering the navigation This patch aligns our behavior with Chrome's. Test: http/tests/security/block-top-level-navigations-by-sandboxed-iframe-with-propagated-user-gesture.html * dom/Document.cpp: (WebCore::Document::canNavigateInternal): * dom/UserGestureIndicator.cpp: (WebCore::UserGestureToken::UserGestureToken): (WebCore::UserGestureToken::isValidForDocument const): (WebCore::UserGestureIndicator::processingUserGesture): * dom/UserGestureIndicator.h: (WebCore::UserGestureToken::create): 2020-12-02 Chris Dumez Block suspicious top level navigations by iframes even if sandbox=allow-top-navigation is specified https://bugs.webkit.org/show_bug.cgi?id=219408 Reviewed by Geoffrey Garen. Block suspicious top level navigations by iframes even if sandbox=allow-top-navigation is specified, when the parent of the sandboxed iframe is not first-party. Test: http/tests/security/block-top-level-navigations-by-third-party-sandboxed-iframe.html * dom/Document.cpp: (WebCore::Document::isNavigationBlockedByThirdPartyIFrameRedirectBlocking): 2020-11-20 Youenn Fablet Add support for RTCPeerConnection.onicecandidateerror event https://bugs.webkit.org/show_bug.cgi?id=169644 Reviewed by Alex Christensen. Expose RTCPeerConnection.onicecandidateerror and use it for wrong STUN/TURN server URLs. For that matter, add RTCPeerConnectionIceErrorEvent as per spec with a slight change to the init directory to keep the same terminology between event and init dictionary. Covered by updated webrtc/stun-server-filtering.html test. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::iceServersFromConfiguration): (WebCore::iceServersFromConfiguration): Deleted. * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCPeerConnectionIceErrorEvent.cpp: Added. (WebCore::RTCPeerConnectionIceErrorEvent::create): (WebCore::RTCPeerConnectionIceErrorEvent::RTCPeerConnectionIceErrorEvent): (WebCore::RTCPeerConnectionIceErrorEvent::eventInterface const): * Modules/mediastream/RTCPeerConnectionIceErrorEvent.h: Added. * Modules/mediastream/RTCPeerConnectionIceErrorEvent.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * dom/EventNames.h: * dom/EventNames.in: 2020-09-18 Chris Dumez Crash under WebCore::shouldResetFocusNavigationStartingNode() https://bugs.webkit.org/show_bug.cgi?id=216714 Reviewed by Darin Adler. Protect anchorElement in FrameView::scrollToFragmentInternal() to make sure it stays alive until the time we pass it to setFocusNavigationStartingNode(). * page/FrameView.cpp: (WebCore::FrameView::scrollToFragmentInternal): 2020-08-13 Chris Dumez REGRESSION (r260684): Messages YouTube inline video: after Multitasking away and Back, Audio is heard but icon indicates "muted" https://bugs.webkit.org/show_bug.cgi?id=215453 Reviewed by Tim Horton. r260684 silenced all JS events during the snapshot sequence that occurs whenever the user homes out of Safari. This was meant to address compatibility with websites that did not expect various resize/orientationchange events when homing out. However, the snapshot sequence is fairly long and this was causing us to silence JS events which have nothing to do with the snapshot sequence, like window.postMessage()'s message events. This is what caused this regression. To address the issue, this patch basically reverts r260684 and deals with websites-compatibility issues via less risky site-specific and event-specific quirks: - We silence Window resize events on nytimes.com to address . - We silence Window resize events and MediaQueryList change events on twitter.com to address and . * css/MediaQueryMatcher.cpp: (WebCore::MediaQueryMatcher::evaluateAll): * dom/EventTarget.cpp: (WebCore::EventTarget::fireEventListeners): * page/FrameView.cpp: (WebCore::FrameView::sendResizeEventIfNeeded): * page/Page.h: (WebCore::Page::isTakingSnapshotsForApplicationSuspension const): (WebCore::Page::setIsTakingSnapshotsForApplicationSuspension): (WebCore::Page::shouldFireEvents const): Deleted. (WebCore::Page::setShouldFireEvents): Deleted. * page/Quirks.cpp: (WebCore::Quirks::shouldSilenceWindowResizeEvents const): (WebCore::Quirks::shouldSilenceMediaQueryListChangeEvents const): * page/Quirks.h: 2021-02-16 Michael Catanzaro [GTK] Need new user agent quirk for Google Docs and Google Drive https://bugs.webkit.org/show_bug.cgi?id=221845 Reviewed by Adrian Perez de Castro. Switch Google Docs to use a Chrome browser quirk instead of an Internet Explorer quirk. Remove the Google Drive quirk altogether. Remove the Internet Explorer and Windows platform quirks, which are no longer used. Retarget the Google Docs quirk to apply only to docs.google.com because we no longer need to send the quirk to accounts.youtube.com for it to be effective. Lastly, update Chrome and Firefox version strings for good measure. * platform/UserAgentQuirks.cpp: (WebCore::urlRequiresChromeBrowser): (WebCore::urlRequiresLinuxDesktopPlatform): (WebCore::UserAgentQuirks::quirksForURL): (WebCore::UserAgentQuirks::stringForQuirk): (WebCore::urlRequiresInternetExplorerBrowser): Deleted. (WebCore::urlRequiresWindowsPlatform): Deleted. * platform/glib/UserAgentGLib.cpp: (WebCore::buildUserAgentString): 2021-02-10 Xabier Rodriguez Calvar [GStreamer] Make m_client WeakPtr in AudioSourceProviderGStreamer https://bugs.webkit.org/show_bug.cgi?id=217952 Reviewed by Carlos Garcia Campos. * platform/audio/AudioSourceProviderClient.h: Turned into CanMakeWeakPtr. * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp: (WebCore::AudioSourceProviderGStreamer::setClient): Adapt to use WeakPtr. * platform/audio/gstreamer/AudioSourceProviderGStreamer.h: Turned m_client into WeakPtr. 2020-11-27 Philippe Normand [GStreamer] AudioSourceProvider can potentially invoke an already-freed client https://bugs.webkit.org/show_bug.cgi?id=217952 Reviewed by Xabier Rodriguez-Calvar. * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp: (WebCore::AudioSourceProviderGStreamer::deinterleavePadsConfigured): Check the provider has a client before setting up the audio format. 2020-11-26 Michael Catanzaro [WPE][GTK] Use Internet Explorer quirk for Google Docs https://bugs.webkit.org/show_bug.cgi?id=219278 Reviewed by Carlos Garcia Campos. Since r266584, we've suffered from an annoying unsupported browser warning when using Google Docs. We don't have many options to avoid it. I'm afraid that Firefox or Chrome quirks are too risky, since these seem to tempt Google into using web platform features that WebKit does not support. The safest quirk is the macOS platform quirk, but that doesn't work well here because it breaks various keyboard shortcuts like Ctrl+A and Ctrl+Z. So an Internet Explorer quirk is really the last card we have left. I think this is the safest Google quirk we've ever had, in that it's pretty unlikely that Google will try to send Internet Explorer anything that doesn't work in WebKit. However, it will break eventually, whenever Google decides that Internet Explorer is no longer supported. I guess that date is probably at least five years away, so we can only hope that Google drops this anticompetitive nonsense before then. P.S. Let's also switch Google Drive to this new quirk. The unsupported browser warning on Google Drive seems to be completely independent, but the IE quirk seems safer that the existing Firefox quirk, so why not? * platform/UserAgentQuirks.cpp: (WebCore::isGoogle): (WebCore::urlRequiresInternetExplorerBrowser): (WebCore::urlRequiresWindowsPlatform): (WebCore::urlRequiresLinuxDesktopPlatform): (WebCore::UserAgentQuirks::quirksForURL): (WebCore::UserAgentQuirks::stringForQuirk): * platform/UserAgentQuirks.h: * platform/glib/UserAgentGLib.cpp: (WebCore::buildUserAgentString): 2020-12-11 Miguel Gomez REGRESSION(r268923): [WPE] Nothing renders on the rpi3 using the proprietary video driver https://bugs.webkit.org/show_bug.cgi?id=219739 Reviewed by Carlos Garcia Campos. Rewrite the GLSL code to perform rounded rectangle clipping so it works with the limitations of the raspberrypi3 proprietary video driver. * platform/graphics/texmap/TextureMapperShaderProgram.cpp: 2020-12-11 Fujii Hironori [TextureMapper] REGRESION(r269570): mask layer doesn't clip descendent layers https://bugs.webkit.org/show_bug.cgi?id=219136 Reviewed by Carlos Garcia Campos. computeOverlapRegions shouldn't include the descendent layer region for layers with a mask layer. Add a new mode Mask to ComputeOverlapRegionMode which is like Union mode but doesn't include descendent layers. Test: compositing/masks/clip-path-composited-descendent-2.html * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::computeOverlapRegions): Skip children for the Mask mode. (WebCore::TextureMapperLayer::paintUsingOverlapRegions): Use ComputeOverlapRegionMode::Mask for a layer with mask layer. * platform/graphics/texmap/TextureMapperLayer.h (ComputeOverlapRegionMode): Added Mask. 2020-11-03 Stephan Szabo [WinCairo/PlayStation] ICU 68.1 no longer exposes FALSE and TRUE macros by default https://bugs.webkit.org/show_bug.cgi?id=218522 Reviewed by Don Olmstead. * platform/text/TextCodecICU.cpp: Replace use of TRUE with true 2020-11-16 Fujii Hironori [TextureMapper] The edges of blur backdrop-filter look gradient tranparent https://bugs.webkit.org/show_bug.cgi?id=218645 Reviewed by Carlos Garcia Campos. The blur backdrop-filter needs a larger input image than an output image. However, it's not easy to get a larger input image in the edges of the windows. Cocoa port is doing extrapolation by duplicating edges pixels of the input image which has the same size with the output image (Bug 146215). Take the same approach. * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::computeOverlapRegions): Don't inflate the local bounding rect by the outsets for backdrop layers. * platform/graphics/texmap/TextureMapperShaderProgram.cpp: (sampleColorAtRadius): Don't clamp 'coord'. 2020-11-13 Miguel Gomez [GTK][WPE] CSS backdrop overlay corners are not rounded on results.webkit.org https://bugs.webkit.org/show_bug.cgi?id=215445 Reviewed by Carlos Garcia Campos. Pass the backdropFiltersRect from CoordinatedGraphicsLayer through Nicosia to TextureMapperLayer. The latter will use this value to clip when painting the backdrop layer. Based on a patch created by Carlos Garcia Campos . * platform/graphics/nicosia/NicosiaPlatformLayer.h: (Nicosia::CompositionLayer::flushState): * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::paintSelfAndChildren): (WebCore::TextureMapperLayer::setBackdropFiltersRect): * platform/graphics/texmap/TextureMapperLayer.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::setBackdropFilters): (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly): 2020-11-09 Fujii Hironori [TextureMapper] backdrop-filter should use the identity transform to render the root layer https://bugs.webkit.org/show_bug.cgi?id=218699 Reviewed by Don Olmstead. Even thouth CSS reflections mirror the content, backdrop-filter in the reflection doesn't. It sees through the background. css3/filters/backdrop/backdrop-filter-with-reflection.html is the test case. * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica): (WebCore::TextureMapperLayer::paintIntoSurface): (WebCore::TextureMapperLayer::paintWithIntermediateSurface): Removed TextureMapperPaintOptions::isReplica. 2020-11-09 Fujii Hironori [TextureMapper] The top and left sides of drop-shadow are clipped https://bugs.webkit.org/show_bug.cgi?id=218647 Reviewed by Don Olmstead. TextureMapperLayer::computeOverlapRegions incorrectly calculated the local bounding rect for top and left of outsets. The drop-shadow was incorrectly blended with the content. Test: compositing/filters/drop-shadow.html * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::computeOverlapRegions): Stopped using std::max for the left and top of outsets. Stopped taking the unite with unfilteredTargetRect because outsets are always positive. * platform/graphics/texmap/TextureMapperShaderProgram.cpp: Fixed sourceOver(). 2020-11-08 Fujii Hironori TextureMapperLayer::computeOverlapRegions: Accumulate nested replica transform matrices recursively https://bugs.webkit.org/show_bug.cgi?id=218364 Reviewed by Don Olmstead. Transformed nested reflection layers were wrongly clipped because computeOverlapRegions applied replica transform matrices incorrectly. Test: compositing/reflections/nested-reflection-opacity2.html * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::resolveOverlaps): (WebCore::TextureMapperLayer::computeOverlapRegions): (WebCore::TextureMapperLayer::paintUsingOverlapRegions): * platform/graphics/texmap/TextureMapperLayer.h: 2020-11-08 Fujii Hironori [GraphicsLayerTextureMapper] reflection masks aren't applied https://bugs.webkit.org/show_bug.cgi?id=218429 Reviewed by Don Olmstead. The backing store of the mask layer of replica layers aren't updated at all since r178111. * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers): Use updateBackingStoreIncludingSubLayers for the replica layer to update backing stores recursively instead of updating only one layer by using updateBackingStoreIfNeeded. 2020-11-03 Fujii Hironori [TextureMapper] Crashed in TextureMapperLayer::paintUsingOverlapRegions https://bugs.webkit.org/show_bug.cgi?id=214817 Reviewed by Don Olmstead. TextureMapperLayer::paintUsingOverlapRegions has the expression `overlapRegion.bounds().size().area()` which crashes for a very large layer. computeOverlapRegions returned very large overlap and non-overlap regions without taking the clip bounds into account. Change computeOverlapRegions to return clipped regions. paintUsingOverlapRegions no longer needs to clip the returned regions. Test: compositing/tiling/huge-layer-with-opacity.html * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::computeOverlapRegions): (WebCore::TextureMapperLayer::paintUsingOverlapRegions): * platform/graphics/texmap/TextureMapperLayer.h: 2020-10-30 Fujii Hironori [TextureMapper] Replica layers don't blend correctly because computeOverlapRegions doesn't take TextureMapperPaintOptions::transform into account https://bugs.webkit.org/show_bug.cgi?id=218307 Reviewed by Don Olmstead. Blending in replica layers didn't work as expected because computeOverlapRegions didn't take the transform of TextureMapperPaintOptions into account. Rendering replica layers are achieved by using the transform. TextureMapperLayer::paintWithIntermediateSurface also should take the transform. commitSurface no longer needs to transform by it. Test: compositing/reflections/opacity-in-reflection.html * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::computeOverlapRegions): (WebCore::TextureMapperLayer::paintUsingOverlapRegions): (WebCore::commitSurface): (WebCore::TextureMapperLayer::paintWithIntermediateSurface): * platform/graphics/texmap/TextureMapperLayer.h: 2020-10-28 Fujii Hironori TextureMapperLayer::paintWithIntermediateSurface: Reduce BitmapTextures by unifying replicaSurface and mainSurface https://bugs.webkit.org/show_bug.cgi?id=217943 Reviewed by Don Olmstead. TextureMapperLayer::paintWithIntermediateSurface was using two BitmapTextures for the main layer and replica layer. But, a single BitmapTexture suffices. Create a BitmapTexture and render both layers onto it. No new tests, no behavior changes. * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::paintIntoSurface): (WebCore::TextureMapperLayer::paintWithIntermediateSurface): * platform/graphics/texmap/TextureMapperLayer.h: 2020-10-27 Fujii Hironori [TextureMapper][GTK] Test compositing/clipping/border-radius-stacking-context-clip.html is failing https://bugs.webkit.org/show_bug.cgi?id=214868 Reviewed by Carlos Garcia Campos. If a replica layer has m_state.pos, m_layerTransforms.combined should be translated by them. * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::computeTransformsRecursive): * platform/graphics/texmap/TextureMapperLayer.h: 2020-10-27 Miguel Gomez [WPE] REGRESSION(r268992) Redefinition of min() inside TextureMapperShaderProgram for GLES > 3.0 https://bugs.webkit.org/show_bug.cgi?id=218231 Reviewed by Sergio Villar Senin. Remove the definition of the min() function and replace its usage with an if. This works for every GLSL version. * platform/graphics/texmap/TextureMapperShaderProgram.cpp: (WebCore::TextureMapperShaderProgram::create): (WebCore::STRINGIFY): Deleted. 2020-10-26 Fujii Hironori [TextureMapper] min(genIType) isn't supported for GLSL ES < 3.0 https://bugs.webkit.org/show_bug.cgi?id=218164 Reviewed by Don Olmstead. Nothing is drawn in AC mode of WinCairo port since r268923. r268923 added a shader code of using min of int type which is supported since GLSL ES 3.0. * platform/graphics/texmap/TextureMapperShaderProgram.cpp: Added fragmentTemplateES to define int type of min. (WebCore::TextureMapperShaderProgram::create): 2020-11-13 Miguel Gomez [GTK][WPE] FilterInfo must cleared when reusing BitmapTextureGL https://bugs.webkit.org/show_bug.cgi?id=218854 Reviewed by Carlos Garcia Campos. Clear the FilterInfo attribute when reusing a BitmapTextureGL. * platform/graphics/texmap/BitmapTextureGL.cpp: (WebCore::BitmapTextureGL::didReset): 2020-10-30 Miguel Gomez [GTK] Direct composited images may not be rendered after a window resize https://bugs.webkit.org/show_bug.cgi?id=218292 Reviewed by Carlos Garcia Campos. Ensure that valid buffers passed for ImageBackings are not destroyed until the CoordinatedGraphicsScene consumes them. * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.cpp: (Nicosia::ImageBackingTextureMapperImpl::flushUpdate): * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly): (WebCore::CoordinatedGraphicsLayer::purgeBackingStores): 2020-10-23 Miguel Gomez [GTK][WPE] Implement antialiased rounded rectangle clipping in TextureMapper https://bugs.webkit.org/show_bug.cgi?id=174457 Reviewed by Carlos Garcia Campos. Implement rounded rectangle clipping in TextureMapperGL, supporting up to 10 simultaneous rounded rectangle clips. TextureMapper::beginClip() now receives a rounded rectangle, and it applies the appropriate clipping method as required. The rounded rectangle clip implementation uses the fragment shader to calculate whether each pixel is inside the defined rounded rectangles, and paints or skips it as needed. * platform/graphics/texmap/ClipStack.cpp: (WebCore::ClipStack::addRoundedRect): * platform/graphics/texmap/ClipStack.h: (WebCore::ClipStack::State::State): (WebCore::ClipStack::roundedRectComponents const): (WebCore::ClipStack::roundedRectInverseTransformComponents const): (WebCore::ClipStack::roundedRectCount const): (WebCore::ClipStack::isRoundedRectClipEnabled const): (WebCore::ClipStack::isRoundedRectClipAllowed const): * platform/graphics/texmap/TextureMapper.h: * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::prepareRoundedRectClip): (WebCore::TextureMapperGL::drawTexture): (WebCore::TextureMapperGL::drawTexturePlanarYUV): (WebCore::TextureMapperGL::drawTextureSemiPlanarYUV): (WebCore::TextureMapperGL::drawTexturePackedYUV): (WebCore::TextureMapperGL::drawSolidColor): (WebCore::TextureMapperGL::beginRoundedRectClip): (WebCore::TextureMapperGL::beginClip): * platform/graphics/texmap/TextureMapperGL.h: * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::paintSelf): (WebCore::TextureMapperLayer::paintSelfAndChildren): (WebCore::TextureMapperLayer::paintUsingOverlapRegions): * platform/graphics/texmap/TextureMapperShaderProgram.cpp: (WebCore::TextureMapperShaderProgram::create): * platform/graphics/texmap/TextureMapperShaderProgram.h: 2020-11-17 Chris Lord REGRESSION(r269579) [WPE] Many tests with scrolling flaky after this revision https://bugs.webkit.org/show_bug.cgi?id=218859 Reviewed by Simon Fraser. Set scrolling node ID correctly on CoordinatedGraphicsLayer. * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateBeforeChildren): * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp: * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::setScrollingNodeID): (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly): * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: 2020-11-09 Chris Lord [GTK][WPE] Scrolling with mouse wheel doesn't work on iframes with async scrolling enabled https://bugs.webkit.org/show_bug.cgi?id=214179 Reviewed by Žan Doberšek. Implement ScrollingTree::scrollingNodeForPoint in ScrollingTreeNicosia. This fixes overflow and iframe scrolling when async scrolling is enabled on WPE and GTK ports. * page/scrolling/ThreadedScrollingTree.h: * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateBeforeChildren): * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h: * page/scrolling/nicosia/ScrollingTreeNicosia.cpp: (WebCore::collectDescendantLayersAtPoint): (WebCore::ScrollingTreeNicosia::scrollingNodeForPoint): * page/scrolling/nicosia/ScrollingTreeNicosia.h: * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::commitStateBeforeChildren): * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.h: * platform/graphics/nicosia/NicosiaPlatformLayer.h: (Nicosia::CompositionLayer::flushState): (Nicosia::CompositionLayer::accessPending): 2020-11-18 Michael Catanzaro [WPE][GTK] Update Outlook user agent quirk https://bugs.webkit.org/show_bug.cgi?id=219049 Reviewed by Carlos Garcia Campos. Users report that our user agent quirk for Outlook no longer works. Problem is outlook.live.com has moved to outlook.office.com. Thanks to Adrian Vovk for rebuilding WebKit to confirm that this patch fixes the issue. * platform/UserAgentQuirks.cpp: (WebCore::urlRequiresMacintoshPlatform): 2020-11-18 Carlos Garcia Campos Unreviewed. Fix the build with GCC 10 Add a temporary workaround for a GCC 10 bug. * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting): 2020-11-13 Adrian Perez de Castro [GTK][WPE] Build broken in stable 2.30.x releases with ENABLE_VIDEO=OFF https://bugs.webkit.org/show_bug.cgi?id=218921 Reviewed by Carlos Garcia Campos. No new tests needed. * Modules/webaudio/AudioContext.cpp: Add missing Document.h include. 2020-10-27 Philippe Normand [GStreamer] Bad handling of audio files in the ImageDecoder https://bugs.webkit.org/show_bug.cgi?id=218239 Reviewed by Adrian Perez de Castro. The final main thread notification needs to be blocking otherwise the decoder might get disposed of too early. Test: fast/images/animated-image-mp3-crash.html * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: (WebCore::ImageDecoderGStreamer::pushEncodedData): 2020-10-05 Enrique Ocaña González [GTK][X11] WebProcess crash in WebCore::GLContextGLX::createPbufferContext() with NVidia proprietary drivers https://bugs.webkit.org/show_bug.cgi?id=217323 Reviewed by Adrian Perez de Castro. The returnedElements variable might remain uninitialized if the glXChooseFBConfig() function call fails, leading to execution of the wrong code branch later. * platform/graphics/glx/GLContextGLX.cpp: (WebCore::GLContextGLX::createPbufferContext): Initialized the returnedElements variable. 2020-10-15 Chris Lord [GTK][WPE] Add support for smooth scrolling animation with async scrolling https://bugs.webkit.org/show_bug.cgi?id=210382 Reviewed by Carlos Garcia Campos. Respect smooth-scrolling setting and fix deadlock issues with async scrolling on nicosia path. No new tests, no functional change. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::scrollAnimatorEnabled const): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::ThreadedScrollingTree): * page/scrolling/ThreadedScrollingTree.h: (WebCore::ThreadedScrollingTree::scrollAnimatorEnabled const): * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeFrameScrollingNodeNicosia::ScrollingTreeFrameScrollingNodeNicosia): (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateAfterChildren): (WebCore::ScrollingTreeFrameScrollingNodeNicosia::ensureScrollAnimationKinetic): (WebCore::ScrollingTreeFrameScrollingNodeNicosia::ensureScrollAnimationSmooth): (WebCore::ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent): (WebCore::ScrollingTreeFrameScrollingNodeNicosia::stopScrollAnimations): (WebCore::ScrollingTreeFrameScrollingNodeNicosia::repositionRelatedLayers): * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h: * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::ScrollingTreeOverflowScrollingNodeNicosia): (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::commitStateAfterChildren): (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::repositionScrollingLayers): (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::ensureScrollAnimationKinetic): (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::ensureScrollAnimationSmooth): (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::handleWheelEvent): (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::stopScrollAnimations): * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.h: * platform/PlatformWheelEvent.h: * platform/ScrollAnimation.h: * platform/ScrollAnimationKinetic.cpp: (WebCore::ScrollAnimationKinetic::isActive const): * platform/ScrollAnimationKinetic.h: * platform/ScrollAnimationSmooth.cpp: (WebCore::ScrollAnimationSmooth::scroll): (WebCore::ScrollAnimationSmooth::isActive const): * platform/ScrollAnimationSmooth.h: * platform/generic/ScrollAnimatorGeneric.cpp: (WebCore::ScrollAnimatorGeneric::ensureSmoothScrollingAnimation): 2020-09-01 Chris Lord [GTK][WPE] Add support for smooth scrolling animation with async scrolling https://bugs.webkit.org/show_bug.cgi?id=210382 Reviewed by Carlos Garcia Campos. This removes the dependency on ScrollableArea from ScrollAnimationSmooth, which allows its use as a utility class for smooth scrolling. This class is then used in the Nicosia async layer composition scrolling code to provide smooth scrolling, when the feature is enabled. This mirrors the work done in bug 209230 for kinetic scrolling. No new tests, enabling existing functionality in more situations. * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::scrollTo): * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeFrameScrollingNodeNicosia::ScrollingTreeFrameScrollingNodeNicosia): (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateAfterChildren): (WebCore::ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent): (WebCore::ScrollingTreeFrameScrollingNodeNicosia::stopScrollAnimations): * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h: * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::ScrollingTreeOverflowScrollingNodeNicosia): (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::commitStateAfterChildren): (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::handleWheelEvent): (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::stopScrollAnimations): * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.h: * platform/ScrollAnimation.h: (WebCore::ScrollAnimation::serviceAnimation): * platform/ScrollAnimationKinetic.cpp: * platform/ScrollAnimationKinetic.h: * platform/ScrollAnimationSmooth.cpp: (WebCore::ScrollAnimationSmooth::ScrollAnimationSmooth): (WebCore::ScrollAnimationSmooth::scroll): (WebCore::ScrollAnimationSmooth::stop): (WebCore::ScrollAnimationSmooth::updateVisibleLengths): (WebCore::ScrollAnimationSmooth::animationTimerFired): * platform/ScrollAnimationSmooth.h: * platform/ScrollAnimator.cpp: (WebCore::ScrollAnimator::ScrollAnimator): * platform/generic/ScrollAnimatorGeneric.cpp: (WebCore::ScrollAnimatorGeneric::ScrollAnimatorGeneric): (WebCore::ScrollAnimatorGeneric::ensureSmoothScrollingAnimation): 2020-10-13 Michael Catanzaro [SOUP] webkit_web_view_get_https_status() broken with service workers https://bugs.webkit.org/show_bug.cgi?id=216038 Reviewed by Carlos Garcia Campos. This implements CertificateInfo::isolatedCopy for libsoup ports. This is impossible to do completely, because we cannot copy the private key portion of the GTlsCertificate, because it is a write-only property, because it might be backed by a hardware token and therefore really impossible to write software to get it. If we were to implement g_tls_certificate_copy() in GLib -- which I will probably do eventually, because I need this outside WebKit as well -- then GTlsCertificate implementations could copy the private key or PKCS#11 handle or whatever. But anyway, let not perfect be the enemy of the good. We only need this for service workers currently. (Probably that's all we'll *ever* need it for.) So we are only working with server certificates, and the private portion of the certificate is guaranteed to not exist (because servers don't send us their private keys), and we can just forget about it. As long as nobody tries to copy a client certificate in the future -- where we really would need the private key portion of the certificate -- this will be perfectly fine. Actually copying the certificate is kind of annoying, because a chain of certificates is represented by having the main (server) certificate keep a reference to its issuer, which is not referenced anywhere else, so we have to reconstruct the chain in reverse order starting from the final certificate, working back towards the server cert. Fun. Let's also be careful to construct a completely new GByteArray rather than expecting the GTlsCertificate implementation to copy it for us. Because GTlsCertificate is implemented by an extension point and applications and system administrators can -- and do -- implement their own, implementations could do anything, including keep a reference to the GByteArray that we pass in. It would be nice to have a test for this, but writing tests is hard. Also, I don't really want to learn what service workers are. :) Drive-by fix: also remove explicit from a constructor that doesn't need it. * platform/network/soup/CertificateInfo.h: (WebCore::CertificateInfo::isolatedCopy const): * platform/network/soup/CertificateInfoSoup.cpp: (WebCore::createCertificate): (WebCore::CertificateInfo::isolatedCopy const): 2020-10-13 Philippe Normand [GStreamer] Crash in WebCore::GStreamerRegistryScanner::isAVC1CodecSupported https://bugs.webkit.org/show_bug.cgi?id=217647 Reviewed by Xabier Rodriguez-Calvar. The registry scanner was assuming the avc1 codec field is always of the form avc1.codecprofile, which is wrong. Covered by test: media/media-can-play-mpeg4-video.html * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: (WebCore::GStreamerRegistryScanner::isAVC1CodecSupported const): Check for '.' presence and fallback to unconstrained check if no profile or level information was extracted. 2020-10-13 Adrian Perez de Castro [GTK] Make gamepads visible after their first input is received https://bugs.webkit.org/show_bug.cgi?id=217494 Reviewed by Carlos Garcia Campos. Turns out this was mostly working already, with a small caveat: Sometimes there would be a timing issue if m_inputNotificationTimer would be fired before having a chance of setting the m_initialGamepadsConnected flag, and in that case the early return would prevent dispatchPlatformGamepadInputActivity() from ever being called. This re-arms the timer to be fired again in the next event loop iteration if the flag was unset, so it will be checked again after it has been toggled. This same approach is used by HIDGamepadProvider in the Mac port, for example. * platform/gamepad/manette/ManetteGamepadProvider.cpp: (WebCore::ManetteGamepadProvider::inputNotificationTimerFired): Re-arm timer if m_initialGamepadsConnected was not yet set. 2020-10-10 Adrian Perez de Castro [GTK] Build broken with ENABLE_GAMEPAD enabled https://bugs.webkit.org/show_bug.cgi?id=217226 Reviewed by Darin Adler. No new tests needed. * Headers.cmake: List SharedGamepadValue.h in WebCore_PRIVATE_FRAMEWORK_HEADERS, which was missing. * platform/gamepad/EmptyGamepadProvider.h: Mark class as final, because the destructor is final itself. * platform/gamepad/manette/ManetteGamepad.cpp: (WebCore::ManetteGamepad::ManetteGamepad): Adapt to use SharedGamepadValue. (WebCore::ManetteGamepad::buttonPressedOrReleased): Ditto. (WebCore::ManetteGamepad::absoluteAxisChanged): Ditto. * platform/gamepad/manette/ManetteGamepad.h: Ditto. * platform/gamepad/manette/ManetteGamepadProvider.cpp: Rename m_connectionDelayTimer to m_initialGamepadsConnectedTimer, which better reflects the usage and also makes the provider a bit more similar to HIDGamepadProvider (from the Mac port). Arrange to use the EventMakesGamepadsVisible flag. (WebCore::ManetteGamepadProvider::ManetteGamepadProvider): Remove the loop that iterates over the pre-detected gamepads because they are being added too early before any client has had the chance to be attached. (WebCore::ManetteGamepadProvider::startMonitoringGamepads): The loop that iterates and adds pre-detected gamepads is moved here, once there is at least a client. This solves hitting an assertion later on when UIGamepadProvider checks that the number of gamepads it has been notified of matches the amount tracked by ManetteGamepadProvider. (WebCore::ManetteGamepadProvider::stopMonitoringGamepads): (WebCore::ManetteGamepadProvider::deviceConnected): (WebCore::ManetteGamepadProvider::deviceDisconnected): (WebCore::ManetteGamepadProvider::initialGamepadsConnectedTimerFired): (WebCore::ManetteGamepadProvider::inputNotificationTimerFired): * platform/gamepad/manette/ManetteGamepadProvider.h: Ditto. 2020-10-12 Adrian Perez de Castro REGRESSION(r256892): [WPE][GTK] Build broken with ENABLE_ACCELERATED_2D_CANVAS=ON https://bugs.webkit.org/show_bug.cgi?id=217384 Most of the patch by Žan Doberšek. Reviewed by Darin Adler. No new tests needed. * platform/graphics/cairo/ImageBufferCairoGLSurfaceBackend.cpp: Move the namespace declaration after the #include statements, to avoid incorrect nested WebCore::WebCore namespace declarations. (WebCore::ImageBufferCairoGLSurfaceBackend::create): Add missing semicolon to statement, use getter for Cairo surface. (WebCore::ImageBufferCairoGLSurfaceBackend::platformLayer const): Rename from ImageBuffer::platformLayer. (WebCore::ImageBufferCairoGLSurfaceBackend::copyToPlatformTexture const): Add missing first argument. * platform/graphics/cairo/ImageBufferCairoGLSurfaceBackend.h: Adapt. 2020-10-03 Adrian Perez de Castro [GTK] Build broken with ENABLE_MEDIA_STREAM enabled and ENABLE_WEB_RTC_DISABLED https://bugs.webkit.org/show_bug.cgi?id=217128 Remove USE(LIBWEBRTC) guards from media stream code, as it does not actually depend on libwebrtc and can be built by itself. This allows using e.g. live audio recording inputs with WebAudio. Reviewed by Philippe Normand. No new tests needed. * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp: * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h: * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp: (WebCore::GStreamerAudioCapturer::GStreamerAudioCapturer): * platform/mediastream/gstreamer/GStreamerAudioCapturer.h: * platform/mediastream/gstreamer/GStreamerAudioStreamDescription.h: * platform/mediastream/gstreamer/GStreamerCapturer.cpp: * platform/mediastream/gstreamer/GStreamerCapturer.h: * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp: * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h: * platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp: * platform/mediastream/gstreamer/GStreamerVideoCapturer.h: * platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.cpp: * platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.h: * platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.cpp: * platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.h: * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp: * platform/mock/MockRealtimeAudioSource.cpp: * platform/mock/MockRealtimeVideoSource.cpp: 2020-10-02 Adrian Perez de Castro [GTK] Build broken with ENABLE_MEDIA_STREAM enabled and ENABLE_WEB_RTC_DISABLED https://bugs.webkit.org/show_bug.cgi?id=217128 Reviewed by Philippe Normand. No new tests needed. * platform/mediastream/gstreamer/GStreamerAudioData.h: Remove USE(LIBWEBRTC) guard, as there is nothing specific to WebRTC in this file, and it is needed when building with ENABLE_MEDIA_STREAM enabled. 2020-09-26 Carlos Garcia Campos [SOUP] Do not set site for cookies twice in case of redirection https://bugs.webkit.org/show_bug.cgi?id=217010 Reviewed by Michael Catanzaro. Only set is-toplevel-navigation on SoupMessage when same site info is present. * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::ResourceRequest::updateSoupMessageMembers const): 2020-09-26 Carlos Garcia Campos [SOUP] Slack.com is not working, new messages do not load due to WebSocket authentication failure issue https://bugs.webkit.org/show_bug.cgi?id=149551 Reviewed by Michael Catanzaro. The problem is that we are not including all the cookies in the web socket request. There are two cookies with the Lax same-site policy set, that are not included for the websocket request. * Modules/websockets/ThreadableWebSocketChannel.cpp: (WebCore::ThreadableWebSocketChannel::webSocketConnectRequest): Add same site information to WebSocket requests. 2020-09-10 Carlos Garcia Campos [GTK][WPE] Support NTLM authentication https://bugs.webkit.org/show_bug.cgi?id=122952 Reviewed by Adrian Perez de Castro. Add SoupAuthNTLM feature to the session. * platform/network/soup/SoupNetworkSession.cpp: (WebCore::SoupNetworkSession::SoupNetworkSession): 2020-09-04 Carlos Garcia Campos [GLIB] Stop using firefox user agent quirk for google docs https://bugs.webkit.org/show_bug.cgi?id=215845 Reviewed by Adrian Perez de Castro. It causes problems with the CSP headers when accounts.youtube.com is used by google login and it no longer works for google docs in any case. * platform/UserAgentQuirks.cpp: (WebCore::isGoogle): (WebCore::urlRequiresFirefoxBrowser): 2020-08-20 Carlos Garcia Campos [GTK][WPE] Debug crashes in backdrop filter tests https://bugs.webkit.org/show_bug.cgi?id=215209 Reviewed by Adrian Perez de Castro. This only happens in WKTR because RenderLayerCompositor::flushPendingLayerChanges() is called from RenderLayerCompositor::layerTreeAsText(), so the coordinator doesn't know layers are being flushed and we don't return early from notifyFlushRequired(). We don't really need to have a coordinator associated to the backdrop layer, we just need to attach the layer to the coordinator to ensure it's updated. * platform/graphics/nicosia/NicosiaAnimation.cpp: (Nicosia::Animation::applyInternal): Handle AnimatedPropertyWebkitBackdropFilter. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer): Detach also the backdrop layer. (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly): Attach the backdrop layer to the coordinator if there's one. (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers): Do not call this for the backdrop layer. (WebCore::CoordinatedGraphicsLayer::invalidateCoordinator): Set coordinator to nullptr. (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded): Set the coordinator and attach the layer. Also attach the backdrop layer. (WebCore::CoordinatedGraphicsLayer::setCoordinator): Deleted. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: 2020-09-01 Carlos Garcia Campos [Linux] Web Inspector: show per thread cpu usage https://bugs.webkit.org/show_bug.cgi?id=215883 Reviewed by Adrian Perez de Castro. Get per thread CPU usage and information to fill ResourceUsageData in Linux. * page/ResourceUsageThread.h: * page/cocoa/ResourceUsageThreadCocoa.mm: (WebCore::ResourceUsageThread::platformSaveStateBeforeStarting): Update to new API in SamplingProfiler. * page/linux/ResourceUsageThreadLinux.cpp: (WebCore::ResourceUsageThread::platformSaveStateBeforeStarting): Initialize m_samplingProfilerThreadID. (WebCore::threadInfoMap): (WebCore::threadCPUUsage): (WebCore::collectCPUUsage): (WebCore::ResourceUsageThread::platformCollectCPUData): (WebCore::cpuUsage): Deleted. 2020-08-27 Carlos Garcia Campos [GTK] Include the run loop source name in frame rendering timeline https://bugs.webkit.org/show_bug.cgi?id=215847 Reviewed by Adrian Perez de Castro. Include the given name in rendering frame record data. * inspector/TimelineRecordFactory.cpp: (WebCore::TimelineRecordFactory::createRenderingFrameData): * inspector/TimelineRecordFactory.h: * inspector/agents/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::internalStart): 2020-08-24 Carlos Garcia Campos [GTK] Implement rendering frames timeline panel for GTK+ port https://bugs.webkit.org/show_bug.cgi?id=150392 Reviewed by Brian Burg. Use new RunLoop API to observe the run loop events when the GLib event loop is used. * inspector/agents/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::internalStart): (WebCore::InspectorTimelineAgent::internalStop): * inspector/agents/InspectorTimelineAgent.h: 2020-08-14 Zalan Bujtas RenderTextControlSingleLine::scroll* functions should not call Element::scroll* on the inner text content https://bugs.webkit.org/show_bug.cgi?id=215516 Reviewed by Simon Fraser. Normally the RenderBox::content*, border*, padding* and scroll* functions grab the geometry information from the renderer itself. The clients of these functions expect the geometry data to be consistent with the rest of the rendering context (e.g coordinates are in the coordinate system of the containing block, paint time operations are not applied etc). Also these functions are supposed to be const. They should not mutate the geometry or the render tree itself. Forwarding ::scroll* calls to Element::scroll* can't guarantee neither of these above. * rendering/RenderTextControlSingleLine.cpp: (WebCore::RenderTextControlSingleLine::scrollWidth const): (WebCore::RenderTextControlSingleLine::scrollHeight const): (WebCore::RenderTextControlSingleLine::scrollLeft const): (WebCore::RenderTextControlSingleLine::scrollTop const): 2020-08-13 Zalan Bujtas Add RenderTreeMutationDisallowedScope to track intrusive render tree mutations https://bugs.webkit.org/show_bug.cgi?id=215463 Reviewed by Simon Fraser. RenderLayer::enclosingScrollableLayer should not mutate the render tree accidentally. This is related to . * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * rendering/RenderTreeMutationDisallowedScope.cpp: Added. * rendering/RenderTreeMutationDisallowedScope.h: Added. (WebCore::RenderTreeMutationDisallowedScope::RenderTreeMutationDisallowedScope): (WebCore::RenderTreeMutationDisallowedScope::~RenderTreeMutationDisallowedScope): (WebCore::RenderTreeMutationDisallowedScope::isMutationAllowed): * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::destroy): 2020-08-13 Carlos Garcia Campos REGRESSION(r254506): [Freetype] Spektra variable font does not work properly https://bugs.webkit.org/show_bug.cgi?id=215214 Reviewed by Adrian Perez de Castro. This regressed in r254506, when a font smoothing mode is passed to drawGlyphsToContext() a new cairo font options is set, using the default font options and changing the antialiasing. This means the font options from the font (the ones containing the variation settings) set in the context by cairo_set_scaled_font() are lost. We should copy the scaled font options instead, then set the antialiasing and apply them. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::drawGlyphsToContext): Use cairo_scaled_font_get_font_options() instead of getDefaultCairoFontOptions(). 2020-08-13 Carlos Garcia Campos Crash in WebCore::StyledMarkupAccumulator::traverseNodesForSerialization https://bugs.webkit.org/show_bug.cgi?id=199224 Reviewed by Michael Catanzaro. The crash happens in StyledMarkupAccumulator::traverseNodesForSerialization() when we can't enter the node and nextSkippingChildren() returns nullptr. Test: editing/pasteboard/copy-across-shadow-boundaries-crash.html * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization): Set next to pastEnd if nextSkippingChildren() returns nullptr. 2020-08-12 Myles C. Maxfield Font loads quickly followed by navigations may fail indefinitely https://bugs.webkit.org/show_bug.cgi?id=215435 Reviewed by Darin Adler. Font loads are coalesced using a zero-delay timer. However, that zero-delay timer can fire while the page is in the middle of a navigation, which will cause the font loads to fail. Then, the second page can request those same fonts, which are marked as failed, and as such will never actually load/use the desired web font. This patch just stops the zero-delay timer during navigations, and resumes it when resuming the document. This means: 1. The second page in the above story will not see that the font has failed, or even started, and will then re-request the font and load it successfully 2. If the user goes "back" to the previous page, the zero-delay timer is restarted, the CachedFont realizes it's already succeeded, and the previous page is rendered as expected. Test: fast/loader/font-load-timer.html * css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::suspendFontLoadingTimer): (WebCore::CSSFontSelector::restartFontLoadingTimer): * css/CSSFontSelector.h: * dom/Document.cpp: (WebCore::Document::resume): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::stopLoading): 2020-08-12 Lauro Moura Highpass Biquads use old formulas https://bugs.webkit.org/show_bug.cgi?id=181191 Reviewed by Darin Adler. Like r265517, but for the highpass filter. Spec: https://www.w3.org/TR/webaudio/#dom-biquadfiltertype-highpass Covered by existing tests * platform/audio/Biquad.cpp: (WebCore::Biquad::setHighpassParams): 2020-08-12 Stephan Szabo [PlayStation] Build fix for !ENABLE(ACCESSIBILITY) after r265514 https://bugs.webkit.org/show_bug.cgi?id=215426 AXObjectCache::getOrCreate(AccessibilityRole) changed names in the above, but the short definition for !ENABLE(ACCESSIBILITY) didn't update. Unreviewed build fix. * accessibility/AXObjectCache.h: Update name to match new name 2020-08-12 Wenson Hsieh Broken formatting in price table on yandex.ru after translating to English https://bugs.webkit.org/show_bug.cgi?id=215416 Reviewed by Tim Horton. Extend the behavior added in r265188 so that it applies to all elements that have `display: table-cell;`, rather than only table data cell elements. * editing/TextManipulationController.cpp: (WebCore::isEnclosingItemBoundaryElement): 2020-08-12 Adrian Perez de Castro Unreviewed non-unified build fix. No new tests needed. * accessibility/AccessibilityMenuListOption.cpp: Add missing inclusion of HTMLSelectElement.h. * page/Quirks.h: Add mising forward declaration of HTMLVideoElement. * page/UndoItem.cpp: Add missing inclusion of Document.h. 2020-08-12 Carlos Garcia Campos REGRESSION(r261570): [GTK] Fails to send drop event to JavaScript https://bugs.webkit.org/show_bug.cgi?id=215032 Reviewed by Darin Adler. Add support for custom data in drag and drop operations too. * platform/gtk/PasteboardGtk.cpp: (WebCore::Pasteboard::write): Se custom data on m_selectionData. (WebCore::Pasteboard::read): Initialize the content origin also for drag and drop pasteboards. (WebCore::Pasteboard::hasData): For drag and drop pasteboards return true also if m_selectionData has custom data. (WebCore::Pasteboard::typesSafeForBindings): Implement this for drag and drop pasteboards. (WebCore::Pasteboard::readOrigin): Ditto. (WebCore::Pasteboard::readStringInCustomData): Ditto. (WebCore::Pasteboard::writeCustomData): Ditto. 2020-08-11 James Darpinian [WebGL2] Depth formats can have mipmaps in WebGL 2 https://bugs.webkit.org/show_bug.cgi?id=215404 Reviewed by Kenneth Russell. Fixes 150 WebGL 2 conformance tests. * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::validateTexFuncFormatAndType): 2020-08-11 Chris Dumez Unreviewed, address post-landing review comment from Darin for r265536. * Modules/webaudio/WaveShaperDSPKernel.cpp: (WebCore::WaveShaperDSPKernel::processCurve): 2020-08-11 Chris Dumez Fix WaveShapperNode's waveshaping curve implementation https://bugs.webkit.org/show_bug.cgi?id=215391 Reviewed by Darin Adler. Fix WaveShapperNode's waveshaping curve implementation using the algorithm in the specification: - https://www.w3.org/TR/webaudio/#dom-waveshapernode-curve No new tests, rebaselined existing tests. * Modules/webaudio/WaveShaperDSPKernel.cpp: (WebCore::WaveShaperDSPKernel::processCurve): 2020-08-11 Simon Fraser Have render tree dumps show overflow information https://bugs.webkit.org/show_bug.cgi?id=215385 Reviewed by Zalan Bujtas. Add code to RenderObject::outputRenderObject() to show layout/visual overflow, as we do for render tree dumps. * rendering/RenderObject.cpp: (WebCore::RenderObject::outputRenderObject const): 2020-08-11 Brady Eidson Add a "use stored credentials" setting to WKWebView. and https://bugs.webkit.org/show_bug.cgi?id=215388 Reviewed by Geoff Garen. Covered by Preconnect API tests. This setting is to allow apps to explicitly deny using the credential storage for network operations. (e.g. to make sure the Keychain UI doesn't pop up for an offscreen load) * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::shouldUseCredentialStorage): * page/Page.h: (WebCore::Page::setCanUseCredentialStorage): (WebCore::Page::canUseCredentialStorage const): 2020-08-11 Commit Queue Unreviewed, reverting r265502. https://bugs.webkit.org/show_bug.cgi?id=215396 Needs locking to avoid flaky GC-related crashes Reverted changeset: "[WebGL2] expando-loss and expando-loss-2 conformance tests are failing" https://bugs.webkit.org/show_bug.cgi?id=214765 https://trac.webkit.org/changeset/265502 2020-08-11 Jon Davis Add privacy and security keywords to feature status entries https://bugs.webkit.org/show_bug.cgi?id=215203 Reviewed by Youenn Fablet. * features.json: 2020-08-11 Chris Dumez Fix BiquadFilterNode's lowpass filter https://bugs.webkit.org/show_bug.cgi?id=215381 Reviewed by Darin Adler. Fix BiquadFilterNode's lowpass filter as it was causing us to fail a WPT test: - https://www.w3.org/TR/webaudio/#dom-biquadfiltertype-lowpass No new tests, rebaselined existing test. * Modules/webaudio/BiquadProcessor.cpp: (WebCore::BiquadProcessor::BiquadProcessor): * platform/audio/Biquad.cpp: (WebCore::Biquad::setLowpassParams): 2020-08-11 Darin Adler LayoutTest accessibility/mac/select-element-selection-with-optgroups.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=175341 Reviewed by Chris Fleizach. Failures were due to new AX objects being created for HTMLOptionElement. Unlike most other AX objects, these were not cached in the AXObjectCache and multiple objects could be created for the same underlying option. Fixed this by changing it to track the option element in the cache in the conventional way. * WebCore.xcodeproj/project.pbxproj: Remove AccessibilityMediaControls.h/cpp. The source files were removed back in April. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::getOrCreate): Added code for HTMLOptionElement and HTMLOptGroupElement so AccessibilityMenuListOption and AccessibilityListBoxOption can be created in this function. (WebCore::AXObjectCache::create): Renamed the version of this that takes an AccessibilityRole to not claim that it ever gets the value from the cache, because it never does. Also removed the cases for ListBoxOption and MenuListOption. * accessibility/AXObjectCache.h: Updated for above. * accessibility/AccessibilityARIAGrid.cpp: (WebCore::AccessibilityARIAGrid::addChildren): Use create. * accessibility/AccessibilityListBox.cpp: (WebCore::AccessibilityListBox::addChildren): Removed super-old comment that mentions the long-ago-removed WML. (WebCore::AccessibilityListBox::listBoxOptionAccessibilityObject const): Use the element to get the list box option rather than creating a new one every time. No longer any need to special case
elements since the getOrCreate function will return nil for non-option elements that don't have a renderer. * accessibility/AccessibilityListBoxOption.cpp: (WebCore::AccessibilityListBoxOption::AccessibilityListBoxOption): Take the element in the constructor instead of using a separate function to associate it. (WebCore::AccessibilityListBoxOption::create): Ditto. (WebCore::AccessibilityListBoxOption::isEnabled const): Update for WeakPtr. (WebCore::AccessibilityListBoxOption::isSelected const): Ditto. (WebCore::AccessibilityListBoxOption::canSetSelectedAttribute const): Ditto. (WebCore::AccessibilityListBoxOption::actionElement const): Update for WeakPtr. (WebCore::AccessibilityListBoxOption::node const): Added. For some reason the AccessibilityMenuListOption class had this function and this one did not. They should both have it. * accessibility/AccessibilityListBoxOption.h: Updated for above. Made most functions private and final. Fixed includes and forward declarations. Removed the setHTMLElement function. Changed m_optionElement from HTMLElement* to WeakPtr. * accessibility/AccessibilityMenuList.cpp: (WebCore::AccessibilityMenuList::addChildren): Use create. * accessibility/AccessibilityMenuListOption.cpp: (WebCore::AccessibilityMenuListOption::AccessibilityMenuListOption): Take the element in the constructor instead of using a separate function to associate it. (WebCore::AccessibilityMenuListOption::create): Ditto. (WebCore::AccessibilityMenuListOption::setElement): Deleted. (WebCore::AccessibilityMenuListOption::node const): Moved here from the header. (WebCore::AccessibilityMenuListOption::isEnabled const): Removed unneeded cast now that m_element has a more specific type, and added a null check. (WebCore::AccessibilityMenuListOption::isVisible const): Removed dependency on m_parent pointer, which does not exist now that we don't derive from AccessibilityMockObject. (WebCore::AccessibilityMenuListOption::isSelected const): Removed unneeded cast now that m_element has a more specific type, and added a null check. (WebCore::AccessibilityMenuListOption::setSelected): Ditto, but no null check needed because canSetSelectedAttribute takes care of that. (WebCore::AccessibilityMenuListOption::stringValue const): Ditto. * accessibility/AccessibilityMenuListOption.h: Updated for above. Marked functions final instead of override. Changed m_element from RefPtr to WeakPtr to avoid reference cycles that could leak to memory leaks. Derive from AccessibilityObject instead of AccessibilityMockObject, since the latter class has nothing to offer us. * accessibility/AccessibilityMenuListPopup.cpp: (WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject const): Use the element to get the menu list option rather than creating a new one every time. No longer any need to check that the type is HTMLOptionElement because that's the responsibility of the code in the cache now. (WebCore::AccessibilityMenuListPopup::addChildren): Removed unneeded call to setParent since the menu list option objects no longer hold parent pointers. * accessibility/AccessibilityNodeObject.cpp: (WebCore::accessibleNameForNode): Added a special case for HTMLOptionElement like the one for HTMLInputElement. The code worked for fairly well for option elements before, almost by accident, and the way it worked was perturbed by the change to whether we cache those objects. This newer code path works in a more straightforward way, keeps our existing tests psasing, and likely gets some edge cases handled more correctly (should add new tests for those). * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::documentLinks): Use create. (WebCore::AccessibilityRenderObject::addImageMapChildren): Ditto. (WebCore::AccessibilityRenderObject::addTextFieldChildren): Ditto. * accessibility/AccessibilitySlider.cpp: (WebCore::AccessibilitySlider::addChildren): Ditto. * accessibility/AccessibilitySpinButton.cpp: (WebCore::AccessibilitySpinButton::addChildren): Ditto. * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::addChildren): Ditto. (WebCore::AccessibilityTable::headerContainer): Ditto. * accessibility/atk/WebKitAccessible.cpp: (fallbackObject): Deleted. (webkitAccessibleGetName): Added null check. (webkitAccessibleGetDescription): Ditto. (webkitAccessibleGetParent): Ditto. (webkitAccessibleGetNChildren): Ditto. (webkitAccessibleRefChild): Ditto. (webkitAccessibleGetIndexInParent): Ditto. (webkitAccessibleGetAttributes): Ditto. (webkitAccessibleGetRole): Ditto. (webkitAccessibleRefStateSet): Ditto. (webkitAccessibleRefRelationSet): Ditto. (webkitAccessibleGetObjectLocale): Ditto. (webkitAccessibleGetAccessibilityObject): Ditto. (webkitAccessibleDetach): Use nullptr instead of fallbackObject. (webkitAccessibleIsDetached): Ditto. * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::selected const): Made this const. An earlier version of the patch required this; the latest version doesn't, but it's more logical and better for it to be const. * html/HTMLOptionElement.h: Updated for above. 2020-08-11 Timothy Hatcher Deferred WKUserScripts are exponentially injected on preloaded pages with frames. https://bugs.webkit.org/show_bug.cgi?id=215382 rdar://problem/66837802 Reviewed by Sam Weinig. When defering a script in a frame it was previously added to a vector per-page. Later when notified to inject the defered scripts, the page would iterate over all the frames and evaluate the scripts on each frame. Since this vector had all the frame's scripts the evaluations would be multiplied by the number of frames. Now the defered scripts are stored per-frame and the page asks each frame to inject the defered scripts. * page/Frame.cpp: (WebCore::Frame::injectUserScripts): (WebCore::Frame::addUserScriptAwaitingNotification): (WebCore::Frame::injectUserScriptsAwaitingNotification): * page/Frame.h: * page/Page.cpp: (WebCore::Page::notifyToInjectUserScripts): (WebCore::Page::addUserScriptAwaitingNotification): Deleted. * page/Page.h: * page/Quirks.cpp: (WebCore::Quirks::triggerOptionalStorageAccessQuirk const): 2020-08-11 Wenson Hsieh Text input autocorrect="off" attribute ignored on Mac https://bugs.webkit.org/show_bug.cgi?id=151019 Reviewed by Simon Fraser. Add support for the `autocorrect` attribute on macOS, by not showing the automatic spell checking popup or automatically correcting misspelled words if the root editable element has `autocorrect="off"`. Tests: editing/input/cocoa/autocorrect-off.html editing/input/cocoa/autocorrect-on.html * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::isAutomaticSpellingCorrectionEnabled): 2020-08-11 Sihui Liu Text manipulation crashes when replacing element with img role https://bugs.webkit.org/show_bug.cgi?id=215344 Reviewed by Wenson Hsieh. positionInParentAfterNode and positionInParentBeforeNode do not return Position with Nodes that are ignored by editing. Element with img role is one of such Nodes. However, TextManipulationController can manipulate content of children of the ignored Nodes (see the newly added test). Therefore, we'd better not use positionInParentBeforeNode or positionInParentBeforeNode in TextManipulationController::replace, because insertion position can be inside a ignored Node. API Test: TextManipulation.CompleteTextManipulationShouldReplaceContentIgnoredByEditing * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::replace): 2020-08-11 Kenneth Russell [WebGL2] expando-loss and expando-loss-2 conformance tests are failing https://bugs.webkit.org/show_bug.cgi?id=214765 Reviewed by Darin Adler. Use JSWebGLRenderingContext's and JSWebGL2RenderingContext's existing visitAdditionalChildren hook (via JSCustomMarkFunction in their IDL) to add opaque roots for all WebGLObjects latched in to the context state, and all WebGLObjects they refer to. (Extensions were already previously handled.) Add "GenerateIsReachable=Impl" to the IDL files for all such objects (WebGLBuffer, WebGLTexture, etc.) so that they pay attention to the opaque root state when determining liveness of their JavaScript wrappers. Thanks to ysuzuki@ for pointing out the need for this. * bindings/js/JSWebGL2RenderingContextCustom.cpp: (WebCore::JSWebGL2RenderingContext::visitAdditionalChildren): * bindings/js/JSWebGLRenderingContextCustom.cpp: (WebCore::JSWebGLRenderingContext::visitAdditionalChildren): * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::visitReferencedJSWrappers): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLBuffer.idl: * html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::visitReferencedJSWrappers): * html/canvas/WebGLFramebuffer.h: * html/canvas/WebGLFramebuffer.idl: * html/canvas/WebGLProgram.cpp: (WebCore::WebGLProgram::visitReferencedJSWrappers): * html/canvas/WebGLProgram.h: * html/canvas/WebGLProgram.idl: * html/canvas/WebGLQuery.idl: * html/canvas/WebGLRenderbuffer.idl: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::visitReferencedJSWrappers): * html/canvas/WebGLRenderingContextBase.h: * html/canvas/WebGLSampler.idl: * html/canvas/WebGLShader.idl: * html/canvas/WebGLTexture.idl: * html/canvas/WebGLTransformFeedback.cpp: (WebCore::WebGLTransformFeedback::visitReferencedJSWrappers): * html/canvas/WebGLTransformFeedback.h: * html/canvas/WebGLTransformFeedback.idl: * html/canvas/WebGLVertexArrayObject.idl: * html/canvas/WebGLVertexArrayObjectBase.cpp: (WebCore::WebGLVertexArrayObjectBase::visitReferencedJSWrappers): * html/canvas/WebGLVertexArrayObjectBase.h: * html/canvas/WebGLVertexArrayObjectOES.idl: 2020-08-11 Youenn Fablet Add JS console log message in case of capture failure https://bugs.webkit.org/show_bug.cgi?id=215370 Reviewed by Eric Carlson. Covered by rebased test. * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::trackEnded): 2020-08-11 Zalan Bujtas [AutoTableLayout] REGRESSION(r263855) Paypal email is rendered right aligned on Safari https://bugs.webkit.org/show_bug.cgi?id=215340 Reviewed by Simon Fraser. Prior to r263855, these zero-length, non-empty columns had the preferred width value of 1px and the available space got distributed based on this made-up 1px value. In this patch, we distribute the available horizontal space evenly among these zero-length, 'width: auto' columns. Test: fast/table/zero-length-non-empty-columns-with-auto-width.html * rendering/AutoTableLayout.cpp: (WebCore::AutoTableLayout::layout): 2020-08-11 Sergio Villar Senin [css-flexbox] Only update the intrinsic height if we don't have an override height https://bugs.webkit.org/show_bug.cgi?id=215369 Reviewed by Javier Fernandez. If we do have an override height, children will size themselves relative to the override height (e.g. flexbox flexing/stretching, percentage heights). Because flex intrinsic height is based on its children, it would then store an incorrect intrinsic height. This is specially problematic with min-height:auto is nested column flexboxes where flexboxes are flex items at the same time. Based on Blink's https://crrev.com/c/1283482 by * rendering/RenderBox.cpp: (WebCore::RenderBox::cacheIntrinsicContentLogicalHeightForFlexItem const): Early return if there is an override height. 2020-08-11 Andres Gonzalez Update the isolated tree on element language changes. https://bugs.webkit.org/show_bug.cgi?id=215354 Reviewed by Chris Fleizach. Test: accessibility/language-attribute-change.html * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::handleAttributeChange): Added handling of AXLanguageChanged notifications. (WebCore::AXObjectCache::updateIsolatedTree): Update the isolated tree for ASLanguage notifications. * accessibility/AXObjectCache.h: 2020-08-11 Alicia Boya García [MSE][GStreamer] Remove m_sourceBufferPrivateClient checks in SourceBufferPrivateGStreamer https://bugs.webkit.org/show_bug.cgi?id=215263 Reviewed by Xabier Rodriguez-Calvar. m_sourceBufferPrivateClient is only reset to NULL from SourceBuffer's destructor. At this point SourceBufferPrivateGStreamer is about to receive its last unref by SourceBuffer and therefore be destroyed. Similarly, there is no need to check for m_mediaSource being null. m_mediaSource is only reset when the SourceBuffer is removed, and at that point SourceBufferPrivate shouldn't receive any calls. This is a clean-up and doesn't introduce new behavior. Asserts have been added checking the precondition above. * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::removedFromMediaSource): (WebCore::SourceBufferPrivateGStreamer::didReceiveInitializationSegment): (WebCore::SourceBufferPrivateGStreamer::didReceiveSample): (WebCore::SourceBufferPrivateGStreamer::didReceiveAllPendingSamples): (WebCore::SourceBufferPrivateGStreamer::appendParsingFailed): 2020-08-11 Philippe Normand [GStreamer] gst-full standalone library support https://bugs.webkit.org/show_bug.cgi?id=215262 Reviewed by Xabier Rodriguez-Calvar. A new CMake option is introduced to enable gst-full support: USE_GSTREAMER_FULL. By default this option is disabled. WebKit distributors might want to enable this if they distribute GStreamer through gst-build's gst-full library. In gst-build the following options can be used to produce a usable libgstreamer-full-1.0.so: -Dpython=disabled -Dges=disabled -Ddevtools=disabled -Dintrospection=disabled -Ddefault_library=static Once enabled in our build, the dynamic library libgstreamer-full-1.0.so will be loaded instead of all the other GStreamer libraries. Plugins are statically registered in this library as well. This can be useful when deploying WebKit in controlled embedded platform where disk space is limited. One of the goals of gst-full is to enable full customization of the plugins to be included in the library. Static registration can also reduce GStreamer initialization time. * platform/GStreamer.cmake: * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::initializeGStreamer): (WebCore::initializeGStreamerAndRegisterWebKitElements): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Disable missing-plugins handling when gst-full is in use. The plugin installer doesn't make much sense for this scenario. 2020-08-10 Myles C. Maxfield Fix bad merge in r265488 https://bugs.webkit.org/show_bug.cgi?id=214769 Unreviewed. This is something that got dropped in a bad merge from r265488. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::layoutSimpleText const): * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBuffer::originAt const): (WebCore::GlyphBuffer::expandInitialAdvance): 2020-08-10 Myles C. Maxfield Spacing of Chinese characters is inconsistent in macOS 11/Safari 14 beta https://bugs.webkit.org/show_bug.cgi?id=214769 Reviewed by Darin Adler. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=206208.. In the general case, text shaping is Turing-complete. In order for it to work properly, we need to feed the text shaping virtual machine the correct inputs so that it can produce correct outputs. The input to text shaping is supposed to be the raw glyph advances straight from CTFontGetAdvancesForGlyphs(). Previously, we were applying letter-spacing, word-spacing, justification, and tab stops before shaping. Most fonts don't care about this and still produce the correct results. However, Ping Fang on macOS Big Sur and iOS 14 _does_ care about this, and its shaping rules operate incorrectly when fed these pre-expanded glyph widths. The solution is to apply this extra spacing after shaping occurs. However, because shaping is Turing-complete, it is free to add or remove glyphs willy-nilly. This means we need some way of tracing back which character in the input string correspond to which output glyphs, so we know which glyphs to add additional spacing to. This is what https://bugs.webkit.org/show_bug.cgi?id=215059 does: It switches from using CTFontTransformGlyphsWithLanguage() to CTFontShapeGlyphs(), which outputs this glyph-character tracing info. Then, once we have this tracing info, we can apply spacing properly after shaping has completed. That's what this patch does. Tests: fast/text/letter-spacing-shaping.html fast/text/tab-letter-space.html * platform/graphics/FontCascade.cpp: Clients of WidthIterator::advance() need to call WidthIterator::finalize() (see below). (WebCore::FontCascade::widthOfTextRange const): (WebCore::FontCascade::layoutSimpleText const): (WebCore::FontCascade::floatWidthForSimpleText const): (WebCore::FontCascade::adjustSelectionRectForSimpleText const): (WebCore::FontCascade::offsetForPositionForSimpleText const): * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBuffer::expandInitialAdvance): (WebCore::GlyphBuffer::expandAdvance): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::WidthIterator): (WebCore::WidthIterator::hasExtraSpacing const): (WebCore::WidthIterator::advanceInternal): Delete the code that used to apply spacing before shaping. Instead, it gets moved to applyExtraSpacingAfterShaping(). (WebCore::WidthIterator::calculateAdditionalWidth const): This is a refactoring of the additional space calculation code. This is a const function, and has no side-effects. It outputs 4 floats: - How much space needs to be added to the left of the current character - How much space needs to be added to the right of the current character - How much space needs to be added to the left of the current character due to justification - How much space needs to be added to the right of the current character due to justification We need these last two values because one of the outputs of WidthIterator::advance() is a bool which represents whether or not we are ending on a justification space, so that the next WidthIterator that gets created for the next thing on the line can forbid/require a leading justification appropriately. (WebCore::WidthIterator::applyAdditionalWidth): Given the 4 values calculated in calculateAdditionalWidth(), apply them. We're operating in logical order, so this function has to do some translation from visual order to logical order (hence all the m_run.ltr() calls). If we're trying to add size to the left of the first character in LTR, we can't directly do that, because advances can only add space to the right side of a character, and there is no character to the left of the first character to expand. Therefore, we do this by increasing the initial advance of the GlyphBuffer, which is a special advance created just to solve this problem. In RTL, the problem is a bit more complicated - we don't know whether advance() will be called again, thereby delivering a glyph which we _can_ expand, so we instead store what would have been expanded inside m_leftoverJustificationWidth, and wait for the next call to advance(). If none comes, clients have to call finalize() instead, which will apply m_leftoverJustificationWidth to the GlyphBuffer's initial advance. (WebCore::WidthIterator::applyExtraSpacingAfterShaping): (WebCore::WidthIterator::finalize): (WebCore::WidthIterator::advance): * platform/graphics/WidthIterator.h: * rendering/svg/SVGTextMetricsBuilder.cpp: (WebCore::SVGTextMetricsBuilder::measureTextRenderer): 2020-08-10 Myles C. Maxfield [Cocoa] Migrate from CTFontTransformGlyphsWithLanguage() to CTFontShapeGlyphs() https://bugs.webkit.org/show_bug.cgi?id=215059 Reviewed by Darin Adler. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=214769 and https://bugs.webkit.org/show_bug.cgi?id=206208. The solution for https://bugs.webkit.org/show_bug.cgi?id=214769 requires applying letter-spacing after text shaping. Today, we apply letter-spacing before text shaping which is wrong. However, if we want to apply letter-spacing after text shaping, we need to use CTFontShapeGlyphs(), which returns the glyph -> string mapping, which allows us to determine which glyphs to add letter-spacing to. Updates existing tests. Tests: fast/text/international/kana-voiced-sound-marks-1.html fast/text/international/kana-voiced-sound-marks-2.html * platform/graphics/Font.cpp: (WebCore::Font::applyTransforms const): * platform/graphics/Font.h: * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::widthForSimpleText const): (WebCore::FontCascade::characterRangeCodePath): (WebCore::FontCascade::layoutSimpleText const): * platform/graphics/FontCascade.h: * platform/graphics/SurrogatePairAwareTextIterator.cpp: (WebCore::SurrogatePairAwareTextIterator::consumeSlowCase): Now that we're using CTFontShapeGlyphs(), the shaping routine can and does look at the underlying character string to perform character composition. This means that the glyph buffer needs to match exactly what is in the string. We can't do any shenanigans where we pretend the string has characters that aren't actually there. * platform/graphics/SurrogatePairAwareTextIterator.h: (WebCore::SurrogatePairAwareTextIterator::consume): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::shouldApplyFontTransforms const): (WebCore::WidthIterator::applyFontTransforms): Reversing the glyph buffer for rtl content needs to be done inside platform-specific code, because its behavior depends on which platform shaping routine is being used. (WebCore::WidthIterator::commitCurrentFontRange): (WebCore::WidthIterator::advanceInternal): * platform/graphics/WidthIterator.h: * platform/graphics/cocoa/FontCocoa.mm: (WebCore::Font::applyTransforms const): * platform/graphics/mac/SimpleFontDataCoreText.cpp: (WebCore::Font::getCFStringAttributes const): 2020-08-10 Devin Rousso Add quirk to force touch events on mail.yahoo.com https://bugs.webkit.org/show_bug.cgi?id=215329 Reviewed by Darin Adler and Tim Horton. serves a mobile site even in desktop browsing "mode", meaning that certain actions, such as selecting an aufotill contact, expect mobile behaviors, such as mouse events being dispatched after touch events rather than instantly (in the case of a connected trackpad with an iPad). This quirk ensures always mobile behavior for those actions, matching the expectations of . * page/Quirks.h: * page/Quirks.cpp: (WebCore::isYahooMail): Added. (WebCore::Quirks::shouldSynthesizeTouchEvents const): Added. (WebCore::Quirks::shouldAvoidPastingImagesAsWebContent const): * loader/DocumentLoader.h: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::mouseEventPolicy const): 2020-08-10 Chris Dumez AuxiliaryProcess::didReceiveInvalidMessage() for WebPage::PerformDragControllerAction IPC https://bugs.webkit.org/show_bug.cgi?id=215341 Reviewed by Alex Christensen. Consistently use OptionSet instead of DragApplicationFlags. * page/gtk/DragControllerGtk.cpp: (WebCore::DragController::isCopyKeyDown): * page/mac/DragControllerMac.mm: (WebCore::DragController::isCopyKeyDown): (WebCore::DragController::dragOperation): * platform/DragData.cpp: (WebCore::DragData::DragData): * platform/DragData.h: (WebCore::DragData::flags const): * platform/cocoa/DragDataCocoa.mm: (WebCore::DragData::DragData): * platform/win/DragDataWin.cpp: (WebCore::DragData::DragData): 2020-08-10 Peng Liu MobileSafari crashes at WebCore: -[WebAVPlayerController seekToTime:toleranceBefore:toleranceAfter:] https://bugs.webkit.org/show_bug.cgi?id=215332 Reviewed by Eric Carlson. Add a NULL pointer check to fix a crash. * platform/ios/WebAVPlayerController.mm: (-[WebAVPlayerController seekToTime:toleranceBefore:toleranceAfter:]): 2020-08-10 Myles C. Maxfield Shaping can be performed on glyphIDs from the wrong font https://bugs.webkit.org/show_bug.cgi?id=215333 Reviewed by Darin Adler. The problem is this line: if (font != lastFontData && width) This means we will only trigger shaping code if width is non-zero. However, even if width is non-zero, we will still happily add glyphs to the glyph buffer, and when we do eventually get around to shaping, we shape all yet-unshaped glyphs, regardless of which font they came from. Test: fast/text/zero-width-shaping-font-mismatch.html * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::commitCurrentFontRange): (WebCore::WidthIterator::advanceInternal): * platform/graphics/WidthIterator.h: 2020-08-10 Clark Wang Add AudioProcessingEvent Constructor https://bugs.webkit.org/show_bug.cgi?id=215237 Reviewed by Chris Dumez. Added constructor according to spec: https://bugs.webkit.org/show_bug.cgi?id=215237. Added in AudioProcessingEventInit files. Test: webaudio/audioprocessingevent-constructor.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioProcessingEvent.cpp: (WebCore::AudioProcessingEvent::create): (WebCore::AudioProcessingEvent::AudioProcessingEvent): * Modules/webaudio/AudioProcessingEvent.h: * Modules/webaudio/AudioProcessingEvent.idl: * Modules/webaudio/AudioProcessingEventInit.h: Added. * Modules/webaudio/AudioProcessingEventInit.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-10 Chris Dumez Align existing AudioParam API with the specification https://bugs.webkit.org/show_bug.cgi?id=215301 Reviewed by Sam Weinig. Align existing AudioParam API with the specification: - https://www.w3.org/TR/webaudio/#AudioParam In particular, the following changes were made: - Use float instead of unrestricted float where appropriate, so that we properly throw when provided non-finite values. - Use double instead of float where appropriate - A lot of the operations were previously returning nothing but they should return the AudioParam itself to allow chaining. - Throw an exceptions when passed invalid values (e.g. negative times) - Throw exceptions when events overlap. This part is based on Chromium's implementation here: - https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/modules/webaudio/audio_param_timeline.cc#L513 and is specification is here: - https://webaudio.github.io/web-audio-api/#dfn-automation-event This allows us to pass some more WPT webaudio tests. No new tests, rebaselined existing tests. * Modules/webaudio/AudioParam.cpp: * Modules/webaudio/AudioParam.h: * Modules/webaudio/AudioParam.idl: * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::setValueAtTime): (WebCore::AudioParamTimeline::linearRampToValueAtTime): (WebCore::AudioParamTimeline::exponentialRampToValueAtTime): (WebCore::AudioParamTimeline::setTargetAtTime): (WebCore::AudioParamTimeline::setValueCurveAtTime): (WebCore::AudioParamTimeline::insertEvent): (WebCore::AudioParamTimeline::cancelScheduledValues): (WebCore::AudioParamTimeline::valuesForTimeRangeImpl): * Modules/webaudio/AudioParamTimeline.h: (WebCore::AudioParamTimeline::ParamEvent::ParamEvent): (WebCore::AudioParamTimeline::ParamEvent::time const): (WebCore::AudioParamTimeline::ParamEvent::duration const): (WebCore::AudioParamTimeline::ParamEvent::curve): 2020-08-10 Eric Carlson r262456 broke sites that expect webkitDisplayingFullscreen to be true almost immediately https://bugs.webkit.org/show_bug.cgi?id=215240 Reviewed by Darin Adler. Add a quirk for sites that use the Akamai Media Player, which begins polling `webkitDisplayingFullscreen` every 100ms immediately after entering video fullscreen mode and exits fullscreen as soon as it returns false. r262456 changed the HTMLMediaPlayer state machine so `webkitDisplayingFullscreen` doesn't return `true` until the fullscreen window has been opened in the UI process. This was done to fix bugs triggered by rapidly entering and exiting fullscreen and PiP and make our own fullscreen/PiP tests less flakey, so instead of reverting the change universally do it as a quirk for sites using the Akamai Media Player. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::webkitDisplayingFullscreen): * page/Quirks.cpp: (WebCore::Quirks::needsAkamaiMediaPlayerQuirk const): * page/Quirks.h: 2020-08-10 Antti Koivisto Return values of FontDatabase::collectionForFamily are not thread safe https://bugs.webkit.org/show_bug.cgi?id=215320 Reviewed by Anders Carlsson. Font prewarming can add new entries to m_familyNameToFontDescriptors while lookups are being made. Access to it is protected by a lock. However if the hashmap ends up rehashing, the pointer returned from collectionForFamily may end up becoming invalid. This can result in a crash later under findClosestFont. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::collectionForFamily): Heap allocate the hashmap values so they stay valid over hashtable mutations. 2020-08-09 Said Abou-Hallawa [macOS] Drag/drop an image of a unsupported format to an file input element should convert it to a supported format https://bugs.webkit.org/show_bug.cgi?id=212482 Reviewed by Darin Adler. Although the list of the dropped files are sent from the UI process to the Web process through the WebPage channel, the file input settings are only known by the Web process. So we have to do the image transcoding in WebCore. Tests: fast/forms/file/entries-api/image-no-transcode-drag-drop.html fast/forms/file/entries-api/image-transcode-drag-drop.html * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * html/FileInputType.cpp: (WebCore::FileInputType::handleDOMActivateEvent): (WebCore::FileInputType::fileChooserSettings const): Move filling FileChooserSettings to the function: fileChooserSettings(). (WebCore::FileInputType::applyFileChooserSettings): Call fileChooserSettings() instead of receiving FileChooserSettings as an argument. (WebCore::FileInputType::filesChosen): Add this function which can be called from receiveDroppedFiles() or receiveDroppedFilesWithImageTranscoding(). (WebCore::FileInputType::receiveDroppedFilesWithImageTranscoding): Finds out whether image transcoding is needed for the dropped files. If it is needed, it will be done in a WorkQueue and call filesChosen() when it is done. Otherwise it will call filesChosen() immediately. (WebCore::FileInputType::receiveDroppedFiles): * html/FileInputType.h: * platform/graphics/ImageUtilities.h: Added. * platform/graphics/cg/ImageUtilitiesCG.cpp: Added. (WebCore::sharedImageTranscodingQueue): Provide a shared WorkQueue which can be used by WebCore and WebKit. (WebCore::transcodeImage): (WebCore::findImagesForTranscoding): (WebCore::transcodeImages): 2020-08-09 Wenson Hsieh REGRESSION (r260831): Web process crashes under Editor::setComposition() after navigating with marked text https://bugs.webkit.org/show_bug.cgi?id=215315 Reviewed by Darin Adler. To address a variety of crashes due to frames changing (or otherwise losing) their document while executing editing commands, r260831 refactored the Editor class such that it extends the functionality of the Document class, rather than the Frame class. In nearly all scenarios, this either leads to no behavior change or prevents null pointer crashes, since a document is almost always attached to a frame when applying any editing commands. However, there is one scenario where a document that has not yet been attached to its frame (and therefore does not have a browsing context) will cause a null deref when trying to confirm an existing IME composition. The logic added in will try and confirm any existing composition range on a document right before committing provisional navigation. In the case where we are navigating back to a previously visited page, `m_frame`'s document in `FrameLoader::commitProvisionalLoad()` will not be attached until the cached page's mainframe is opened underneath `CachedPage::restore()`. Since the call to `Editor::confirmComposition()` currently happens before this step, we end up crashing while attempting to create a `UserTypingGestureIndicator`. Note that even if we avoid this with a null check, we'll still end up crashing shortly thereafter, underneath `Editor::insertTextForConfirmedComposition`. And even if this second crash is avoided with another null check, we'll just end up with some version of webkit.org/b/59121, where the composition range is present after navigation, but is out of sync with platform UI. To fix the crash (and also not bring back bug #59121), we refactor this composition confirmation logic so that it lives in Editor, and is also robust against the case where the document is not attached to a frame; we then invoke this call after we're done committing the provisional load, so that any frame that is not yet attached before commiting the load still has a chance to confirm its composition. Test: WKWebViewMacEditingTests.ProcessSwapAfterSettingMarkedText * editing/Editor.cpp: (WebCore::Editor::confirmCompositionAndNotifyClient): Move functionality from `willTransitionToCommitted` to `confirmCompositionAndNotifyClient`, a helper method that will bail if the document is not attached, but otherwise confirm the active composition (if it exists). * editing/Editor.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::commitProvisionalLoad): Add a call to confirm the editor's current composition after we're done committing the load. Note that in the case where we had a composition before committing the load, we'll end up confirming the composition earlier (in the first call site), rather than confirming after the load has been committed. This means that this second call will be a no-op, due to the editor not having any composition. (WebCore::FrameLoader::willTransitionToCommitted): Deleted. * loader/FrameLoader.h: 2020-08-09 Ben Nham Preload graphics drivers in Mac WebProcess https://bugs.webkit.org/show_bug.cgi?id=215183 Reviewed by Darin Adler. In newer versions of Mac OS, graphics drivers are no longer part of the shared cache due to size restrictions. This can cause first render to be blocked by ~10 ms when we dlopen those drivers. To work around this, we preload the drivers when prewarming the WebProcess. * page/ProcessWarming.cpp: (WebCore::ProcessWarming::prewarmGlobally): 2020-08-09 Youenn Fablet Always resolve ReadableStream's tee()'s cancel promise after the stream closes or errors https://bugs.webkit.org/show_bug.cgi?id=215197 Reviewed by Darin Adler. Make sure to resolve the cancel promise if the source gets closed or errored. Test: imported/w3c/web-platform-tests/streams/queuing-strategies-size-function-per-global.window.html * Modules/streams/ReadableStreamInternals.js: (readableStreamTee): (readableStreamTeePullFunction): 2020-08-08 Myles C. Maxfield Update OriginalAdvancesForCharacterTreatedAsSpace to work correctly in the presence of inserted or removed glyphs https://bugs.webkit.org/show_bug.cgi?id=215302 Reviewed by Darin Adler. OriginalAdvancesForCharacterTreatedAsSpace is trying to make sure that shaping doesn't cause spaces to get wider or thinner. However, the way it was doing that is, for all the space characters, overwrite that glyph index's advance after shaping to be what it was before shaping. However, this is wrong, because shaping can insert or delete glyphs. Instead, now that we have explicit string indices for each glyph, we can use those to determine which glyphs come from space characters. These glyphs are the ones which should be overwritten. * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::applyFontTransforms): (WebCore::WidthIterator::advanceInternal): * platform/graphics/WidthIterator.h: 2020-08-08 Myles C. Maxfield Fix bad merge in r265241 https://bugs.webkit.org/show_bug.cgi?id=215051 Unreviewed. This is something that got dropped in a bad merge from r265241. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::widthForSimpleText const): 2020-08-08 Myles C. Maxfield Make GlyphBuffers required in the fast text codepath https://bugs.webkit.org/show_bug.cgi?id=215052 Reviewed by Darin Adler. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=214769 and https://bugs.webkit.org/show_bug.cgi?id=206208. Performing shaping affects the width of strings; indeed, that is one of its purposes for existence. Shaping can only happen when we have a GlyphBuffer to shape. We can't just arbitrarily decide to disable shaping for various functions just because those functions don't ever inspect the exact glyphs. No new tests. This is a preparation step toward https://bugs.webkit.org/show_bug.cgi?id=214769 and https://bugs.webkit.org/show_bug.cgi?id=206208, and I couldn't come up with a test case that was broken here. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::widthOfTextRange const): (WebCore::FontCascade::widthForSimpleText const): (WebCore::FontCascade::layoutSimpleText const): (WebCore::FontCascade::floatWidthForSimpleText const): (WebCore::FontCascade::adjustSelectionRectForSimpleText const): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::shouldApplyFontTransforms const): (WebCore::WidthIterator::applyFontTransforms): (WebCore::WidthIterator::advanceInternal): (WebCore::WidthIterator::advance): (WebCore::WidthIterator::advanceOneCharacter): * platform/graphics/WidthIterator.h: * rendering/svg/SVGTextMetricsBuilder.cpp: (WebCore::SVGTextMetricsBuilder::advanceSimpleText): 2020-08-08 Myles C. Maxfield WidthIterator::m_finalRoundingWidth is always 0 https://bugs.webkit.org/show_bug.cgi?id=215307 Reviewed by Darin Adler. There's no reason for it to exist. No new tests because there is no behavior change. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::layoutSimpleText const): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::advanceInternal): * platform/graphics/WidthIterator.h: (WebCore::WidthIterator::runWidthSoFar const): (WebCore::WidthIterator::finalRoundingWidth const): Deleted. 2020-08-08 Myles C. Maxfield Use references instead of pointers for GlyphBuffer::add()'s Font argument https://bugs.webkit.org/show_bug.cgi?id=215309 Reviewed by Darin Adler. They're not allowed to be null. No new tests because there is no behavior change. * platform/graphics/ComplexTextController.cpp: (WebCore::ComplexTextController::advance): * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::widthForSimpleText const): (WebCore::FontCascade::drawGlyphBuffer const): (WebCore::offsetToMiddleOfGlyph): (WebCore::FontCascade::drawEmphasisMarks const): (WebCore::GlyphToPathTranslator::GlyphToPathTranslator): (WebCore::GlyphToPathTranslator::advance): (WebCore::FontCascade::dashesForIntersectionsWithRect const): * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBuffer::fontAt const): (WebCore::GlyphBuffer::add): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::advanceInternal): * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::DrawGlyphs::generateGlyphBuffer const): * rendering/mathml/MathOperator.cpp: (WebCore::MathOperator::paintGlyph): (WebCore::MathOperator::paint): * rendering/mathml/RenderMathMLToken.cpp: (WebCore::RenderMathMLToken::paint): 2020-08-07 Chris Dumez AudioContext / OfflineAudioContext should support a wider sample rate range https://bugs.webkit.org/show_bug.cgi?id=215289 Reviewed by Eric Carlson. AudioContext / OfflineAudioContext should support a wider sample rate range. We only supported sample rates in the [44100, 96000] range, which is much smaller than other browsers and would cause us to fail a LOT of web-platform-tests. We now support sample rates in the range [3000, 384000], which is the same range as Chromium. No new tests, rebaselined existing tests. * Modules/webaudio/AudioBuffer.cpp: (WebCore::AudioBuffer::create): * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::isSampleRateRangeGood): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::create): * platform/audio/FFTFrame.h: * platform/audio/HRTFPanner.cpp: (WebCore::HRTFPanner::fftSizeForSampleRate): Update fftSizeForSampleRate() to support wider sample rate range. This implementation is based on Chromium's: https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/platform/audio/hrtf_panner.cc#L70 * platform/audio/gstreamer/FFTFrameGStreamer.cpp: (WebCore::FFTFrame::minFFTSize): (WebCore::FFTFrame::maxFFTSize): * platform/audio/mac/FFTFrameMac.cpp: (WebCore::FFTFrame::minFFTSize): (WebCore::FFTFrame::maxFFTSize): 2020-08-07 James Darpinian [WebGL2] Missing validation for sampler unit index https://bugs.webkit.org/show_bug.cgi?id=215303 Reviewed by Dean Jackson. Test: webgl/2.0.0/deqp/functional/gles3/negativeshaderapi.html * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::bindSampler): 2020-08-07 James Darpinian Off by one error in transform feedback buffer binding https://bugs.webkit.org/show_bug.cgi?id=215298 Reviewed by Dean Jackson. Caught by conformance test deqp/functional/gles3/negativebufferapi.html * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::setIndexedBufferBinding): 2020-08-07 Alexey Shvayka {Intersection,Resize,Performance}Observer callbacks get incorrect `this` value https://bugs.webkit.org/show_bug.cgi?id=215162 Reviewed by Geoffrey Garen. This change utilizes CallbackThisObject] IDL attribute to invoke a callback of IntersectionObserver [1], ResizeObserver [2], and PerformanceObserver [3] with correct `this` value of its observer, aligning WebKit with Blink and Gecko. Tests: imported/w3c/web-platform-tests/intersection-observer/observer-callback-arguments.html imported/w3c/web-platform-tests/resize-observer/observe.html imported/w3c/web-platform-tests/performance-timeline/po-observe.any.js [1] https://w3c.github.io/IntersectionObserver/#notify-intersection-observers-algo (step 3.4) [2] https://github.com/w3c/csswg-drafts/pull/5383 [3] https://w3c.github.io/performance-timeline/#queue-the-performanceobserver-task (step 3.3.5) * html/LazyLoadImageObserver.cpp: * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::notify): * page/IntersectionObserverCallback.h: * page/IntersectionObserverCallback.idl: * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::deliver): * page/PerformanceObserverCallback.h: * page/PerformanceObserverCallback.idl: * page/ResizeObserver.cpp: (WebCore::ResizeObserver::deliverObservations): * page/ResizeObserverCallback.h: * page/ResizeObserverCallback.idl: 2020-08-07 Chris Dumez baseLatency attribute is missing on AudioContext interface https://bugs.webkit.org/show_bug.cgi?id=215277 Reviewed by Eric Carlson. baseLatency attribute is missing on AudioContext interface: - https://www.w3.org/TR/webaudio/#dom-audiocontext-baselatency Test: webaudio/audiocontext-baselatency.html * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::baseLatency): (WebCore::AudioContext::destination): * Modules/webaudio/AudioContext.h: * Modules/webaudio/AudioContext.idl: * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::framesPerBuffer const): * Modules/webaudio/DefaultAudioDestinationNode.h: * platform/audio/AudioDestination.h: * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::AudioDestinationCocoa::framesPerBuffer const): * platform/audio/cocoa/AudioDestinationCocoa.h: * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: (WebCore::AudioDestinationGStreamer::framesPerBuffer const): * platform/audio/gstreamer/AudioDestinationGStreamer.h: 2020-08-07 Rob Buis Implement PerfomanceObserverInit.buffered https://bugs.webkit.org/show_bug.cgi?id=214883 Reviewed by Darin Adler. Implement PerfomanceObserverInit.buffered IDL and functionality [1]. Behavior matches Chrome and Firefox. Tests: imported/w3c/web-platform-tests/resource-timing/buffered-flag.any.html imported/w3c/web-platform-tests/resource-timing/buffered-flag.any.worker.html imported/w3c/web-platform-tests/user-timing/buffered-flag.any.html imported/w3c/web-platform-tests/user-timing/buffered-flag.any.worker.html imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.html imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.worker.html [1] https://w3c.github.io/performance-timeline/#performanceobserverinit-dictionary * page/Performance.cpp: (WebCore::Performance::appendBufferedEntriesByType const): * page/Performance.h: * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::observe): * page/PerformanceObserver.h: * page/PerformanceObserver.idl: 2020-08-07 John Wilander Experimental: Cap the expiry of persistent cookies set in 3rd-party CNAME cloaked HTTP responses https://bugs.webkit.org/show_bug.cgi?id=215201 Reviewed by Brent Fulgham. Also reviewed and commented on by Chris Dumez, Jiten Mehta, Sam Weinig, and Alex Christensen. Tests: http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-1p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-3p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-matching-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-no-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-1p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-3p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-no-cname.html * page/Settings.yaml: Added the off-by-default flag isCNAMECloakingMitigationEnabled. * platform/network/NetworkStorageSession.cpp: (WebCore::NetworkStorageSession::resourceLoadStatisticsEnabled const): New getter for the ITP setting. * platform/network/NetworkStorageSession.h: * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::capExpiryOfPersistentCookie): Broke this function out so that it can be reused. (WebCore::parseDOMCookie): Here's from where the function above was broken out. The existing functionality has a test case. 2020-08-07 Chris Dumez length attribute is missing on OfflineAudioContext https://bugs.webkit.org/show_bug.cgi?id=215287 Reviewed by Geoffrey Garen. length attribute is missing on OfflineAudioContext: - https://www.w3.org/TR/webaudio/#dom-offlineaudiocontext-length Test: webaudio/offlineaudiocontext-length.html * Modules/webaudio/BaseAudioContext.h: (WebCore::BaseAudioContext::renderTarget const): * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::length const): * Modules/webaudio/OfflineAudioContext.h: * Modules/webaudio/OfflineAudioContext.idl: 2020-08-07 Alexey Shvayka Reduce the amount of custom binding code for JSXPathNSResolver https://bugs.webkit.org/show_bug.cgi?id=161030 Reviewed by Darin Adler. This patch introduces CustomXPathNSResolver callback interface, cleaning up CodeGeneratorJS.pm and removing custom binding code. XPathNSResolver is kept as a wrapper for NativeXPathNSResolver, preserving common case performance via IDL interface converter, and because a callback interface can't be returned from a function without substantial code generator change. Also, improves non-callable method error message and fixes 2 spec incompatibilities: a) no "lookupNamespaceURI" method lookup on functions [1]; b) resolver's "prefix" parameter is required [2]. Since C++ methods can't be overload based on return type, this patch adds [ImplementedAs] IDL attribute support for callback interface methods. Because XPathNSResolver wrappers are always temporary (no reference is kept), [IsWeakCallback] IDL attribute isn't added, preserving strong reference. [1]: https://heycam.github.io/webidl/#call-a-user-objects-operation (step 10.1) [2]: https://dom.spec.whatwg.org/#dom-xpathnsresolver-lookupnamespaceuri Tests: imported/w3c/web-platform-tests/dom/idlharness.window.js imported/w3c/web-platform-tests/domxpath/callback-interface.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/IDLTypes.h: * bindings/js/JSCallbackData.cpp: (WebCore::JSCallbackData::invokeCallback): * bindings/js/JSCustomXPathNSResolver.cpp: Removed. * bindings/js/JSCustomXPathNSResolver.h: Removed. * bindings/js/JSDOMConvertXPathNSResolver.h: (WebCore::Converter>::convert): (WebCore::Converter>::convert): Deleted. (WebCore::JSConverter>::convert): Deleted. (WebCore::JSConverter>::convertNewlyCreated): Deleted. * bindings/scripts/CodeGenerator.pm: (IsBuiltinType): (IsWrapperType): * bindings/scripts/CodeGeneratorJS.pm: (AddToIncludesForIDLType): (GenerateHeader): (GenerateCallbackHeaderContent): (GenerateCallbackImplementationContent): (GetBaseIDLType): (NativeToJSValueDOMConvertNeedsState): (NativeToJSValueDOMConvertNeedsGlobalObject): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameterBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolverBody): * xml/CustomXPathNSResolver.cpp: Copied from Source/WebCore/bindings/js/JSXPathNSResolverCustom.cpp. (WebCore::CustomXPathNSResolver::lookupNamespaceURI): * xml/CustomXPathNSResolver.h: Copied from Source/WebCore/bindings/js/JSXPathNSResolverCustom.cpp. * xml/CustomXPathNSResolver.idl: Renamed from Source/WebCore/bindings/js/JSXPathNSResolverCustom.cpp. * xml/XPathNSResolver.idl: 2020-08-07 Antti Koivisto REGRESSION (r260276): instructure.com custom PDF viewer stops scrolling / loading after switching to another tab then switching back https://bugs.webkit.org/show_bug.cgi?id=215215 Reviewed by Simon Fraser. Test: scrollingcoordinator/overflow-proxy-reattach.html * page/scrolling/ScrollingStateOverflowScrollProxyNode.cpp: (WebCore::ScrollingStateOverflowScrollProxyNode::setPropertyChangedBitsAfterReattach): We need to reset OverflowScrollingNode after reattach. * page/scrolling/ScrollingStateOverflowScrollProxyNode.h: * testing/Internals.cpp: (WebCore::Internals::setPageIsInWindow): * testing/Internals.h: * testing/Internals.idl: Add direct testing support for background tab state. 2020-08-07 Chris Dumez Stop storing the sampleRate on AudioNode and get it from the AudioContext instead https://bugs.webkit.org/show_bug.cgi?id=215246 Reviewed by Eric Carlson. Stop storing the sampleRate on AudioNode and get it from the AudioContext instead. This avoids having to pass the sampleRate everywhere when we construct nodes. No new tests, no behavior change. * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::AnalyserNode): * Modules/webaudio/AudioBasicInspectorNode.cpp: (WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode): * Modules/webaudio/AudioBasicInspectorNode.h: * Modules/webaudio/AudioBasicProcessorNode.cpp: (WebCore::AudioBasicProcessorNode::AudioBasicProcessorNode): * Modules/webaudio/AudioBasicProcessorNode.h: * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::AudioBufferSourceNode): * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::AudioDestinationNode): * Modules/webaudio/AudioDestinationNode.h: * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::AudioNode): (WebCore::AudioNode::sampleRate const): (WebCore::AudioNode::processIfNecessary): * Modules/webaudio/AudioNode.h: * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode): * Modules/webaudio/AudioScheduledSourceNode.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createScriptProcessor): * Modules/webaudio/BiquadFilterNode.cpp: (WebCore::BiquadFilterNode::BiquadFilterNode): * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::create): (WebCore::ChannelMergerNode::ChannelMergerNode): * Modules/webaudio/ChannelMergerNode.h: * Modules/webaudio/ChannelSplitterNode.cpp: (WebCore::ChannelSplitterNode::create): (WebCore::ChannelSplitterNode::ChannelSplitterNode): * Modules/webaudio/ChannelSplitterNode.h: * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::ConvolverNode): * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::DefaultAudioDestinationNode): (WebCore::DefaultAudioDestinationNode::sampleRate const): * Modules/webaudio/DefaultAudioDestinationNode.h: * Modules/webaudio/DelayNode.cpp: (WebCore::DelayNode::DelayNode): * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::DynamicsCompressorNode): * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::GainNode): * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode): * Modules/webaudio/MediaStreamAudioDestinationNode.cpp: (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode): * Modules/webaudio/MediaStreamAudioSourceNode.cpp: (WebCore::MediaStreamAudioSourceNode::MediaStreamAudioSourceNode): * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::OfflineAudioDestinationNode): * Modules/webaudio/OfflineAudioDestinationNode.h: * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::OscillatorNode): * Modules/webaudio/PannerNode.cpp: * Modules/webaudio/PannerNode.h: * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::create): (WebCore::ScriptProcessorNode::ScriptProcessorNode): * Modules/webaudio/ScriptProcessorNode.h: * Modules/webaudio/WaveShaperNode.cpp: (WebCore::WaveShaperNode::WaveShaperNode): * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::createWebKitPanner): * Modules/webaudio/WebKitAudioPannerNode.cpp: (WebCore::WebKitAudioPannerNode::WebKitAudioPannerNode): * Modules/webaudio/WebKitAudioPannerNode.h: 2020-08-07 Dean Jackson Pocket City game play area is blank (WebGL is broken in Catalyst) https://bugs.webkit.org/show_bug.cgi?id=215251 Reviewed by Tim Horton. Our configuration for WebGL under Catalyst was incorrect. Since it uses "desktop" OpenGL, it had to use the normal macOS setup (enabling texture rectangle extension, and the correct target). * platform/graphics/GraphicsContextGL.h: Add PLATFORM(MACCATALYST). * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: Ditto. (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): 2020-08-07 Rob Buis Fix warnings related to unsigned >=0 ASSERTs https://bugs.webkit.org/show_bug.cgi?id=215223 Reviewed by Sergio Villar Senin. Fix warnings related to unsigned >=0 ASSERTs by removing the expressions. Example warning: TextCheckingHelper.cpp:425:39: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] * editing/Editor.cpp: (WebCore::Editor::markAndReplaceFor): * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingHelper::findFirstMisspelledWordOrUngrammaticalPhrase const): (WebCore::TextCheckingHelper::findUngrammaticalPhrases const): (WebCore::TextCheckingHelper::guessesForMisspelledWordOrUngrammaticalPhrase const): 2020-08-06 Sihui Liu Text manipulation: leading and trailing spaces should be ignored when comparing content https://bugs.webkit.org/show_bug.cgi?id=214878 Reviewed by Ryosuke Niwa. TextIterator does not emit collapsed space if there is no text emitted before or the last emitted character is collapsed space. When TextManipulationController starts observing paragraphs, it iterates the whole document and the range of TextIterator is the range of document. For some text node A in the document, if TextIterator emits text for some other text node B before it, the collapsed space at the beginning of A will be emitted, and TextManipulationController would think the emitted space is part of A's content. When TextManipulationController replaces content for A, and the range of TextIterator is set to the range of A, the collapsed space is not emitted. The check to ensure A's content is unchanged would fail. To solve this issue, for first and last token in the paragraph, TextManipulationController checks content after removing leading and trailing spaces. API test: TextManipulation.CompleteTextManipulationParagraphsContainCollapsedSpaces * editing/TextManipulationController.cpp: (WebCore::areEqualIgnoringLeadingAndTrailingWhitespaces): (WebCore::TextManipulationController::replace): 2020-08-06 Kenneth Russell Implement createImageBitmap(ImageData) https://bugs.webkit.org/show_bug.cgi?id=183438 Reviewed by Dean Jackson. Implement createImageBitmap(ImageData), including scaling, flipping and alpha premultiplication, and fix bugs in createImageBitmap(ImageBitmap). Support copying unpremultiplied-alpha data to the unpremultiplied-alpha format in ImageBuffer::putImageData. Plumb this change through all ImageBuffer backends and display lists. Handle error cases exposed by W3C WPT tests now that createImageBitmap(ImageData) is working. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::dumpImageBitmap): (WebCore::CloneDeserializer::readImageBitmap): * html/ImageBitmap.cpp: (WebCore::ImageBitmap::create): (WebCore::ImageBitmap::detachBitmaps): (WebCore::alphaPremultiplicationForPremultiplyAlpha): (WebCore::ImageBitmap::resolveWithBlankImageBuffer): (WebCore::ImageBitmap::createPromise): (WebCore::ImageBitmap::createFromBuffer): * html/ImageBitmap.h: * html/OffscreenCanvas.cpp: (WebCore::OffscreenCanvas::transferToImageBitmap): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::texImageSourceHelper): (WebCore::WebGLRenderingContextBase::texImageImpl): * html/canvas/WebGLRenderingContextBase.h: * platform/graphics/ConcreteImageBuffer.h: (WebCore::ConcreteImageBuffer::putImageData): * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::putImageData): * platform/graphics/ImageBufferBackend.cpp: (WebCore::ImageBufferBackend::convertToLuminanceMask): (WebCore::copyUnpremultipliedToUnpremultiplied): (WebCore::ImageBufferBackend::copyImagePixels const): (WebCore::ImageBufferBackend::putImageData): * platform/graphics/ImageBufferBackend.h: * platform/graphics/cairo/GraphicsContextGLCairo.cpp: (WebCore::GraphicsContextGLOpenGL::ImageExtractor::extractImage): * platform/graphics/cairo/ImageBufferCairoSurfaceBackend.cpp: (WebCore::ImageBufferCairoSurfaceBackend::putImageData): * platform/graphics/cairo/ImageBufferCairoSurfaceBackend.h: * platform/graphics/cg/GraphicsContextGLCG.cpp: (WebCore::GraphicsContextGLOpenGL::ImageExtractor::extractImage): * platform/graphics/cg/ImageBufferCGBackend.cpp: (WebCore::copyImagePixelsAccelerated): * platform/graphics/cg/ImageBufferCGBitmapBackend.cpp: (WebCore::ImageBufferCGBitmapBackend::putImageData): * platform/graphics/cg/ImageBufferCGBitmapBackend.h: * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp: (WebCore::ImageBufferIOSurfaceBackend::putImageData): * platform/graphics/cg/ImageBufferIOSurfaceBackend.h: * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::PutImageData::PutImageData): (WebCore::DisplayList::operator<<): * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::PutImageData::create): (WebCore::DisplayList::PutImageData::destFormat const): (WebCore::DisplayList::PutImageData::encode const): (WebCore::DisplayList::PutImageData::decode): * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::putImageData): * platform/graphics/displaylists/DisplayListRecorder.h: * platform/graphics/opengl/GraphicsContextGLOpenGL.cpp: (WebCore::GraphicsContextGLOpenGL::ImageExtractor::ImageExtractor): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/win/GraphicsContextGLDirect2D.cpp: (WebCore::GraphicsContextGLOpenGL::ImageExtractor::extractImage): * platform/graphics/win/ImageBufferDirect2DBackend.cpp: (WebCore::ImageBufferDirect2DBackend::putImageData): * platform/graphics/win/ImageBufferDirect2DBackend.h: 2020-08-06 Simon Fraser Avoid triggering redundant compositing updates when trying ot run a steps() animation on transform https://bugs.webkit.org/show_bug.cgi?id=215241 Reviewed by Zalan Bujtas. With a steps() timing function and keyframes animating the transform property, KeyframeEffect::applyPendingAcceleratedActions() tries to restart the animation every time because the GraphicsLayer reports that it didn't start an accelerated animation. r264856 patched some of this, but we still call animationFinished() every time, and this triggers a compositing update via the m_owningLayer.setNeeds* calls in RenderLayerBacking::animationFinished(). So don't try to remove the animation if wasn't running. This makes those compositing updates a no-op, which is important because these animations still invalidate style on every frame (webkit.org/b/215229). Test: animations/steps-transform-compositing-updates.html * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::applyPendingAcceleratedActions): 2020-08-06 Peng Liu Web process crashes at WebCore::FullscreenManager::didExitFullscreen https://bugs.webkit.org/show_bug.cgi?id=215243 Reviewed by Eric Carlson. No new tests, no functional change. * dom/FullscreenManager.cpp: (WebCore::FullscreenManager::didExitFullscreen): m_fullscreenElement might be nullptr when fullscreenOrPendingElement() is not nullptr. 2020-08-06 Wenson Hsieh WeakPtr threading assertion on editing/undo-manager/undo-manager-delete-stale-undo-items.html https://bugs.webkit.org/show_bug.cgi?id=215221 Reviewed by Devin Rousso. Refactors `UndoItem` to avoid dereferencing its `m_undoManager` underneath `UndoItem::document`, which is consulted when computing its JS wrapper's opaque roots. Instead of going through `m_undoManager` to grab the document, store a `WeakPtr` to the `Document` upon setting the `UndoManager` and return its pointer value directly in `document()`. * page/UndoItem.cpp: (WebCore::UndoItem::setUndoManager): (WebCore::UndoItem::invalidate): (WebCore::UndoItem::document const): * page/UndoItem.h: 2020-08-06 Myles C. Maxfield Use references instead of pointers for WidthIterator's fonts https://bugs.webkit.org/show_bug.cgi?id=215186 Reviewed by Zalan Bujtas. They can never be null. No new tests because there is no behavior change. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::widthOfTextRange const): (WebCore::FontCascade::layoutSimpleText const): (WebCore::FontCascade::floatWidthForSimpleText const): (WebCore::FontCascade::adjustSelectionRectForSimpleText const): (WebCore::FontCascade::offsetForPositionForSimpleText const): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::WidthIterator): (WebCore::WidthIterator::applyFontTransforms): (WebCore::WidthIterator::advanceInternal): * platform/graphics/WidthIterator.h: * rendering/svg/SVGTextMetricsBuilder.cpp: (WebCore::SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer): 2020-08-06 Chris Dumez BaseAudioContext.decodeAudioData() should return a Promise https://bugs.webkit.org/show_bug.cgi?id=215242 Reviewed by Eric Carlson. BaseAudioContext.decodeAudioData() should return a Promise as per: - https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-decodeaudiodata Behavior is unchanged for prefixed WebKitAudioContext.decodeAudioData() to ensure backward compatibility. No new tests, rebaselined existing tests. * Modules/webaudio/AsyncAudioDecoder.cpp: (WebCore::AsyncAudioDecoder::decodeAsync): (WebCore::AsyncAudioDecoder::DecodingTask::DecodingTask): (WebCore::AsyncAudioDecoder::DecodingTask::notifyComplete): * Modules/webaudio/AsyncAudioDecoder.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::decodeAudioData): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/BaseAudioContext.idl: * Modules/webaudio/WebKitAudioContext.idl: 2020-08-06 Chris Dumez Drop non-standard createBuffer(ArrayBuffer, boolean) overload from AudioContext https://bugs.webkit.org/show_bug.cgi?id=215238 Reviewed by Darin Adler. Drop non-standard createBuffer(ArrayBuffer, boolean) overload from AudioContext: - https://webaudio.github.io/web-audio-api/#BaseAudioContext This overload is kept on WebKitAudioContext for backward-compatibility when the page is still using the prefixed API. No new tests, rebaselined existing test. * Modules/webaudio/BaseAudioContext.cpp: * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/BaseAudioContext.idl: * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::createLegacyBuffer): * Modules/webaudio/WebKitAudioContext.h: * Modules/webaudio/WebKitAudioContext.idl: 2020-08-06 Chris Dumez MediaStreamAudioDestinationNode should have a constructor https://bugs.webkit.org/show_bug.cgi?id=215233 Reviewed by Geoffrey Garen. MediaStreamAudioDestinationNode should have a constructor: - https://webaudio.github.io/web-audio-api/#mediastreamaudiodestinationnode No new tests, rebaselined existing tests. * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::AnalyserNode): * Modules/webaudio/AudioBasicInspectorNode.cpp: (WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode): (WebCore::AudioBasicInspectorNode::pullInputs): (WebCore::AudioBasicInspectorNode::checkNumberOfChannelsForInput): (WebCore::AudioBasicInspectorNode::updatePullStatus): * Modules/webaudio/AudioBasicInspectorNode.h: * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::createMediaStreamDestination): * Modules/webaudio/MediaStreamAudioDestinationNode.cpp: (WebCore::MediaStreamAudioDestinationNode::create): (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode): * Modules/webaudio/MediaStreamAudioDestinationNode.h: * Modules/webaudio/MediaStreamAudioDestinationNode.idl: * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::createMediaStreamDestination): 2020-08-06 Said Abou-Hallawa [CG] Avoid creating a sub-image when drawing a small scaled sub-rect from a native image https://bugs.webkit.org/show_bug.cgi?id=215015 Reviewed by Simon Fraser. The reason for creating the sub-image in GraphicsContext::drawNativeImage() is to have a better image interpolation for the scaled sub-rect. For small destRect, the interpolation on the original image is almost the same as the interpolation on the sub-image. So we should avoid creating the sub- image if destRect.area() is less than some minimum value. Creating many sub-images can affect the rendering performance. * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::drawNativeImage): 2020-08-06 David Kilzer WTF::makeString() should handle enum values Reviewed by Sam Weinig. * Modules/webgpu/WHLSL/Metal/WHLSLMangledNames.h: (WTF::MangledNameAdaptor::length): (WTF::MangledNameAdaptor::writeTo): - Update for function renames. 2020-08-06 Chris Dumez MediaStreamAudioSourceNode should have a constructor https://bugs.webkit.org/show_bug.cgi?id=215225 Reviewed by Eric Carlson. MediaStreamAudioSourceNode should have a constructor: - https://webaudio.github.io/web-audio-api/#mediastreamaudiosourcenode No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::createMediaStreamSource): * Modules/webaudio/MediaStreamAudioSourceNode.cpp: (WebCore::MediaStreamAudioSourceNode::create): * Modules/webaudio/MediaStreamAudioSourceNode.h: * Modules/webaudio/MediaStreamAudioSourceNode.idl: * Modules/webaudio/MediaStreamAudioSourceOptions.h: Copied from Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.idl. * Modules/webaudio/MediaStreamAudioSourceOptions.idl: Copied from Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.idl. * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::createMediaStreamSource): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-06 Myles C. Maxfield Rename LeadingExpansion and TrailingExpansion to LeftExpansion and RightExpansion https://bugs.webkit.org/show_bug.cgi?id=215211 Reviewed by Darin Adler. "Leading" and "Trailing" are terms-of-art which represent logical order. However, the behavior of these flags operates in visual order. Instead, we should rename them to their visual order analogues: left and right. No new tests because there is no behavior change. * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::measureText): (WebCore::CanvasRenderingContext2D::drawTextInternal): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::justifyRuns): (WebCore::Layout::LineBuilder::Run::expand): (WebCore::Layout::LineBuilder::Run::visuallyCollapseTrailingWhitespace): * platform/graphics/ComplexTextController.cpp: (WebCore::expansionLocation): (WebCore::ComplexTextController::adjustGlyphsAndAdvances): * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::expansionOpportunityCountInternal): (WebCore::FontCascade::leftExpansionOpportunity): (WebCore::FontCascade::rightExpansionOpportunity): (WebCore::FontCascade::leadingExpansionOpportunity): Deleted. (WebCore::FontCascade::trailingExpansionOpportunity): Deleted. * platform/graphics/FontCascade.h: * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::WidthIterator): (WebCore::expansionLocation): (WebCore::WidthIterator::advanceInternal): * platform/text/TextFlags.h: * rendering/ComplexLineLayout.cpp: (WebCore::expansionBehaviorForInlineTextBox): (WebCore::applyExpansionBehavior): * rendering/EllipsisBox.cpp: (WebCore::EllipsisBox::paint): (WebCore::EllipsisBox::selectionRect): (WebCore::EllipsisBox::paintSelection): * rendering/InlineBox.h: (WebCore::InlineBox::setCanHaveLeftExpansion): (WebCore::InlineBox::setCanHaveRightExpansion): (WebCore::InlineBox::setForceRightExpansion): (WebCore::InlineBox::setForceLeftExpansion): (WebCore::InlineBox::InlineBoxBitfields::InlineBoxBitfields): (WebCore::InlineBox::hasSelectedChildren const): (WebCore::InlineBox::setHasSelectedChildren): (WebCore::InlineBox::canHaveLeftExpansion const): (WebCore::InlineBox::canHaveRightExpansion const): (WebCore::InlineBox::forceRightExpansion const): (WebCore::InlineBox::forceLeftExpansion const): (WebCore::InlineBox::setCanHaveLeadingExpansion): Deleted. (WebCore::InlineBox::setCanHaveTrailingExpansion): Deleted. (WebCore::InlineBox::setForceTrailingExpansion): Deleted. (WebCore::InlineBox::setForceLeadingExpansion): Deleted. (WebCore::InlineBox::canHaveLeadingExpansion const): Deleted. (WebCore::InlineBox::canHaveTrailingExpansion const): Deleted. (WebCore::InlineBox::forceTrailingExpansion const): Deleted. (WebCore::InlineBox::forceLeadingExpansion const): Deleted. * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::expansionBehavior const): * rendering/InlineTextBox.h: * rendering/RenderFileUploadControl.cpp: (WebCore::RenderFileUploadControl::paintObject): (WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths const): * rendering/RenderListBox.cpp: (WebCore::RenderListBox::updateFromElement): (WebCore::RenderListBox::paintItemForeground): * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::getAverageCharWidth): * rendering/SimpleLineLayout.cpp: (WebCore::SimpleLineLayout::expansionBehavior): * rendering/SimpleLineLayout.h: * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::initializeInlineTextBox): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::constructTextRun const): * rendering/svg/SVGTextMetrics.cpp: (WebCore::SVGTextMetrics::constructTextRun): 2020-08-06 Chris Dumez DynamicsCompressorNode.reduction attribute should be a float, not an AudioParam https://bugs.webkit.org/show_bug.cgi?id=215195 Reviewed by Youenn Fablet. DynamicsCompressorNode.reduction attribute should be a float, not an AudioParam: - https://webaudio.github.io/web-audio-api/#dynamicscompressornode Backward-compatibility is maintained for the prefixed WebAudio API. No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::DynamicsCompressorNode): (WebCore::DynamicsCompressorNode::process): * Modules/webaudio/DynamicsCompressorNode.h: (WebCore::DynamicsCompressorNode::reduction const): (WebCore::DynamicsCompressorNode::DynamicsCompressorNode): (WebCore::DynamicsCompressorNode::setReduction): * Modules/webaudio/DynamicsCompressorNode.idl: * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::createWebKitDynamicsCompressor): * Modules/webaudio/WebKitAudioContext.h: * Modules/webaudio/WebKitAudioContext.idl: * Modules/webaudio/WebKitDynamicsCompressorNode.h: Copied from Source/WebCore/Modules/webaudio/DynamicsCompressorNode.idl. * Modules/webaudio/WebKitDynamicsCompressorNode.idl: Copied from Source/WebCore/Modules/webaudio/DynamicsCompressorNode.idl. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-06 Truitt Savell Unreviewed, reverting r265328. Broke 17 MediaRecorder tests. Reverted changeset: "Add support for MediaRecorder bitrate options" https://bugs.webkit.org/show_bug.cgi?id=214973 https://trac.webkit.org/changeset/265328 2020-08-06 Chris Dumez MediaElementAudioSourceNode interface should have a constructor https://bugs.webkit.org/show_bug.cgi?id=215200 Reviewed by Youenn Fablet. MediaElementAudioSourceNode interface should have a constructor: - https://webaudio.github.io/web-audio-api/#mediaelementaudiosourcenode Test: webaudio/mediaelementaudiosourcenode-constructor.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::createMediaElementSource): * Modules/webaudio/AudioContext.idl: * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::create): (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode): * Modules/webaudio/MediaElementAudioSourceNode.h: * Modules/webaudio/MediaElementAudioSourceNode.idl: * Modules/webaudio/MediaElementAudioSourceOptions.h: Copied from Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.idl. * Modules/webaudio/MediaElementAudioSourceOptions.idl: Copied from Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.idl. * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::createMediaElementSource): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-06 Youenn Fablet Add support for MediaRecorder bitrate options https://bugs.webkit.org/show_bug.cgi?id=214973 Reviewed by Eric Carlson. Pipe options to MediaRecorderPrivate constructor. For the actual implementation, pass it down to VideoSampleBufferCompressor and AudioSampleBufferCompressor. For AudioSampleBufferCompressor, we do not handle well some bit rates, so for now, we limit to specific values. Tests: http/wpt/mediarecorder/MediaRecorder-audio-bitrate.html http/wpt/mediarecorder/MediaRecorder-video-bitrate.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): (WebCore::MediaRecorder::createMediaRecorderPrivate): (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::startRecording): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorderProvider.cpp: (WebCore::MediaRecorderProvider::createMediaRecorderPrivate): * Modules/mediarecorder/MediaRecorderProvider.h: * WebCore.xcodeproj/project.pbxproj: * loader/EmptyClients.cpp: * platform/mediarecorder/MediaRecorderPrivate.h: * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::create): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: (WebCore::AudioSampleBufferCompressor::setBitsPerSecond): (WebCore::AudioSampleBufferCompressor::outputBitRate const): (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription): Do not exit when not able to set bitrate as we still want to set m_maxOutputPacketSize. In case of error in setting up the converter, clean it up so that we do not use a partially set up converter. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::create): (WebCore::MediaRecorderPrivateWriter::setOptions): * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.h: * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: (WebCore::VideoSampleBufferCompressor::setBitsPerSecond): (WebCore::setCompressionSessionProperty): (WebCore::VideoSampleBufferCompressor::initCompressionSession): * testing/Internals.cpp: (WebCore::createRecorderMockSource): 2020-08-06 Simon Fraser Scrolling tree nodes sometimes don't match layer z-order https://bugs.webkit.org/show_bug.cgi?id=215210 Reviewed by Antti Koivisto. When adding nodes to the scrolling state tree during compositing layer traversal, we would sometimes add then in the wrong order. For example, if the composited layer tree was: + Root + Stacking context Fixed layer 1 Fixed layer 2 we would build a scrolling tree like: + Root scrolling node Node for layer 2 Node for layer 1 This happened because RenderLayerCompositor::updateBackingAndHierarchy() failed to propagate up scrollingTreeState.nextChildIndex. This is generally benign, but inserting node 1 followed by node 2 would be seen as a scrolling tree mutation, causing us to re-commit the scrolling tree when it hadn't really changed, triggering extra CPU usage. Part of : higher CPU usage on instagram.com. Test: scrollingcoordinator/scrolling-tree/sibling-node-order.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): 2020-08-05 Rob Buis Remove the StyleResolver-specific evaluate function in MediaQueryEvaluator https://bugs.webkit.org/show_bug.cgi?id=152089 Reviewed by Darin Adler. The function mentioned in the bug is already gone (see r252736), also remove the StyleResolver reference. * css/MediaQueryEvaluator.h: 2020-08-05 Simon Fraser Add some more Animations logging https://bugs.webkit.org/show_bug.cgi?id=215181 Reviewed by Zalan Bujtas. Add logging that shows when DeclarativeAnimation::tick() runs and when it invalidates style. * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::tick): * animation/DocumentTimelinesController.cpp: (WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents): * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::invalidate): 2020-08-05 Peng Liu Netflix.com shows a scrubber that doesn't work https://bugs.webkit.org/show_bug.cgi?id=215199 Reviewed by Eric Carlson. The "contentDuration" property of WebPlaybackControlsManager needs to be infinite when the video is not seekable. Otherwise, AVKit will show a scrubber that doesn't work on the Touch Bar. * platform/mac/WebPlaybackControlsManager.mm: (-[WebPlaybackControlsManager contentDuration]): (-[WebPlaybackControlsManager setContentDuration:]): 2020-08-05 James Darpinian [WebGL2] Upgrade vertexAttribPointer with new supported types https://bugs.webkit.org/show_bug.cgi?id=215036 Reviewed by Dean Jackson. Tested by updated WebGL conformance tests webgl/2.0.0/conformance/attribs/gl-vertexattribpointer-offsets.html and webgl/2.0.0/conformance/attribs/gl-vertexattribpointer.html * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::sizeInBytes): (WebCore::WebGLRenderingContextBase::vertexAttribPointer): 2020-08-05 Tim Horton Remove all references to non-existent 10.16 https://bugs.webkit.org/show_bug.cgi?id=215202 Reviewed by Wenson Hsieh. * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: 2020-08-05 Andres Gonzalez Crash in com.apple.WebKit.WebContent at com.apple.AppKit: _NSAccessibilityRemoveAllObserversAndSendDestroyedNotification https://bugs.webkit.org/show_bug.cgi?id=215189 Reviewed by Chris Fleizach. AXIsolatedObject::detachPlatformWrapper was calling the wrapper's detach method that in turn calls the system NSAccessibilityUnregisterUniqueIdForUIElement on the secondary thread. This function is not thread safe and hence the random crashes. This changes AXIsolatedObject::detachPlatformWrapper to call the wrapper's detachIsolatedObject, avoiding the above problem altogether. The wrapper's detach remains the same that it was before isolated tree mode was introduced, and should only run on the main thread. * accessibility/AccessibilityObjectInterface.h: * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::applyPendingChanges): * accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm: (WebCore::AXIsolatedObject::detachPlatformWrapper): * accessibility/mac/WebAccessibilityObjectWrapperBase.h: * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase detach]): (-[WebAccessibilityObjectWrapperBase detachIsolatedObject:]): (-[WebAccessibilityObjectWrapperBase detachAXObject]): Merged back into detach. (-[WebAccessibilityObjectWrapperBase detachIsolatedObject]): Deleted. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper unregisterUniqueIdForUIElement]): 2020-08-05 Chris Dumez Add constructor for DynamicsCompressorNode https://bugs.webkit.org/show_bug.cgi?id=215180 Reviewed by Geoffrey Garen. Add constructor for DynamicsCompressorNode: - https://webaudio.github.io/web-audio-api/#dynamicscompressornode This patch also add a new handleAudioNodeOptions() member function to AudioNode to avoid code duplication and every node constructor. No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::create): * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::AudioNode): (WebCore::AudioNode::initializeDefaultNodeOptions): (WebCore::AudioNode::handleAudioNodeOptions): * Modules/webaudio/AudioNode.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createDynamicsCompressor): * Modules/webaudio/BiquadFilterNode.cpp: (WebCore::BiquadFilterNode::create): * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::create): * Modules/webaudio/ChannelSplitterNode.cpp: (WebCore::ChannelSplitterNode::create): * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::create): (WebCore::ConvolverNode::ConvolverNode): * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::DefaultAudioDestinationNode): * Modules/webaudio/DelayNode.cpp: (WebCore::DelayNode::create): * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::create): (WebCore::DynamicsCompressorNode::DynamicsCompressorNode): (WebCore::DynamicsCompressorNode::setChannelCount): (WebCore::DynamicsCompressorNode::setChannelCountMode): * Modules/webaudio/DynamicsCompressorNode.h: * Modules/webaudio/DynamicsCompressorNode.idl: * Modules/webaudio/DynamicsCompressorOptions.h: Copied from Source/WebCore/Modules/webaudio/DynamicsCompressorNode.idl. * Modules/webaudio/DynamicsCompressorOptions.idl: Copied from Source/WebCore/Modules/webaudio/DynamicsCompressorNode.idl. * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::create): * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::create): * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::create): (WebCore::PannerNode::PannerNode): * Modules/webaudio/WaveShaperNode.cpp: (WebCore::WaveShaperNode::create): * Modules/webaudio/WebKitAudioPannerNode.cpp: (WebCore::WebKitAudioPannerNode::WebKitAudioPannerNode): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-05 Chris Dumez Add constructor to ConvolverNode https://bugs.webkit.org/show_bug.cgi?id=215169 Reviewed by Eric Carlson. Add constructor to ConvolverNode, as per specification: - https://webaudio.github.io/web-audio-api/#ConvolverNode No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createConvolver): * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::create): (WebCore::ConvolverNode::ConvolverNode): (WebCore::ConvolverNode::setBuffer): (WebCore::ConvolverNode::setChannelCount): (WebCore::ConvolverNode::setChannelCountMode): * Modules/webaudio/ConvolverNode.h: * Modules/webaudio/ConvolverNode.idl: * Modules/webaudio/ConvolverOptions.h: Copied from Source/WebCore/Modules/webaudio/ConvolverNode.idl. * Modules/webaudio/ConvolverOptions.idl: Copied from Source/WebCore/Modules/webaudio/ConvolverNode.idl. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-05 Chris Dumez REGRESSION (r265266) DumpRenderTree crash at WebKitAudioListener::dopplerFactor https://bugs.webkit.org/show_bug.cgi?id=215171 Reviewed by Eric Carlson. We were calling the isWebKitAudioContext() virtual function from the BaseAudioContext constructor, which was not OK. We now initialize the listener lazily so that we can know if we are a WebKitAudioContext or not at the time of creation. Also use downcast<> instead of static_cast<> to cast from AudioListener to WebKitAudioListener for extra safety. Finally, AudioListener was missing a virtual destructor even though we were using polymorphism. No new tests, covered by existing tests that are crashing on the bots. * Modules/webaudio/AudioListener.h: (WebCore::AudioListener::isWebKitAudioListener const): * Modules/webaudio/AudioListener.idl: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::constructCommon): (WebCore::WebCore::BaseAudioContext::listener): * Modules/webaudio/BaseAudioContext.h: (WebCore::BaseAudioContext::listener): Deleted. * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::listener): (WebCore::PannerNode::getAzimuthElevation): (WebCore::PannerNode::distanceConeGain): * Modules/webaudio/PannerNode.h: * Modules/webaudio/WebKitAudioContext.h: (WebCore::WebKitAudioContext::listener): * Modules/webaudio/WebKitAudioListener.h: (isType): * Modules/webaudio/WebKitAudioListener.idl: * Modules/webaudio/WebKitAudioPannerNode.cpp: (WebCore::WebKitAudioPannerNode::listener): (WebCore::WebKitAudioPannerNode::getAzimuthElevation): (WebCore::WebKitAudioPannerNode::dopplerRate): (WebCore::WebKitAudioPannerNode::distanceConeGain): * Modules/webaudio/WebKitAudioPannerNode.h: 2020-08-05 Chris Dumez Align BiquadFilterNode.getFrequencyResponse() with the specification https://bugs.webkit.org/show_bug.cgi?id=215148 Reviewed by Eric Carlson. Align BiquadFilterNode.getFrequencyResponse() with the specification: - https://webaudio.github.io/web-audio-api/#dom-biquadfilternode-getfrequencyresponse In particular, the 3 argument arrays should not be nullable and we should throw if they have different lengths. No new tests, rebaselined existing tests. * Modules/webaudio/BiquadFilterNode.cpp: (WebCore::BiquadFilterNode::getFrequencyResponse): * Modules/webaudio/BiquadFilterNode.h: * Modules/webaudio/BiquadFilterNode.idl: 2020-08-05 Chris Dumez Add constructor to BiquadFilterNode https://bugs.webkit.org/show_bug.cgi?id=215144 Reviewed by Eric Carlson. Add constructor to BiquadFilterNode: - https://webaudio.github.io/web-audio-api/#biquadfilternode No new tests, rebaselined existing tests.. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createBiquadFilter): * Modules/webaudio/BiquadDSPKernel.cpp: (WebCore::BiquadDSPKernel::updateCoefficientsIfNecessary): * Modules/webaudio/BiquadFilterNode.cpp: (WebCore::BiquadFilterNode::create): (WebCore::BiquadFilterNode::BiquadFilterNode): * Modules/webaudio/BiquadFilterNode.h: * Modules/webaudio/BiquadFilterNode.idl: * Modules/webaudio/BiquadFilterOptions.h: Copied from Source/WebCore/Modules/webaudio/BiquadFilterNode.idl. * Modules/webaudio/BiquadFilterOptions.idl: Copied from Source/WebCore/Modules/webaudio/BiquadFilterNode.idl. * Modules/webaudio/BiquadFilterType.h: Copied from Source/WebCore/Modules/webaudio/BiquadFilterNode.idl. * Modules/webaudio/BiquadFilterType.idl: Copied from Source/WebCore/Modules/webaudio/BiquadFilterNode.idl. * Modules/webaudio/BiquadProcessor.cpp: (WebCore::BiquadProcessor::BiquadProcessor): * Modules/webaudio/BiquadProcessor.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-04 Simon Fraser Update event regions only once per frame https://bugs.webkit.org/show_bug.cgi?id=215132 Reviewed by Darin Adler. Event regions (for touch-action, editable areas etc) were updated as part of compositing updates, but we only need their output once per rendering update, so move their computation out of RenderLayerCompositor::updateBackingAndHierarchy() and into a new RenderLayer tree walk that is called from Page::doAfterUpdateRendering(). RenderLayerBacking stores a dirty bit to track when regions need to be updated. Reduces the amount of time spent in rendering updates when scrolling on facebook.com on iPad, which has lots of discontiguous touch-action regions. * dom/Document.cpp: (WebCore::Document::updateEventRegions): * dom/Document.h: * page/Frame.cpp: (WebCore::Frame::layerTreeAsText const): * page/Page.cpp: (WebCore::Page::doAfterUpdateRendering): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::maintainsEventRegion const): (WebCore::RenderLayerBacking::updateEventRegion): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateEventRegions): (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): * rendering/RenderLayerCompositor.h: 2020-08-05 Adrian Perez de Castro Unreviewed non-unified build fix. No new tests needed. * Modules/webaudio/AudioListener.h: Add forward declaration for BaseAudioSharedUnit. 2020-08-05 Sihui Liu TextManipulationController should observe newly inserted or displayed text https://bugs.webkit.org/show_bug.cgi?id=215157 Reviewed by Wenson Hsieh. TextManipulationController already tracks renderer state of Element, but the case where Text children of an Element is newly inserted and displayed is not covered. Therefore, TextManipulationController also needs to know when render of Text is created. API test: TextManipulation.CompleteTextManipulationForNewlyDisplayedText * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::didCreateRendererForTextNode): (WebCore::TextManipulationController::scheduleObservationUpdate): (WebCore::TextManipulationController::removeNode): * editing/TextManipulationController.h: * rendering/updating/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::createTextRenderer): 2020-08-05 Youenn Fablet RegistrationDatabase::openSQLiteDatabase can spin https://bugs.webkit.org/show_bug.cgi?id=215120 Reviewed by Geoffrey Garen. In case we fail opening the database when importing, we delete the database, the file and retry. We do not need to retry in that case since there is nothing to import. Update the code to proceed with sending an import failure to SWServer. In case of pushing changes to the database, it might be useful to retry but it is best to do this asynchronously. For instance, there might be a script deleting the files/folders where is stored the database. In that case, we check the result of pushing changes. If they succeed, we call the completion handler and stop. Otherwise, we will retry pushing the changes if changes were not pushed again in the meantime. We introduce a push counter for that purpose. * workers/service/server/RegistrationDatabase.cpp: (WebCore::RegistrationDatabase::postTaskToWorkQueue): (WebCore::RegistrationDatabase::openSQLiteDatabase): (WebCore::RegistrationDatabase::importRecordsIfNecessary): (WebCore::RegistrationDatabase::pushChanges): (WebCore::RegistrationDatabase::schedulePushChanges): (WebCore::RegistrationDatabase::doPushChanges): * workers/service/server/RegistrationDatabase.h: * workers/service/server/SWServer.cpp: (WebCore::SWServer::registrationStoreDatabaseFailedToOpen): 2020-08-05 Youenn Fablet SWServerJobQueue::didResolveRegistrationPromise should not assume its registration key relates to an existing worker https://bugs.webkit.org/show_bug.cgi?id=215123 Reviewed by Geoffrey Garen. We know that in some cases, the registration is null in SWServerJobQueue::didResolveRegistrationPromise. This might happen for instance in case a worker gets terminated, thus removing a job and the next job is clearing the registration. Also, SWServerJobQueue::didResolveRegistrationPromise is not checking that the job identifier is the same in SWServerJobQueue::install and SWServerJobQueue::didResolveRegistrationPromise while other code paths do. A future refactoring might allow to call SWServerJobQueue::didResolveRegistrationPromise code synchronously from SWServerJobQueue::install. In the meantime, let's add a null check and add release logging for that case. * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::install): (WebCore::SWServerJobQueue::didResolveRegistrationPromise): 2020-08-05 Rob Buis Allow multiple calls to PerformanceObserver.observe with different types https://bugs.webkit.org/show_bug.cgi?id=214884 Reviewed by Darin Adler. Allow multiple calls to PerformanceObserver.observe with different type, but throw an exception if the observer type is changed [1]. Behavior matches Firefox and Chrome. Test: imported/web-platform-tests/performance-timeline/po-observe-type.any.html [1] https://w3c.github.io/performance-timeline/#observe-method * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::observe): * page/PerformanceObserver.h: 2020-08-05 Youenn Fablet Update AudioSampleDataSource offset computation https://bugs.webkit.org/show_bug.cgi?id=215127 Reviewed by Eric Carlson. As per logs, it sometimes happens that the offset is so big that the timestamp is below the start of the window. In that case, our logic is not able to catch up and reduce the offset. To handle this, we special case if the timestamp is below the start frame and do as if we were starting from scratch. Otherwise, we continue our logic to fine tune the offset by slowly making it bigger to not hit the end of the window but still be close to it. Updated logging to help further debugging this issue if needed. * platform/audio/mac/AudioSampleDataSource.h: * platform/audio/mac/AudioSampleDataSource.mm: (WebCore::AudioSampleDataSource::pushSamplesInternal): (WebCore::computeOffsetDelay): (WebCore::AudioSampleDataSource::pullSamplesInternal): (WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks): * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp: (WebCore::RealtimeIncomingAudioSourceCocoa::OnData): 2020-08-05 Eric Liang AX: WebCore should provide a way to get raw role for accessibility objects https://bugs.webkit.org/show_bug.cgi?id=215149 Reviewed by Chris Fleizach. Added a conversion from WebRole to string for accessibility. This allows us to get it in the WebKit bundle. * accessibility/AXLogger.cpp: (WebCore::operator<<): * accessibility/AccessibilityObjectInterface.h: (WebCore::accessibilityRoleToString): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityElementCount]): (-[WebAccessibilityObjectWrapper _accessibilityWebRoleAsString]): (-[WebAccessibilityObjectWrapper accessibilityTraits]): 2020-08-04 Devin Rousso "DoubleDown Casino" respin button stops working with trackpad https://bugs.webkit.org/show_bug.cgi?id=215146 Reviewed by Tim Horton. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isDoubleDown): Added. 2020-08-04 Chris Dumez Align AudioListener with the W3C specification https://bugs.webkit.org/show_bug.cgi?id=215134 Reviewed by Geoffrey Garen. Align AudioListener with the W3C specification: - https://webaudio.github.io/web-audio-api/#audiolistener Note that the prefixed API still behaves the way it used to. I have maintained the old version of the AudioListener API by moving it to a new WebKitAudioListener interface. No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioListener.cpp: (WebCore::AudioListener::AudioListener): (WebCore::AudioListener::setPosition): (WebCore::AudioListener::position const): (WebCore::AudioListener::setOrientation): (WebCore::AudioListener::orientation const): (WebCore::AudioListener::upVector const): * Modules/webaudio/AudioListener.h: (WebCore::AudioListener::create): (WebCore::AudioListener::positionX): (WebCore::AudioListener::positionY): (WebCore::AudioListener::positionZ): (WebCore::AudioListener::forwardX): (WebCore::AudioListener::forwardY): (WebCore::AudioListener::forwardZ): (WebCore::AudioListener::upX): (WebCore::AudioListener::upY): (WebCore::AudioListener::upZ): * Modules/webaudio/AudioListener.idl: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::constructCommon): * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::dopplerRate): * Modules/webaudio/WebKitAudioContext.h: (WebCore::WebKitAudioContext::listener): * Modules/webaudio/WebKitAudioContext.idl: * Modules/webaudio/WebKitAudioListener.h: Copied from Source/WebCore/Modules/webaudio/AudioListener.h. * Modules/webaudio/WebKitAudioListener.idl: Copied from Source/WebCore/Modules/webaudio/AudioListener.idl. * Modules/webaudio/WebKitAudioPannerNode.cpp: (WebCore::WebKitAudioPannerNode::listener): * Modules/webaudio/WebKitAudioPannerNode.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: 2020-08-04 Myles C. Maxfield Add glyph origins member to GlyphBuffer https://bugs.webkit.org/show_bug.cgi?id=215057 Reviewed by Darin Adler. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=214769 and https://bugs.webkit.org/show_bug.cgi?id=206208. The solution for https://bugs.webkit.org/show_bug.cgi?id=214769 requires applying letter-spacing after text shaping. Today, we apply letter-spacing before text shaping, which is wrong. However, if we want to apply letter-spacing after text shaping, we need to use CTFontShapeGlyphs(), which outputs glyph origins in addition to glyph advances. Adding a glyph origins field to GlyphBuffer allows us to flatten these origins at the appropriate places. This patch is meant to be applied on top of https://bugs.webkit.org/show_bug.cgi?id=215051, which decreases the inline sizes of these vector members from 2048 to 1024. I measured the median and mean of these strings in our Page Load Test to be 6 and 7.4, which indicates we were being wildly inefficient with the members of GlyphBuffer. Decreasing these inline sizes means we're now using less memory than we were before. No new tests becasue there is no behavior change yet. This patch just adds the field. The next patch will hook up CTFontShapeGlyphs() itself. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::drawText const): (WebCore::FontCascade::drawEmphasisMarks const): (WebCore::FontCascade::displayListForTextRun const): (WebCore::FontCascade::drawGlyphBuffer const): * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBufferAdvance::GlyphBufferAdvance): (WebCore::GlyphBufferOrigin::GlyphBufferOrigin): (WebCore::GlyphBufferOrigin::operator FloatPoint): (WebCore::GlyphBufferOrigin::setX): (WebCore::GlyphBufferOrigin::setY): (WebCore::GlyphBufferOrigin::x const): (WebCore::GlyphBufferOrigin::y const): (WebCore::GlyphBufferOrigin::encode const): (WebCore::GlyphBufferOrigin::decode): (WebCore::GlyphBuffer::clear): (WebCore::GlyphBuffer::origins): (WebCore::GlyphBuffer::origins const): (WebCore::GlyphBuffer::add): (WebCore::GlyphBuffer::remove): (WebCore::GlyphBuffer::makeHole): (WebCore::GlyphBuffer::shrink): (WebCore::GlyphBuffer::flatten): (WebCore::GlyphBuffer::isFlattened const): (WebCore::GlyphBuffer::swap): * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawGlyphs): * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::DrawGlyphs::generateGlyphBuffer const): 2020-08-04 Chris Fleizach AX: VoiceOver needs access to font styling at insertion point https://bugs.webkit.org/show_bug.cgi?id=215129 Reviewed by Darin Adler. Give access to relevant font styling properties at the insertion point so that VoiceOver can speak them when text commands alter styling. Test: accessibility/mac/resolved-text-editing.html * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::resolvedEditingStyles const): * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper _accessibilityResolvedEditingStyles]): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::resolvedEditingStyles const): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/mac/WebAccessibilityObjectWrapperBase.h: * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase baseAccessibilityResolvedEditingStyles]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): 2020-08-04 Peng Liu REGRESSION (r265019): ASSERTION FAILED: !m_impl || m_impl->wasConstructedOnMainThread() == isMainThread() under WebCore::PlaybackSessionInterfaceAVKit::invalidate() https://bugs.webkit.org/show_bug.cgi?id=215118 Reviewed by Jer Noble. Revert the change about using a WeakPtr of PlaybackSessionModel in r265019. On WK1, a VideoFullscreenControllerContext (a subclass of PlaybackSessionModel) object is created on the main thread, so we cannot use a WeakPtr of it on the UI thread. No new tests, fix an API test failure: WebKitLegacy.AudioSessionCategoryIOS. * platform/ios/PlaybackSessionInterfaceAVKit.h: * platform/ios/PlaybackSessionInterfaceAVKit.mm: (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit): (WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const): 2020-08-04 Chris Dumez Align AudioBufferSourceNode's start() / stop() with the specification https://bugs.webkit.org/show_bug.cgi?id=215130 Reviewed by Darin Adler. Align AudioBufferSourceNode's start() / stop() with the specification: - https://www.w3.org/TR/webaudio/#dom-audiobuffersourcenode-start - https://www.w3.org/TR/webaudio/#dom-audioscheduledsourcenode-stop In particular, we should throw a RangeError when the parameters are invalid, not an InvalidStateError. Also, we should not return early if there is no buffer. No new tests, rebaselined existing tests. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::startPlaying): * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::startLater): (WebCore::AudioScheduledSourceNode::stopLater): 2020-08-04 Andres Gonzalez Add the ability of comparing the accessibility tree with isolated tree mode on and off. https://bugs.webkit.org/show_bug.cgi?id=215000 Reviewed by Chris Fleizach. Test: accessibility/mac/isolated-tree-mode-on-off.html Added [WebAccessibilityObjectWrapper isIsolatedObject] for testing purposes, so that layout tests can determine whether an object is isolated or not. It should not be used by real clients since there should be no difference in behavior of a WebAccessibilityObjectWrapper from a client point of view, regardless the underlying object being isolated or not. * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase isIsolatedObject]): 2020-08-04 Chris Dumez Move non standard AudioBufferSourceNode API to new WebKitAudioBufferSourceNode interface https://bugs.webkit.org/show_bug.cgi?id=215106 Reviewed by Eric Carlson. Move non standard AudioBufferSourceNode API to new WebKitAudioBufferSourceNode interface to maintain backward compatibility while having an unprefixed API that matches the specification: - https://www.w3.org/TR/webaudio/#AudioBufferSourceNode In particular the 'playbackState' and 'gain' attributes should not part of the standard. Test: webaudio/audiobuffersourcenode-legacy-api.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::AudioBufferSourceNode): (WebCore::AudioBufferSourceNode::process): (WebCore::AudioBufferSourceNode::reset): * Modules/webaudio/AudioBufferSourceNode.h: (WebCore::AudioBufferSourceNode::legacyGainValue const): * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/WebKitAudioBufferSourceNode.h: Copied from Source/WebCore/Modules/webaudio/AudioBufferSourceNode.idl. * Modules/webaudio/WebKitAudioBufferSourceNode.idl: Copied from Source/WebCore/Modules/webaudio/AudioBufferSourceNode.idl. * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::createWebKitBufferSource): * Modules/webaudio/WebKitAudioContext.h: * Modules/webaudio/WebKitAudioContext.idl: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: 2020-08-04 Youenn Fablet Remove AudioSampleDataSource::setPaused https://bugs.webkit.org/show_bug.cgi?id=215125 Reviewed by Geoffrey Garen. m_paused is unused except for setting m_transitioningFromPaused. setPaused is only used in AudioMediaStreamTrackRenderCocoa at creation of the source. We can remove the call for setPaused(true) and remove setPaused/m_paused. * platform/audio/mac/AudioSampleDataSource.h: * platform/audio/mac/AudioSampleDataSource.mm: (WebCore::AudioSampleDataSource::setPaused): Deleted. * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp: (WebCore::AudioMediaStreamTrackRendererCocoa::pushSamples): 2020-08-04 Rob Buis Performance.getEntriesByName/Type should match case sensitive https://bugs.webkit.org/show_bug.cgi?id=214960 Reviewed by Youenn Fablet. Performance.getEntriesByName/Type should match case sensitive [1]. Behavior matches Firefox and Chrome. Tests: imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.html imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.worker.html [1] https://w3c.github.io/performance-timeline/#getentriesbytype-method * page/Performance.cpp: (WebCore::Performance::getEntriesByType const): (WebCore::Performance::getEntriesByName const): 2020-08-03 Simon Fraser m_isEditableRegionEnabled should be reset in didCommitLoad, not didFinishLoad https://bugs.webkit.org/show_bug.cgi?id=215115 Reviewed by Wenson Hsieh. Resetting m_isEditableRegionEnabled in didFinishLoad() is too late because inline script at the end of the (e.g. in a layout test) will have already run before the reset. Fix by adding Page::didCommitLoad() and resetting m_isEditableRegionEnabled there. * loader/FrameLoader.cpp: (WebCore::FrameLoader::dispatchDidCommitLoad): * page/Page.cpp: (WebCore::Page::didCommitLoad): (WebCore::Page::didFinishLoad): * page/Page.h: 2020-08-03 Myles C. Maxfield Unconditionally record string offsets in the fast text codepath https://bugs.webkit.org/show_bug.cgi?id=215051 Reviewed by Darin Adler. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=214769 and https://bugs.webkit.org/show_bug.cgi?id=206208. The solution for https://bugs.webkit.org/show_bug.cgi?id=214769 requires applying letter-spacing after text shaping. Today, we apply letter-spacing before text shaping, which is wrong. However, if we want to apply letter-spacing after text shaping, we will need a way of mapping back which shaped glyphs correspond to which characters in the string, so we can apply letter-spacing to the correct glyphs. Therefore, we need to record string offsets any time letter-spacing can be applied (which is all the time - letter spacing can be applied on any element). This also helps on the path toward https://bugs.webkit.org/show_bug.cgi?id=214769. When we move off the complex text codepath, we will need these string offsets to calculate things like what the text range of a selection is when the user has selected some glyphs on the page. There is no performance change because these string offsets were already being calculated; the difference is just that we're storing them now. Also, we were being wildly inefficient with the members of GlyphBuffer, giving them inline sizes of 2048. I measured the median and mean of these strings in our Page Load Test to be 6 and 7.4. So, I cut down the inline sizes down to 1024, so now we're using less memory than we were before. No new tests because there is no behavior change. The additional string offsets are unused (for now). A subsequent patch will start using them. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::layoutText const): (WebCore::FontCascade::drawEmphasisMarks const): (WebCore::computeUnderlineType): (WebCore::FontCascade::layoutSimpleText const): (WebCore::FontCascade::layoutComplexText const): (WebCore::FontCascade::dashesForIntersectionsWithRect const): * platform/graphics/FontCascade.h: * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBuffer::clear): (WebCore::GlyphBuffer::fonts): (WebCore::GlyphBuffer::offsetsInString): (WebCore::GlyphBuffer::fonts const): (WebCore::GlyphBuffer::offsetsInString const): (WebCore::GlyphBuffer::glyphAt const): (WebCore::GlyphBuffer::advanceAt const): (WebCore::GlyphBuffer::stringOffsetAt const): (WebCore::GlyphBuffer::add): (WebCore::GlyphBuffer::remove): (WebCore::GlyphBuffer::makeHole): (WebCore::GlyphBuffer::expandLastAdvance): (WebCore::GlyphBuffer::shrink): (WebCore::GlyphBuffer::swap): (WebCore::GlyphBuffer::saveOffsetsInString): Deleted. (WebCore::GlyphBuffer::offsetInString const): Deleted. 2020-08-03 Myles C. Maxfield Rename WidthIterator::m_currentCharacter to WidthIterator::m_currentCharacterIndex https://bugs.webkit.org/show_bug.cgi?id=215056 Reviewed by Darin Adler. It represents an index, not a character. No new tests because there is no behavior change. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=214769 and https://bugs.webkit.org/show_bug.cgi?id=206208. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::offsetForPositionForSimpleText const): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::advanceInternal): (WebCore::WidthIterator::advance): (WebCore::WidthIterator::advanceOneCharacter): * platform/graphics/WidthIterator.h: (WebCore::WidthIterator::currentCharacterIndex const): (WebCore::WidthIterator::currentCharacter const): Deleted. 2020-08-03 Youenn Fablet Move user gesture propagation over promise behind a feature flag https://bugs.webkit.org/show_bug.cgi?id=215014 Reviewed by Eric Carlson. If runtime flag is false, disable user gesture propagation to the next micro task. * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::queueMicrotaskToEventLoop): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::userGesturePromisePropagationEnabled const): (WebCore::RuntimeEnabledFeatures::setUserGesturePromisePropagationEnabled): 2020-08-03 Chris Dumez Add constructor for AudioBufferSourceNode https://bugs.webkit.org/show_bug.cgi?id=215096 Reviewed by Darin Adler. Add constructor for AudioBufferSourceNode as per: - https://www.w3.org/TR/webaudio/#DelayNode This patch also adds support for the detune attribute on AudioBufferSourceNode, which gets initialized by the constructor. No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::create): (WebCore::AudioBufferSourceNode::AudioBufferSourceNode): (WebCore::AudioBufferSourceNode::process): (WebCore::AudioBufferSourceNode::reset): (WebCore::AudioBufferSourceNode::totalPitchRate): * Modules/webaudio/AudioBufferSourceNode.h: * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/AudioBufferSourceOptions.h: Copied from Source/WebCore/Modules/webaudio/AudioBufferSourceNode.idl. * Modules/webaudio/AudioBufferSourceOptions.idl: Copied from Source/WebCore/Modules/webaudio/AudioBufferSourceNode.idl. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createBufferSource): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-03 Simon Fraser Add an EventRegions log channel https://bugs.webkit.org/show_bug.cgi?id=215092 Reviewed by Daniel Bates. Add a log channel for EventRegions, add logging in some interesting places. * platform/Logging.h: * rendering/EventRegion.cpp: (WebCore::EventRegion::unite): (WebCore::EventRegion::uniteTouchActions): (WebCore::EventRegion::uniteEventListeners): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::paintObject): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateEventRegion): 2020-08-03 Myles C. Maxfield Make FontCascade.drawText() return a FloatSize instead of a float https://bugs.webkit.org/show_bug.cgi?id=215055 Reviewed by Darin Adler. Advances are philosophically two-dimensional data structures. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=214769 and https://bugs.webkit.org/show_bug.cgi?id=206208. No new tests because there shouldn't be any behavior change. But in the weird rare case where there might be, we should be defensive and handle it correctly. I've never seen one of these cases, though. * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::drawElementTitle): * page/DebugPageOverlays.cpp: (WebCore::drawRightAlignedText): * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::drawText const): * platform/graphics/FontCascade.h: * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawText): (WebCore::GraphicsContext::drawBidiText): * platform/graphics/GraphicsContext.h: 2020-08-03 Tim Horton Occasional crashes when running nested runloops while using UIWebView https://bugs.webkit.org/show_bug.cgi?id=213067 Reviewed by Darin Adler. New test: WebKitLegacy.NestedRunLoopUnderRunLoopObserverDoubleUnlock * platform/ios/wak/WebCoreThread.mm: (MainRunLoopAutoUnlock): (_WebThreadAutoLock): Under certain circumstances, a CFRunLoopObserver that is already removed can fire again (e.g. when removed in a nested runloop, it can be fired again in the main runloop). The WebThread code assumes that the auto-unlock observer is called exactly once after being installed. If this is not the case, the main thread lock count can underflow, wreaking havoc the next time we try to lock. Instead of depending on CFRunLoop to do this for us, make it explicit with a global boolean. This leaves in place the somewhat-odd behavior that running a nested runloop can cause the main runloop's WebThread lock to be dropped, because a great deal of code (and tests) depend on this behavior (keeping the lock held until the outer runloop spins would result in deadlock if the inner runloop's loop condition depends on the WebThread being able to execute code). However, this is not unique to this underflow case, and appears to be extremely long-standing behavior, so maintaining it seems the best course of action. 2020-08-03 Wenson Hsieh Remove the ENABLE_DATA_INTERACTION feature flag https://bugs.webkit.org/show_bug.cgi?id=215091 Reviewed by Megan Gardner. `ENABLE(DATA_INTERACTION)` is an alias for `PLATFORM(IOS_FAMILY) && ENABLE(DRAG_SUPPORT)`. It was used early on when bringing drag and drop support to iPad in order to hide the feature from open source WebKit code, and has not been necessary for several years. * page/DragController.cpp: (WebCore::DragController::shouldUseCachedImageForDragImage const): * page/DragController.h: (WebCore::DragController::canLoadDataFromDraggingPasteboard const): * page/EventHandler.cpp: (WebCore::EventHandler::dragCancelled): (WebCore::EventHandler::didStartDrag): * page/FocusController.cpp: (WebCore::shouldClearSelectionWhenChangingFocusedElement): * page/mac/DragControllerMac.mm: * platform/DragImage.cpp: * platform/ios/WebItemProviderPasteboard.mm: 2020-08-03 Chris Dumez Add constructor for GainNode https://bugs.webkit.org/show_bug.cgi?id=215093 Reviewed by Eric Carlson. Add constructor for GainNode as per: - https://www.w3.org/TR/webaudio/#gainnode No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createGain): * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::create): (WebCore::GainNode::GainNode): (WebCore::GainNode::process): (WebCore::GainNode::reset): * Modules/webaudio/GainNode.h: * Modules/webaudio/GainNode.idl: * Modules/webaudio/GainOptions.h: Copied from Source/WebCore/Modules/webaudio/GainNode.idl. * Modules/webaudio/GainOptions.idl: Copied from Source/WebCore/Modules/webaudio/GainNode.idl. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-03 Chris Dumez Add constructor to DelayNode https://bugs.webkit.org/show_bug.cgi?id=215083 Reviewed by Eric Carlson. Add constructor to DelayNode: - https://www.w3.org/TR/webaudio/#DelayNode No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createDelay): * Modules/webaudio/DelayDSPKernel.cpp: (WebCore::DelayDSPKernel::process): * Modules/webaudio/DelayNode.cpp: (WebCore::DelayNode::DelayNode): (WebCore::DelayNode::create): (WebCore::DelayNode::delayTime): * Modules/webaudio/DelayNode.h: * Modules/webaudio/DelayNode.idl: * Modules/webaudio/DelayOptions.h: Copied from Source/WebCore/Modules/webaudio/DelayNode.idl. * Modules/webaudio/DelayOptions.idl: Copied from Source/WebCore/Modules/webaudio/DelayNode.idl. * Modules/webaudio/DelayProcessor.cpp: (WebCore::DelayProcessor::DelayProcessor): * Modules/webaudio/DelayProcessor.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-03 Myles C. Maxfield Make WidthIterator::advance() return void https://bugs.webkit.org/show_bug.cgi?id=215053 Reviewed by Darin Adler. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=214769 and https://bugs.webkit.org/show_bug.cgi?id=206208. This is a small simplification in the fast text codepath. It used to return how many characters were consumed. However, this information is already exposed by just calling currentCharacter() on the width iterator before and after calling advance(). No new tests because there is no behavior change. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::drawText const): (WebCore::FontCascade::displayListForTextRun const): (WebCore::FontCascade::layoutSimpleText const): (WebCore::FontCascade::adjustSelectionRectForSimpleText const): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::advanceInternal): (WebCore::WidthIterator::advance): * platform/graphics/WidthIterator.h: * rendering/svg/SVGTextMetricsBuilder.cpp: (WebCore::SVGTextMetricsBuilder::advanceSimpleText): 2020-08-03 Youenn Fablet MediaRecorderPrivateWriter should ensure its writer input is ready for more data before appending new samples https://bugs.webkit.org/show_bug.cgi?id=215081 Reviewed by Eric Carlson. After r265192, we were checking whether the writer input was ready. If so, we were pushing pending samples and then the new sample. The issue is that pushing pending samples might make the writer input no longer ready. Update the code to enqueue the sample if its writer input is not ready. Add an ASSERT in appendCompressedVideoSampleBuffer to make sure this is the case. Also make sure that we only enqueue the end of segment sample if video writer input is ready. Make sure flushCompressedSampleBuffers is called directly by stopRecording only if not already flushing samples. If we are not flushing, we proceed with the stop steps. If not, we wait for the end of flushCompressedSampleBuffers to proceed with the stop steps. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::appendCompressedAudioSampleBufferIfPossible): (WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBufferIfPossible): (WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBuffer): (WebCore::MediaRecorderPrivateWriter::flushCompressedSampleBuffers): (WebCore::MediaRecorderPrivateWriter::stopRecording): (WebCore::MediaRecorderPrivateWriter::finishedFlushingSamples): (WebCore::MediaRecorderPrivateWriter::doStopRecording): 2020-08-03 Clark Wang Added AudioBuffer Constructor https://bugs.webkit.org/show_bug.cgi?id=214990 Reviewed by Chris Dumez. Added AudioBuffer constructor according to spec: https://www.w3.org/TR/webaudio/#AudioBuffer-constructors. Added in AudioBufferOptions files. Updated BaseAudioContext::createBuffer to use new constructor. Re-baselined existing tests. Some fail now due to unsupported sampleRate. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioBuffer.cpp: (WebCore::AudioBuffer::create): (WebCore::AudioBuffer::AudioBuffer): * Modules/webaudio/AudioBuffer.h: * Modules/webaudio/AudioBuffer.idl: * Modules/webaudio/AudioBufferOptions.h: Added. * Modules/webaudio/AudioBufferOptions.idl: Added. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createBuffer): * Modules/webaudio/BaseAudioContext.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-03 Kenneth Russell [WebGL2] webgl/2.0.0/conformance[2]/textures/image_bitmap* failures https://bugs.webkit.org/show_bug.cgi?id=211484 Reviewed by Dean Jackson. Implement ImageBitmapOptions' ImageOrientation and PremultiplyAlpha settings. ImageOrientation="flipY" is supported directly while constructing ImageBitmap's representation, ImageBuffer. PremultiplyAlpha="premultiply" can not be supported via ImageBuffer's graphics operations, so this attribute is stored on ImageBitmap, serialized and deserialized when ImageBitmap is transferred, and handled in the WebGL implementation. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::dumpImageBitmap): (WebCore::CloneDeserializer::deserialize): (WebCore::CloneDeserializer::CloneDeserializer): (WebCore::CloneDeserializer::readImageBitmap): (WebCore::SerializedScriptValue::SerializedScriptValue): * bindings/js/SerializedScriptValue.h: (WebCore::SerializedScriptValue::SerializedScriptValue): * html/ImageBitmap.cpp: (WebCore::ImageBitmap::create): (WebCore::ImageBitmap::detachBitmaps): (WebCore::imageOrientationForOrientation): (WebCore::ImageBitmap::createPromise): (WebCore::ImageBitmap::createFromBuffer): * html/ImageBitmap.h: * html/OffscreenCanvas.cpp: (WebCore::OffscreenCanvas::transferToImageBitmap): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::texImageSourceHelper): * platform/graphics/ImageBuffer.h: 2020-08-03 Brian Burg [WebDriver] window.print should not invoke native UI https://bugs.webkit.org/show_bug.cgi?id=215084 Reviewed by Devin Rousso. This could be handled at a higher level if there is a valid use case to allow printing, but I'm not aware of one. For now, this fixes a script evaluation hang on Mac and iOS. * page/DOMWindow.cpp: (WebCore::DOMWindow::print): Don't call out to print delegates if this is a WebDriver-controlled page. 2020-08-03 Rob Buis Remove unused API in HighlightMap https://bugs.webkit.org/show_bug.cgi?id=215078 Reviewed by Sam Weinig. Remove unused API in HighlightMap, this is probably not needed anymore since the maplike code changed at some point. * Modules/highlight/HighlightMap.cpp: (WebCore::HighlightMap::getGroupForKey): Deleted. * Modules/highlight/HighlightMap.h: 2020-08-03 James Darpinian [WebGL2] Assert when restoring lost context https://bugs.webkit.org/show_bug.cgi?id=214999 Reviewed by Darin Adler. Remove an assert that was wrong when restoring a lost context. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::initializeVertexArrayObjects): 2020-08-03 Adrian Perez de Castro Non-unified build fixes, early August 20202 edition https://bugs.webkit.org/show_bug.cgi?id=215082 Unreviewed build fix. No new tests needed. * accessibility/AccessibilityRenderObject.cpp: Add missing inclusion of Range.h. * dom/RadioButtonGroups.cpp: Ditto. * editing/Editing.cpp: Ditto. * editing/EditingStyle.cpp: Ditto. * editing/EditorCommand.cpp: Ditto. * editing/FrameSelection.cpp: Ditto. * editing/TypingCommand.cpp: Ditto. * editing/VisiblePosition.cpp: Add missing inclusion of SimpleRange.h. * rendering/HitTestResult.cpp: Add missing inclusion of Range.h. 2020-08-03 Antti Koivisto REGRESSION(r259585) Text decoration color with value currentColor miscomputed in some cases https://bugs.webkit.org/show_bug.cgi?id=215079 Reviewed by Zalan Bujtas. r259585 did some refactoring that broke a special case where text decoration color comes from '-webkit-text-fill-color' property. Test: fast/text/text-decoration-currentcolor-fill-color.html * rendering/TextDecorationPainter.cpp: (WebCore::TextDecorationPainter::decorationColor): Move resolving currentColor to RenderStyle. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::colorResolvingCurrentColor const): Handle CSSPropertyTextDecorationColor as a special case here. (WebCore::RenderStyle::visitedDependentColor const): 2020-08-03 Clark Wang Added Constructor to AnalyserNode https://bugs.webkit.org/show_bug.cgi?id=215040 Reviewed by Chris Dumez. Introduced AnalyserNode constructor and AnalyserOptions according to spec: https://www.w3.org/TR/webaudio/#AnalyserNode-constructors. Re-baselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::create): (WebCore::AnalyserNode::AnalyserNode): (WebCore::AnalyserNode::setFftSize): (WebCore::AnalyserNode::setMinMaxDecibels): (WebCore::AnalyserNode::setMinDecibels): (WebCore::AnalyserNode::setMaxDecibels): * Modules/webaudio/AnalyserNode.h: * Modules/webaudio/AnalyserNode.idl: * Modules/webaudio/AnalyserOptions.h: Added. * Modules/webaudio/AnalyserOptions.idl: Added. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createAnalyser): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-03 Youenn Fablet MediaRecorderPrivateWriter::appendEndOfVideoSampleDurationIfNeeded should only call requestMediaDataWhenReadyOnQueue once https://bugs.webkit.org/show_bug.cgi?id=214972 Reviewed by Eric Carlson. When processing a compressed sample, pass it to the writer if its ready. Otherwise buffer it and retry passing it to the writer next time we have a sample. When finishing a write, we call requestMediaDataWhenReadyOnQueue to finish passing samples that are still enqueued. Covered by existing tests no longer triggering ObjC exception. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::appendCompressedAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBufferIfPossible): (WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendCompressedSampleBuffers): (WebCore::MediaRecorderPrivateWriter::finishAppendingCompressedAudioSampleBuffers): (WebCore::MediaRecorderPrivateWriter::finishAppendingCompressedVideoSampleBuffers): (WebCore::MediaRecorderPrivateWriter::flushCompressedSampleBuffers): 2020-08-02 Darin Adler Remove some member functions of Range and many calls to createLiveRange https://bugs.webkit.org/show_bug.cgi?id=215070 Reviewed by Sam Weinig. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::nextBoundary): Remove createLiveRange. (WebCore::AXObjectCache::previousBoundary): Ditto. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper _convertToNSRange:]): Take SimpleRange. (-[WebAccessibilityObjectWrapper positionForTextMarker:]): Remove createLiveRange. (-[WebAccessibilityObjectWrapper textRectsFromMarkers:withText:]): Ditto. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper _convertToNSRange:]): Take SimpleRange. (-[WebAccessibilityObjectWrapper _indexForTextMarker:]): Remove createLiveRange. (-[WebAccessibilityObjectWrapper _textMarkerForIndex:]): Ditto. * dom/DocumentMarkerController.cpp: (WebCore::updateRenderedRectsForMarker): Renamed range to makeSimpleRange. (WebCore::makeSimpleRange): Ditto. * dom/DocumentMarkerController.h: Update for the above. * dom/Range.cpp: (WebCore::Range::text const): Use makeSimpleRange. (WebCore::Range::shadowRoot const): Deleted. (WebCore::intervalsSufficientlyOverlap): Deleted. (WebCore::adjustLineHeightOfSelectionRects): Deleted. (WebCore::coalesceSelectionRects): Deleted. (WebCore::Range::collectSelectionRectsWithoutUnionInteriorLines const): Deleted. (WebCore::Range::collectSelectionRects const): Deleted. * dom/Range.h: Update for the above. Also make pastLastNode private since it is only used inside the Range class's implementation. * dom/SimpleRange.cpp: (WebCore::SimpleRange::SimpleRange): Removed overload that takes a Range. * dom/SimpleRange.h: Update for the above. Removed both constructor overloads that take a Range. * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::timerFired): Remove createLiveRange. (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord): Use makeSimpleRange. (WebCore::AlternativeTextController::applyAlternativeTextToRange): Remove createLiveRange. * editing/EditingStyle.cpp: (WebCore::EditingStyle::styleAtSelectionStart): Remove createLiveRange. * editing/Editor.cpp: (WebCore::Editor::performCutOrCopy): Ditto. (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Ditto. (WebCore::Editor::replaceRangeForSpellChecking): Ditto. (WebCore::correctSpellcheckingPreservingTextCheckingParagraph): Ditto. (WebCore::Editor::changeBackToReplacedString): Ditto. (WebCore::Editor::countMatchesForText): Ditto. * editing/InsertListCommand.cpp: (WebCore::InsertListCommand::doApply): Ditto. (WebCore::InsertListCommand::doApplyForSingleParagraph): Change out argument type to SimpleRange. * editing/InsertListCommand.h: Update for above. * editing/SpellChecker.cpp: (WebCore::SpellChecker::isCheckable const): Rewrite questionable logic to use intersectingNodes instead of firstNode. * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingHelper::findUngrammaticalPhrases const): Remove createLiveRange. * editing/TypingCommand.cpp: (WebCore::TypingCommand::deleteKeyPressed): Ditto. (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto. * editing/markup.cpp: (WebCore::createFragmentFromText): Ditto. * editing/ios/EditorIOS.mm: (WebCore::Editor::setTextAsChildOfElement): Use makeRangeSelectingNodeContents. * editing/win/EditorWin.cpp: (WebCore::Editor::pasteWithPasteboard): Remove createLiveRange. * page/DOMSelection.cpp: (WebCore::DOMSelection::addRange): Use makeSimpleRange. (WebCore::DOMSelection::deleteFromDocument): Remove createLiveRange. * page/DragController.cpp: (WebCore::documentFragmentFromDragData): Take SimpleRange. (WebCore::DragController::concludeEditDrag): Remove createLiveRange. (WebCore::DragController::startDrag): Ditto. * page/TextIndicator.cpp: (WebCore::selectionRects): Deleted. (WebCore::initializeIndicator): Call collectSelectionRects directly here, avoiding createLiveRange and using map to convert from Vector to Vector. * page/ios/FrameIOS.mm: (WebCore::Frame::interpretationsForCurrentRoot const): Use makeSimpleRange. * platform/DragImage.cpp: (WebCore::createDragImageForRange): Take SimpleRange. * platform/DragImage.h: Update createDragImageForRange to take SimpleRange. * platform/Pasteboard.h: Updated Windows-only layering-violating functions to take SimpleRange. * platform/ios/DragImageIOS.mm: (WebCore::createDragImageForRange): Take SimpleRange. * platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::writeRangeToDataObject): Take SimpleRange. (WebCore::Pasteboard::writeSelection): Ditto. (WebCore::Pasteboard::documentFragment): Ditto. * rendering/RenderObject.cpp: (WebCore::intervalsSufficientlyOverlap): Added. Moved from Range. Mostly unchanged but uses SimpleRange now instead of a live range, and intersectingNodes instead of a loop using firstNode and pastLastNode. (WebCore::adjustLineHeightOfSelectionRects): Ditto. (WebCore::coalesceSelectionRects): Ditto. (WebCore::RenderObject::collectSelectionRectsWithoutUnionInteriorLines): Ditto. (WebCore::RenderObject::collectSelectionRectsInternal): Ditto. (WebCore::RenderObject::collectSelectionRects): Ditto. * rendering/RenderObject.h: Update for above. * testing/Internals.cpp: (WebCore::Internals::markerRangeForNode): Use makeSimplRange. (WebCore::Internals::locationFromRange): Ditto. (WebCore::Internals::lengthFromRange): Ditto. (WebCore::Internals::rangeAsTextUsingBackwardsTextIterator): Ditto. (WebCore::Internals::subrange): Ditto. (WebCore::Internals::rangeOfStringNearLocation): Ditto. (WebCore::Internals::textIndicatorForRange): Ditto. 2020-08-02 Wenson Hsieh Table data is incorrectly translated in some articles on en.wikipedia.org https://bugs.webkit.org/show_bug.cgi?id=215071 Reviewed by Darin Adler. Text in table cells sometimes end up in adjacent cells after translation, since adjacent cells are currently extracted as different tokens in a single item; mitigate this by splitting text in table cells into different text manipulation items instead. Test: TextManipulation.StartTextManipulationExtractsTableCellsAsSeparateItems * editing/TextManipulationController.cpp: (WebCore::isEnclosingItemBoundaryElement): 2020-08-01 Rob Buis Remove superfluous ResourceTiming constructor overload https://bugs.webkit.org/show_bug.cgi?id=215063 Reviewed by Sam Weinig. Remove superfluous ResourceTiming constructor overload, we can just call another overload from ResourceTiming::fromLoad. * loader/ResourceTiming.cpp: (WebCore::ResourceTiming::fromLoad): * loader/ResourceTiming.h: 2020-08-01 Brady Eidson Special HID mapping for the Logitech F310/F710 controllers. https://bugs.webkit.org/show_bug.cgi?id=215050 Reviewed by Tim Horton. Covered by API test. These two controllers match the standard mapping perfectly. Easy to support. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/gamepad/KnownGamepads.h: * platform/gamepad/mac/GamepadConstantsMac.h: * platform/gamepad/mac/HIDGamepad.cpp: (WebCore::HIDGamepad::create): * platform/gamepad/mac/HIDGamepadElement.cpp: (WebCore::HIDGamepadElement::HIDGamepadElement): * platform/gamepad/mac/HIDGamepadElement.h: (WebCore::HIDGamepadElement::isAxis const): * platform/gamepad/mac/LogitechGamepad.cpp: Added. (WebCore::LogitechGamepadHatswitch::gamepadValueChanged): (WebCore::LogitechGamepad::LogitechGamepad): * platform/gamepad/mac/LogitechGamepad.h: 2020-08-01 Joonghun Park Unreviewed. Remove the build warnings below since r265150. warning: unused parameter ‘foo’ [-Wunused-parameter] No new tests, no new behaviors. * workers/service/server/SWServerJobQueue.cpp: (WebCore::doCertificatesMatch): 2020-08-01 Brady Eidson Special HID mapping for the Google Stadia controller https://bugs.webkit.org/show_bug.cgi?id=215061 Reviewed by Tim Horton. New API test coverage. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/gamepad/GamepadConstants.h: * platform/gamepad/KnownGamepads.h: * platform/gamepad/mac/GamepadConstantsMac.h: * platform/gamepad/mac/HIDGamepad.cpp: (WebCore::HIDGamepad::create): * platform/gamepad/mac/HIDGamepadElement.cpp: (WebCore::HIDGamepadElement::HIDGamepadElement): (WebCore::HIDGamepadHatswitch::gamepadValueChanged): (WebCore::HIDGamepadHatswitch::normalizedValue): * platform/gamepad/mac/HIDGamepadElement.h: (WebCore::HIDGamepadElement::isAxis const): (WebCore::HIDGamepadHatswitch::HIDGamepadHatswitch): * platform/gamepad/mac/StadiaHIDGamepad.cpp: Added. (WebCore::StadiaHIDGamepad::StadiaHIDGamepad): * platform/gamepad/mac/StadiaHIDGamepad.h: 2020-08-01 Sam Weinig Convert LinkHeader to use StringParsingBuffer https://bugs.webkit.org/show_bug.cgi?id=215017 Reviewed by Darin Adler. Update LinkHeader parsing to use StringParsingBuffer and do some light cleanup. * loader/LinkHeader.cpp: (WebCore::isSpaceOrTab): (WebCore::isNotURLTerminatingChar): (WebCore::isValidParameterNameChar): (WebCore::isParameterValueEnd): (WebCore::isParameterValueChar): (WebCore::findURLBoundaries): (WebCore::invalidParameterDelimiter): (WebCore::validFieldEnd): (WebCore::parseParameterDelimiter): (WebCore::paramterNameFromString): (WebCore::parseParameterName): (WebCore::skipQuotesIfNeeded): (WebCore::parseParameterValue): (WebCore::findNextHeader): (WebCore::LinkHeader::LinkHeader): (WebCore::LinkHeaderSet::LinkHeaderSet): (WebCore::LinkHeaderSet::init): Deleted. * loader/LinkHeader.h: 2020-08-01 Darin Adler Remove Range::create and many more uses of live ranges https://bugs.webkit.org/show_bug.cgi?id=215004 Reviewed by Sam Weinig. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange const): Use makeSimpleRange. * accessibility/atk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::nodeTextChangePlatformNotification): Use SimpleRange. * accessibility/atk/WebKitAccessibleHyperlink.cpp: (rangeLengthForObject): Take SimpleRange. (webkitAccessibleHyperlinkGetStartIndex): Use makeSimpleRange. (webkitAccessibleHyperlinkGetEndIndex): Ditto. * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (getSelectionOffsetsForObject): Ditto. * accessibility/atk/WebKitAccessibleUtil.cpp: (objectFocusedAndCaretOffsetUnignored): Ditto. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (+[WebAccessibilityTextMarker startOrEndTextMarkerForRange:isStart:cache:]): Take SimpleRange. (-[WebAccessibilityObjectWrapper arrayOfTextForTextMarkers:attributed:]): Use makeSimpleRange. (-[WebAccessibilityObjectWrapper _convertToDOMRange:]): Return SimpleRange. (-[WebAccessibilityObjectWrapper textMarkerRange]): Remove createLiveRange. (-[WebAccessibilityObjectWrapper textMarkerForPosition:]): Use auto. (-[WebAccessibilityObjectWrapper misspellingTextMarkerRange:forward:]): Remove createLiveRange. (-[WebAccessibilityObjectWrapper rangeFromMarkers:withText:]): Return SimpleRange. (-[WebAccessibilityObjectWrapper textRectsFromMarkers:withText:]): Add createLiveRange. (-[WebAccessibilityObjectWrapper rangeForTextMarkers:]): Return SimpleRange. (-[WebAccessibilityObjectWrapper startOrEndTextMarkerForTextMarkers:isStart:]): Use auto. (-[WebAccessibilityObjectWrapper textMarkerRangeForMarkers:]): Get rid of local. (-[WebAccessibilityObjectWrapper textMarkersForRange:]): Take SimpleRange. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (accessibilityTextOperationForParameterizedAttribute): Remove makeSimpleRange. (accessibilityMisspellingSearchCriteriaForParameterizedAttribute): Return SimpleRange. (-[WebAccessibilityObjectWrapper textMarkerRangeFromRange:]): Take SimpleRange. (textMarkerRangeFromRange): Ditto. (-[WebAccessibilityObjectWrapper startOrEndTextMarkerForRange:isStart:]): Ditto. (startOrEndTextmarkerForRange): Return SimpleRange. (-[WebAccessibilityObjectWrapper rangeForTextMarkerRange:]): Ditto. (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]): Use auto. (-[WebAccessibilityObjectWrapper doAXAttributedStringForRange:]): Remove createLiveRange. (-[WebAccessibilityObjectWrapper textMarkerRangeAtTextMarker:forUnit:]): Ditto. (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): Ditto. * dom/DocumentMarkerController.cpp: (WebCore::updateRenderedRectsForMarker): Use document marker range function. (WebCore::range): Added. * dom/DocumentMarkerController.h: Update for above. * dom/Position.cpp: Removed unneeded Range.h include. * dom/Range.cpp: (WebCore::Range::Range): Removed unused overload that takes start/end. (WebCore::Range::create): Removed overloads that take start/end. (WebCore::Range::setStart): Removed overload that takes Position. (WebCore::Range::setEnd): Ditto. (WebCore::Range::cloneRange const): Rewrote to use setStart/End since that's what the constructor used to do. (WebCore::Range::contains const): Use SimpleRange/createLiveRange instead of makeRange. Soon this function will be deleted. (WebCore::rangeOfContents): Deleted. (WebCore::createLiveRange): Rewrote to use setStart/End since that's what the constructor used to do. * dom/Range.h: Update for above removals. * dom/SimpleRange.h: Export commonInclusiveAncestor for use outside WebCore. * dom/StaticRange.cpp: (WebCore::StaticRange::create): Added overload that copies the SimpleRange. * dom/StaticRange.h: Update for above. * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord): Use document marker range function. * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle): Use makeSimpleRange. * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::mergeParagraphs): Ditto. (WebCore::DeleteSelectionCommand::originalStringForAutocorrectionAtBeginningOfSelection): Ditto. * editing/EditingStyle.cpp: (WebCore::EditingStyle::textDirectionForSelection): Use makeSimpleRange and intersectingNodes. * editing/Editor.cpp: (WebCore::Editor::replaceSelectionWithFragment): Use makeRangeSelectingNodeContents. (WebCore::Editor::updateMarkersForWordsAffectedByEditing): Use makeSimpleRange. (WebCore::Editor::transpose): Ditto. (WebCore::Editor::rangeOfString): Use makeRangeSelectingNodeContents. (WebCore::Editor::handleAcceptedCandidate): Update since rangeForTextCheckingResult now returns an Optional. * editing/FrameSelection.cpp: (WebCore::FrameSelection::selectRangeOnElement): Use SimpleRange. * editing/ReplaceRangeWithTextCommand.cpp: (WebCore::ReplaceRangeWithTextCommand::ReplaceRangeWithTextCommand): Take SimpleRange. (WebCore::ReplaceRangeWithTextCommand::willApplyCommand): Update since m_rangeToBeReplaced is a SimpleRange. (WebCore::ReplaceRangeWithTextCommand::doApply): Ditto. (WebCore::ReplaceRangeWithTextCommand::targetRanges const): Ditto. * editing/ReplaceRangeWithTextCommand.h: Update for above. * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::insertedContentRange const): Return a SimpleRange. * editing/ReplaceSelectionCommand.h: Update for above. * editing/SpellingCorrectionCommand.cpp: (WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand): Take a SimpleRange. (WebCore::SpellingCorrectionCommand::create): Moved here from header. * editing/SpellingCorrectionCommand.h: Update for above. * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingHelper::findFirstMisspelledWordOrUngrammaticalPhrase const): Use makeSimpleRange. * editing/TypingCommand.cpp: (WebCore::TypingCommand::markMisspellingsAfterTyping): Use makeSimpleRange. (WebCore::TypingCommand::willAddTypingToOpenCommand): Take SimpleRange. (WebCore::TypingCommand::deleteKeyPressed): Remove createLiveRange. (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto. * editing/TypingCommand.h: Update for above. * editing/VisiblePosition.cpp: (WebCore::makeRange): Deleted. (WebCore::startVisiblePosition): Deleted. (WebCore::endVisiblePosition): Deleted. (WebCore::setStart): Deleted. (WebCore::setEnd): Deleted. * editing/VisiblePosition.h: Update for above. Also export makeSimpleRange for use outside WebCore. * editing/VisibleUnits.cpp: (WebCore::suffixLengthForRange): Take SimpleRange. (WebCore::prefixLengthForRange): Ditto. (WebCore::previousBoundary): Use makeSimpleRange. (WebCore::nextBoundary): Ditto. * editing/VisibleUnits.h: Update for above. * editing/cocoa/DataDetection.mm: (WebCore::buildQuery): Remove unused local variable. * editing/ios/EditorIOS.mm: (WebCore::Editor::setDictationPhrasesAsChildOfElement): Use makeRangeSelectingNodeContents. * page/DOMSelection.cpp: (WebCore::DOMSelection::getRangeAt): Use createLiveRange. * page/DragController.cpp: (WebCore::DragController::insertDroppedImagePlaceholdersAtCaret): Remove makeSimpleRange. * page/Frame.cpp: (WebCore::Frame::rangeForPoint): Return SimpleRange. * page/Frame.h: Update for above. * page/ios/FrameIOS.mm: (WebCore::Frame::interpretationsForCurrentRoot const): Use makeRangeSelectingNodeContents, intersectingNodes, and makeSimpleRange. * testing/Internals.cpp: (WebCore::Internals::markerRangeForNode): Use createLiveRange and the document marker range function. 2020-07-31 Jer Noble [Mac] AudioSessionRoutingArbitrator causes a launch time regression checking for CoreAudio muted state https://bugs.webkit.org/show_bug.cgi?id=214993 Reviewed by Eric Carlson. The initial query of isMuted() is only there to tell whether, when we get a notification that the mute state changed, whether our internal state is dirty and we need to fire a notification. Instead, replace the bool member with an Optional, so we know we need to fire a changed notification whenever the first mute state change comes in. * platform/audio/mac/AudioSessionMac.mm: (WebCore::AudioSession::AudioSession): (WebCore::AudioSession::handleMutedStateChange): (WebCore::AudioSessionPrivate::AudioSessionPrivate): Deleted. 2020-07-31 Jer Noble Unreviewed Windows build fix after r265167; add some missing includes. * page/Screen.cpp: 2020-07-31 Myles C. Maxfield Clean up text layout code a bit https://bugs.webkit.org/show_bug.cgi?id=215013 Reviewed by Zalan Bujtas. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=214769. See file-specific ChangeLog entries for more information. No tests because there is no behavior change. * platform/graphics/Font.h: Remove unnecessary declaration. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::layoutText const): Rename glyphBufferForTextRun() to layoutText(). Also, make it return a GlyphBuffer instead of taking a GlyphBuffer as an out param. Its previous return, the initial advance, is now returned in GlyphBuffer::initialAdvance. (WebCore::FontCascade::drawText const): Update to new signature of layoutText(). (WebCore::FontCascade::drawEmphasisMarks const): Inline drawEmphasisMarksForSimpleText() and drawEmphasisMarksForComplexText(), since they're nearly identical. Update to the new signature of layoutText(). (WebCore::FontCascade::displayListForTextRun const): Update to the new signature of layoutText(). (WebCore::FontCascade::layoutSimpleText const): Make this return a new GlyphBuffer, instead of taking one as an out param. Also, use accessors of WidthIterator instead of reaching into its guts. The previous return value is now returned in GlyphBuffer::initialAdvance. (WebCore::FontCascade::layoutComplexText const): Ditto. (WebCore::FontCascade::floatWidthForSimpleText const): Use accessors of WidthIterator instead of reaching into its guts. (WebCore::FontCascade::adjustSelectionRectForSimpleText const): Ditto. (WebCore::FontCascade::offsetForPositionForSimpleText const): Ditto. (WebCore::FontCascade::dashesForIntersectionsWithRect const): Same as FontCascade::drawEmphasisMarks() above. (WebCore::FontCascade::glyphBufferForTextRun const): Renamed to layoutText(). (WebCore::FontCascade::getGlyphsAndAdvancesForSimpleText const): Renamed to layoutSimpleText(). (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText const): Renamed to layoutComplexText(). (WebCore::FontCascade::drawEmphasisMarksForSimpleText const): Inlined into drawEmphasisMarks(). (WebCore::FontCascade::drawEmphasisMarksForComplexText const): Ditto. * platform/graphics/FontCascade.h: * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBufferAdvance::GlyphBufferAdvance): (WebCore::GlyphBufferAdvance::operator FloatSize): * platform/graphics/TextRun.h: Remove unnecessary declaration. * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::WidthIterator): Update for changes to WidthIterator.h * platform/graphics/WidthIterator.h: Rearrange the class members to sort them by size, to get better packing. Also, make all member variables private, and initialize them all with { } syntax. (WebCore::WidthIterator::finalRoundingWidth const): (WebCore::WidthIterator::currentCharacter const): * rendering/svg/SVGTextMetrics.cpp: Remove unnecessary include. 2020-07-31 Chris Dumez Add OfflineAudioCompletionEvent constructor https://bugs.webkit.org/show_bug.cgi?id=214994 Reviewed by Eric Carlson. Add OfflineAudioCompletionEvent constructor, as per: - https://www.w3.org/TR/webaudio/#OfflineAudioCompletionEvent Test: webaudio/OfflineAudioCompletionEvent-constructor.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::finishedRendering): * Modules/webaudio/OfflineAudioCompletionEvent.cpp: (WebCore::OfflineAudioCompletionEvent::create): (WebCore::OfflineAudioCompletionEvent::OfflineAudioCompletionEvent): * Modules/webaudio/OfflineAudioCompletionEvent.h: * Modules/webaudio/OfflineAudioCompletionEvent.idl: * Modules/webaudio/OfflineAudioCompletionEventInit.h: Copied from Source/WebCore/Modules/webaudio/OfflineAudioCompletionEvent.idl. * Modules/webaudio/OfflineAudioCompletionEventInit.idl: Copied from Source/WebCore/Modules/webaudio/OfflineAudioCompletionEvent.idl. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-07-31 Jer Noble [Mac] YouTube does not offer HDR variants to devices which support HDR https://bugs.webkit.org/show_bug.cgi?id=215022 Reviewed by Eric Carlson. Test: platform/mac/media/media-source/is-type-supported-vp9-codec-check.html There are three separate issues which block YouTube from offering HDR: 1) YouTube checks both valid and invalid VP9 strings through MediaSource.isTypeSupported(), and UAs which answer `true` to even invalid VP9 strings are blocked from HDR. To solve this, we will now send isTypeSupported() through the same code path as Media Capabilities. 2) YouTube's standard valid and invalid VP9 strings do not include the fullRangeVideoFlag field, which would normally be tossed as invalid. We shouldn't relax our requirements globally, so we will add a Quirk which relaxes the requriement that VP9 strings contain a fullRangeVideoFlag. 3) YouTube's HDR query checks that window.screen.pixelDepth is > 24. We obviously don't want to change the value of this field globally, so we will add separate Quirk which sets window.screen.pixelDepth to 25 (a totally nonsensical value) when HDR is available. Each of these Quirks has a path towards removal for YouTube. The fullRangeVideoFlag field involves YouTube updating their compatibility check to inculde the fullRangeVideoFlag. The pixelDepth check can be replaced by the `dynamic-range:high` Media Query. * Modules/mediasource/MediaSource.cpp: (WebCore::addVP9FullRangeVideoFlagToContentType): (WebCore::MediaSource::addSourceBuffer): (WebCore::MediaSource::removeSourceBuffer): (WebCore::MediaSource::isTypeSupported): (WebCore::MediaSource::onReadyStateChange): (WebCore::MediaSource::activeRanges const): * Modules/mediasource/MediaSource.h: * page/Quirks.cpp: (WebCore::Quirks::needsVP9FullRangeFlagQuirk const): (WebCore::Quirks::needsHDRPixelDepthQuirk const): * page/Quirks.h: * page/Screen.cpp: (WebCore::Screen::pixelDepth const): * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::isContentTypeSupported): * platform/graphics/cocoa/VP9UtilitiesCocoa.h: * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: (WebCore::isVPCodecConfigurationRecordSupported): (WebCore::validateVPParameters): 2020-07-31 Chris Dumez Add linked-on-after check to keep WebSQL working in UIWebView until apps are rebuilt with iOS 14 SDK https://bugs.webkit.org/show_bug.cgi?id=215035 Reviewed by Tim Horton. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isJesusCalling): Deleted. (WebCore::IOSApplication::isFudget): Deleted. (WebCore::IOSApplication::isFamilyHealthApp): Deleted. Drop code that is no longer needed. 2020-07-31 Brady Eidson Log a warning to the dev console when gamepads are accessed from an insecure context. https://bugs.webkit.org/show_bug.cgi?id=214995 Reviewed by Tim Horton. Test: http/tests/misc/gamepads-insecure.html * Modules/gamepad/NavigatorGamepad.cpp: (WebCore::NavigatorGamepad::getGamepads): Insecure contexts should log that getGamepads() will be going away in a future release. Just do it once, because getGamepads() is called frequently. 2020-07-31 Aditya Keerthi [macOS] Date/time input types should have a textfield appearance https://bugs.webkit.org/show_bug.cgi?id=214978 Reviewed by Wenson Hsieh. On iOS, date/time input types have a menulist-button appearance. However, this appearance does not match the style of native date controls on macOS. The textfield appearance with no focus ring brings us closer to a natively styled control. * rendering/RenderTheme.h: * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::dateInputStyleSheet const): (WebCore::RenderThemeMac::dateTimeLocalInputStyleSheet const): (WebCore::RenderThemeMac::monthInputStyleSheet const): (WebCore::RenderThemeMac::timeInputStyleSheet const): (WebCore::RenderThemeMac::weekInputStyleSheet const): 2020-07-31 Brady Eidson Special HID mapping for the Dualshock 3 controller and https://bugs.webkit.org/show_bug.cgi?id=214911 Reviewed by Tim Horton. Covered by API tests. - Move GamepadButtons into a GamepadConstants header - Add a "KnownGamepads" header to hold all vendor/product pairs that WebKit knows about - Add a Dualshock3 controller mapping based on its HID report - Add a basic DS3 test based on the HID report * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/gamepad/GamepadConstants.cpp: Copied from Source/WebCore/platform/gamepad/mac/GenericHIDGamepad.h. (WebCore::standardGamepadMappingString): * platform/gamepad/GamepadConstants.h: Added. * platform/gamepad/KnownGamepads.h: Copied from Source/WebCore/platform/gamepad/mac/GenericHIDGamepad.h. * platform/gamepad/cocoa/GameControllerGamepad.mm: (WebCore::GameControllerGamepad::setupAsExtendedGamepad): * platform/gamepad/mac/Dualshock3HIDGamepad.cpp: Added. (WebCore::Dualshock3HIDGamepad::Dualshock3HIDGamepad): * platform/gamepad/mac/Dualshock3HIDGamepad.h: Copied from Source/WebCore/platform/gamepad/mac/GenericHIDGamepad.h. * platform/gamepad/mac/GenericHIDGamepad.cpp: (WebCore::GenericHIDGamepad::GenericHIDGamepad): (WebCore::GenericHIDGamepad::id): Deleted. * platform/gamepad/mac/GenericHIDGamepad.h: * platform/gamepad/mac/HIDGamepad.cpp: (WebCore::HIDGamepad::create): (WebCore::HIDGamepad::HIDGamepad): (WebCore::HIDGamepad::initialize): * platform/gamepad/mac/HIDGamepad.h: * platform/mac/HIDDevice.h: (WebCore::HIDDevice::fullProductIdentifier const): * platform/mac/HIDElement.h: (WebCore::HIDElement::fullUsage const): 2020-07-31 Alex Christensen Fix Windows build. https://bugs.webkit.org/show_bug.cgi?id=214988 * platform/network/cf/CertificateInfo.h: * platform/network/cf/CertificateInfoCFNet.cpp: 2020-07-31 Chris Dumez Add constructor for WaveShaperNode https://bugs.webkit.org/show_bug.cgi?id=214989 Reviewed by Youenn Fablet. Add constructor for WaveShaperNode: - https://www.w3.org/TR/webaudio/#waveshapernode No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createWaveShaper): * Modules/webaudio/OverSampleType.h: Copied from Source/WebCore/Modules/webaudio/WaveShaperNode.idl. * Modules/webaudio/OverSampleType.idl: Copied from Source/WebCore/Modules/webaudio/WaveShaperNode.idl. * Modules/webaudio/WaveShaperNode.cpp: (WebCore::WaveShaperNode::create): (WebCore::WaveShaperNode::setCurve): (WebCore::processorType): * Modules/webaudio/WaveShaperNode.h: (WTF::LogArgument::toString): * Modules/webaudio/WaveShaperNode.idl: * Modules/webaudio/WaveShaperOptions.h: Copied from Source/WebCore/Modules/webaudio/WaveShaperNode.idl. * Modules/webaudio/WaveShaperOptions.idl: Copied from Source/WebCore/Modules/webaudio/WaveShaperNode.idl. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-07-31 Youenn Fablet Update service worker if certificate info does not match when soft updating https://bugs.webkit.org/show_bug.cgi?id=214988 Reviewed by Alex Christensen. In case service worker certificate info does not match, treat it as if the script changed. This is a convenient way to update the service worker and the stored registration database. Covered by API test. * platform/network/cf/CertificateInfo.h: * platform/network/cf/CertificateInfoCFNet.cpp: (WebCore::certificatesMatch): * workers/service/server/SWServerJobQueue.cpp: (WebCore::doCertificatesMatch): (WebCore::SWServerJobQueue::scriptFetchFinished): * workers/service/server/SWServerWorker.h: (WebCore::SWServerWorker::certificateInfo const): 2020-07-31 Sihui Liu -[WKWebsiteDataStore _renameOrigin:] needs to support IndexedDB renames https://bugs.webkit.org/show_bug.cgi?id=214905 Reviewed by Alex Christensen. To do the renaming, we close all existing databases whose top origin is old origin, and move all files in directory of old origin to that of new origin. API test: WebKit.WebsiteDataStoreRenameOriginForIndexedDatabase * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::closeDatabasesForOrigins): (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins): (WebCore::IDBServer::IDBServer::renameOrigin): * Modules/indexeddb/server/IDBServer.h: 2020-07-31 Chris Fleizach AX: Inteterminate progressbar reading as 50% with Voiceover https://bugs.webkit.org/show_bug.cgi?id=214330 Reviewed by Zalan Bujtas. Expose indeterminate status to iOS API. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityIsIndeterminate]): (-[WebAccessibilityObjectWrapper accessibilityIsInDescriptionListTerm]): (-[WebAccessibilityObjectWrapper accessibilityIsInDescriptionListDefinition]): - Drive by style fix. 2020-07-31 Peng Liu PIP on netflix.com shows only a gray window and spinner https://bugs.webkit.org/show_bug.cgi?id=214899 Reviewed by Jer Noble. Use an empty "seekableRanges" instead of a special "duration" value (NaN) to indicate that seeking is not supported. With this change, the "duration" will always have a meaningful value, so that WebAVPlayerController can work properly in the picture-in-picture mode. Related change: https://trac.webkit.org/changeset/217858. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::supportsSeeking const): * platform/cocoa/PlaybackSessionModelMediaElement.mm: (WebCore::PlaybackSessionModelMediaElement::duration const): (WebCore::PlaybackSessionModelMediaElement::seekableRanges const): * platform/mac/WebPlaybackControlsManager.mm: (-[WebPlaybackControlsManager canBeginTouchBarScrubbing]): 2020-07-31 Carlos Garcia Campos [GTK] Mouse wheel events on horizontal scrollbar not correctly handled when AC mode is forced https://bugs.webkit.org/show_bug.cgi?id=207113 Reviewed by Adrian Perez de Castro. Remove GTK specific code to invert scroll direction of wheel events. * page/EventHandler.cpp: (WebCore::EventHandler::handleWheelEvent): (WebCore::EventHandler::shouldSwapScrollDirection const): Deleted. * platform/SourcesGLib.txt: * platform/glib/EventHandlerGLib.cpp: Removed. 2020-07-10 Sergio Villar Senin [WebXR] Retrieve supported reference spaces from actual XR systems https://bugs.webkit.org/show_bug.cgi?id=214187 Reviewed by Carlos Garcia Campos. Each XR system supports a set of reference spaces which are used by WebXR to stablish a spatial relationship with user's physical environment. The list of supported reference spaces determine whether or not a session request succeeds or not, as it will refuse to start a session with an unsupported reference space. So far, no reference spaces were retrieved from the actual devices. This patch adds the required OpenXR machinery to retrieve them. In particular, we have to create a XrSession (although we don't have to start it) in order to retrieve the reference spaces. Since we don't need it to show content to the user we can create it in headless mode and then discard it afterwards when no longer needed. * Modules/webxr/WebXRSession.cpp: (WebCore::WebXRSession::WebXRSession): Clarify a comment. Also s/TODO/FIXME/g. * platform/xr/openxr/PlatformXROpenXR.cpp: (PlatformXR::isExtensionSupported): New method to check whether a specific extension is supported. (PlatformXR::Instance::Impl::checkInstanceExtensionProperties const): renamed from enumerateInstanceExtensionProperties(). Returns whether or not the call succeeded. (PlatformXR::Instance::Impl::Impl): Pass the list of enabled extensions to the instance. (PlatformXR::Instance::enumerateImmersiveXRDevices): Log the systems found. (PlatformXR::OpenXRDevice::OpenXRDevice): (PlatformXR::OpenXRDevice::enumerateReferenceSpaces const): New method to list the supported reference spaces by the XR system. (PlatformXR::OpenXRDevice::collectSupportedSessionModes): Store reference spaces as enabled features for supported modes. (PlatformXR::OpenXRDevice::collectConfigurationViews): Renamed from enumerateConfigurationViews(). (PlatformXR::Instance::Impl::enumerateInstanceExtensionProperties const): Deleted. (PlatformXR::OpenXRDevice::enumerateConfigurationViews): Deleted. * platform/xr/openxr/PlatformXROpenXR.h: 2020-07-31 Youenn Fablet Add LibWebRTCAudioModule logging https://bugs.webkit.org/show_bug.cgi?id=214987 Reviewed by Eric Carlson. * platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp: (WebCore::LibWebRTCAudioModule::RegisterAudioCallback): (WebCore::LibWebRTCAudioModule::StartPlayout): (WebCore::LibWebRTCAudioModule::StopPlayout): 2020-07-30 Simon Fraser Minor RenderLayerCompositor::updateBackingAndHierarchy() cleanup https://bugs.webkit.org/show_bug.cgi?id=215008 Reviewed by Zalan Bujtas. Instead of setting child layers, and then adding another child (overflowControlLayer), append overflowControlLayer to the vector and then set children. No behavior change. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): 2020-07-30 Sam Weinig It would be nice if the predicate taking functions in ParsingUtilities.h didn't require specifying the character type https://bugs.webkit.org/show_bug.cgi?id=215002 Reviewed by Darin Adler. Remove the need for specifying the character type by providing overloads for LChar and UChar explicitly. * html/parser/HTMLSrcsetParser.cpp: (WebCore::parseImageCandidatesFromSrcsetAttribute): * html/parser/ParsingUtilities.h: (WebCore::characterPredicate): * html/track/VTTScanner.h: (WebCore::characterPredicate): * loader/LinkHeader.cpp: (WebCore::findURLBoundaries): (WebCore::invalidParameterDelimiter): (WebCore::parseParameterDelimiter): (WebCore::parseParameterName): (WebCore::skipQuotesIfNeeded): (WebCore::parseParameterValue): (WebCore::findNextHeader): * loader/ResourceCryptographicDigest.cpp: (WebCore::parseCryptographicDigestImpl): (WebCore::parseEncodedCryptographicDigestImpl): * loader/SubresourceIntegrity.cpp: (WebCore::splitOnSpaces): * loader/appcache/ApplicationCacheManifestParser.cpp: (WebCore::parseApplicationCacheManifest): * page/csp/ContentSecurityPolicyDirectiveList.cpp: (WebCore::ContentSecurityPolicyDirectiveList::parseDirective): (WebCore::ContentSecurityPolicyDirectiveList::parseReportURI): * page/csp/ContentSecurityPolicyMediaListDirective.cpp: (WebCore::ContentSecurityPolicyMediaListDirective::parse): * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::isSourceListNone): (WebCore::ContentSecurityPolicySourceList::parse): (WebCore::ContentSecurityPolicySourceList::parseSource): (WebCore::ContentSecurityPolicySourceList::parseScheme): (WebCore::ContentSecurityPolicySourceList::parseHost): (WebCore::ContentSecurityPolicySourceList::parsePath): (WebCore::ContentSecurityPolicySourceList::parsePort): (WebCore::ContentSecurityPolicySourceList::parseNonceSource): * platform/DateComponents.cpp: (WebCore::countDigits): * svg/SVGLengthList.cpp: (WebCore::SVGLengthList::parse): * svg/SVGParserUtilities.cpp: (WebCore::genericParseNumber): * svg/SVGParserUtilities.h: (WebCore::skipOptionalSVGSpaces): 2020-07-30 Sam Weinig Convert DateComponents to use StringParsingBuffer https://bugs.webkit.org/show_bug.cgi?id=213929 Reviewed by Darin Adler. - Switches string parsing in DateComponents to using StringParsingBuffer, making use of ParsingUtilities to streamline / simplify the code. - Moves a few constant values only used in DateComponents.cpp to DateComponents.cpp - Rename toInt in DateComponents.cpp to parseInt, and have use an Optional return value rather than bool + out-parameter. - Add new parseIntWithinLimits that also checks that parsed value is within specfied limits, as this is what almost all of the int parsing in DateComponents needs. * platform/DateComponents.cpp: (WebCore::countDigits): (WebCore::parseInt): (WebCore::parseIntWithinLimits): (WebCore::DateComponents::parseYear): (WebCore::withinHTMLDateLimits): (WebCore::createFromString): (WebCore::DateComponents::fromParsingMonth): (WebCore::DateComponents::fromParsingDate): (WebCore::DateComponents::fromParsingWeek): (WebCore::DateComponents::fromParsingTime): (WebCore::DateComponents::fromParsingDateTimeLocal): (WebCore::DateComponents::fromParsingDateTime): (WebCore::DateComponents::parseTimeZone): (WebCore::DateComponents::parseMonth): (WebCore::DateComponents::parseDate): (WebCore::DateComponents::parseWeek): (WebCore::DateComponents::parseTime): (WebCore::DateComponents::parseDateTimeLocal): (WebCore::DateComponents::parseDateTime): (WebCore::DateComponents::setMonthsSinceEpoch): (WebCore::DateComponents::setMillisecondsSinceEpochForWeek): (WebCore::toInt): Deleted. * platform/DateComponents.h: (WebCore::DateComponents::minimumYear): Deleted. (WebCore::DateComponents::maximumYear): Deleted. 2020-07-30 Ryan Haddad Unreviewed attempt to fix Catalyst build after r265084. * editing/cocoa/DictionaryLookup.mm: 2020-07-30 Dean Jackson [WebGL] Safari snapshots of WebGL content in the tab picker don't work https://bugs.webkit.org/show_bug.cgi?id=214452 Original patch by Justin Fan. Reviewed by Darin Adler. Test is in TestWebKitAPI/Tests/WebKitCocoa/WKWebViewSnapshot.mm. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::paint): Will properly request a paint when a snapshot is requested. * html/HTMLCanvasElement.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas): Only clear the last snapshot if readPixels will succeed. * rendering/RenderHTMLCanvas.cpp: (WebCore::RenderHTMLCanvas::paintReplaced): 2020-07-30 Jer Noble [Cocoa] Adopt -[AVContentKeyRequest willOutputBeObscuredDueToInsufficientExternalProtectionForDisplays:] https://bugs.webkit.org/show_bug.cgi?id=214659 Reviewed by Darin Adler. Use the new WTF::Observer object as the listener type for notifying clients of display changes. When a displayChanged event is observed, use the new AVContentKeyRequest -willOutputBeObscuredDueToInsufficientExternalProtectionForDisplays: to set the keyStatus for that request appropriately. * Modules/encryptedmedia/MediaKeySession.cpp: (WebCore::MediaKeySession::MediaKeySession): (WebCore::MediaKeySession::displayID): (WebCore::MediaKeySession::displayChanged): * Modules/encryptedmedia/MediaKeySession.h: * dom/Document.cpp: (WebCore::Document::windowScreenDidChange): (WebCore::Document::addDisplayChangedObserver): * dom/Document.h: * platform/encryptedmedia/CDMInstanceSession.h: (WebCore::CDMInstanceSession::displayChanged): * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (-[WebCoreFPSContentKeySessionDelegate contentKeySession:externalProtectionStatusDidChangeForContentKeyRequest:]): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::externalProtectionStatusDidChangeForContentKeyRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::displayChanged): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::externalProtectionStatusDidChangeForContentKeyRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateProtectionStatusForDisplayID): 2020-07-30 James Darpinian [WebGL2] Buffer updates https://bugs.webkit.org/show_bug.cgi?id=209511 Reviewed by Dean Jackson. Various fixes in bufferData, bufferSubData, and getBufferSubData. Passes all WebGL conformance tests in conformance/buffers/* and conformance2/buffers/*. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::sliceArrayBufferView): (WebCore::WebGL2RenderingContext::getBufferSubData): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::bufferData): (WebCore::WebGLRenderingContextBase::bufferSubData): * html/canvas/WebGLRenderingContextBase.h: * html/canvas/WebGLRenderingContextBase.idl: 2020-07-30 Jer Noble [Cocoa] Make DecoderTest run against .mp4 files; add rate-limiting. https://bugs.webkit.org/show_bug.cgi?id=214807 Reviewed by Darin Adler. Export registerWebKitVP9Decoder() from VP9UtilitiesCocoa instead of LibWebRTCProvider to make it easier for DecodeTest to import, as LibWebRTCProvider also pulls in a bunch of libwebrtc headers. Also, export SourceBufferParser.h so DecoderTest can create parsers for fMP4 files. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/cocoa/VP9UtilitiesCocoa.h: * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: (WebCore::registerWebKitVP9Decoder): 2020-07-30 Ryosuke Niwa Clicking on a shadow DOM does not move the selection to the focused element when delegatesFocus is set to true https://bugs.webkit.org/show_bug.cgi?id=214859 Reviewed by Wenson Hsieh. The bug was caused by EventHandler moving the selection to where the user had clicked, not to where the focus had been delegated, which is a uniquely WebKit behavior. Fixed the bug by revealing the focused element as done in Element::focus in EventHandler::dispatchMouseEvent and avoid updating the selection to the clicked point later in EventHandler::handleMousePressEventSingleClick by adding an early exit. Test: fast/shadow-dom/delegates-focus-and-types-into-input.html * dom/Element.cpp: (WebCore::Element::focus): (WebCore::Element::revealFocusedElement): Extracted from Element::focus. * dom/Element.h: * page/EventHandler.cpp: (WebCore::EventHandler::handleMousePressEventSingleClick): Added an early exit when dispatchMouseEvent had delegated the focus to an element different from the one the user had clicked. (WebCore::EventHandler::dispatchMouseEvent): Added a code to reveal the newly focused element when the focus had been delegated. * page/EventHandler.h: 2020-07-30 Tim Horton Web content gets stuck in an inactive state (no cursor updates or text insertion caret) when activating a tab with a thumbnail visible https://bugs.webkit.org/show_bug.cgi?id=214962 Reviewed by Wenson Hsieh. New API test: WebKit.WKThumbnailViewResetsViewStateWhenUnparented * testing/Internals.cpp: (WebCore::Internals::isPageActive const): * testing/Internals.h: * testing/Internals.idl: Add a "view window is active" getter. 2020-07-30 Antoine Quint [iOS] Unable to swipe on IMDB.com after long press on image https://bugs.webkit.org/show_bug.cgi?id=214968 Reviewed by Wenson Hsieh. When a long press occurs on an , a system drag interaction is initiated on iOS. In WebCore, EventHandler::tryToBeginDragAtPoint() is called and a synthetic mouse event is produced, causing handleMousePressEvent() to be called. Further down the call chain, dispatchPointerEventIfNeeded() is called and a valid PointerEvent is generated in PointerCaptureController::pointerEventForMouseEvent() with "pointerType" set to "mouse", even though there is already a touch interaction initiated. We now check whether there are known touches before generating a PointerEvent for a MouseEvent. In the case of IMDb, the page would keep track of "pointerdown" events to track whether a multi-touch user gesture is in progress so that their slide shows can support two-finger zooming as well as single-finger swiping. In the case of a long press, the second "pointerdown" event would trick the code in thinking a zoom gesture was initiated and it never recovered. Test: pointerevents/ios/long-press-yields-single-pointerdown-event.html * page/PointerCaptureController.cpp: (WebCore::PointerCaptureController::pointerEventForMouseEvent): 2020-07-30 Chris Dumez OfflineAudioContext.startRendering() should return a Promise https://bugs.webkit.org/show_bug.cgi?id=214940 Reviewed by Eric Carlson. OfflineAudioContext.startRendering() should return a Promise: - https://www.w3.org/TR/webaudio/#dom-offlineaudiocontext-startrendering This is important as it was preventing a lot of web-platform-tests from running properly and our test coverage was therefore really poor. No new tests, rebaselined existing tests. * Modules/webaudio/AudioBuffer.idl: * Modules/webaudio/AudioDestinationNode.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::finishedRendering): * Modules/webaudio/BaseAudioContext.h: (WebCore::BaseAudioContext::didFinishOfflineRendering): * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::startRendering): * Modules/webaudio/DefaultAudioDestinationNode.h: * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::startOfflineRendering): (WebCore::OfflineAudioContext::didFinishOfflineRendering): * Modules/webaudio/OfflineAudioContext.h: * Modules/webaudio/OfflineAudioContext.idl: * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::startRendering): * Modules/webaudio/OfflineAudioDestinationNode.h: 2020-07-30 Darin Adler Further reduction in the use of live ranges, particularly in headers https://bugs.webkit.org/show_bug.cgi?id=214793 Reviewed by Sam Weinig. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::performTextOperation): Do not call createLiveRange. (WebCore::AccessibilityObject::replaceTextInRange): Ditto. * dom/SimpleRange.cpp: Moved makeSimpleRange functions to the header. * dom/SimpleRange.h: Reworked the makeSimpleRange implementation to avoid a mistake which made template expansion infinitely recurse while compiling and crash the compiler. Ended up moving all the code to the header. Should be a good thing; I expect it will optimize well inlined. * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): Use makeSimpleRange. * editing/Editor.cpp: (WebCore::Editor::replaceSelectionWithText): Do not call createLiveRange. (WebCore::Editor::setComposition): Use SimpleRange. (WebCore::Editor::stringForCandidateRequest const): Do not call createLiveRange. (WebCore::Editor::handleAcceptedCandidate): Use auto intead of RefPtr. * editing/EditorCommand.cpp: (WebCore::expandSelectionToGranularity): Do not call createLiveRange. (WebCore::executeDeleteToMark): Ditto. (WebCore::executeSelectToMark): Ditto. (WebCore::valueFormatBlock): Ditto. * editing/FormatBlockCommand.cpp: (WebCore::FormatBlockCommand::formatRange): Use makeSimpleRange. (WebCore::FormatBlockCommand::elementForFormatBlockCommand): Take a SimpleRange. * editing/FormatBlockCommand.h: Updated for above. * editing/FrameSelection.cpp: (WebCore::FrameSelection::moveTo): Deleted overload taking a live range. (WebCore::FrameSelection::setSelectedRange): Take a SimpleRange. * editing/FrameSelection.h: Updated for above. * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplacementFragment::ReplacementFragment): Do not call createLiveRange. * editing/VisibleUnits.cpp: (WebCore::enclosingTextUnitOfGranularity): Return SimpleRange. (WebCore::wordRangeFromPosition): Ditto. (WebCore::closestWordBoundaryForPosition): Use SimpleRange. (WebCore::rangeExpandedByCharactersInDirectionAtWordBoundary): Return a SimpleRange. (WebCore::rangeExpandedAroundPositionByCharacters): Ditto. (WebCore::wordBoundaryForPositionWithoutCrossingLine): Use SimpleRange. * editing/VisibleUnits.h: Updated for above. * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::detectItemAroundHitTestResult): Use SimpleRange. * editing/cocoa/DictionaryLookup.mm: (WebCore::DictionaryLookup::rangeForSelection): Use SimpleRange. (WebCore::DictionaryLookup::rangeAtHitTestResult): Ditto. * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::getPasteboardTypesAndDataForAttachment): Do not call createLiveRange. * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::WebContentReader::readPlainText): Ditto. * editing/gtk/WebContentReaderGtk.cpp: (WebCore::WebContentReader::readPlainText): Ditto. * editing/libwpe/EditorLibWPE.cpp: (WebCore::createFragmentFromPasteboardData): Ditto. * editing/mac/DictionaryLookupLegacy.mm: (WebCore::DictionaryLookup::rangeAtHitTestResult): Use SimpleRange. * editing/markup.cpp: (WebCore::serializePreservingVisualAppearance): Take SimpleRange. (WebCore::contextPreservesNewline): Ditto. (WebCore::createFragmentFromText): Ditto. * editing/markup.h: Updated for above. * loader/archive/cf/LegacyWebArchive.cpp: (WebCore::LegacyWebArchive::create): Take SimpleRange. * loader/archive/cf/LegacyWebArchive.h: Updated for above. * page/DragController.cpp: (WebCore::DragController::performDragOperation): Use SimpleRange. (WebCore::DragController::concludeEditDrag): Do not call createLiveRange. (WebCore::selectElement): Use SimpleRange. (WebCore::DragController::removeAllDroppedImagePlaceholders): Ditto. (WebCore::DragController::insertDroppedImagePlaceholdersAtCaret): Ditto. * page/DragController.h: Use SimpleRange. * page/Page.cpp: (WebCore::Page::findTextMatches): Return vector of SimpleRange, in structure so we have one return value instead of two out arguments. Also renamed from findStringMatchingRanges. (WebCore::Page::rangeOfString): Return SimpleRange. (WebCore::replaceRanges): Do not call createLiveRange. (WebCore::Page::replaceRangesWithText): Take SimpleRange. * page/Page.h: Updated for above. * page/ios/FrameIOS.mm: (WebCore::Frame::wordsInCurrentParagraph const): Use SimpleRange. * rendering/HitTestResult.cpp: (WebCore::HitTestResult::isOverTextInsideFormControlElement const): Use SimpleRange, and also use hasAnyPlainText instead of computing the plain text string and checking if it's empty. 2020-07-30 Brady Eidson Refactor HID gamepad code to be much less fragile and much easier to hack on. https://bugs.webkit.org/show_bug.cgi?id=214910 Reviewed by Darin Adler. Covered by API tests. Currently - for HID device gamepads - we throw all buttons and axes against the wall and see what sticks. Instead, for specific popular devices, we'd like to have device-specific mappings so the representation makes sense. To support that work, this is a major refactoring of the HID gamepad code. It does the following: - Breaks out logic specific to IOHIDDeviceRef into HIDDevice - Breaks out logic specific to IOHIDElementRef into HIDElement - Moves responsibities of managing things to the right places (e.g. HIDElement manages its own current value directly) - Makes HIDGamepadElement derive from HIDElement directly - Moves device specific logic from HIDGamepad into a subclass of HID gamepad. Currently the only subclass is "generic" which encompasses HIDGamepad's old behavior - Changes button/value vectors from Vector to Vector so multiple objects can reference the value at once. e.g. HIDGamepadButton can simply update it's own SharedGamepadValue without knowing which HIDGamepad owns it or which index into the gamepad's value vector it should be mutating. This will be critical in the "specific device mapping" work as some types of HIDElements actually drive more than one gamepad button value. e.g. a "direction pad axis" actually manages 2 button values, or a "hat-switch" direction pad manages 4 button values This patch doesn't change any current behavior. * Modules/gamepad/Gamepad.cpp: (WebCore::Gamepad::updateFromPlatformGamepad): * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/Logging.h: * platform/gamepad/PlatformGamepad.h: * platform/gamepad/SharedGamepadValue.h: Copied from Source/WebKit/UIProcess/Gamepad/UIGamepad.h. (WebCore::SharedGamepadValue::SharedGamepadValue): (WebCore::SharedGamepadValue::setValue): (WebCore::SharedGamepadValue::value const): (WebCore::SharedGamepadValue::Data::Data): * platform/gamepad/cocoa/GameControllerGamepad.h: * platform/gamepad/cocoa/GameControllerGamepad.mm: (WebCore::GameControllerGamepad::setupAsExtendedGamepad): (WebCore::GameControllerGamepad::setupAsGamepad): * platform/gamepad/mac/GenericHIDGamepad.cpp: Added. (WebCore::GenericHIDGamepad::GenericHIDGamepad): (WebCore::GenericHIDGamepad::id): (WebCore::GenericHIDGamepad::maybeAddGenericDesktopElement): (WebCore::GenericHIDGamepad::maybeAddButtonElement): * platform/gamepad/mac/GenericHIDGamepad.h: Copied from Source/WebKit/WebProcess/Gamepad/WebGamepad.h. * platform/gamepad/mac/HIDGamepad.cpp: (WebCore::HIDGamepad::create): (WebCore::HIDGamepad::HIDGamepad): (WebCore::HIDGamepad::initialize): (WebCore::HIDGamepad::valueChanged): (WebCore::HIDGamepad::getCurrentValueForElement): Deleted. (WebCore::HIDGamepad::initElements): Deleted. (WebCore::HIDGamepad::initElementsFromArray): Deleted. (WebCore::HIDGamepad::maybeAddButton): Deleted. (WebCore::HIDGamepad::maybeAddAxis): Deleted. * platform/gamepad/mac/HIDGamepad.h: (WebCore::HIDGamepad::hidDevice const): (WebCore::HIDGamepadElement::HIDGamepadElement): Deleted. (WebCore::HIDGamepadElement::~HIDGamepadElement): Deleted. (WebCore::HIDGamepadElement::isButton const): Deleted. (WebCore::HIDGamepadElement::isAxis const): Deleted. (WebCore::HIDGamepadButton::HIDGamepadButton): Deleted. (WebCore::HIDGamepadAxis::HIDGamepadAxis): Deleted. * platform/gamepad/mac/HIDGamepadElement.cpp: Added. (WebCore::HIDGamepadElement::HIDGamepadElement): (WebCore::HIDGamepadElement::refreshCurrentValue): (WebCore::HIDGamepadElement::normalizedValue): (WebCore::HIDGamepadButton::gamepadValueChanged): (WebCore::HIDGamepadAxis::gamepadValueChanged): (WebCore::HIDGamepadAxis::normalizedValue): * platform/gamepad/mac/HIDGamepadElement.h: Copied from Source/WebCore/platform/gamepad/PlatformGamepad.h. (WebCore::HIDGamepadElement::~HIDGamepadElement): (WebCore::HIDGamepadElement::isButton const): (WebCore::HIDGamepadElement::isAxis const): * platform/gamepad/mac/HIDGamepadProvider.mm: (WebCore::HIDGamepadProvider::deviceAdded): * platform/gamepad/mac/MultiGamepadProvider.h: * platform/graphics/cocoa/SourceBufferParserWebM.cpp: * platform/mac/HIDDevice.cpp: Added. (WebCore::HIDDevice::HIDDevice): (WebCore::HIDDevice::uniqueInputElementsInDeviceTreeOrder const): * platform/mac/HIDDevice.h: Copied from Source/WebCore/platform/gamepad/PlatformGamepad.h. (WebCore::HIDDevice::rawElement const): (WebCore::HIDDevice::vendorID const): (WebCore::HIDDevice::productID const): (WebCore::HIDDevice::productName const): * platform/mac/HIDElement.cpp: Copied from Source/WebKit/UIProcess/Gamepad/UIGamepad.h. (WebCore::HIDElement::HIDElement): (WebCore::HIDElement::valueChanged): * platform/mac/HIDElement.h: Copied from Source/WebKit/UIProcess/Gamepad/UIGamepad.h. (WebCore::HIDElement::rawElement const): (WebCore::HIDElement::physicalMin const): (WebCore::HIDElement::physicalMax const): (WebCore::HIDElement::physicalValue const): (WebCore::HIDElement::usage const): (WebCore::HIDElement::usagePage const): (WebCore::HIDElement::cookie const): * testing/MockGamepad.cpp: (WebCore::MockGamepad::updateDetails): (WebCore::MockGamepad::setAxisValue): (WebCore::MockGamepad::setButtonValue): * testing/MockGamepad.h: 2020-07-29 Joonghun Park Unreviewed. Remove the build warning below since r265062. warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] No new tests, no new behaviors. * Modules/webaudio/AudioBuffer.cpp: (WebCore::AudioBuffer::copyFromChannel): (WebCore::AudioBuffer::copyToChannel): 2020-07-29 Jer Noble Support HDR decode in SW VP9 https://bugs.webkit.org/show_bug.cgi?id=214928 Reviewed by Eric Carlson. Convert the incoming properties parsed from the VP9 header into extensions to our CMFormatDescription attached to each incoming video fram. Drive-by fix: Files in the wild will have incorrect values for whether a given frame is a keyframe or not. Trust the VP9 header parser rather than the container in this situations. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::convertToCMColorPrimaries): (WebCore::convertToCMTransferFunction): (WebCore::convertToCMYCbCRMatrix): (WebCore::createFormatDescriptionFromVP9HeaderParser): (WebCore::SourceBufferParserWebM::OnFrame): 2020-07-29 Wenson Hsieh [iPadOS] Custom dropdown menu dismisses immediately on account.nhl.com https://bugs.webkit.org/show_bug.cgi?id=214944 Reviewed by Jer Noble. Exempt account.nhl.com from site-specific "simulated mouse events" behavior, since it is incompatible with some custom dropdown menus that appear on this website. * page/Quirks.cpp: (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const): 2020-07-29 Clark Wang Added constructor methods to ChannelMergerNode, ChannelSplitterNode https://bugs.webkit.org/show_bug.cgi?id=214851 Reviewed by Chris Dumez. Added constructors for ChannelMergerNode, ChannelSplitterNode according to spec: https://www.w3.org/TR/webaudio/#ChannelMergerNode-constructors. Added new files for ChannelMergerOptions and ChannelSplitterOptions. This patch also ensures that BaseAudioContext::create*() and *Node::create() methods behave the same. Re-baselined existing tests that now pass, or fail further along. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioNode.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createChannelSplitter): (WebCore::BaseAudioContext::createChannelMerger): * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::create): (WebCore::ChannelMergerNode::setChannelCount): (WebCore::ChannelMergerNode::setChannelCountMode): * Modules/webaudio/ChannelMergerNode.h: * Modules/webaudio/ChannelMergerNode.idl: * Modules/webaudio/ChannelMergerOptions.h: Added. * Modules/webaudio/ChannelMergerOptions.idl: Added. * Modules/webaudio/ChannelSplitterNode.cpp: (WebCore::ChannelSplitterNode::create): (WebCore::ChannelSplitterNode::setChannelCount): (WebCore::ChannelSplitterNode::setChannelCountMode): (WebCore::ChannelSplitterNode::setChannelInterpretation): * Modules/webaudio/ChannelSplitterNode.h: * Modules/webaudio/ChannelSplitterNode.idl: * Modules/webaudio/ChannelSplitterOptions.h: Added. * Modules/webaudio/ChannelSplitterOptions.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-07-29 Clark Wang Added copyFromChannel, copyToChannel to AudioBuffer https://bugs.webkit.org/show_bug.cgi?id=214926 Reviewed by Chris Dumez. Added copyFromChannel, copyToChannel methods according to spec: https://www.w3.org/TR/webaudio/#dom-audiobuffer-copyfromchannel-destination. Used Chromium implementation for reference: https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/modules/webaudio/audio_buffer.cc. Re-baselined existing tests. Fails on catching sharedBuffer being passed in, but currently WebKit does not support sharedBuffer implementation. * Modules/webaudio/AudioBuffer.cpp: (WebCore::AudioBuffer::getChannelData): (WebCore::AudioBuffer::copyFromChannel): (WebCore::AudioBuffer::copyToChannel): * Modules/webaudio/AudioBuffer.h: * Modules/webaudio/AudioBuffer.idl: 2020-07-29 Wenson Hsieh [macOS] Inspector bar in Mail compose shows incorrect text alignment style for ranged selections https://bugs.webkit.org/show_bug.cgi?id=214930 Reviewed by Tim Horton. When a range of text is selected, AppKit consults `-attributedSubstringForProposedRange:completionHandler:` (or just `-attributedSubstringFromRange:` in WebKitLegacy) to update the inspector bar with new style information. Among this information is the paragraph style (an `NSParagraphStyle` corresponding to the attribute key `NSParagraphStyleAttributeName`), which AppKit uses to select either the left, center or right text alignment segmented control. However, in both WebKitLegacy and modern WebKit, we don't include this information at all in HTMLConverter, so AppKit just defaults to using `-[NSParagraphStyle defaultParagraphStyle]`, with a default text alignment of `NSTextAlignmentNatural`. To fix this, include a new paragraph style object in the case where the text alignment is not equal to natural (in other words, either a direction has been explicitly specified, or the text alignment style is not equal to "start"). This paragraph style matches the default paragraph style, except for the `alignment` property which is set to the corresponding `NSTextAlignment` value. Tests: AttributedSubstringForProposedRange.TextAlignmentParagraphStyles FontAttributes.FontAttributesAfterChangingSelection * editing/Editor.cpp: (WebCore::Editor::fontAttributesAtSelectionStart const): Also fixes an existing bug in `Editor::fontAttributesAtSelectionStart`, where `NSTextAlignmentNatural` is currently always used for `text-align: start;`, even if the direction is specified as RTL. Instead, change this so that we only fall back to "natural" if no direction is specified; otherwise, go with the explicit "left" or "right" values. * editing/cocoa/HTMLConverter.mm: (WebCore::editingAttributedString): 2020-07-29 Jer Noble REGRESSION(r264476): Calling systemHasAC() regresses launch time performance https://bugs.webkit.org/show_bug.cgi?id=214907 Reviewed by Eric Carlson. Because calling into IOPS can block, delay queries about AC state during WebProcessPool creation until the next run-loop. Simultaneously, we don't need to check HDR state in the UI process for IOS, so send a default value there as well. * platform/cocoa/PowerSourceNotifier.h: * platform/cocoa/PowerSourceNotifier.mm: (WebCore::PowerSourceNotifier::PowerSourceNotifier): * platform/cocoa/SystemBattery.h: * platform/cocoa/SystemBattery.mm: (WebCore::cachedSystemHasAC): * platform/ios/PlatformScreenIOS.mm: (WebCore::collectScreenProperties): 2020-07-29 Don Olmstead Remove USE(ZLIB) https://bugs.webkit.org/show_bug.cgi?id=214929 Reviewed by Darin Adler. Remove USE(ZLIB) guards in WebSocket code. Since WebSocketDeflateFramer::canDeflate is always true remove it and the callsite checking it in WebSocketChannel. * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::connect): * Modules/websockets/WebSocketDeflateFramer.cpp: (WebCore::WebSocketExtensionDeflateFrame::processResponse): (WebCore::WebSocketDeflateFramer::enableDeflate): (WebCore::WebSocketDeflateFramer::deflate): (WebCore::WebSocketDeflateFramer::resetDeflateContext): (WebCore::WebSocketDeflateFramer::inflate): (WebCore::WebSocketDeflateFramer::resetInflateContext): (WebCore::WebSocketDeflateFramer::canDeflate const): Deleted. * Modules/websockets/WebSocketDeflateFramer.h: * Modules/websockets/WebSocketDeflater.cpp: 2020-07-29 Chris Dumez Calling AudioNode constructors should have identical behavior to using create*() function on BaseAudioContext https://bugs.webkit.org/show_bug.cgi?id=214931 Reviewed by Eric Carlson. Calling AudioNode constructors should have identical behavior to using create*() function on BaseAudioContext. Otherwise, this leads to assertion hits on the bots like we saw for Bug 214851. We need to make sure that the AudioContext gets initialized when an AudioNode constructor gets called. We also need to make sure refNode() gets called if necessary. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createPanner): (WebCore::BaseAudioContext::createOscillator): (WebCore::BaseAudioContext::createPeriodicWave): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::create): * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::create): * Modules/webaudio/PeriodicWave.cpp: (WebCore::PeriodicWave::create): 2020-07-29 Simon Fraser REGRESSION: ASSERTION FAILED: !needsLayout() on tiled-drawing/scrolling/fast-scroll-mainframe-zoom.html flakily https://bugs.webkit.org/show_bug.cgi?id=214651 Reviewed by Zalan Bujtas. Page::doAfterUpdateRendering() is expected to only call functions that can't trigger layout. However, it could cause the firing of the "monitorWheelEvent" callback which can run arbitrary JS, so move that earlier in the rendering update, before we do the final layout. Also assert that the main frame doesn't need layout at the end of Page::doAfterUpdateRendering(); we were only checking subframes. Tested by lots of existing tests. * page/Page.cpp: (WebCore::Page::updateRendering): (WebCore::Page::doAfterUpdateRendering): 2020-07-29 Chris Dumez Make sure playback state constants remain on OscillatorNode for backward compatibility https://bugs.webkit.org/show_bug.cgi?id=214925 Reviewed by Eric Carlson. Make sure playback state constants remain on OscillatorNode for backward compatibility, while we keep supporting the prefixed Web Audio API. No new tests, updated existing test. * Modules/webaudio/OscillatorNode.idl: * Modules/webaudio/WebKitOscillatorNode.idl: 2020-07-29 Chris Dumez http/tests/cookies/document-cookie-multiple-cookies.html is failing on Windows https://bugs.webkit.org/show_bug.cgi?id=214880 Reviewed by Darin Adler. Fix same bug as in r264943 but on Windows. No new tests, covered by http/tests/cookies/document-cookie-multiple-cookies.html. * platform/network/cf/NetworkStorageSessionCFNetWin.cpp: (WebCore::parseDOMCookie): (WebCore::NetworkStorageSession::setCookiesFromDOM const): 2020-07-29 Youenn Fablet scaleResolutionDownBy has no effect on RTCRtpSender https://bugs.webkit.org/show_bug.cgi?id=214783 Reviewed by Eric Carlson. Covered by updated test. * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::updateRTCRtpSendParameters): Allow to change scaleResolutionDownBy. 2020-07-29 Mark Lam CodeGeneratorJS should release the throwScope before doing a void call at end of a function. https://bugs.webkit.org/show_bug.cgi?id=214924 Reviewed by Chris Dumez. It is necessary to release the throwScope because the void call at the end of the function may throw an exception. Releasing the throwScope here says that this function is releasing the responsibility to handle the exception, and will allow the potential exception from the trailing void call to propagate to its caller. The responsibility to handle the exception is passed to this function's caller (or some earlier caller in the stack). It is ok to release the throwScope here because the trailing void call will effectively be the last thing that this function does before returning. Covered by existing tests. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementationFunctionCall): * bindings/scripts/test/JS/JSMapLike.cpp: (WebCore::jsMapLikePrototypeFunctionClearBody): * bindings/scripts/test/JS/JSSetLike.cpp: (WebCore::jsSetLikePrototypeFunctionClearBody): * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunctionBody): (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessageBody): (WebCore::jsTestActiveDOMObjectPrototypeFunctionOverloadedMethod1Body): (WebCore::jsTestActiveDOMObjectPrototypeFunctionOverloadedMethod2Body): * bindings/scripts/test/JS/JSTestCEReactions.cpp: (WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactionsBody): (WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactionsNotNeededBody): * bindings/scripts/test/JS/JSTestCallTracer.cpp: (WebCore::jsTestCallTracerPrototypeFunctionTestOperationInterfaceBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationSpecifiedBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithArgumentsBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgumentBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgumentBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableVariantArgumentBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithOptionalVariantArgumentBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithDefaultVariantArgumentBody): * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: (WebCore::jsTestEnabledBySettingPrototypeFunctionEnabledBySettingOperationBody): * bindings/scripts/test/JS/JSTestGlobalObject.cpp: (WebCore::jsTestGlobalObjectInstanceFunctionRegularOperationBody): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1Body): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2Body): (WebCore::jsTestGlobalObjectConstructorFunctionEnabledAtRuntimeOperationStaticBody): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldBody): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldWhenRuntimeFeatureEnabledBody): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldWhenRuntimeFeaturesEnabledBody): (WebCore::jsTestGlobalObjectInstanceFunctionTestPrivateFunctionBody): (WebCore::jsTestGlobalObjectInstanceFunctionCalculateSecretResultBody): * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: (WebCore::jsTestIndexedSetterWithIdentifierPrototypeFunctionIndexedSetterBody): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod1Body): (WebCore::jsTestInterfaceConstructorFunctionImplementsMethod4Body): (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod1Body): (WebCore::jsTestInterfaceConstructorFunctionSupplementalMethod4Body): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: (WebCore::jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetterBody): (WebCore::jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetterBody): * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: (WebCore::jsTestNamedDeleterWithIdentifierPrototypeFunctionNamedDeleterBody): * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: (WebCore::jsTestNamedSetterWithIdentifierPrototypeFunctionNamedSetterBody): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: (WebCore::jsTestNamedSetterWithIndexedGetterPrototypeFunctionNamedSetterBody): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterPrototypeFunctionNamedSetterBody): (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterPrototypeFunctionIndexedSetter1Body): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: (WebCore::jsTestNamedSetterWithUnforgablePropertiesInstanceFunctionUnforgeableOperationBody): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsInstanceFunctionUnforgeableOperationBody): * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::jsTestNodePrototypeFunctionTestWorkerPromiseBody): (WebCore::jsTestNodePrototypeFunctionCalculateSecretResultBody): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::callJSTestObj1): (WebCore::callJSTestObj3): (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1Body): (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2Body): (WebCore::jsTestObjConstructorFunctionEnabledAtRuntimeOperationStaticBody): (WebCore::jsTestObjPrototypeFunctionEnabledInSpecificWorldWhenRuntimeFeatureEnabledBody): (WebCore::jsTestObjPrototypeFunctionWorldSpecificMethodBody): (WebCore::jsTestObjPrototypeFunctionCalculateSecretResultBody): (WebCore::jsTestObjPrototypeFunctionVoidMethodBody): (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgsBody): (WebCore::jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameterBody): (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithStandaloneEnumArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValueBody): (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNullableUSVStringArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgTreatingNullAsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithByteStringArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNullableByteStringArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithByteStringArgTreatingNullAsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionSerializedValueBody): (WebCore::jsTestObjPrototypeFunctionMethodWithRecordBody): (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionBody): (WebCore::jsTestObjPrototypeFunctionAddEventListenerBody): (WebCore::jsTestObjPrototypeFunctionRemoveEventListenerBody): (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidBody): (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidExceptionBody): (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextBody): (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateBody): (WebCore::jsTestObjPrototypeFunctionWithDocumentArgumentBody): (WebCore::jsTestObjPrototypeFunctionWithCallerDocumentArgumentBody): (WebCore::jsTestObjPrototypeFunctionWithCallerWindowArgumentBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValueBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgsBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValueBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringAndDefaultValueBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefinedBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringIsNullBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVStringIsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringIsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaNBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaNBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongIsZeroBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongIsZeroBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmptyBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalseBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAnyBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalObjectBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapperBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapperIsNullBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolverBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalRecordBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalPromiseBody): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionAndOptionalArgBody): (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackAndOptionalArgBody): (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackArgBody): (WebCore::jsTestObjPrototypeFunctionConditionalMethod2Body): (WebCore::jsTestObjPrototypeFunctionConditionalMethod3Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod10Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod12Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod13Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithDistinguishingUnion1Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithDistinguishingUnion2Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWith2DistinguishingUnions1Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWith2DistinguishingUnions2Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithNonDistinguishingUnion1Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithNonDistinguishingUnion2Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion1Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion2Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion1Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion2Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter1Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter2Body): (WebCore::jsTestObjConstructorFunctionClassMethodBody): (WebCore::jsTestObjConstructorFunctionOverloadedMethod11Body): (WebCore::jsTestObjConstructorFunctionOverloadedMethod12Body): (WebCore::jsTestObjPrototypeFunctionClassMethodWithClampBody): (WebCore::jsTestObjPrototypeFunctionClassMethodWithClampOnOptionalBody): (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRangeBody): (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRangeOnOptionalBody): (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequenceBody): (WebCore::jsTestObjPrototypeFunctionOperationWithOptionalUnionParameterBody): (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequenceBody): (WebCore::jsTestObjPrototypeFunctionConvert1Body): (WebCore::jsTestObjPrototypeFunctionConvert2Body): (WebCore::jsTestObjPrototypeFunctionConvert3Body): (WebCore::jsTestObjPrototypeFunctionConvert4Body): (WebCore::jsTestObjPrototypeFunctionOrangeBody): (WebCore::jsTestObjPrototypeFunctionVariadicStringMethodBody): (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethodBody): (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethodBody): (WebCore::jsTestObjPrototypeFunctionVariadicUnionMethodBody): (WebCore::jsTestObjPrototypeFunctionAnyBody): (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionBody): (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentBody): (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionBody): (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentBody): (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Body): (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Body): (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionBody): (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionBody): (WebCore::jsTestObjPrototypeFunctionConditionalOverload1Body): (WebCore::jsTestObjPrototypeFunctionConditionalOverload2Body): (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload1Body): (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload2Body): (WebCore::jsTestObjPrototypeFunctionAttachShadowRootBody): (WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameterBody): (WebCore::jsTestObjPrototypeFunctionBufferSourceParameterBody): (WebCore::jsTestObjPrototypeFunctionLegacyCallerNamedBody): (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationBody): (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationWithExceptionBody): (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWindowFunctionBody): (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWorkerFunctionBody): (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWindowAndWorkerFunctionBody): * bindings/scripts/test/JS/JSTestOperationConditional.cpp: (WebCore::jsTestOperationConditionalPrototypeFunctionNonConditionalOperationBody): (WebCore::jsTestOperationConditionalPrototypeFunctionConditionalOperationBody): * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionBody): * bindings/scripts/test/JS/JSTestTypedefs.cpp: (WebCore::jsTestTypedefsPrototypeFunctionFuncBody): (WebCore::jsTestTypedefsPrototypeFunctionSetShadowBody): (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceArgBody): (WebCore::jsTestTypedefsPrototypeFunctionSequenceOfNullablesArgBody): (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceOfNullablesArgBody): (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceOfUnionsArgBody): (WebCore::jsTestTypedefsPrototypeFunctionUnionArgBody): (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampBody): (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampInTypedefBody): (WebCore::jsTestTypedefsPrototypeFunctionMethodWithExceptionBody): 2020-07-29 Darin Adler Improve range idioms and other changes to prepare the way for more reduction in live range use https://bugs.webkit.org/show_bug.cgi?id=214882 Reviewed by Sam Weinig. * accessibility/AXObjectCache.cpp: (WebCore::AccessibilityReplacedText::AccessibilityReplacedText): Call the VisiblePosition versions of start and end instead of converting to Position and then back to VisiblePosition. (WebCore::AXObjectCache::rangeMatchesTextNearRange): Simplify with makeSimpleRange. (WebCore::AXObjectCache::characterOffsetForPoint): Ditto. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::visiblePositionRangeForUnorderedPositions const): Update idiom for creating VisiblePositionRange since it's just a struct now without explicit constructors. (WebCore::AccessibilityObject::positionOfLeftWord const): Ditto. (WebCore::AccessibilityObject::positionOfRightWord const): Ditto. (WebCore::AccessibilityObject::leftLineVisiblePositionRange const): Ditto. (WebCore::AccessibilityObject::rightLineVisiblePositionRange const): Ditto. (WebCore::AccessibilityObject::sentenceForPosition const): Ditto. (WebCore::AccessibilityObject::paragraphForPosition const): Ditto. (WebCore::AccessibilityObject::styleRangeForPosition const): Ditto. (WebCore::AccessibilityObject::visiblePositionRangeForRange const): Ditto. (WebCore::AccessibilityObject::lineRangeForPosition const): Ditto. (WebCore::AccessibilityObject::stringForVisiblePositionRange): Ditto. (WebCore::AccessibilityObject::lengthForVisiblePositionRange const): Ditto. (WebCore::AccessibilityObject::nextSentenceEndPosition const): Ditto. (WebCore::AccessibilityObject::previousSentenceStartPosition const): Ditto. * accessibility/AccessibilityObjectInterface.h: Moved VisiblePositionRange to VisiblePosition.h for wider use. Also removed constructors. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::textUnderElement const): Simplify with makeSimpleRange. (WebCore::AccessibilityRenderObject::linkClickPoint): Ditto. (WebCore::AccessibilityRenderObject::clickPoint): Ditto. (WebCore::AccessibilityRenderObject::visiblePositionRange const): Updated for removal of VisiblePositionRange constructor. (WebCore::AccessibilityRenderObject::visiblePositionRangeForLine const): Remove unnecessary explicit conversion to VisiblePositionRange. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (visiblePositionRangeForTextMarkerRange): Added, replacing separate functions for start and end. (-[WebAccessibilityObjectWrapper visiblePositionRangeForTextMarkerRange:]): Simplify using visiblePositionRangeForTextMarkerRange. * dom/Document.cpp: Added include of "Range.h", may not be needed right now, but highly likely to be needed after future live range work. * dom/Node.cpp: Removed include of "Range.h". * dom/Position.h: Added PositionRange. This will be a more efficient alternative to SimpleRange that can avoid computing node offets for positions before and after anchor nodes in some cases. Not used yet. * dom/RadioButtonGroups.cpp: Removed include of "Range.h". * dom/Range.h: Export makeSimpleRange overload now used outside WebCore. * dom/SimpleRange.cpp: (WebCore::makeSimpleRange): Added overloads for ranges that consist of just a single boundary point, so the argument does not have to be passed twice. (WebCore::commonInclusiveAncestor): Added overload so caller can just pass a simple range rather than passing two boundary point container nodes. * dom/SimpleRange.h: Added makeSimpleRange overloads that take one or more argument that can be passed to makeBoundaryPoint or actual boundary points. * dom/StaticRange.cpp: Removed include of "Range.h". * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand): Simplify with makeSimpleRange. (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult): Ditto. * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::applyBlockStyle): Ditto. * editing/CompositeEditCommand.cpp: (WebCore::stringForVisiblePositionIndexRange): Updated for removal of VisiblePositionRange constructor; also use move to reduce reference count churn a tiny bit. (WebCore::CompositeEditCommand::moveParagraphs): Simplify with makeSimpleRange. * editing/DeleteSelectionCommand.cpp: Added include of "Range.h", may not be needed now, but highly likely to be needed after future live range work. * editing/Editing.cpp: (WebCore::indexForVisiblePosition): Simplify using makeSimpleRange and makeBoundaryPointBeforeNodeContents. * editing/Editor.cpp: (WebCore::Editor::selectedText const): Simplify using VisibleSelection::firstRange. (WebCore::extendSelection): Simplify using makeSimpleRange. (WebCore::Editor::contextRangeForCandidateRequest const): Ditto. (WebCore::Editor::adjustedSelectionRange): Simplify with the new overload of commonInclusiveAncestor. * editing/FrameSelection.cpp: (WebCore::FrameSelection::wordOffsetInRange const): Deleted. Moved the code into the iOS-specific part of WebKitLegacy WebFrame. (WebCore::FrameSelection::spaceFollowsWordInRange const): Deleted. Moved the code into the iOS-specific part of WebKitLegacy WebFrame. (WebCore::FrameSelection::selectionAtSentenceStart const): Merged in with actualSelectionAtSentenceStart. (WebCore::FrameSelection::actualSelectionAtSentenceStart const): Deleted. * editing/FrameSelection.h: Updated for the above deletion. * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingParagraph::offsetTo const): Simplify with makeSimpleRange. * editing/TextManipulationController.cpp: (WebCore::ParagraphContentIterator::ParagraphContentIterator): Simplify with makeSimpleRange. * editing/TypingCommand.cpp: (WebCore::TypingCommand::postTextStateChangeNotificationForDeletion): Pass visibleStart/End instead of converting to Position and back to VisiblePosition. * editing/VisiblePosition.cpp: (WebCore::makeSimpleRange): Added. Converts a VisiblePositionRange into a SimpleRange. * editing/VisiblePosition.h: Moved VisiblePositionRange here. * editing/VisibleSelection.cpp: (WebCore::VisibleSelection::firstRange const): Simplify using makeSimpleRange. (WebCore::VisibleSelection::toNormalizedRange const): Ditto. (WebCore::makeSearchRange): Deleted. This was confusingly named given that it was only used in appendTrailingWhitespace. (WebCore::VisibleSelection::appendTrailingWhitespace): Merged makeSearchRange in here and simplified using makeSimpleRange. * editing/VisibleSelection.h: Added conversion to VisiblePositionRange. Previously this was implemented as a constructor for VisiblePositionRange, but that was a layering inversion since this is built on top of VisiblePosition. * editing/VisibleUnits.cpp: (WebCore::distanceBetweenPositions): Simplified using makeSimpleRange. (WebCore::charactersAroundPosition): Ditto. (WebCore::wordRangeFromPosition): Removed an unhelpful comment. (WebCore::closestWordBoundaryForPosition): Ditto. * editing/cocoa/DataDetection.mm: (WebCore::detectItem): Simplify using makeSimpleRange. (WebCore::searchForLinkRemovingExistingDDLinks): Removed out argument about modifying the DOM. This was used to work around a problem caused by using live ranges. The problem no longer exists because the code does not use live ranges any more. (WebCore::DataDetection::detectContentInRange): Removed the workaround. * editing/cocoa/DictionaryLookup.mm: (WebCore::DictionaryLookup::rangeForSelection): Simplify using makeSimpleRange. (WebCore::DictionaryLookup::rangeAtHitTestResult): Ditto. * editing/cocoa/WebContentReaderCocoa.mm: Added include of "Range.h", may not be needed now, but highly likely to be needed after future live range work. * editing/ios/DictationCommandIOS.cpp: Removed include of "Range.h". * editing/mac/DictionaryLookupLegacy.mm: (WebCore::DictionaryLookup::rangeForSelection): Simplify using makeSimpleRange. (WebCore::DictionaryLookup::rangeAtHitTestResult): Ditto. * editing/mac/EditorMac.mm: Removed include of "Range.h". * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::renderedTextRespectingRange): Simplify using makeSimpleRange. * editing/win/EditorWin.cpp: Added include of "Range.h", may not be needed now, but highly likely to be needed after future live range work. * html/shadow/mac/ImageControlsButtonElementMac.cpp: Removed include of "Range.h". * page/DOMSelection.cpp: (WebCore::DOMSelection::addRange): Call setSelection instead of moveTo. No need to have two functions that do the same thing. * page/EventHandler.cpp: (WebCore::textDistance): Simplify using makeSimpleRange. * page/Frame.cpp: (WebCore::Frame::rangeForPoint): Simplify using makeSimpleRange. * page/TextIndicator.cpp: (WebCore::estimatedBackgroundColorForRange): Simplify using the commonInclusiveAncestor overload that takes a range. (WebCore::initializeIndicator): Ditto. 2020-07-29 Adrian Perez de Castro Non-unified build fixes, late July 2020 edition https://bugs.webkit.org/show_bug.cgi?id=214918 Unreviewed build fix. No new tests needed. * Modules/webaudio/WebKitOscillatorNode.h: Add missing WebKitAudioContext.h header to make the constructor of WebKitOscillatorNode that WebKitAudioContext inherits from the base context, otherwise the compiler does not know which base class constructor to invoke. * bindings/js/JSDOMConvertDate.h: Add missing JSGlobalObject.h header. * bindings/js/ReadableStreamDefaultController.cpp: Sprinkle missing JSC:: namespace prefixes where needed. (WebCore::invokeReadableStreamDefaultControllerFunction): (WebCore::ReadableStreamDefaultController::close): (WebCore::ReadableStreamDefaultController::error): (WebCore::ReadableStreamDefaultController::enqueue): * editing/SpellChecker.cpp: Add missing inclusion of TextIterator.h. * editing/SpellChecker.h: Add missing inclusion of SimpleRange.h. * editing/TextCheckingHelper.h: Forward declare Frame and VisibleSelection. * editing/TextIterator.cpp: Add missing inclusion of Range.h. * workers/WorkerScriptLoader.h: Add missing inclusion of CertificateInfo.h. 2020-07-29 Commit Queue Unreviewed, reverting r265002. https://bugs.webkit.org/show_bug.cgi?id=214919 Broke imported/w3c/web-platform-tests/webaudio/the-audio-api /the-scriptprocessornode-interface/simple-input-output.html Reverted changeset: "Added constructor methods to ChannelMergerNode, ChannelSplitterNode" https://bugs.webkit.org/show_bug.cgi?id=214851 https://trac.webkit.org/changeset/265002 2020-07-28 Fujii Hironori [WinCairo] REGRESSION(r264986) Unreviewed crash fix https://bugs.webkit.org/show_bug.cgi?id=201507 * platform/graphics/egl/GLContextEGL.cpp: (WebCore::GLContextEGL::createWindowContext): Initialize a variable 'surface' as EGL_NO_SURFACE for WinCairo. 2020-07-28 Chris Dumez Move non standard OscillatorNode API to new webKitOscillatorNode interface https://bugs.webkit.org/show_bug.cgi?id=214902 Reviewed by Darin Adler. Move non standard OscillatorNode API to new webKitOscillatorNode interface: https://webaudio.github.io/web-audio-api/#oscillatornode Namely, the playbackState attribute and its associated constants are now exposed on the prefixed webKitOscillatorNode interface instead of the unprefixed OscillatorNode. This way, this API is still available to apps using the prefixed API but we do not support this legacy API if the app is using the modern unprefixed API. Test: webaudio/oscillatornode-legacy-api.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::create): (WebCore::OscillatorNode::setType): (WebCore::OscillatorNode::setPeriodicWave): * Modules/webaudio/OscillatorNode.h: * Modules/webaudio/OscillatorNode.idl: * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::createWebKitOscillator): * Modules/webaudio/WebKitAudioContext.h: * Modules/webaudio/WebKitAudioContext.idl: * Modules/webaudio/WebKitOscillatorNode.h: Copied from Source/WebCore/Modules/webaudio/OscillatorNode.idl. (WebCore::WebKitOscillatorNode::create): (WebCore::WebKitOscillatorNode::setWebKitPeriodicWave): (WebCore::WebKitOscillatorNode::WebKitOscillatorNode): * Modules/webaudio/WebKitOscillatorNode.idl: Copied from Source/WebCore/Modules/webaudio/OscillatorNode.idl. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: 2020-07-28 Karl Rackler Unreviewed, reverting r264930. Reverting Pre-Submission Testing Reverted changeset: "scaleResolutionDownBy has no effect on RTCRtpSender" https://bugs.webkit.org/show_bug.cgi?id=214783 https://trac.webkit.org/changeset/264930 2020-07-28 Oriol Brufau [css-grid] Fix 'align-content' in grid containers with small content area https://bugs.webkit.org/show_bug.cgi?id=214370 Reviewed by Darin Adler. In order to properly obey 'align-content', grid containers need to know the available grid space for the block axis. But there was a bug when the sum of border and padding sizes in the block axis were bigger than the content area. Then the available space was considered to be that sum. This patch fixes it so that the available grid space is the size of its content box when that is definite. Tests: imported/w3c/web-platform-tests/css/css-grid/alignment/grid-place-content-001.html imported/w3c/web-platform-tests/css/css-sizing/available-height-for-replaced-content-001.html * rendering/RenderBox.cpp: (WebCore::RenderBox::availableLogicalHeight const): 2020-07-28 Peng Liu Clean up PlaybackSessionInterface[Mac|AVKit] https://bugs.webkit.org/show_bug.cgi?id=214895 Reviewed by Eric Carlson. No new tests, no functional change. * platform/ios/PlaybackSessionInterfaceAVKit.h: * platform/ios/PlaybackSessionInterfaceAVKit.mm: (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit): (WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const): Remove unnecessary WEBCORE_EXPORT. Include the correct header for Ref. Replace "protected" with "private". Use WeakPtr of PlaybackSessionModel instead of a raw pointer. * platform/mac/PlaybackSessionInterfaceMac.h: Add "final" to ensureControlsManager(). Some small cleanup. 2020-07-28 Chris Dumez [EventSource] WebKit fails to UTF-8 encode the Last-Event-ID HTTP header value https://bugs.webkit.org/show_bug.cgi?id=214860 Reviewed by Alex Christensen and Darin Adler. WebKit fails to UTF-8 encode the Last-Event-ID HTTP header value for EventSource. The specification is here: https://html.spec.whatwg.org/multipage/server-sent-events.html#reestablish-the-connection (step 5.3.) This is causing us to fail a couple of EventSource web-platform-tests which are passing in both Chrome & Firefox. No new tests, rebaselined existing tests. * platform/network/cf/ResourceRequestCFNet.cpp: (WebCore::setHeaderFields): * platform/network/cf/ResourceRequestCFNet.h: (WebCore::httpHeaderValueUsingSuitableEncoding): * platform/network/cocoa/ResourceRequestCocoa.mm: (WebCore::ResourceRequest::doUpdatePlatformRequest): 2020-07-28 Fujii Hironori [WinCairo] ANGLE D3D renderer can crash when PlatformDisplayWin is destructed in IPC thread https://bugs.webkit.org/show_bug.cgi?id=214241 Reviewed by Don Olmstead. Web process calls _exit() in IPC thread when the IPC connection is closed. PlatformDisplay::sharedDisplay has a static variable of std::unique_ptr to ensure it will be destructed on the process termination. This rarely causes crashes in ANGLE because ANGLE D3D renderer isn't thread-safe at the moment. * platform/graphics/PlatformDisplay.cpp: (WebCore::PlatformDisplay::sharedDisplay): Don't destruct PlatformDisplay for PLATFORM(WIN). Use unique_ptr::release to leak it. 2020-07-28 Clark Wang Added constructor methods to ChannelMergerNode, ChannelSplitterNode https://bugs.webkit.org/show_bug.cgi?id=214851 Reviewed by Chris Dumez. Added constructors for ChannelMergerNode, ChannelSplitterNode according to spec: https://www.w3.org/TR/webaudio/#ChannelMergerNode-constructors. Added new files for ChannelMergerOptions and ChannelSplitterOptions. Re-baselined existing tests that now pass, or fail due to a different interface. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioNode.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createChannelSplitter): (WebCore::BaseAudioContext::createChannelMerger): * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::create): (WebCore::ChannelMergerNode::setChannelCount): (WebCore::ChannelMergerNode::setChannelCountMode): * Modules/webaudio/ChannelMergerNode.h: * Modules/webaudio/ChannelMergerNode.idl: * Modules/webaudio/ChannelMergerOptions.h: Added. * Modules/webaudio/ChannelMergerOptions.idl: Added. * Modules/webaudio/ChannelSplitterNode.cpp: (WebCore::ChannelSplitterNode::create): (WebCore::ChannelSplitterNode::setChannelCount): (WebCore::ChannelSplitterNode::setChannelCountMode): (WebCore::ChannelSplitterNode::setChannelInterpretation): * Modules/webaudio/ChannelSplitterNode.h: * Modules/webaudio/ChannelSplitterNode.idl: * Modules/webaudio/ChannelSplitterOptions.h: Added. * Modules/webaudio/ChannelSplitterOptions.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-07-28 Rob Buis PerformanceObserver should work with 'type' and not just `entryTypes` https://bugs.webkit.org/show_bug.cgi?id=209216 Reviewed by Youenn Fablet. Add support for 'type' attribute as specified here [1]. Tests: imported/w3c/web-platform-tests/performance-timeline/po-observe-type.any.html imported/w3c/web-platform-tests/performance-timeline/po-observe-type.any.worker.html [1] https://w3c.github.io/performance-timeline/#dom-performanceobserverinit * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::observe): * page/PerformanceObserver.h: * page/PerformanceObserver.idl: 2020-07-28 Karl Rackler Unreviewed, reverting r264955. Reverting because this commit may have caused issues with tests. Reverted changeset: "WebCoreResourceHandleAsOperationQueueDelegate can use RunLoop::dispatch" https://bugs.webkit.org/show_bug.cgi?id=214771 https://trac.webkit.org/changeset/264955 2020-07-28 Saam Barati JSPromise::reject might throw more than an unterminated exception https://bugs.webkit.org/show_bug.cgi?id=214854 Reviewed by Yusuke Suzuki. Before, we were assuming the only exception that could be thrown was an early termination exception. However, it's tenuous to assume the types of exceptions that can be thrown. This particular test was throwing a stack overflow exception. It's better form to just propagate the exception upwards instead of attempting to enumerate the list of valid exceptions. Test: js/dom/promise-rejection-might-stack-overflow.html * bindings/js/JSDOMPromiseDeferred.cpp: (WebCore::DeferredPromise::reject): 2020-07-28 Alex Christensen Add null checks in ResourceLoader https://bugs.webkit.org/show_bug.cgi?id=214786 Reviewed by Youenn Fablet. We had added some iOS-only checks based on crash tracer data. It turns out these code paths are indeed reachable. Let's make ResourceLoader less platform-dependent. The original patch for this has a test that would reach this code, but it never finishes loading. Rather than add a test that always times out or not committing the fix, I commit the fix without the test. * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::init): (WebCore::ResourceLoader::cancel): 2020-07-28 Yusuke Suzuki IndexedDB binding utilities miss exception checks https://bugs.webkit.org/show_bug.cgi?id=214820 Reviewed by Mark Lam. Test: js/dom/indexed-db-operations-exception-checks.html This patch appropriately inserts exception checking code into IndexedDB binding utilities. * Modules/indexeddb/IDBKeyRange.cpp: (WebCore::IDBKeyRange::only): (WebCore::IDBKeyRange::lowerBound): (WebCore::IDBKeyRange::upperBound): (WebCore::IDBKeyRange::bound): (WebCore::IDBKeyRange::includes): * bindings/js/IDBBindingUtilities.cpp: (WebCore::get): (WebCore::set): (WebCore::toJS): (WebCore::createIDBKeyFromValue): (WebCore::internalCreateIDBKeyFromScriptValueAndKeyPath): (WebCore::ensureNthValueOnKeyPath): (WebCore::injectIDBKeyIntoScriptValue): (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath): (WebCore::canInjectIDBKeyIntoScriptValue): (WebCore::scriptValueToIDBKey): * bindings/js/IDBBindingUtilities.h: * bindings/js/JSCustomXPathNSResolver.cpp: (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI): * bindings/js/JSDOMConvertDate.cpp: (WebCore::valueToDate): * bindings/js/JSDOMConvertDate.h: (WebCore::Converter::convert): * bindings/js/JSDOMConvertStrings.h: (WebCore::JSConverter::convert): (WebCore::JSConverter::convert): (WebCore::JSConverter::convert): * bindings/js/JSDOMConvertWebGL.cpp: (WebCore::convertToJSValue): * bindings/js/JSLazyEventListener.cpp: (WebCore::JSLazyEventListener::initializeJSFunction const): * bindings/scripts/CodeGeneratorJS.pm: (GenerateEnumerationImplementationContent): * bindings/scripts/test/JS/JSTestCallbackInterface.cpp: (WebCore::convertEnumerationToJS): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::convertEnumerationToJS): * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp: (WebCore::convertEnumerationToJS): * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp: (WebCore::convertEnumerationToJS): * bridge/c/c_utility.cpp: (JSC::Bindings::convertNPVariantToValue): 2020-07-28 Adrian Perez de Castro [GTK] Crash in Nicosia::GC3DLayer::makeContextCurrent due to failure in EGL display creation https://bugs.webkit.org/show_bug.cgi?id=201507 Reviewed by Carlos Garcia Campos. Ensure that EGL context and display creation failures are always logged using RELEASE_LOG_INFO(), even for intermediate failures for which a fallback will be tried next, in order to ease diagnosis of related issues. Failure to create contexts at the end of the public methods ::createContext() and ::createSharingContext() is still logged with WTFLogAlways() to write a notice to standard error, and let users/developers know that something failed and checking the complete logs (e.g. with "journalctl" on Linux) may reveal more information. This also replaces the chains of "if" statements with a single "switch" on the PlatformDisplay::Type enum, which makes the code easier to follow and should be more robust as well. No new tests needed. * platform/graphics/egl/GLContextEGL.cpp: (WebCore::GLContextEGL::getEGLConfig): (WebCore::GLContextEGL::createWindowContext): (WebCore::GLContextEGL::createSurfacelessContext): (WebCore::GLContextEGL::createContext): (WebCore::GLContextEGL::createSharingContext): 2020-07-28 Xabier Rodriguez Calvar [GStreamer] Use GST_PLUGIN_FEATURE_RANK env var to have Thunder ranked higher in runtime instead of current custom one https://bugs.webkit.org/show_bug.cgi?id=214826 * platform/graphics/gstreamer/GStreamerCommon.cpp: Unreviewed, added comment about delaying because of the dependency on GStreamer 1.16. 2020-07-28 Xabier Rodriguez Calvar [GStreamer] media/vp9.html failing since check-in in r263894 https://bugs.webkit.org/show_bug.cgi?id=213947 Reviewed by Philippe Normand. Test: media/vp9.html. * testing/Internals.cpp: (WebCore::Internals::usingGStreamer const): Added. * testing/Internals.h: * testing/Internals.idl: 2020-07-27 Carlos Garcia Campos [GTK][WPE] Support for backdrop-filter https://bugs.webkit.org/show_bug.cgi?id=169988 Reviewed by Adrian Perez de Castro. Add initial support for backdrop filters to coordinated graphics. * platform/graphics/nicosia/NicosiaPlatformLayer.h: (Nicosia::CompositionLayer::flushState): Update the backdrop layer. * platform/graphics/texmap/TextureMapper.h: * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::computeTransformsRecursive): Call it on backdrop layer too. (WebCore::TextureMapperLayer::paintSelfAndChildren): Paint the backdrop layer before current layer to apply backdrop filters on previous contents, then the layer is painted on top. (WebCore::TextureMapperLayer::paintIntoSurface): In case of backdrop layer paint the root layer up to the target layer into the intermediate surface. (WebCore::TextureMapperLayer::setBackdropLayer): Set the bakdrop layer and mark it as such. (WebCore::TextureMapperLayer::applyAnimationsRecursively): Also call syncAnimations on backdrop layer to get the filters updated. * platform/graphics/texmap/TextureMapperLayer.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::didChangeBackdropFilters): (WebCore::CoordinatedGraphicsLayer::didChangeBackdropFiltersRect): (WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect): Also call it for backdrop layer. (WebCore::CoordinatedGraphicsLayer::setContentsVisible): Ditto. (WebCore::CoordinatedGraphicsLayer::setBackdropFilters): (WebCore::CoordinatedGraphicsLayer::setBackdropFiltersRect): (WebCore::CoordinatedGraphicsLayer::flushCompositingState): Also call it for backdrop layer. (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly): Handle the changes in backdrop filters and the rect, creating the backdrop layer or updating it. (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers): Also call it for backdrop layer. (WebCore::CoordinatedGraphicsLayer::addAnimation): Handle AnimatedPropertyWebkitBackdropFilter property. (WebCore::dumpInnerLayer): Dump internal layer info. (WebCore::CoordinatedGraphicsLayer::dumpAdditionalProperties const): Dump backdrop layer. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: 2020-07-28 Youenn Fablet ReadableStreamDefaultController should use private JS built-in methods https://bugs.webkit.org/show_bug.cgi?id=214819 Reviewed by Darin Adler. Call directly private buitl-in methods instead of getting close/error/enqueue methods from the controller. Test: http/wpt/fetch/readableStreamDefaultController-overwriting.html * bindings/js/ReadableStreamDefaultController.cpp: (WebCore::invokeReadableStreamDefaultControllerFunction): (WebCore::ReadableStreamDefaultController::close): (WebCore::ReadableStreamDefaultController::error): (WebCore::ReadableStreamDefaultController::enqueue): * bindings/js/ReadableStreamDefaultController.h: (WebCore::ReadableStreamDefaultController::enqueue): (WebCore::ReadableStreamDefaultController::error): 2020-07-27 Carlos Garcia Campos REGRESSION(r230479): [TextureMapper] replica layer is not rendered https://bugs.webkit.org/show_bug.cgi?id=214827 Reviewed by Adrian Perez de Castro. Since r230479 the replica layer transform is not applied because m_layerTransforms.localTransform is never set for the replica layer. We need to call applyAnimationsRecursively() on the replica layer to initialize the localTransform (even when we know the replica layer won't have animations). * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::applyAnimationsRecursively): 2020-07-27 Alex Christensen Null check inlineStyle in StyledElement::invalidateStyleAttribute https://bugs.webkit.org/show_bug.cgi?id=214782 Reviewed by Geoffrey Garen. This fixes a reachable crash. Test: fast/dom/null-inline-style.html * dom/StyledElement.cpp: (WebCore::StyledElement::invalidateStyleAttribute): 2020-07-27 Wenson Hsieh [iOS] Drag and drop does not preserve file names that contain periods https://bugs.webkit.org/show_bug.cgi?id=214701 Reviewed by Tim Horton. Cocoa documentation does not make it clear whether the `-suggestedName` property on `NSItemProvider` should or should not include the file extension. To avoid adding a redundant file extension, logic in `WebItemProviderPasteboard` attempts to deduce whether the suggested name already contains an extension, and only appends a file extension (taken from name of the original file) if the suggested name does not have one. Unfortunately, since this logic only checks whether or not there is a period in the filename, it will incorrectly avoid adding a file extension when the suggested name contains a period. To fix this, instead of checking for the presence of a period, check to see whether the file extension of the suggested name is the same, and append the extension if it isn't. Test: DragAndDropTests.SuggestedNameContainsDot * platform/ios/WebItemProviderPasteboard.mm: (linkTemporaryItemProviderFilesToDropStagingDirectory): 2020-07-27 Zalan Bujtas Extension is sized incorrectly, content is cut off. https://bugs.webkit.org/show_bug.cgi?id=214858 Reviewed by Simon Fraser. Autosizing uses an 1px tall viewport to layout the content initially. When the document renderer's height is set to a percent value, this 1px tall viewport will drive the available height for the descendants and we pretty much end up with overflow content. Autosizing takes the overflow into account when computing the final content size, however this overflow depends on the type of the layout context (e.g. flex vs. block). Let's replace percent height values on the document renderer with the initial "height: auto". Test: fast/dynamic/size-to-content-autosize-with-percent-document-height.html * page/FrameView.cpp: (WebCore::FrameView::performSizeToContentAutoSize): 2020-07-27 Chris Dumez Update release*() functions on ExceptionOr() to always release the member https://bugs.webkit.org/show_bug.cgi?id=214835 Reviewed by Darin Adler. Update release*() functions on ExceptionOr() to always release the member instead of simply doing a cast to an rvalue reference and leaving it up to the caller. Also add assertions to make sure we don't release those members more than once and to make sure we don't try to access the member after releasing it. * Modules/indexeddb/IDBIndex.cpp: (WebCore::IDBIndex::doOpenCursor): (WebCore::IDBIndex::doOpenKeyCursor): (WebCore::IDBIndex::doGetAll): (WebCore::IDBIndex::doGetAllKeys): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::doOpenCursor): (WebCore::IDBObjectStore::doOpenKeyCursor): (WebCore::IDBObjectStore::doDelete): (WebCore::IDBObjectStore::doGetAll): (WebCore::IDBObjectStore::doGetAllKeys): Fix issues found in existing code by new assertions. * dom/ExceptionOr.h: (WebCore::ExceptionOr::exception const): (WebCore::ExceptionOr::releaseException): (WebCore::ExceptionOr::returnValue const): (WebCore::ExceptionOr::releaseReturnValue): (WebCore::>::releaseException): (WebCore::ExceptionOr::exception const): (WebCore::ExceptionOr::releaseException): * dom/TreeWalker.cpp: Fix issues found in existing code by new assertions. 2020-07-27 Geoffrey Garen WebCoreResourceHandleAsOperationQueueDelegate can use RunLoop::dispatch https://bugs.webkit.org/show_bug.cgi?id=214771 Reviewed by Darin Adler. Use the new helper function for consistency, and to remove a bit of code. * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (scheduledWithCustomRunLoopMode): Deleted. (-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]): Deleted. 2020-07-27 Chris Dumez thisValue is not always set correctly when calling JS callbacks https://bugs.webkit.org/show_bug.cgi?id=214847 Reviewed by Darin Adler. thisValue was not always set correctly when calling JS callbacks. This was causing us to fail the last subtest on: http://w3c-test.org/dom/traversal/TreeWalker-acceptNode-filter.html The specification for TreeWalker is here: - https://dom.spec.whatwg.org/#concept-node-filter Step 6 refers to [call a user object’s operation] in the WebIDL specification: - https://heycam.github.io/webidl/#call-a-user-objects-operation Step 10.5 says: "Set thisArg to O (overriding the provided value)." We were missing this step in our implementation so thisValue ended up being undefined (as per earlier step 2). No new tests, resync'd existing test. * bindings/js/JSCallbackData.cpp: (WebCore::JSCallbackData::invokeCallback): 2020-07-27 Sihui Liu Text manipulation should not extract non-breaking spaces https://bugs.webkit.org/show_bug.cgi?id=214839 Reviewed by Wenson Hsieh. Spaces are very likely to be dropped during translation. And non-breaking space, if dropped, is likely to affect layout of web page. API test: TextManipulation.StartTextManipulationIgnoresSpaces * editing/TextManipulationController.cpp: (WebCore::isNotSpace): (WebCore::TextManipulationController::parse): 2020-07-27 Chris Dumez ASSERT([filteredCookies.get() count] <= 1) on imported/w3c/web-platform-tests/websockets/cookies/third-party-cookie-accepted.https.html https://bugs.webkit.org/show_bug.cgi?id=214222 Reviewed by Alex Christensen. Per the HTML specification [1], upon setting document.cookie, we should act as we would when receiving a Set-Cookie string [2]. This means that you can only set one cookie at a time (you cannot comma-separate several cookies). We were behaving correctly on macOS because we were using the [NSHTTPCookie _parsedCookiesWithResponseHeaderFields] SPI that was made specifically for this purpose. However, we would set multiple cookies (in release), and crash in debug on iOS because iOS was using a different API to parse the cookies ([NSHTTPCookie cookiesWithResponseHeaderFields:). Note that [NSHTTPCookie _parsedCookiesWithResponseHeaderFields] was deprecated in CFNetwork, in favor of [NSHTTPCookie _cookieForSetCookieString:]. As a result, I updated both macOS and iOS to use the same new CFNetwork SPI, which gives us the standard behavior. [1] https://html.spec.whatwg.org/#dom-document-cookie [2] https://tools.ietf.org/html/rfc6265#section-4.1 Test: http/tests/cookies/document-cookie-multiple-cookies.html * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::parseDOMCookie): (WebCore::NetworkStorageSession::setCookiesFromDOM const): 2020-07-27 Clark Wang Added Constructor method to OscillatorNode https://bugs.webkit.org/show_bug.cgi?id=214746 Reviewed by Chris Dumez. Re-baselined existing tests that now pass, or fail further along. Added ctor to OscillatorNode, added OscillatorOptions, OscillatorType files all according to spec: https://www.w3.org/TR/webaudio/#OscillatorNode-constructors. Updated createOscillator() method in BaseAudioContext. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioContextOptions.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createOscillator): * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::create): (WebCore::OscillatorNode::OscillatorNode): (WebCore::OscillatorNode::setType): (WebCore::OscillatorNode::setPeriodicWave): * Modules/webaudio/OscillatorNode.h: (WTF::LogArgument::toString): (WTF::LogArgument::toString): Deleted. * Modules/webaudio/OscillatorNode.idl: * Modules/webaudio/OscillatorOptions.h: Copied from Source/WebCore/Modules/webaudio/PeriodicWaveConstraints.h. * Modules/webaudio/OscillatorOptions.idl: Copied from Source/WebCore/Modules/webaudio/PeriodicWaveConstraints.h. * Modules/webaudio/OscillatorType.h: Copied from Source/WebCore/Modules/webaudio/PeriodicWaveConstraints.h. * Modules/webaudio/OscillatorType.idl: Copied from Source/WebCore/Modules/webaudio/PeriodicWaveConstraints.h. * Modules/webaudio/PannerOptions.h: * Modules/webaudio/PeriodicWave.cpp: * Modules/webaudio/PeriodicWaveConstraints.h: * Modules/webaudio/PeriodicWaveOptions.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-07-27 Mark Lam DisallowVMEntry needs a copy assignment operator, detected by gcc's -Wdeprecated-copy warning https://bugs.webkit.org/show_bug.cgi?id=214809 Reviewed by Yusuke Suzuki. Added handling of a possible VMInquiry failure in JSDOMWindow::getOwnPropertySlot() after returning from Base::getOwnPropertySlot(). If a VMInquiry is requested and Base::getOwnPropertySlot() returns false with slot.isTaintedByOpaqueObject() set, then it means that Base::getOwnPropertySlot() failed to execute the VMInquiry, not that it successfully determined that the property doesn't exist. This issue was noticed while studying how JSDOMWindow::getOwnPropertySlot() uses copy assignment of JSC::PropertySlots. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::getOwnPropertySlot): 2020-07-27 Dean Jackson Repeatable WebContent crash: WebCore::jsWebGLRenderingContextPrototypeFunctionGetError https://bugs.webkit.org/show_bug.cgi?id=214814 rdar://59290537 Reviewed by Anders Carlsson. If a WebGL context was killed due to too many contexts in the page, we would get a null pointer crash if the page called getError() more than once on it. This is an edge case not covered by the WebGL conformance suite since the recyling behaviour is specific to our implementation. Test: fast/canvas/webgl/recycle-contexts.html * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::getError): Add a null check. 2020-07-27 Youenn Fablet scaleResolutionDownBy has no effect on RTCRtpSender https://bugs.webkit.org/show_bug.cgi?id=214783 Reviewed by Eric Carlson. Covered by updated test. * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::updateRTCRtpSendParameters): Allow to change scaleResolutionDownBy. 2020-07-25 Simon Fraser Scroll Snap broken when using RTL layout https://bugs.webkit.org/show_bug.cgi?id=193671 Reviewed by Wenson Hsieh. There were various places in the scroll snapping code which confused scroll offsets (zero-based) with scroll positions (relative to scroll origin, can be negative). This broke snapping in `direction: rtl` content. The computation of snap locations in updateSnapOffsetsForScrollableArea() was also broken in RTL; we need to snap the right edge of boxes to the right edge of the scroller for the 'start' alignment. (Snapping for LTR boxes in an RTL scroller is poorly defined; for now, follow Gecko.) Tests: css3/scroll-snap/scroll-snap-2d-change-axis-type-rtl.html css3/scroll-snap/scroll-snap-2d-offsets-computed-independently.rtl.html css3/scroll-snap/scroll-snap-elements-container-larger-than-children-rtl.html css3/scroll-snap/scroll-snap-iframe-rtl.html css3/scroll-snap/scroll-snap-offsets-mixed-rtl.html css3/scroll-snap/scroll-snap-offsets-rtl.html * page/scrolling/AxisScrollSnapOffsets.cpp: (WebCore::computeScrollSnapAlignOffset): (WebCore::updateSnapOffsetsForScrollableArea): * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const): * platform/ScrollAnimator.cpp: (WebCore::ScrollAnimator::updateActiveScrollSnapIndexForOffset): (WebCore::ScrollAnimator::scrollOffset const): * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::updateScrollSnapPoints): 2020-07-26 Michael Catanzaro -Wunused-parameter in FilterEffectRenderer.cpp https://bugs.webkit.org/show_bug.cgi?id=214808 Unreviewed. * platform/graphics/filters/FilterEffectRenderer.cpp: (WebCore::FilterEffectRenderer::tryCreate): 2020-07-22 Darin Adler Stop using live ranges in SpellChecker.h and TextCheckingHelper.h https://bugs.webkit.org/show_bug.cgi?id=214648 Reviewed by Sam Weinig. * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: Removed unneeded include of TextCheckingHelper.h. * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::removeMarkers): Updated for change to the argument type name. (WebCore::DocumentMarkerController::filterMarkers): Ditto. (WebCore::addMarker): Added. Convenience so call doesn't have to get the document to call this. (WebCore::removeMarkers): Ditto. * dom/DocumentMarkerController.h: Moved RemovePartiallyOverlappingMarker out of the DocumentMarkerController class, tweaked its name and changed it into an enum class. Added conveniences functions for add/removeMarker. * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection): Use convenience versions of removeMarkers and addMarker. (WebCore::AlternativeTextController::handleAlternativeTextUIResult): Ditto. (WebCore::AlternativeTextController::respondToUnappliedEditing): Ditto. (WebCore::AlternativeTextController::markReversed): Ditto. (WebCore::AlternativeTextController::markCorrection): Ditto. (WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection): Ditto. (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand): Ditto. (WebCore::AlternativeTextController::applyAlternativeTextToRange): Ditto. * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): Ditto. * editing/Editor.cpp: (WebCore::Editor::ignoreSpelling): Ditto. (WebCore::Editor::learnSpelling): Ditto. (WebCore::Editor::advanceToNextMisspelling): Rewrote to not use a live range and for the changes to the TextCheckingHelper. (WebCore::Editor::isSelectionUngrammatical): Deleted. (WebCore::Editor::guessesForMisspelledOrUngrammatical): Changed to use a return value instead of out arguments. (WebCore::Editor::clearMisspellingsAndBadGrammar): Use convenience versions of removeMarkers. (WebCore::Editor::markMisspellingsAfterTypingToWord): Ditto. (WebCore::Editor::markMisspellingsOrBadGrammar): Updated for change to TextCheckingHelper. (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Do not use live ranges. (WebCore::correctSpellcheckingPreservingTextCheckingParagraph): Take a range that isn't a live range. (WebCore::Editor::markAndReplaceFor): Tweak for changes to text checking and to use convenience version of addMarker. (WebCore::Editor::changeBackToReplacedString): Use convenience versions of removeMarkers and addMarker. (WebCore::Editor::updateMarkersForWordsAffectedByEditing): Ditto. (WebCore::Editor::countMatchesForText): Ditto. (WebCore::Editor::scanSelectionForTelephoneNumbers): Ditto. (WebCore::Editor::editorUIUpdateTimerFired): Ditto. (WebCore::Editor::handleAcceptedCandidate): Ditto. * editing/Editor.h: Update for the above. * editing/SpellChecker.cpp: (WebCore::SpellCheckRequest::SpellCheckRequest): No longer take live ranges. (WebCore::SpellCheckRequest::create): Ditto. (WebCore::SpellChecker::canCheckAsynchronously const): Ditto. (WebCore::SpellChecker::isCheckable const): Ditto. (WebCore::SpellChecker::didCheckSucceed): Use convenience versions of removeMarkers. * editing/SpellChecker.h: Remove the use of live ranges. Removed many unneeded includes and forward declarations. * editing/TextCheckingHelper.cpp: (WebCore::expandToParagraphBoundary): Take and return non-live ranges. (WebCore::TextCheckingParagraph::TextCheckingParagraph): Ditto. (WebCore::TextCheckingParagraph::expandRangeToNextEnd): Updated to use non-live ranges. (WebCore::TextCheckingParagraph::invalidateParagraphRangeValues): Ditto. (WebCore::TextCheckingParagraph::paragraphRange const): Ditto. (WebCore::TextCheckingParagraph::subrange const): Ditto. (WebCore::TextCheckingParagraph::offsetTo const): Ditto. (WebCore::TextCheckingParagraph::offsetAsRange const): Ditto. (WebCore::TextCheckingParagraph::automaticReplacementStart const): Ditto. (WebCore::TextCheckingParagraph::automaticReplacementLength const): Ditto. (WebCore::TextCheckingHelper::~TextCheckingHelper): Deleted. (WebCore::TextCheckingHelper::findMispelledWords const): Renamed from findFirstMispelling, and made this private function since it has confusing argument and return types. Reimplemented to use non-live ranges and to use return values and the addMarker convenience function. Also changed this to not mark when called just to find the first mispelled word. The old version always marked, which didn't make logical sense, but was harmless because the caller always marked the same way. Now this does what it says. (WebCore::TextCheckingHelper::findFirstMisspelledWord const): Added. Replaces findFirstMispelling as a public function, and returns a structure instead of using out arguments. (WebCore::TextCheckingHelper::findFirstMisspelledWordOrUngrammaticalPhrase const): Renamed from findFirstMisspellingOrBadGrammar and changed to return a structure instead of using out arguments. (WebCore::TextCheckingHelper::findUngrammaticalPhrases const): Renamed from findFirstGrammarDetail and findFirstBadGrammar. Both functions are now private and use the new Operation enum class to distinguish the "find first" from "mark all" usage. Also use the convience version of addMarker and return results in a structure instead of using out arguments. (WebCore::TextCheckingHelper::findFirstUngrammaticalPhrase const): Added. Replaces findFirstBadGrammar as a public function, returns a structure instead of using out arguments. (WebCore::TextCheckingHelper::guessesForMisspelledWordOrUngrammaticalPhrase const): Renamed from guessesForMisspelledOrUngrammaticalRange and changed to return a structure instead of out arguments. (WebCore::TextCheckingHelper::markAllMisspelledWords const): Renamed from markAllMisspellings and changed to use a return value instead of an out argument. (WebCore::TextCheckingHelper::markAllUngrammaticalPhrases const): Renamed from markAllBadGrammar. * editing/TextCheckingHelper.h: Removed unneed include of "EditorClient.h". Use non-live ranges. Updated for the other changes above. * editing/ios/DictationCommandIOS.cpp: (WebCore::DictationCommandIOS::doApply): Use the convenience version of addMarker. * editing/ios/EditorIOS.mm: (WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto. * page/ContextMenuController.cpp: (WebCore::ContextMenuController::populate): Updated for the change to Editor::guessesForMisspelledOrUngrammatical. * platform/text/TextChecking.h: Added a TextCheckingGuesses structure here used both by Editor and TextCheckingHelper. 2020-07-26 Youenn Fablet Update capture MediaStreamTrack frameRate and aspectRatio capabilities https://bugs.webkit.org/show_bug.cgi?id=214741 Reviewed by Eric Carlson. We support frame decimation to decrease the frame rate. This allows to get a frame rate down to 1. We support resizing up to max width/height resolution. This allows very wide aspect ratios. Covered by updated tests. * platform/mediastream/RealtimeVideoCaptureSource.cpp: (WebCore::RealtimeVideoCaptureSource::updateCapabilities): 2020-07-24 Mark Lam pluginElementCustomGetOwnPropertySlot() should support VMInquiry requests. https://bugs.webkit.org/show_bug.cgi?id=214555 Reviewed by Yusuke Suzuki. 1. Add handling for VMInquiry failure in CodeGeneratorJS. 2. Fix pluginElementCustomGetOwnPropertySlot() to setIsTaintedByOpaqueObject(). 3. Fix pluginElementCustomGetOwnPropertySlot() handle a VMInquiry failure case and if so, to initialize the PropertySlot to a jsUndefined() value. The client shouldn't be reading the value if the VMInquiry failed, but as a defensive action, we'll initialize the slot to effectively return an undefined value. * bindings/js/JSPluginElementFunctions.cpp: (WebCore::pluginElementCustomGetOwnPropertySlot): * bindings/scripts/CodeGeneratorJS.pm: (GenerateGetOwnPropertySlot): (GenerateGetOwnPropertySlotByIndex): * bindings/scripts/test/JS/JSTestPluginInterface.cpp: (WebCore::JSTestPluginInterface::getOwnPropertySlot): (WebCore::JSTestPluginInterface::getOwnPropertySlotByIndex): 2020-07-25 Wenson Hsieh [iOS] Crash under ValidationBubble::setAnchorRect when showing form validation UI in unparented view https://bugs.webkit.org/show_bug.cgi?id=214789 Reviewed by Tim Horton. On iOS, in the case where `WKWebView` is unparented (or is otherwise missing a root view controller, or the private WKUIDelegate method `-_presentingViewControllerForWebView:` returns `nil`), we end up crashing under `ValidationBubble::setAnchorRect` while attempting to add `presentingViewController.view` (which is `nil`) to an array of passthrough views. Since `fallbackViewController` is not guaranteed to successfully find a view controller anyways, make this scenario fail gracefully with a null check, instead of crashing the app. Test: FormValidation.PresentingFormValidationUIWithoutViewControllerDoesNotCrash * platform/ios/ValidationBubbleIOS.mm: (WebCore::ValidationBubble::setAnchorRect): 2020-07-25 Simon Fraser Some scroll snap cleanup https://bugs.webkit.org/show_bug.cgi?id=214788 Reviewed by Wenson Hsieh. Mostly cleanup in updateSnapOffsetsForScrollableArea() related to getting the scroll limits, which changes behavior. updateSnapOffsetsForScrollableArea() was manually computing the scroll limits with scrollingElementBox.scrollWidth() - scrollingElementBox.contentWidth(), but needs to use the same computation that scrolling uses, namely scrollableArea.maximumScrollOffset(). This changes results, since the old code could compute offsets outside of the scroll limits. It can also get the scrollPosition from the scrollableArea, instead of going via Element. When computing scroll offsets, explicitly round now (which changes some test results). * page/scrolling/AxisScrollSnapOffsets.cpp: (WebCore::updateSnapOffsetsForScrollableArea): * platform/ScrollAnimator.cpp: (WebCore::ScrollAnimator::updateActiveScrollSnapIndexForOffset): Explicitly round. * platform/ScrollTypes.h: * platform/ScrollableArea.h: * platform/cocoa/ScrollController.h: * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::setActiveScrollSnapIndicesForOffset): Use ScrollOffset instead of x,y. 2020-07-25 Kenneth Russell [WebGL2] Context state updates https://bugs.webkit.org/show_bug.cgi?id=209513 Reviewed by Dean Jackson. Refactor a few methods related to context state to reduce duplicated code between WebGL 1.0 and 2.0. No behavioral changes. Covered by existing WebGL conformance tests. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::validateCapability): (WebCore::WebGL2RenderingContext::clear): Deleted. (WebCore::WebGL2RenderingContext::hint): Deleted. * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::hint): Deleted. (WebCore::WebGLRenderingContext::clear): Deleted. (WebCore::WebGLRenderingContext::validateCapability): Deleted. * html/canvas/WebGLRenderingContext.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::clear): (WebCore::WebGLRenderingContextBase::hint): (WebCore::WebGLRenderingContextBase::validateCapability): * html/canvas/WebGLRenderingContextBase.h: 2020-07-24 Brady Eidson Throw another one on the pile take 2. * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::controllerDidConnect): Back to the NSString* trick now we know the function is declared. 2020-07-24 Brady Eidson Throw another one on the pile. * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (Actually include the SPI header) 2020-07-24 Brady Eidson Maybe the last build fix after r264874 * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: 2020-07-24 Brady Eidson Yet another (bizarre?) attempted build fix after r264874 * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::controllerDidConnect): The last attempt revealed the real problem - missing declaration for this function. *sigh* 2020-07-24 Brady Eidson Another (bizarre?) attempted build fix after r264874 * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::controllerDidConnect): The CFSTR macro was wonky for unknown reasons...? Let's try it this way. 2020-07-24 Brady Eidson Build fix after r264874 Remove all nullability specifiers because just having one goes viral. * platform/gamepad/cocoa/GameControllerSPI.h: 2020-07-24 Alex Christensen Null check frame in Document::dispatchDisabledAdaptationsDidChangeForMainFrame and a few other places https://bugs.webkit.org/show_bug.cgi?id=214715 Reviewed by Geoffrey Garen. Test: security/mutation-observer-frame-detach.html * dom/Document.cpp: (WebCore::Document::didBecomeCurrentDocumentInFrame): (WebCore::Document::initContentSecurityPolicy): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::commitData): Add some null checks and early returns if the frame detaches. * loader/SubframeLoader.cpp: (WebCore::FrameLoader::SubframeLoader::loadSubframe): Balance the call to incrementLoadEventDelayCount in the early return case or this test never finishes loading. 2020-07-24 Alex Christensen Fix assertion when highlighting in detached frames and make loads complete https://bugs.webkit.org/show_bug.cgi?id=214770 Reviewed by Geoffrey Garen. There's an assertion added in r53218 I think should be an early return. It can be triggered by an interesting test I found while looking into rdar://problem/65467702 I also needed to balance the call to incrementLoadEventDelayCount in an early return in order to get the test to finish loading. Test: fast/editing/frame-selection-is-not-caret.html * editing/FrameSelection.cpp: (WebCore::FrameSelection::caretBlinkTimerFired): * loader/SubframeLoader.cpp: (WebCore::FrameLoader::SubframeLoader::loadSubframe): 2020-07-24 Michael Saboff Fixed exception check handling below ScheduledAction::executeFunctionInContext() https://bugs.webkit.org/show_bug.cgi?id=214774 Reviewed by Mark Lam. Test: js/dom/scheduled-action-exception-checks.html * bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::executeFunctionInContext): 2020-07-24 Brady Eidson Hard code some MFi controller devices instead of dynamically managing HID vs GameController.framework. rdar://problem/65961406 and https://bugs.webkit.org/show_bug.cgi?id=214664 Reviewed by Tim Horton. Covered by API tests. I'd added code to dynamically tell whether a device would be handled by GameController.framework or IOHID. On macOS Big Sur, it works flawlessly. On Catalina, it doesn't. The key problem being that GameController.framework will try to handle some controllers it should not. Instead, we can use a hard coded list of the controllers that are most important to support using GCF. The GCF provider and HID provider coordinate on that list when deciding if they should handle a new device. The worst case scenario for that list missing an important controller is that it would be handled in HID instead of GCF, so some features may be missing. * Modules/gamepad/GamepadManager.cpp: (WebCore::GamepadManager::makeGamepadVisible): * platform/gamepad/cocoa/GameControllerGamepadProvider.h: (WebCore::GameControllerGamepadProvider::numberOfConnectedGamepads const): * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::willHandleVendorAndProduct): (WebCore::GameControllerGamepadProvider::controllerDidConnect): * platform/gamepad/cocoa/GameControllerSPI.h: * platform/gamepad/mac/HIDGamepadProvider.h: (WebCore::HIDGamepadProvider::numberOfConnectedGamepads const): * platform/gamepad/mac/HIDGamepadProvider.mm: (WebCore::deviceAddedCallback): (WebCore::gameControllerFrameworkWillHandleHIDDevice): (WebCore::HIDGamepadProvider::deviceAdded): (WebCore::HIDGamepadProvider::deviceRemoved): (WebCore::HIDGamepadProvider::waitForManagementDecisionForDevice): Deleted. (WebCore::HIDGamepadProvider::removeDeviceWaitingForManagementDecision): Deleted. (WebCore::HIDGamepadProvider::gamePadServiceWasPublished): Deleted. 2020-07-24 Mark Lam Fix exception check handling below postMessage(). https://bugs.webkit.org/show_bug.cgi?id=214761 Reviewed by Yusuke Suzuki and Keith Miller. Test: js/dom/missing-exception-check-below-postMessage.html * bindings/js/JSDOMConvertSequences.h: (WebCore::Detail::SequenceConverter::convertArray): (WebCore::Detail::SequenceConverter::convert): 2020-07-24 Eric Carlson [Cocoa] Tell AVAssetResourceLoadingContentInformationRequest that asset size is available immediately https://bugs.webkit.org/show_bug.cgi?id=214759 Reviewed by Jer Noble. * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm: (WebCore::WebCoreAVFResourceLoader::responseReceived): 2020-07-23 Simon Fraser steps() timing function on a transform animation triggers a render every frame https://bugs.webkit.org/show_bug.cgi?id=214712 Reviewed by Tim Horton. An animation of transform, with a steps() timing function, would schedule a rendering update on every frame. This happened because KeyframeEffect::updateAcceleratedActions() would keep trying, and failing to start the accelerated animation every frame, since GraphicsLayerCA refuses to run accelerated animations with steps timing functions. Fix by making m_isRunningAccelerated a tri-state enum, which gets a new value once we've tried to run the animation the first time. Also ensure that we re-try if the timing function changes, via animationDidChangeTimingProperties(). Test: animations/steps-transform-rendering-updates.html * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::isRunningAcceleratedAnimationForProperty const): (WebCore::KeyframeEffect::updateAcceleratedActions): (WebCore::KeyframeEffect::animationDidChangeTimingProperties): (WebCore::KeyframeEffect::animationWasCanceled): (WebCore::KeyframeEffect::willChangeRenderer): (WebCore::KeyframeEffect::animationSuspensionStateDidChange): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): * animation/KeyframeEffect.h: (WebCore::KeyframeEffect::isRunningAccelerated const): * page/Page.cpp: (WebCore::Page::startTrackingRenderingUpdates): (WebCore::Page::renderingUpdateCount const): (WebCore::Page::updateRendering): * page/Page.h: * testing/Internals.cpp: (WebCore::Internals::startTrackingRenderingUpdates): (WebCore::Internals::renderingUpdateCount): * testing/Internals.h: * testing/Internals.idl: 2020-07-24 Mark Lam Fix JS bindings code to DECLARE_THROW_SCOPE in the functions that can throw instead of passing a ThrowScope around. https://bugs.webkit.org/show_bug.cgi?id=214695 Reviewed by Yusuke Suzuki. There are a few exceptions where it makes sense to pass a ThrowScope&, but those are rare. Unless one has a very good reason to do so, the best practice is to always DECLARE_THROW_SCOPE in the functions that can throw. Test: js/dom/missing-exception-check-below-queueMicrotask.html * bindings/js/JSDOMAttribute.h: (WebCore::IDLAttribute::set): (WebCore::IDLAttribute::setStatic): (WebCore::IDLAttribute::get): (WebCore::IDLAttribute::getStatic): * bindings/js/JSDOMIterator.h: (WebCore::iteratorForEach): * bindings/js/JSDOMOperation.h: (WebCore::IDLOperation::call): (WebCore::IDLOperation::callStatic): * bindings/js/JSDOMOperationReturningPromise.h: (WebCore::IDLOperationReturningPromise::call): (WebCore::IDLOperationReturningPromise::callReturningOwnPromise): (WebCore::IDLOperationReturningPromise::callStatic): (WebCore::IDLOperationReturningPromise::callStaticReturningOwnPromise): * bindings/js/JSDOMWindowCustom.cpp: (WebCore::jsDOMWindowInstanceFunctionOpenDatabaseBody): * bindings/js/JSEventTargetCustom.h: (WebCore::IDLOperation::call): * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GenerateAttributeGetterBodyDefinition): (GenerateAttributeSetterBodyDefinition): (GenerateOperationBodyDefinition): (GenerateSerializerDefinition): (GenerateWriteBarriersForArguments): (GenerateImplementationCustomFunctionCall): (GenerateIterableDefinition): (NativeToJSValueMayThrow): (NativeToJSValue): * bindings/scripts/test/JS/JSMapLike.cpp: (WebCore::jsMapLikeSizeGetter): (WebCore::jsMapLikePrototypeFunctionGetBody): (WebCore::jsMapLikePrototypeFunctionHasBody): (WebCore::jsMapLikePrototypeFunctionEntriesBody): (WebCore::jsMapLikePrototypeFunctionKeysBody): (WebCore::jsMapLikePrototypeFunctionValuesBody): (WebCore::jsMapLikePrototypeFunctionForEachBody): (WebCore::jsMapLikePrototypeFunctionSetBody): (WebCore::jsMapLikePrototypeFunctionClearBody): (WebCore::jsMapLikePrototypeFunctionDeleteBody): * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: (WebCore::jsReadOnlyMapLikeSizeGetter): (WebCore::jsReadOnlyMapLikePrototypeFunctionGetBody): (WebCore::jsReadOnlyMapLikePrototypeFunctionHasBody): (WebCore::jsReadOnlyMapLikePrototypeFunctionEntriesBody): (WebCore::jsReadOnlyMapLikePrototypeFunctionKeysBody): (WebCore::jsReadOnlyMapLikePrototypeFunctionValuesBody): (WebCore::jsReadOnlyMapLikePrototypeFunctionForEachBody): * bindings/scripts/test/JS/JSReadOnlySetLike.cpp: (WebCore::jsReadOnlySetLikeSizeGetter): (WebCore::jsReadOnlySetLikePrototypeFunctionHasBody): (WebCore::jsReadOnlySetLikePrototypeFunctionEntriesBody): (WebCore::jsReadOnlySetLikePrototypeFunctionKeysBody): (WebCore::jsReadOnlySetLikePrototypeFunctionValuesBody): (WebCore::jsReadOnlySetLikePrototypeFunctionForEachBody): * bindings/scripts/test/JS/JSSetLike.cpp: (WebCore::jsSetLikeSizeGetter): (WebCore::jsSetLikePrototypeFunctionHasBody): (WebCore::jsSetLikePrototypeFunctionEntriesBody): (WebCore::jsSetLikePrototypeFunctionKeysBody): (WebCore::jsSetLikePrototypeFunctionValuesBody): (WebCore::jsSetLikePrototypeFunctionForEachBody): (WebCore::jsSetLikePrototypeFunctionAddBody): (WebCore::jsSetLikePrototypeFunctionClearBody): (WebCore::jsSetLikePrototypeFunctionDeleteBody): * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: (WebCore::jsTestActiveDOMObjectExcitingAttrGetter): (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunctionBody): (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessageBody): (WebCore::jsTestActiveDOMObjectPrototypeFunctionOverloadedMethod1Body): (WebCore::jsTestActiveDOMObjectPrototypeFunctionOverloadedMethod2Body): (WebCore::jsTestActiveDOMObjectPrototypeFunctionOverloadedMethodOverloadDispatcher): * bindings/scripts/test/JS/JSTestCEReactions.cpp: (WebCore::jsTestCEReactionsAttributeWithCEReactionsGetter): (WebCore::setJSTestCEReactionsAttributeWithCEReactionsSetter): (WebCore::jsTestCEReactionsReflectAttributeWithCEReactionsGetter): (WebCore::setJSTestCEReactionsReflectAttributeWithCEReactionsSetter): (WebCore::jsTestCEReactionsStringifierAttributeGetter): (WebCore::setJSTestCEReactionsStringifierAttributeSetter): (WebCore::jsTestCEReactionsAttributeWithCEReactionsNotNeededGetter): (WebCore::setJSTestCEReactionsAttributeWithCEReactionsNotNeededSetter): (WebCore::jsTestCEReactionsReflectAttributeWithCEReactionsNotNeededGetter): (WebCore::setJSTestCEReactionsReflectAttributeWithCEReactionsNotNeededSetter): (WebCore::jsTestCEReactionsStringifierAttributeNotNeededGetter): (WebCore::setJSTestCEReactionsStringifierAttributeNotNeededSetter): (WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactionsBody): (WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactionsNotNeededBody): * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: (WebCore::jsTestCEReactionsStringifierValueGetter): (WebCore::setJSTestCEReactionsStringifierValueSetter): (WebCore::jsTestCEReactionsStringifierValueWithoutReactionsGetter): (WebCore::setJSTestCEReactionsStringifierValueWithoutReactionsSetter): (WebCore::jsTestCEReactionsStringifierPrototypeFunctionToStringBody): * bindings/scripts/test/JS/JSTestCallTracer.cpp: (WebCore::jsTestCallTracerTestAttributeInterfaceGetter): (WebCore::setJSTestCallTracerTestAttributeInterfaceSetter): (WebCore::jsTestCallTracerTestAttributeSpecifiedGetter): (WebCore::setJSTestCallTracerTestAttributeSpecifiedSetter): (WebCore::jsTestCallTracerTestAttributeWithVariantGetter): (WebCore::setJSTestCallTracerTestAttributeWithVariantSetter): (WebCore::jsTestCallTracerTestReadonlyAttributeGetter): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationInterfaceBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationSpecifiedBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithArgumentsBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgumentBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgumentBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableVariantArgumentBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithOptionalVariantArgumentBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithDefaultVariantArgumentBody): * bindings/scripts/test/JS/JSTestDOMJIT.cpp: (WebCore::jsTestDOMJITAnyAttrGetter): (WebCore::jsTestDOMJITBooleanAttrGetter): (WebCore::jsTestDOMJITByteAttrGetter): (WebCore::jsTestDOMJITOctetAttrGetter): (WebCore::jsTestDOMJITShortAttrGetter): (WebCore::jsTestDOMJITUnsignedShortAttrGetter): (WebCore::jsTestDOMJITLongAttrGetter): (WebCore::jsTestDOMJITUnsignedLongAttrGetter): (WebCore::jsTestDOMJITLongLongAttrGetter): (WebCore::jsTestDOMJITUnsignedLongLongAttrGetter): (WebCore::jsTestDOMJITFloatAttrGetter): (WebCore::jsTestDOMJITUnrestrictedFloatAttrGetter): (WebCore::jsTestDOMJITDoubleAttrGetter): (WebCore::jsTestDOMJITUnrestrictedDoubleAttrGetter): (WebCore::jsTestDOMJITDomStringAttrGetter): (WebCore::jsTestDOMJITByteStringAttrGetter): (WebCore::jsTestDOMJITUsvStringAttrGetter): (WebCore::jsTestDOMJITNodeAttrGetter): (WebCore::jsTestDOMJITBooleanNullableAttrGetter): (WebCore::jsTestDOMJITByteNullableAttrGetter): (WebCore::jsTestDOMJITOctetNullableAttrGetter): (WebCore::jsTestDOMJITShortNullableAttrGetter): (WebCore::jsTestDOMJITUnsignedShortNullableAttrGetter): (WebCore::jsTestDOMJITLongNullableAttrGetter): (WebCore::jsTestDOMJITUnsignedLongNullableAttrGetter): (WebCore::jsTestDOMJITLongLongNullableAttrGetter): (WebCore::jsTestDOMJITUnsignedLongLongNullableAttrGetter): (WebCore::jsTestDOMJITFloatNullableAttrGetter): (WebCore::jsTestDOMJITUnrestrictedFloatNullableAttrGetter): (WebCore::jsTestDOMJITDoubleNullableAttrGetter): (WebCore::jsTestDOMJITUnrestrictedDoubleNullableAttrGetter): (WebCore::jsTestDOMJITDomStringNullableAttrGetter): (WebCore::jsTestDOMJITByteStringNullableAttrGetter): (WebCore::jsTestDOMJITUsvStringNullableAttrGetter): (WebCore::jsTestDOMJITNodeNullableAttrGetter): (WebCore::jsTestDOMJITPrototypeFunctionGetAttributeBody): (WebCore::jsTestDOMJITPrototypeFunctionItemBody): (WebCore::jsTestDOMJITPrototypeFunctionHasAttributeBody): (WebCore::jsTestDOMJITPrototypeFunctionGetElementByIdBody): (WebCore::jsTestDOMJITPrototypeFunctionGetElementsByNameBody): * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: (WebCore::jsTestEnabledBySettingTestSubObjEnabledBySettingConstructorGetter): (WebCore::setJSTestEnabledBySettingTestSubObjEnabledBySettingConstructorSetter): (WebCore::jsTestEnabledBySettingEnabledBySettingAttributeGetter): (WebCore::setJSTestEnabledBySettingEnabledBySettingAttributeSetter): (WebCore::jsTestEnabledBySettingPrototypeFunctionEnabledBySettingOperationBody): * bindings/scripts/test/JS/JSTestEnabledForContext.cpp: (WebCore::jsTestEnabledForContextTestSubObjEnabledForContextConstructorGetter): (WebCore::setJSTestEnabledForContextTestSubObjEnabledForContextConstructorSetter): * bindings/scripts/test/JS/JSTestEventConstructor.cpp: (WebCore::jsTestEventConstructorAttr1Getter): (WebCore::jsTestEventConstructorAttr2Getter): (WebCore::jsTestEventConstructorAttr3Getter): * bindings/scripts/test/JS/JSTestEventTarget.cpp: (WebCore::jsTestEventTargetPrototypeFunctionItemBody): * bindings/scripts/test/JS/JSTestException.cpp: (WebCore::jsTestExceptionNameGetter): * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: (WebCore::jsTestGenerateIsReachableASecretAttributeGetter): * bindings/scripts/test/JS/JSTestGlobalObject.cpp: (WebCore::jsTestGlobalObjectRegularAttributeGetter): (WebCore::setJSTestGlobalObjectRegularAttributeSetter): (WebCore::jsTestGlobalObjectPublicAndPrivateAttributeGetter): (WebCore::setJSTestGlobalObjectPublicAndPrivateAttributeSetter): (WebCore::jsTestGlobalObjectPublicAndPrivateConditionalAttributeGetter): (WebCore::setJSTestGlobalObjectPublicAndPrivateConditionalAttributeSetter): (WebCore::jsTestGlobalObjectEnabledAtRuntimeAttributeGetter): (WebCore::setJSTestGlobalObjectEnabledAtRuntimeAttributeSetter): (WebCore::jsTestGlobalObjectTestCEReactionsConstructorGetter): (WebCore::setJSTestGlobalObjectTestCEReactionsConstructorSetter): (WebCore::jsTestGlobalObjectTestCEReactionsStringifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestCEReactionsStringifierConstructorSetter): (WebCore::jsTestGlobalObjectTestCallTracerConstructorGetter): (WebCore::setJSTestGlobalObjectTestCallTracerConstructorSetter): (WebCore::jsTestGlobalObjectTestCallbackInterfaceConstructorGetter): (WebCore::setJSTestGlobalObjectTestCallbackInterfaceConstructorSetter): (WebCore::jsTestGlobalObjectTestClassWithJSBuiltinConstructorConstructorGetter): (WebCore::setJSTestGlobalObjectTestClassWithJSBuiltinConstructorConstructorSetter): (WebCore::jsTestGlobalObjectTestDOMJITConstructorGetter): (WebCore::setJSTestGlobalObjectTestDOMJITConstructorSetter): (WebCore::jsTestGlobalObjectTestDomainSecurityConstructorGetter): (WebCore::setJSTestGlobalObjectTestDomainSecurityConstructorSetter): (WebCore::jsTestGlobalObjectTestEnabledBySettingConstructorGetter): (WebCore::setJSTestGlobalObjectTestEnabledBySettingConstructorSetter): (WebCore::jsTestGlobalObjectTestEnabledForContextConstructorGetter): (WebCore::setJSTestGlobalObjectTestEnabledForContextConstructorSetter): (WebCore::jsTestGlobalObjectTestEventConstructorConstructorGetter): (WebCore::setJSTestGlobalObjectTestEventConstructorConstructorSetter): (WebCore::jsTestGlobalObjectTestEventTargetConstructorGetter): (WebCore::setJSTestGlobalObjectTestEventTargetConstructorSetter): (WebCore::jsTestGlobalObjectTestExceptionConstructorGetter): (WebCore::setJSTestGlobalObjectTestExceptionConstructorSetter): (WebCore::jsTestGlobalObjectTestGenerateIsReachableConstructorGetter): (WebCore::setJSTestGlobalObjectTestGenerateIsReachableConstructorSetter): (WebCore::jsTestGlobalObjectTestGlobalObjectConstructorGetter): (WebCore::setJSTestGlobalObjectTestGlobalObjectConstructorSetter): (WebCore::jsTestGlobalObjectTestIndexedSetterNoIdentifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestIndexedSetterNoIdentifierConstructorSetter): (WebCore::jsTestGlobalObjectTestIndexedSetterThrowingExceptionConstructorGetter): (WebCore::setJSTestGlobalObjectTestIndexedSetterThrowingExceptionConstructorSetter): (WebCore::jsTestGlobalObjectTestIndexedSetterWithIdentifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestIndexedSetterWithIdentifierConstructorSetter): (WebCore::jsTestGlobalObjectTestInterfaceConstructorGetter): (WebCore::setJSTestGlobalObjectTestInterfaceConstructorSetter): (WebCore::jsTestGlobalObjectTestInterfaceLeadingUnderscoreConstructorGetter): (WebCore::setJSTestGlobalObjectTestInterfaceLeadingUnderscoreConstructorSetter): (WebCore::jsTestGlobalObjectTestIterableConstructorGetter): (WebCore::setJSTestGlobalObjectTestIterableConstructorSetter): (WebCore::jsTestGlobalObjectTestJSBuiltinConstructorConstructorGetter): (WebCore::setJSTestGlobalObjectTestJSBuiltinConstructorConstructorSetter): (WebCore::jsTestGlobalObjectTestMapLikeConstructorGetter): (WebCore::setJSTestGlobalObjectTestMapLikeConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedAndIndexedSetterNoIdentifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedAndIndexedSetterNoIdentifierConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedAndIndexedSetterThrowingExceptionConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedAndIndexedSetterThrowingExceptionConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedAndIndexedSetterWithIdentifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedAndIndexedSetterWithIdentifierConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedConstructorConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedConstructorConstructorSetter): (WebCore::jsTestGlobalObjectAudioConstructorGetter): (WebCore::setJSTestGlobalObjectAudioConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedDeleterNoIdentifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedDeleterNoIdentifierConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedDeleterThrowingExceptionConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedDeleterThrowingExceptionConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedDeleterWithIdentifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedDeleterWithIdentifierConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedDeleterWithIndexedGetterConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedDeleterWithIndexedGetterConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedGetterCallWithConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedGetterCallWithConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedGetterNoIdentifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedGetterNoIdentifierConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedGetterWithIdentifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedGetterWithIdentifierConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedSetterNoIdentifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedSetterNoIdentifierConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedSetterThrowingExceptionConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedSetterThrowingExceptionConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedSetterWithIdentifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedSetterWithIdentifierConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedSetterWithIndexedGetterConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedSetterWithIndexedGetterConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedSetterWithIndexedGetterAndSetterConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedSetterWithIndexedGetterAndSetterConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedSetterWithOverrideBuiltinsConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedSetterWithOverrideBuiltinsConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedSetterWithUnforgablePropertiesConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedSetterWithUnforgablePropertiesConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructorSetter): (WebCore::jsTestGlobalObjectTestOperationConditionalConstructorGetter): (WebCore::setJSTestGlobalObjectTestOperationConditionalConstructorSetter): (WebCore::jsTestGlobalObjectTestOverloadedConstructorsConstructorGetter): (WebCore::setJSTestGlobalObjectTestOverloadedConstructorsConstructorSetter): (WebCore::jsTestGlobalObjectTestOverloadedConstructorsWithSequenceConstructorGetter): (WebCore::setJSTestGlobalObjectTestOverloadedConstructorsWithSequenceConstructorSetter): (WebCore::jsTestGlobalObjectTestOverrideBuiltinsConstructorGetter): (WebCore::setJSTestGlobalObjectTestOverrideBuiltinsConstructorSetter): (WebCore::jsTestGlobalObjectTestPluginInterfaceConstructorGetter): (WebCore::setJSTestGlobalObjectTestPluginInterfaceConstructorSetter): (WebCore::jsTestGlobalObjectTestReadOnlyMapLikeConstructorGetter): (WebCore::setJSTestGlobalObjectTestReadOnlyMapLikeConstructorSetter): (WebCore::jsTestGlobalObjectTestReadOnlySetLikeConstructorGetter): (WebCore::setJSTestGlobalObjectTestReadOnlySetLikeConstructorSetter): (WebCore::jsTestGlobalObjectTestReportExtraMemoryCostConstructorGetter): (WebCore::setJSTestGlobalObjectTestReportExtraMemoryCostConstructorSetter): (WebCore::jsTestGlobalObjectTestSerializationConstructorGetter): (WebCore::setJSTestGlobalObjectTestSerializationConstructorSetter): (WebCore::jsTestGlobalObjectTestSerializationIndirectInheritanceConstructorGetter): (WebCore::setJSTestGlobalObjectTestSerializationIndirectInheritanceConstructorSetter): (WebCore::jsTestGlobalObjectTestSerializationInheritConstructorGetter): (WebCore::setJSTestGlobalObjectTestSerializationInheritConstructorSetter): (WebCore::jsTestGlobalObjectTestSerializationInheritFinalConstructorGetter): (WebCore::setJSTestGlobalObjectTestSerializationInheritFinalConstructorSetter): (WebCore::jsTestGlobalObjectTestSerializedScriptValueInterfaceConstructorGetter): (WebCore::setJSTestGlobalObjectTestSerializedScriptValueInterfaceConstructorSetter): (WebCore::jsTestGlobalObjectTestSetLikeConstructorGetter): (WebCore::setJSTestGlobalObjectTestSetLikeConstructorSetter): (WebCore::jsTestGlobalObjectTestStringifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestStringifierConstructorSetter): (WebCore::jsTestGlobalObjectTestStringifierAnonymousOperationConstructorGetter): (WebCore::setJSTestGlobalObjectTestStringifierAnonymousOperationConstructorSetter): (WebCore::jsTestGlobalObjectTestStringifierNamedOperationConstructorGetter): (WebCore::setJSTestGlobalObjectTestStringifierNamedOperationConstructorSetter): (WebCore::jsTestGlobalObjectTestStringifierOperationImplementedAsConstructorGetter): (WebCore::setJSTestGlobalObjectTestStringifierOperationImplementedAsConstructorSetter): (WebCore::jsTestGlobalObjectTestStringifierOperationNamedToStringConstructorGetter): (WebCore::setJSTestGlobalObjectTestStringifierOperationNamedToStringConstructorSetter): (WebCore::jsTestGlobalObjectTestStringifierReadOnlyAttributeConstructorGetter): (WebCore::setJSTestGlobalObjectTestStringifierReadOnlyAttributeConstructorSetter): (WebCore::jsTestGlobalObjectTestStringifierReadWriteAttributeConstructorGetter): (WebCore::setJSTestGlobalObjectTestStringifierReadWriteAttributeConstructorSetter): (WebCore::jsTestGlobalObjectTestTypedefsConstructorGetter): (WebCore::setJSTestGlobalObjectTestTypedefsConstructorSetter): (WebCore::jsTestGlobalObjectInstanceFunctionRegularOperationBody): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1Body): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2Body): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperationOverloadDispatcher): (WebCore::jsTestGlobalObjectConstructorFunctionEnabledAtRuntimeOperationStaticBody): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldBody): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldWhenRuntimeFeatureEnabledBody): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldWhenRuntimeFeaturesEnabledBody): (WebCore::jsTestGlobalObjectInstanceFunctionTestPrivateFunctionBody): (WebCore::jsTestGlobalObjectInstanceFunctionCalculateSecretResultBody): (WebCore::jsTestGlobalObjectInstanceFunctionGetSecretBooleanBody): (WebCore::jsTestGlobalObjectInstanceFunctionTestFeatureGetSecretBooleanBody): * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: (WebCore::jsTestIndexedSetterWithIdentifierPrototypeFunctionIndexedSetterBody): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::jsTestInterfaceConstructorImplementsStaticReadOnlyAttrGetter): (WebCore::jsTestInterfaceConstructorImplementsStaticAttrGetter): (WebCore::setJSTestInterfaceConstructorImplementsStaticAttrSetter): (WebCore::jsTestInterfaceImplementsStr1Getter): (WebCore::jsTestInterfaceImplementsStr2Getter): (WebCore::setJSTestInterfaceImplementsStr2Setter): (WebCore::jsTestInterfaceImplementsStr3Getter): (WebCore::setJSTestInterfaceImplementsStr3Setter): (WebCore::jsTestInterfaceImplementsNodeGetter): (WebCore::setJSTestInterfaceImplementsNodeSetter): (WebCore::jsTestInterfaceConstructorSupplementalStaticReadOnlyAttrGetter): (WebCore::jsTestInterfaceConstructorSupplementalStaticAttrGetter): (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttrSetter): (WebCore::jsTestInterfaceSupplementalStr1Getter): (WebCore::jsTestInterfaceSupplementalStr2Getter): (WebCore::setJSTestInterfaceSupplementalStr2Setter): (WebCore::jsTestInterfaceSupplementalStr3Getter): (WebCore::setJSTestInterfaceSupplementalStr3Setter): (WebCore::jsTestInterfaceSupplementalNodeGetter): (WebCore::setJSTestInterfaceSupplementalNodeSetter): (WebCore::jsTestInterfaceReflectAttributeGetter): (WebCore::setJSTestInterfaceReflectAttributeSetter): (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod1Body): (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2Body): (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod3Body): (WebCore::jsTestInterfaceConstructorFunctionImplementsMethod4Body): (WebCore::jsTestInterfacePrototypeFunctionTakeNodesBody): (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod1Body): (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2Body): (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod3Body): (WebCore::jsTestInterfaceConstructorFunctionSupplementalMethod4Body): (WebCore::jsTestInterfacePrototypeFunctionEntriesCaller): (WebCore::jsTestInterfacePrototypeFunctionKeysCaller): (WebCore::jsTestInterfacePrototypeFunctionValuesCaller): (WebCore::jsTestInterfacePrototypeFunctionForEachCaller): * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: (WebCore::jsTestInterfaceLeadingUnderscoreReadonlyGetter): * bindings/scripts/test/JS/JSTestIterable.cpp: (WebCore::jsTestIterablePrototypeFunctionEntriesCaller): (WebCore::jsTestIterablePrototypeFunctionKeysCaller): (WebCore::jsTestIterablePrototypeFunctionValuesCaller): (WebCore::jsTestIterablePrototypeFunctionForEachCaller): * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp: (WebCore::jsTestJSBuiltinConstructorTestAttributeCustomGetter): (WebCore::jsTestJSBuiltinConstructorTestAttributeRWCustomGetter): (WebCore::setJSTestJSBuiltinConstructorTestAttributeRWCustomSetter): (WebCore::jsTestJSBuiltinConstructorPrototypeFunctionTestCustomFunctionBody): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: (WebCore::jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetterBody): (WebCore::jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetterBody): * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: (WebCore::jsTestNamedDeleterWithIdentifierPrototypeFunctionNamedDeleterBody): * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: (WebCore::jsTestNamedGetterWithIdentifierPrototypeFunctionGetterNameBody): * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: (WebCore::jsTestNamedSetterWithIdentifierPrototypeFunctionNamedSetterBody): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: (WebCore::jsTestNamedSetterWithIndexedGetterPrototypeFunctionNamedSetterBody): (WebCore::jsTestNamedSetterWithIndexedGetterPrototypeFunctionIndexedSetterBody): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterPrototypeFunctionNamedSetterBody): (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterPrototypeFunctionIndexedSetter1Body): (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterPrototypeFunctionIndexedSetter2Body): (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterPrototypeFunctionIndexedSetterOverloadDispatcher): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: (WebCore::jsTestNamedSetterWithUnforgablePropertiesUnforgeableAttributeGetter): (WebCore::jsTestNamedSetterWithUnforgablePropertiesInstanceFunctionUnforgeableOperationBody): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsUnforgeableAttributeGetter): (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsInstanceFunctionUnforgeableOperationBody): * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::jsTestNodeNameGetter): (WebCore::setJSTestNodeNameSetter): (WebCore::jsTestNodePrototypeFunctionTestWorkerPromiseBody): (WebCore::jsTestNodePrototypeFunctionCalculateSecretResultBody): (WebCore::jsTestNodePrototypeFunctionGetSecretBooleanBody): (WebCore::jsTestNodePrototypeFunctionTestFeatureGetSecretBooleanBody): (WebCore::jsTestNodePrototypeFunctionEntriesCaller): (WebCore::jsTestNodePrototypeFunctionKeysCaller): (WebCore::jsTestNodePrototypeFunctionValuesCaller): (WebCore::jsTestNodePrototypeFunctionForEachCaller): (WebCore::JSTestNode::serialize): (WebCore::jsTestNodePrototypeFunctionToJSONBody): * bindings/scripts/test/JS/JSTestNode.h: * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::jsTestObjReadOnlyLongAttrGetter): (WebCore::jsTestObjReadOnlyStringAttrGetter): (WebCore::jsTestObjReadOnlyTestObjAttrGetter): (WebCore::jsTestObjConstructorStaticReadOnlyLongAttrGetter): (WebCore::jsTestObjConstructorStaticStringAttrGetter): (WebCore::setJSTestObjConstructorStaticStringAttrSetter): (WebCore::jsTestObjConstructorTestSubObjGetter): (WebCore::jsTestObjConstructorTestStaticReadonlyObjGetter): (WebCore::jsTestObjEnumAttrGetter): (WebCore::setJSTestObjEnumAttrSetter): (WebCore::jsTestObjByteAttrGetter): (WebCore::setJSTestObjByteAttrSetter): (WebCore::jsTestObjOctetAttrGetter): (WebCore::setJSTestObjOctetAttrSetter): (WebCore::jsTestObjShortAttrGetter): (WebCore::setJSTestObjShortAttrSetter): (WebCore::jsTestObjClampedShortAttrGetter): (WebCore::setJSTestObjClampedShortAttrSetter): (WebCore::jsTestObjEnforceRangeShortAttrGetter): (WebCore::setJSTestObjEnforceRangeShortAttrSetter): (WebCore::jsTestObjUnsignedShortAttrGetter): (WebCore::setJSTestObjUnsignedShortAttrSetter): (WebCore::jsTestObjLongAttrGetter): (WebCore::setJSTestObjLongAttrSetter): (WebCore::jsTestObjLongLongAttrGetter): (WebCore::setJSTestObjLongLongAttrSetter): (WebCore::jsTestObjUnsignedLongLongAttrGetter): (WebCore::setJSTestObjUnsignedLongLongAttrSetter): (WebCore::jsTestObjStringAttrGetter): (WebCore::setJSTestObjStringAttrSetter): (WebCore::jsTestObjUsvstringAttrGetter): (WebCore::setJSTestObjUsvstringAttrSetter): (WebCore::jsTestObjTestObjAttrGetter): (WebCore::setJSTestObjTestObjAttrSetter): (WebCore::jsTestObjTestNullableObjAttrGetter): (WebCore::setJSTestObjTestNullableObjAttrSetter): (WebCore::jsTestObjLenientTestObjAttrGetter): (WebCore::setJSTestObjLenientTestObjAttrSetter): (WebCore::jsTestObjUnforgeableAttrGetter): (WebCore::jsTestObjStringAttrTreatingNullAsEmptyStringGetter): (WebCore::setJSTestObjStringAttrTreatingNullAsEmptyStringSetter): (WebCore::jsTestObjUsvstringAttrTreatingNullAsEmptyStringGetter): (WebCore::setJSTestObjUsvstringAttrTreatingNullAsEmptyStringSetter): (WebCore::jsTestObjByteStringAttrTreatingNullAsEmptyStringGetter): (WebCore::setJSTestObjByteStringAttrTreatingNullAsEmptyStringSetter): (WebCore::jsTestObjStringLongRecordAttrGetter): (WebCore::setJSTestObjStringLongRecordAttrSetter): (WebCore::jsTestObjUsvstringLongRecordAttrGetter): (WebCore::setJSTestObjUsvstringLongRecordAttrSetter): (WebCore::jsTestObjStringObjRecordAttrGetter): (WebCore::setJSTestObjStringObjRecordAttrSetter): (WebCore::jsTestObjStringNullableObjRecordAttrGetter): (WebCore::setJSTestObjStringNullableObjRecordAttrSetter): (WebCore::jsTestObjStringVoidCallbackRecordAttrGetter): (WebCore::setJSTestObjStringVoidCallbackRecordAttrSetter): (WebCore::jsTestObjDictionaryAttrGetter): (WebCore::setJSTestObjDictionaryAttrSetter): (WebCore::jsTestObjNullableDictionaryAttrGetter): (WebCore::setJSTestObjNullableDictionaryAttrSetter): (WebCore::jsTestObjAnnotatedTypeInUnionAttrGetter): (WebCore::setJSTestObjAnnotatedTypeInUnionAttrSetter): (WebCore::jsTestObjAnnotatedTypeInSequenceAttrGetter): (WebCore::setJSTestObjAnnotatedTypeInSequenceAttrSetter): (WebCore::jsTestObjImplementationEnumAttrGetter): (WebCore::setJSTestObjImplementationEnumAttrSetter): (WebCore::jsTestObjMediaDevicesGetter): (WebCore::jsTestObjXMLObjAttrGetter): (WebCore::setJSTestObjXMLObjAttrSetter): (WebCore::jsTestObjCreateGetter): (WebCore::setJSTestObjCreateSetter): (WebCore::jsTestObjReflectedStringAttrGetter): (WebCore::setJSTestObjReflectedStringAttrSetter): (WebCore::jsTestObjReflectedUSVStringAttrGetter): (WebCore::setJSTestObjReflectedUSVStringAttrSetter): (WebCore::jsTestObjReflectedIntegralAttrGetter): (WebCore::setJSTestObjReflectedIntegralAttrSetter): (WebCore::jsTestObjReflectedUnsignedIntegralAttrGetter): (WebCore::setJSTestObjReflectedUnsignedIntegralAttrSetter): (WebCore::jsTestObjReflectedBooleanAttrGetter): (WebCore::setJSTestObjReflectedBooleanAttrSetter): (WebCore::jsTestObjReflectedURLAttrGetter): (WebCore::setJSTestObjReflectedURLAttrSetter): (WebCore::jsTestObjReflectedUSVURLAttrGetter): (WebCore::setJSTestObjReflectedUSVURLAttrSetter): (WebCore::jsTestObjReflectedCustomIntegralAttrGetter): (WebCore::setJSTestObjReflectedCustomIntegralAttrSetter): (WebCore::jsTestObjReflectedCustomBooleanAttrGetter): (WebCore::setJSTestObjReflectedCustomBooleanAttrSetter): (WebCore::jsTestObjReflectedCustomURLAttrGetter): (WebCore::setJSTestObjReflectedCustomURLAttrSetter): (WebCore::jsTestObjEnabledAtRuntimeAttributeGetter): (WebCore::setJSTestObjEnabledAtRuntimeAttributeSetter): (WebCore::jsTestObjConstructorEnabledAtRuntimeAttributeStaticGetter): (WebCore::setJSTestObjConstructorEnabledAtRuntimeAttributeStaticSetter): (WebCore::jsTestObjTypedArrayAttrGetter): (WebCore::setJSTestObjTypedArrayAttrSetter): (WebCore::jsTestObjCustomAttrGetter): (WebCore::setJSTestObjCustomAttrSetter): (WebCore::jsTestObjOnfooGetter): (WebCore::setJSTestObjOnfooSetter): (WebCore::jsTestObjOnwebkitfooGetter): (WebCore::setJSTestObjOnwebkitfooSetter): (WebCore::jsTestObjWithExecStateAttributeGetter): (WebCore::setJSTestObjWithExecStateAttributeSetter): (WebCore::jsTestObjWithCallWithAndSetterCallWithAttributeGetter): (WebCore::setJSTestObjWithCallWithAndSetterCallWithAttributeSetter): (WebCore::jsTestObjWithScriptExecutionContextAttributeGetter): (WebCore::setJSTestObjWithScriptExecutionContextAttributeSetter): (WebCore::jsTestObjWithScriptExecutionContextAndExecStateAttributeGetter): (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateAttributeSetter): (WebCore::jsTestObjWithScriptExecutionContextAndExecStateWithSpacesAttributeGetter): (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateWithSpacesAttributeSetter): (WebCore::jsTestObjConditionalAttr1Getter): (WebCore::setJSTestObjConditionalAttr1Setter): (WebCore::jsTestObjConditionalAttr2Getter): (WebCore::setJSTestObjConditionalAttr2Setter): (WebCore::jsTestObjConditionalAttr3Getter): (WebCore::setJSTestObjConditionalAttr3Setter): (WebCore::jsTestObjConditionalAttr4ConstructorGetter): (WebCore::setJSTestObjConditionalAttr4ConstructorSetter): (WebCore::jsTestObjConditionalAttr5ConstructorGetter): (WebCore::setJSTestObjConditionalAttr5ConstructorSetter): (WebCore::jsTestObjConditionalAttr6ConstructorGetter): (WebCore::setJSTestObjConditionalAttr6ConstructorSetter): (WebCore::jsTestObjCachedAttribute1Getter): (WebCore::jsTestObjCachedAttribute2Getter): (WebCore::jsTestObjCachedAttribute3Getter): (WebCore::jsTestObjAnyAttributeGetter): (WebCore::setJSTestObjAnyAttributeSetter): (WebCore::jsTestObjObjectAttributeGetter): (WebCore::setJSTestObjObjectAttributeSetter): (WebCore::jsTestObjContentDocumentGetter): (WebCore::jsTestObjMutablePointGetter): (WebCore::setJSTestObjMutablePointSetter): (WebCore::jsTestObjStrawberryGetter): (WebCore::setJSTestObjStrawberrySetter): (WebCore::jsTestObjDescriptionGetter): (WebCore::jsTestObjIdGetter): (WebCore::setJSTestObjIdSetter): (WebCore::jsTestObjHashGetter): (WebCore::jsTestObjReplaceableAttributeGetter): (WebCore::setJSTestObjReplaceableAttributeSetter): (WebCore::jsTestObjNullableDoubleAttributeGetter): (WebCore::jsTestObjNullableLongAttributeGetter): (WebCore::jsTestObjNullableBooleanAttributeGetter): (WebCore::jsTestObjNullableStringAttributeGetter): (WebCore::jsTestObjNullableLongSettableAttributeGetter): (WebCore::setJSTestObjNullableLongSettableAttributeSetter): (WebCore::jsTestObjNullableStringSettableAttributeGetter): (WebCore::setJSTestObjNullableStringSettableAttributeSetter): (WebCore::jsTestObjNullableUSVStringSettableAttributeGetter): (WebCore::setJSTestObjNullableUSVStringSettableAttributeSetter): (WebCore::jsTestObjNullableByteStringSettableAttributeGetter): (WebCore::setJSTestObjNullableByteStringSettableAttributeSetter): (WebCore::jsTestObjAttributeGetter): (WebCore::jsTestObjAttributeWithReservedEnumTypeGetter): (WebCore::setJSTestObjAttributeWithReservedEnumTypeSetter): (WebCore::jsTestObjTestReadOnlyVoidPromiseAttributeGetter): (WebCore::jsTestObjTestReadOnlyPromiseAttributeGetter): (WebCore::jsTestObjPutForwardsAttributeGetter): (WebCore::setJSTestObjPutForwardsAttributeSetter): (WebCore::jsTestObjPutForwardsNullableAttributeGetter): (WebCore::setJSTestObjPutForwardsNullableAttributeSetter): (WebCore::jsTestObjStringifierAttributeGetter): (WebCore::setJSTestObjStringifierAttributeSetter): (WebCore::jsTestObjConditionallyReadWriteAttributeGetter): (WebCore::setJSTestObjConditionallyReadWriteAttributeSetter): (WebCore::jsTestObjConditionalAndConditionallyReadWriteAttributeGetter): (WebCore::setJSTestObjConditionalAndConditionallyReadWriteAttributeSetter): (WebCore::jsTestObjRuntimeConditionallyReadWriteAttributeGetter): (WebCore::setJSTestObjRuntimeConditionallyReadWriteAttributeSetter): (WebCore::jsTestObjRuntimeConditionallyReadWriteAttributeUnforgeableGetter): (WebCore::setJSTestObjRuntimeConditionallyReadWriteAttributeUnforgeableSetter): (WebCore::jsTestObjRuntimeConditionallyReadWriteAttributeUnforgeablePrivateGetter): (WebCore::setJSTestObjRuntimeConditionallyReadWriteAttributeUnforgeablePrivateSetter): (WebCore::jsTestObjRuntimeConditionallyReadWriteAttributePromiseGetter): (WebCore::setJSTestObjRuntimeConditionallyReadWriteAttributePromiseSetter): (WebCore::jsTestObjConditionallyExposedToWindowAttributeGetter): (WebCore::setJSTestObjConditionallyExposedToWindowAttributeSetter): (WebCore::jsTestObjConditionallyExposedToWorkerAttributeGetter): (WebCore::setJSTestObjConditionallyExposedToWorkerAttributeSetter): (WebCore::jsTestObjConditionallyExposedToWindowAndWorkerAttributeGetter): (WebCore::setJSTestObjConditionallyExposedToWindowAndWorkerAttributeSetter): (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1Body): (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2Body): (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperationOverloadDispatcher): (WebCore::jsTestObjConstructorFunctionEnabledAtRuntimeOperationStaticBody): (WebCore::jsTestObjPrototypeFunctionEnabledInSpecificWorldWhenRuntimeFeatureEnabledBody): (WebCore::jsTestObjPrototypeFunctionWorldSpecificMethodBody): (WebCore::jsTestObjPrototypeFunctionCalculateSecretResultBody): (WebCore::jsTestObjPrototypeFunctionGetSecretBooleanBody): (WebCore::jsTestObjPrototypeFunctionTestFeatureGetSecretBooleanBody): (WebCore::jsTestObjPrototypeFunctionVoidMethodBody): (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgsBody): (WebCore::jsTestObjPrototypeFunctionByteMethodBody): (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgsBody): (WebCore::jsTestObjPrototypeFunctionOctetMethodBody): (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgsBody): (WebCore::jsTestObjPrototypeFunctionLongMethodBody): (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgsBody): (WebCore::jsTestObjPrototypeFunctionObjMethodBody): (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgsBody): (WebCore::jsTestObjInstanceFunctionUnforgeableMethodBody): (WebCore::jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameterBody): (WebCore::jsTestObjPrototypeFunctionNullableStringMethodBody): (WebCore::jsTestObjConstructorFunctionNullableStringStaticMethodBody): (WebCore::jsTestObjPrototypeFunctionNullableStringSpecialMethodBody): (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithStandaloneEnumArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValueBody): (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrowsBody): (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNullableUSVStringArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgTreatingNullAsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithByteStringArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNullableByteStringArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithByteStringArgTreatingNullAsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionSerializedValueBody): (WebCore::jsTestObjPrototypeFunctionMethodWithRecordBody): (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionBody): (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionReturningLongBody): (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionReturningObjectBody): (WebCore::jsTestObjPrototypeFunctionCustomMethodBody): (WebCore::jsTestObjPrototypeFunctionCustomMethodWithArgsBody): (WebCore::jsTestObjPrototypeFunctionPrivateMethodBody): (WebCore::jsTestObjPrototypeFunctionPublicAndPrivateMethodBody): (WebCore::jsTestObjPrototypeFunctionAddEventListenerBody): (WebCore::jsTestObjPrototypeFunctionRemoveEventListenerBody): (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidBody): (WebCore::jsTestObjPrototypeFunctionWithExecStateObjBody): (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidExceptionBody): (WebCore::jsTestObjPrototypeFunctionWithExecStateObjExceptionBody): (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextBody): (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateBody): (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjExceptionBody): (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpacesBody): (WebCore::jsTestObjPrototypeFunctionWithDocumentArgumentBody): (WebCore::jsTestObjPrototypeFunctionWithCallerDocumentArgumentBody): (WebCore::jsTestObjPrototypeFunctionWithCallerWindowArgumentBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValueBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgsBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValueBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringAndDefaultValueBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefinedBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringIsNullBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVStringIsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringIsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaNBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaNBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongIsZeroBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongIsZeroBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmptyBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalseBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAnyBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalObjectBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapperBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapperIsNullBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolverBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalRecordBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalPromiseBody): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionAndOptionalArgBody): (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackAndOptionalArgBody): (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackArgBody): (WebCore::jsTestObjPrototypeFunctionConditionalMethod1Body): (WebCore::jsTestObjPrototypeFunctionConditionalMethod2Body): (WebCore::jsTestObjPrototypeFunctionConditionalMethod3Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod10Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod12Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod13Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameterOverloadDispatcher): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithDistinguishingUnion1Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithDistinguishingUnion2Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithDistinguishingUnionOverloadDispatcher): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWith2DistinguishingUnions1Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWith2DistinguishingUnions2Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWith2DistinguishingUnionsOverloadDispatcher): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithNonDistinguishingUnion1Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithNonDistinguishingUnion2Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithNonDistinguishingUnionOverloadDispatcher): (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion1Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion2Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnionOverloadDispatcher): (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion1Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion2Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnionOverloadDispatcher): (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter1Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter2Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameterOverloadDispatcher): (WebCore::jsTestObjConstructorFunctionClassMethodBody): (WebCore::jsTestObjConstructorFunctionClassMethodWithOptionalBody): (WebCore::jsTestObjConstructorFunctionClassMethod2Body): (WebCore::jsTestObjConstructorFunctionOverloadedMethod11Body): (WebCore::jsTestObjConstructorFunctionOverloadedMethod12Body): (WebCore::jsTestObjConstructorFunctionOverloadedMethod1OverloadDispatcher): (WebCore::jsTestObjPrototypeFunctionClassMethodWithClampBody): (WebCore::jsTestObjPrototypeFunctionClassMethodWithClampOnOptionalBody): (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRangeBody): (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRangeOnOptionalBody): (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequenceBody): (WebCore::jsTestObjPrototypeFunctionStringArrayFunctionBody): (WebCore::jsTestObjPrototypeFunctionDomStringListFunctionBody): (WebCore::jsTestObjPrototypeFunctionOperationWithOptionalUnionParameterBody): (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequenceBody): (WebCore::jsTestObjPrototypeFunctionGetElementByIdBody): (WebCore::jsTestObjPrototypeFunctionGetSVGDocumentBody): (WebCore::jsTestObjPrototypeFunctionConvert1Body): (WebCore::jsTestObjPrototypeFunctionConvert2Body): (WebCore::jsTestObjPrototypeFunctionConvert3Body): (WebCore::jsTestObjPrototypeFunctionConvert4Body): (WebCore::jsTestObjPrototypeFunctionMutablePointFunctionBody): (WebCore::jsTestObjPrototypeFunctionOrangeBody): (WebCore::jsTestObjPrototypeFunctionVariadicStringMethodBody): (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethodBody): (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethodBody): (WebCore::jsTestObjPrototypeFunctionVariadicUnionMethodBody): (WebCore::jsTestObjPrototypeFunctionAnyBody): (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionBody): (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentBody): (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionBody): (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentBody): (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Body): (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Body): (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunctionOverloadDispatcher): (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionBody): (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionBody): (WebCore::jsTestObjPrototypeFunctionTestCustomPromiseFunctionBody): (WebCore::jsTestObjConstructorFunctionTestStaticCustomPromiseFunctionBody): (WebCore::jsTestObjPrototypeFunctionTestCustomReturnsOwnPromiseFunctionBody): (WebCore::jsTestObjPrototypeFunctionTestReturnsOwnPromiseAndPromiseProxyFunctionBody): (WebCore::jsTestObjPrototypeFunctionConditionalOverload1Body): (WebCore::jsTestObjPrototypeFunctionConditionalOverload2Body): (WebCore::jsTestObjPrototypeFunctionConditionalOverloadOverloadDispatcher): (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload1Body): (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload2Body): (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverloadOverloadDispatcher): (WebCore::jsTestObjPrototypeFunctionAttachShadowRootBody): (WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameterBody): (WebCore::jsTestObjPrototypeFunctionBufferSourceParameterBody): (WebCore::jsTestObjPrototypeFunctionLegacyCallerNamedBody): (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationBody): (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationWithExceptionBody): (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWindowFunctionBody): (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWorkerFunctionBody): (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWindowAndWorkerFunctionBody): (WebCore::jsTestObjPrototypeFunctionToStringBody): (WebCore::JSTestObj::serialize): (WebCore::jsTestObjPrototypeFunctionToJSONBody): * bindings/scripts/test/JS/JSTestObj.h: * bindings/scripts/test/JS/JSTestOperationConditional.cpp: (WebCore::jsTestOperationConditionalPrototypeFunctionNonConditionalOperationBody): (WebCore::jsTestOperationConditionalPrototypeFunctionConditionalOperationBody): * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: (WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItemBody): * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: (WebCore::jsTestPromiseRejectionEventPromiseGetter): (WebCore::jsTestPromiseRejectionEventReasonGetter): * bindings/scripts/test/JS/JSTestSerialization.cpp: (WebCore::jsTestSerializationFirstStringAttributeGetter): (WebCore::setJSTestSerializationFirstStringAttributeSetter): (WebCore::jsTestSerializationSecondLongAttributeGetter): (WebCore::setJSTestSerializationSecondLongAttributeSetter): (WebCore::jsTestSerializationThirdUnserializableAttributeGetter): (WebCore::setJSTestSerializationThirdUnserializableAttributeSetter): (WebCore::jsTestSerializationFourthUnrestrictedDoubleAttributeGetter): (WebCore::setJSTestSerializationFourthUnrestrictedDoubleAttributeSetter): (WebCore::jsTestSerializationFifthLongAttributeGetter): (WebCore::setJSTestSerializationFifthLongAttributeSetter): (WebCore::jsTestSerializationSixthTypedefAttributeGetter): (WebCore::setJSTestSerializationSixthTypedefAttributeSetter): (WebCore::jsTestSerializationSeventhDirectlySerializableAttributeGetter): (WebCore::setJSTestSerializationSeventhDirectlySerializableAttributeSetter): (WebCore::jsTestSerializationEighthIndirectlyAttributeGetter): (WebCore::setJSTestSerializationEighthIndirectlyAttributeSetter): (WebCore::jsTestSerializationNinthOptionalDirectlySerializableAttributeGetter): (WebCore::setJSTestSerializationNinthOptionalDirectlySerializableAttributeSetter): (WebCore::jsTestSerializationTenthFrozenArrayAttributeGetter): (WebCore::setJSTestSerializationTenthFrozenArrayAttributeSetter): (WebCore::jsTestSerializationEleventhSequenceAttributeGetter): (WebCore::setJSTestSerializationEleventhSequenceAttributeSetter): (WebCore::jsTestSerializationTwelfthInterfaceSequenceAttributeGetter): (WebCore::setJSTestSerializationTwelfthInterfaceSequenceAttributeSetter): (WebCore::JSTestSerialization::serialize): (WebCore::jsTestSerializationPrototypeFunctionToJSONBody): * bindings/scripts/test/JS/JSTestSerialization.h: * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: (WebCore::jsTestSerializationInheritInheritLongAttributeGetter): (WebCore::setJSTestSerializationInheritInheritLongAttributeSetter): (WebCore::JSTestSerializationInherit::serialize): (WebCore::jsTestSerializationInheritPrototypeFunctionToJSONBody): * bindings/scripts/test/JS/JSTestSerializationInherit.h: * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: (WebCore::jsTestSerializationInheritFinalFinalLongAttributeFooGetter): (WebCore::setJSTestSerializationInheritFinalFinalLongAttributeFooSetter): (WebCore::jsTestSerializationInheritFinalFinalLongAttributeBarGetter): (WebCore::setJSTestSerializationInheritFinalFinalLongAttributeBarSetter): (WebCore::JSTestSerializationInheritFinal::serialize): (WebCore::jsTestSerializationInheritFinalPrototypeFunctionToJSONBody): * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h: * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: (WebCore::jsTestSerializedScriptValueInterfaceValueGetter): (WebCore::setJSTestSerializedScriptValueInterfaceValueSetter): (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValueGetter): (WebCore::jsTestSerializedScriptValueInterfaceCachedValueGetter): (WebCore::setJSTestSerializedScriptValueInterfaceCachedValueSetter): (WebCore::jsTestSerializedScriptValueInterfacePortsGetter): (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValueGetter): (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionBody): (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionReturningBody): * bindings/scripts/test/JS/JSTestStringifier.cpp: (WebCore::jsTestStringifierPrototypeFunctionToStringBody): * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: (WebCore::jsTestStringifierAnonymousOperationPrototypeFunctionToStringBody): * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: (WebCore::jsTestStringifierNamedOperationPrototypeFunctionIdentifierBody): (WebCore::jsTestStringifierNamedOperationPrototypeFunctionToStringBody): * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: (WebCore::jsTestStringifierOperationImplementedAsPrototypeFunctionIdentifierBody): (WebCore::jsTestStringifierOperationImplementedAsPrototypeFunctionToStringBody): * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: (WebCore::jsTestStringifierOperationNamedToStringPrototypeFunctionToStringBody): * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: (WebCore::jsTestStringifierReadOnlyAttributeIdentifierGetter): (WebCore::jsTestStringifierReadOnlyAttributePrototypeFunctionToStringBody): * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: (WebCore::jsTestStringifierReadWriteAttributeIdentifierGetter): (WebCore::setJSTestStringifierReadWriteAttributeIdentifierSetter): (WebCore::jsTestStringifierReadWriteAttributePrototypeFunctionToStringBody): * bindings/scripts/test/JS/JSTestTypedefs.cpp: (WebCore::jsTestTypedefsUnsignedLongLongAttrGetter): (WebCore::setJSTestTypedefsUnsignedLongLongAttrSetter): (WebCore::jsTestTypedefsSerializedScriptValueGetter): (WebCore::setJSTestTypedefsSerializedScriptValueSetter): (WebCore::jsTestTypedefsConstructorTestSubObjGetter): (WebCore::jsTestTypedefsAttributeWithClampGetter): (WebCore::setJSTestTypedefsAttributeWithClampSetter): (WebCore::jsTestTypedefsAttributeWithClampInTypedefGetter): (WebCore::setJSTestTypedefsAttributeWithClampInTypedefSetter): (WebCore::jsTestTypedefsBufferSourceAttrGetter): (WebCore::setJSTestTypedefsBufferSourceAttrSetter): (WebCore::jsTestTypedefsDomTimeStampAttrGetter): (WebCore::setJSTestTypedefsDomTimeStampAttrSetter): (WebCore::jsTestTypedefsPrototypeFunctionFuncBody): (WebCore::jsTestTypedefsPrototypeFunctionSetShadowBody): (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArgBody): (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceArgBody): (WebCore::jsTestTypedefsPrototypeFunctionSequenceOfNullablesArgBody): (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceOfNullablesArgBody): (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceOfUnionsArgBody): (WebCore::jsTestTypedefsPrototypeFunctionUnionArgBody): (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampBody): (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampInTypedefBody): (WebCore::jsTestTypedefsPrototypeFunctionPointFunctionBody): (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunctionBody): (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction2Body): (WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresIncludeBody): (WebCore::jsTestTypedefsPrototypeFunctionMethodWithExceptionBody): 2020-07-24 Jiewen Tan Propagating user gesture through Fetch API https://bugs.webkit.org/show_bug.cgi?id=214444 Reviewed by Youenn Fablet. This patch propagates media only user gestures through Fetch API, including Fetch and FetchResponse. Covered by new test contents. * Modules/fetch/DOMWindowFetch.cpp: (WebCore::DOMWindowFetch::fetch): Propagates media only user gestures through Fetch. * Modules/fetch/FetchBodyConsumer.cpp: (WebCore::FetchBodyConsumer::clean): (WebCore::FetchBodyConsumer::resolve): (WebCore::FetchBodyConsumer::setConsumePromise): (WebCore::FetchBodyConsumer::resetConsumePromise): (WebCore::FetchBodyConsumer::loadingFailed): (WebCore::FetchBodyConsumer::loadingSucceeded): * Modules/fetch/FetchBodyConsumer.h: (WebCore::FetchBodyConsumer::setMaximumIntervalForUserGestureForwarding): (WebCore::FetchBodyConsumer::FetchBodyConsumer): Propagates media only user gestures through FetchResponse. UserGestureIndicator is only set in the async promise resolving path. * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::queueMicrotaskToEventLoop): Propagates media only user gestures that was propagated through Fetch to the related promise executors. * dom/UserGestureIndicator.cpp: (WebCore::UserGestureIndicator::UserGestureIndicator): (WebCore::UserGestureIndicator::~UserGestureIndicator): * dom/UserGestureIndicator.h: (WebCore::UserGestureToken::setIsPropagatedFromFetch): (WebCore::UserGestureToken::resetIsPropagatedFromFetch): (WebCore::UserGestureToken::isPropagatedFromFetch const): Adds a flag to indicate the propagation source of a user gesture token. And makes pipelines from testing. * page/DOMTimer.cpp: (WebCore::DOMTimer::fired): Gathers some constants. * testing/Internals.cpp: (WebCore::Internals::setFetchMaximumIntervalForUserGestureForwarding): * testing/Internals.h: * testing/Internals.idl: Crafts a way to pass the maximum interval from layout tests. * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::XMLHttpRequest): Gathers some constants. 2020-07-24 Kenneth Russell [WebGL2] Framebuffer and renderbuffer updates https://bugs.webkit.org/show_bug.cgi?id=126448 Reviewed by Dean Jackson. Implement, or finish implementing, the following WebGL 2.0 framebuffer and renderbuffer related APIs: framebufferTextureLayer getInternalformatParameter getRenderbufferParameter invalidateFramebuffer invalidateSubFramebuffer readBuffer renderbufferStorage renderbufferStorageMultisample Covered by existing WebGL 2.0 conformance tests. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::initializeNewContext): (WebCore::WebGL2RenderingContext::validateTexFuncLayer): (WebCore::WebGL2RenderingContext::maxTextureLevelForTarget): (WebCore::WebGL2RenderingContext::blitFramebuffer): (WebCore::WebGL2RenderingContext::framebufferTextureLayer): (WebCore::WebGL2RenderingContext::getInternalformatParameter): (WebCore::WebGL2RenderingContext::invalidateFramebuffer): (WebCore::WebGL2RenderingContext::invalidateSubFramebuffer): (WebCore::WebGL2RenderingContext::renderbufferStorageMultisample): (WebCore::WebGL2RenderingContext::renderbufferStorageImpl): (WebCore::WebGL2RenderingContext::renderbufferStorageHelper): (WebCore::WebGL2RenderingContext::checkAndTranslateAttachments): (WebCore::WebGL2RenderingContext::renderbufferStorage): Deleted. * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::setAttachmentForBoundFramebuffer): (WebCore::WebGLFramebuffer::attach): (WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer): (WebCore::WebGLFramebuffer::setAttachmentInternal): (WebCore::WebGLFramebuffer::removeAttachmentInternal): * html/canvas/WebGLFramebuffer.h: * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::renderbufferStorage): Deleted. * html/canvas/WebGLRenderingContext.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::framebufferRenderbuffer): (WebCore::WebGLRenderingContextBase::framebufferTexture2D): (WebCore::WebGLRenderingContextBase::getRenderbufferParameter): (WebCore::WebGLRenderingContextBase::renderbufferStorage): (WebCore::WebGLRenderingContextBase::renderbufferStorageImpl): (WebCore::WebGLRenderingContextBase::validateTexFuncLevel): (WebCore::WebGLRenderingContextBase::maxTextureLevelForTarget): (WebCore::WebGLRenderingContextBase::validateFramebufferFuncParameters): * html/canvas/WebGLRenderingContextBase.h: * platform/graphics/GraphicsContextGL.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::framebufferTextureLayer): (WebCore::GraphicsContextGLOpenGL::invalidateFramebuffer): (WebCore::GraphicsContextGLOpenGL::invalidateSubFramebuffer): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: 2020-07-24 Jer Noble [Cocoa] Add PerformanceTest tool for measuring raw speed of a video decoder https://bugs.webkit.org/show_bug.cgi?id=214723 Reviewed by Darin Adler. Export classes used by the DecoderTest performance tool. Drive-by fix: allow the clients to enable or disable the hardware decoder for a given decompression session. * WebCore.xcodeproj/project.pbxproj: * platform/MediaSample.h: * platform/graphics/cocoa/SourceBufferParserWebM.h: * platform/graphics/cocoa/WebCoreDecompressionSession.h: * platform/graphics/cocoa/WebCoreDecompressionSession.mm: (WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample): 2020-07-24 Youenn Fablet Monitor the case of a fetch event not able to register to the respondWith promise https://bugs.webkit.org/show_bug.cgi?id=214631 Reviewed by Alex Christensen. In some cases, the "Fetch event is destroyed" error is received. One possibility is that the fetch event is not able to register to its respondWith promise. Add a specific error message for that case. This is difficult to test as we would need to have a fetch event trying to register to the respondWith promise exactly at the time the service worker gets stopped. * bindings/js/JSDOMPromise.cpp: (WebCore::DOMPromise::whenSettled): (WebCore::DOMPromise::whenPromiseIsSettled): * bindings/js/JSDOMPromise.h: * workers/service/FetchEvent.cpp: (WebCore::FetchEvent::respondWith): Change from weakThis to makeRef. While this is not strictly needed since addExtendLifetimePromise ref the event while calling whenSettled, this is clearer and more robust. 2020-07-24 Youenn Fablet ASSERT(!m_peerConnection.isClosed()) on imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-operations.https.html https://bugs.webkit.org/show_bug.cgi?id=214189 Reviewed by Eric Carlson. Covered by unskipped tests. * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::addPendingTrackEvent): This can be called in case the connection is closed but should not be in case the connection is stopped. Update the ASSERT accordingly. 2020-07-24 Xabier Rodriguez Calvar [GStreamer] gst_buffer_unmap: assertion 'GST_IS_BUFFER (buffer)' failed https://bugs.webkit.org/show_bug.cgi?id=213364 Reviewed by Philippe Normand. The initial patch for this bug had good intentions but it failed in something basic and tests did not tackle the original issue. The problem was in that the destructor of the subclass was being called before the destructor of the superclass, hence the buffer was unreffed before unmapped. Now we finish what we started by adding an unmapEarly method that can be used as regular API if wanted and that it is used by the GstMappedOwnedBuffer destructor to instruct GstMappedBuffer superclass to actually unmap without having to wait for the destructor of the superclass to kick in. Tests: GStreamerTest::mappedOwnedBufferDestruction and GStreamerTest::mappedBufferValidityUnmapEarly API tests. * platform/graphics/gstreamer/GStreamerCommon.h: (WebCore::GstMappedBuffer::~GstMappedBuffer): (WebCore::GstMappedBuffer::unmapEarly): (WebCore::GstMappedOwnedBuffer::~GstMappedOwnedBuffer): 2020-07-23 Alex Christensen Split Windows parts from CFNetworkSPI.h to CFNetworkSPIWin.h https://bugs.webkit.org/show_bug.cgi?id=214719 Reviewed by Tim Horton. No change in behavior. Windows CFNetwork work is not actively developed, but Cocoa is. This makes it easier to find where to put new things. * platform/network/NetworkStorageSession.h: * platform/network/ResourceHandleClient.h: * platform/network/ResourceHandleInternal.h: * platform/network/cf/CookieStorageCFNet.cpp: * platform/network/cf/CredentialStorageCFNet.cpp: * platform/network/cf/NetworkStorageSessionCFNetWin.cpp: * platform/network/cf/ResourceErrorCF.cpp: * platform/network/cf/ResourceHandleCFNet.cpp: * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp: * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp: * platform/network/cf/ResourceRequestCFNet.cpp: * platform/network/cf/ResourceRequestCFNet.h: * platform/network/cf/ResourceResponse.h: * platform/network/cf/ResourceResponseCFNet.cpp: * platform/network/cf/SocketStreamHandleImplCFNet.cpp: 2020-07-23 Alex Christensen Remove dead code in ResourceHandleCFNet.cpp https://bugs.webkit.org/show_bug.cgi?id=214717 Reviewed by Darin Adler. ResourceHandleCFNet.cpp is not compiled on Cocoa platforms any more. Remove Cocoa-specific code in that file, which was used on iOS before adopting NSURLSession. * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::ResourceHandle::createCFURLConnection): (WebCore::ResourceHandle::start): (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication): (WebCore::ResourceHandle::receivedCredential): (WebCore::ResourceHandle::schedule): Deleted. (WebCore::ResourceHandle::unschedule): Deleted. 2020-07-23 James Darpinian [WebGL2] Query Objects https://bugs.webkit.org/show_bug.cgi?id=126940 Reviewed by Dean Jackson. Passes conformance tests webgl/2.0.0/conformance2/query/* * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::deleteQuery): (WebCore::WebGL2RenderingContext::isQuery): (WebCore::WebGL2RenderingContext::validateQueryTarget): (WebCore::WebGL2RenderingContext::beginQuery): (WebCore::WebGL2RenderingContext::endQuery): (WebCore::WebGL2RenderingContext::getQuery): (WebCore::WebGL2RenderingContext::getQueryParameter): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLQuery.cpp: (WebCore::WebGLQuery::deleteObjectImpl): * html/canvas/WebGLQuery.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::validateWebGLObject): * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::deleteQuery): (WebCore::GraphicsContextGLOpenGL::isQuery): (WebCore::GraphicsContextGLOpenGL::getQuery): 2020-07-23 Guowei Yang Infrastructure Work for Integrating CoreImage for Accelerated CSS/SVG Filter Rendering https://bugs.webkit.org/show_bug.cgi?id=213672 Reviewed by Simon Fraser. This patch is the infrastructure work to enable filter rendering using CoreImage. The design of this code is as follows: 0) changing WebCore configuration for using CoreImage framework from iOS/mac only to unconditional, so watchOS and tvOS could also use CoreImage 1) adding a new API to obtain the IOSurface from an AcceleratedImageBuffer since CoreImage needs to render to an IOSurface 2) Instead of applying the filters inside FilterEffect, a new class, FilterEffectRendererCoreImage is designed to handle the rendering. We hide the implementation details by subclassing from a generic FilterEffectRenderer class. This also has the benefit of organizing CoreImage obj-c calls in one place. This class owns a FilterEffect node, that is the last FilterEffect of a given filter graph. The filter graph will be traversed backwards and filter parameters is gathered along the way. Then CIFilters will be created and connected to a larger CIFilter graph. The output of the CIFilter graph will be rendered to the IOSurface of a newly created AcceleratedImageBuffer. This image buffer will be returned to RenderLayerFilters and rendered to the screen 3) Inside CSSFilter::build, we first try to create a FilterEffectRenderer by passing in a renderer setting. A valid pointer will be returned only when the following two conditions are met: . CoreImage rendering is enabled in settings . All the filters inside the filter graph is implemented using CIFilters No new tests are required as this is the infrastructure code for integrating CoreImage This patch should pass all the existing css3/filters tests * Configurations/WebCore.xcconfig: modified flag definition so that CoreImage is used on all Apple Platforms, not only iPhone. * Sources.txt: Added the generic FilterEffectRenderer class file * SourcesCocoa.txt: added FilterEffectRendererCoreImage.mm * WebCore.xcodeproj/project.pbxproj: Reflecting newly added files, with some ordering changes * platform/graphics/ConcreteImageBuffer.h: overrides isAccelerated() function that returns true only if the backend is IOSurface * platform/graphics/ImageBuffer.h: defined virtual function isAccelerated() * platform/graphics/ImageBufferBackend.h: defined virtual function isAccelerated() that returns false in the base class (WebCore::ImageBufferBackend::isAccelerated const): returns false for the base class * platform/graphics/PlatformImageBuffer.h: added SPECIALIZE_TYPE_TRAITS to check what type of ImageBufferBackend is * platform/graphics/PlatformImageBuffer.h: Added API to obtain IOSurface from IOSurfaceBackend; added SPECIALIZE_TYPE_TRAITS (WebCore::AcceleratedImageBuffer::surface): Obtain the IOSurface pointer from ImageBufferIOSurfaceBackend (isType): check if a given ImageBuffer is type AcceleratedImageBuffer * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp: (WebCore::ImageBufferIOSurfaceBackend::surface): added an API to get the IOSurface pointer (WebCore::ImageBufferIOSurfaceBackend::isAccelerated const): returns true because it is an accelerated image buffer * platform/graphics/cg/ImageBufferIOSurfaceBackend.h: added function surface() and isAccelerated() * platform/graphics/coreimage/FilterEffectRendererCoreImage.h: Added. * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm: Added. (WebCore::FilterEffectRendererCoreImage::tryCreate): creates a FilterEffectRendererCoreImage unique pointer. If the filters inside the graph are not all implemented, we return nullptr (WebCore::FilterEffectRendererCoreImage::supportsCoreImageRendering): a function that takes in FilterEffect& and returns true if its a filter effect type that is implemented in CoreImage, false otherwise (WebCore::FilterEffectRendererCoreImage::applyEffects): takes in a FilterEffect pointer, calls FilterEffectRendererCoreImage::connectCIFilters to create the final output CIImage (WebCore::FilterEffectRendererCoreImage::connectCIFilters): recursive helper function that traverses the FilterEffect graph backwards, creates CIFilter graph based on the subclass type of current processing FilterEffect node. It will cache the CIFilter in a hashmap, whose key is the corresponding FilterEffect pointer. (WebCore::FilterEffectRendererCoreImage::canRenderUsingCIFilters): unction that takes in the last FilterEffect node and determines whether all of the filters inside the filter graph is already implemented using CIFilters. It returns false as long as there is one filter that hasn't been implemented. The rendering procedure will fallback to software mode if this function returns false (WebCore::FilterEffectRendererCoreImage::output const): returns the ImageBuffer that contains the data of the final output image (WebCore::FilterEffectRendererCoreImage::renderToImageBuffer): r enders CIImage* to an ImageBuffer (WebCore::FilterEffectRendererCoreImage::destRect const): calculates the destination bounding box (WebCore::FilterEffectRendererCoreImage::clearResult): clears all the saved results (WebCore::FilterEffectRendererCoreImage::FilterEffectRendererCoreImage): constructor * platform/graphics/filters/FEBlend.cpp: (WebCore::FEBlend::FEBlend): Pass an additional FilterEffect::Type argument to base class constructor * platform/graphics/filters/FEColorMatrix.cpp: (WebCore::FEColorMatrix::FEColorMatrix): ditto * platform/graphics/filters/FEComponentTransfer.cpp: (WebCore::FEComponentTransfer::FEComponentTransfer): ditto * platform/graphics/filters/FEComposite.cpp: (WebCore::FEComposite::FEComposite): ditto * platform/graphics/filters/FEConvolveMatrix.cpp: (WebCore::FEConvolveMatrix::FEConvolveMatrix): ditto * platform/graphics/filters/FEDiffuseLighting.cpp: (WebCore::FEDiffuseLighting::FEDiffuseLighting):ditto * platform/graphics/filters/FEDisplacementMap.cpp: (WebCore::FEDisplacementMap::FEDisplacementMap):ditto * platform/graphics/filters/FEDisplacementMap.h: * platform/graphics/filters/FEDropShadow.cpp: (WebCore::FEDropShadow::FEDropShadow):ditto * platform/graphics/filters/FEFlood.cpp: (WebCore::FEFlood::FEFlood):ditto * platform/graphics/filters/FEGaussianBlur.cpp: (WebCore::FEGaussianBlur::FEGaussianBlur):ditto * platform/graphics/filters/FELighting.cpp: (WebCore::FELighting::FELighting):ditto * platform/graphics/filters/FELighting.h: * platform/graphics/filters/FEMerge.cpp: (WebCore::FEMerge::FEMerge): ditto * platform/graphics/filters/FEMorphology.cpp: (WebCore::FEMorphology::FEMorphology): ditto * platform/graphics/filters/FEOffset.cpp: (WebCore::FEOffset::FEOffset): ditto * platform/graphics/filters/FESpecularLighting.cpp: (WebCore::FESpecularLighting::FESpecularLighting): ditto * platform/graphics/filters/FETile.cpp: (WebCore::FETile::FETile): ditto * platform/graphics/filters/FETurbulence.cpp: (WebCore::FETurbulence::FETurbulence): ditto * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::FilterEffect): ditto * platform/graphics/filters/FilterEffect.h: added a const member, m_filterEffectType (WebCore::FilterEffect::filterEffectClassType): returns the FilterEffect class type * platform/graphics/filters/FilterEffectRenderer.cpp: Added. (WebCore::FilterEffectRenderer::tryCreate): tries creates a new FilterEffectRenderer unique pointer. Here, we check whether the renderer setting has CoreImage accelerated filter rendering enabled; we also check if all the filters in the given FilterEffect graph is already implemented using CoreImage. If both conditions are satisfied, create a FilterEffectRendererCoreImage otherwise returns nullptr. * platform/graphics/filters/FilterEffectRenderer.h: Added. * platform/graphics/filters/SourceAlpha.cpp: (WebCore::SourceAlpha::SourceAlpha): Pass an additional FilterEffect::Type argument to base class constructor * platform/graphics/filters/SourceAlpha.h: * platform/graphics/filters/SourceGraphic.h: (WebCore::SourceGraphic::SourceGraphic): ditto * rendering/CSSFilter.cpp: (WebCore::CSSFilter::build): we try to create a FilterEffectRenderer here by passing in the state of the CoreImage Accelerated Rendering feature switch (WebCore::CSSFilter::apply): If we have a valid m_filterRenderer pointer, that means we can render the result image using CoreImage path, thus we don't call effect.apply() fall back to software mode if hasResult() returns false. (WebCore::CSSFilter::output const): if we have a valid m_filterRenderer, then we will obtain the ImageBuffer result from it, not FilterEffect (WebCore::CSSFilter::outputRect const): if we have a valid m_filterRenderer, then we will obtain the ImageBuffer result from it, not FilterEffect * rendering/CSSFilter.h: * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::FEImage): Pass an additional FilterEffect::Type argument to base class constructor 2020-07-23 Yusuke Suzuki We should have exception check after promise operation https://bugs.webkit.org/show_bug.cgi?id=214610 Reviewed by Youenn Fablet and Mark Lam. Test: js/dom/promise-should-have-exception-check-on-operation.html Add exception check after promise operations. * bindings/js/JSDOMPromiseDeferred.cpp: (WebCore::DeferredPromise::reject): 2020-07-23 Jer Noble [Cocoa|WebM] Seeking can leave parser in hung state https://bugs.webkit.org/show_bug.cgi?id=214704 Reviewed by Eric Carlson. When the parser is explicitly reset, make sure to clear out all the tracks and initialization datas. Otherwise, a half-filled CMSampleBuffer can be left waiting around for more data, which may never arrive, and no further samples will ever be parsed. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::resetParserState): 2020-07-23 Jer Noble [Cocoa] RELEASE_ASSERT when calling registerSupplementalVP9Decoder() when VideoToolbox.framework is not present https://bugs.webkit.org/show_bug.cgi?id=214697 Reviewed by Eric Carlson. * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: (WebCore::registerSupplementalVP9Decoder): (WebCore::isVP9DecoderAvailable): 2020-07-23 Sihui Liu Allow IndexedDB in third-party frames https://bugs.webkit.org/show_bug.cgi?id=214583 Reviewed by Geoffrey Garen. Match IndexedDB's behavior with localStorage. Third-party iframes now have access to IndexedDB with partitioned in-memory storage. The partitioning key is ClientOrigin, which consists of opening origin and top origin. API Test: IndexedDB.IndexedDBThirdPartyFrameHasAccess IndexedDB.IndexedDBThirdPartyDataRemoval IndexedDB.IndexedDBThirdPartyWorkerHasAccess * Modules/indexeddb/IDBDatabaseIdentifier.cpp: (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier): (WebCore::m_isTransient): (WebCore::IDBDatabaseIdentifier::isolatedCopy const): (WebCore::IDBDatabaseIdentifier::loggingString const): * Modules/indexeddb/IDBDatabaseIdentifier.h: (WebCore::IDBDatabaseIdentifier::hash const): (WebCore::IDBDatabaseIdentifier::operator== const): (WebCore::IDBDatabaseIdentifier::isTransient const): (WebCore::IDBDatabaseIdentifier::encode const): (WebCore::IDBDatabaseIdentifier::decode): * Modules/indexeddb/IDBFactory.cpp: (WebCore::shouldThrowSecurityException): (WebCore::IDBFactory::openInternal): (WebCore::IDBFactory::deleteDatabase): * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::createBackingStore): * Modules/webdatabase/DOMWindowWebDatabase.cpp: (WebCore::DOMWindowWebDatabase::openDatabase): * page/SecurityOrigin.h: (WebCore::SecurityOrigin::canAccessDatabase const): 2020-07-23 Chris Dumez Add support for SVGAElement's rel / relList attributes https://bugs.webkit.org/show_bug.cgi?id=214690 Reviewed by Darin Adler. Add support for SVGAElement's rel / relList attributes: https://www.w3.org/TR/SVG/linking.html#InterfaceSVGAElement No new tests, rebaselined existing tests. * svg/SVGAElement.cpp: (WebCore::SVGAElement::parseAttribute): (WebCore::SVGAElement::relList const): * svg/SVGAElement.h: * svg/SVGAElement.idl: * svg/svgattrs.in: 2020-07-23 Yusuke Suzuki Add exception check for WebCore createRejectedPromiseWithTypeError https://bugs.webkit.org/show_bug.cgi?id=214680 Reviewed by Mark Lam. Test: js/dom/rejected-promise-creation-should-check-exception.html Add missing exception checks in createRejectedPromiseWithTypeError. * bindings/js/JSDOMAttribute.h: (WebCore::IDLAttribute::get): * bindings/js/JSDOMOperationReturningPromise.h: (WebCore::IDLOperationReturningPromise::call): (WebCore::IDLOperationReturningPromise::callReturningOwnPromise): * bindings/js/JSDOMPromiseDeferred.cpp: (WebCore::createRejectedPromiseWithTypeError): 2020-07-23 Fujii Hironori [CMake][Win] Build StructuredExceptionHandlerSuppressor.cpp and makesafeseh.asm only for AppleWin https://bugs.webkit.org/show_bug.cgi?id=214671 Reviewed by Per Arne Vollan. StructuredExceptionHandlerSuppressor is used only by AppleWin port in platform/graphics/ca/win/LayerChangesFlusher.cpp. makesafeseh.asm causes a building problem for 32bit WinCairo because it is using OBJECT library type for WebCore. * PlatformAppleWin.cmake: Added build rules for them. * PlatformWin.cmake: Removed build rules for them. 2020-07-23 Andres Gonzalez Update the isolated tree even when there is no client request. https://bugs.webkit.org/show_bug.cgi?id=214692 Reviewed by Chris Fleizach. AXObjectCache::updateIsolatedTree was checking for isIsolatedTreeEnabled, which in turn checks for whether the clientSupportsIsolatedTree. Often at the time updateIsolatedTree is called, there is no client request since client requests and updates occur in separate threads, independently from each other. Thus the isolated tree wasn't being updated. This patch removes the check for isIsolatedTreeEnabled and rely on the presence of an isolated tree for the given PageID to perform the update. In addition, added an update of the isolated tree for AXLoadingEvent::AXLoadingFinished. This fixes several instance of dynamic content page changes that were not being reflected on the isolated tree. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::clientSupportsIsolatedTree): Some logging. (WebCore::AXObjectCache::isIsolatedTreeEnabled): Some logging. (WebCore::AXObjectCache::frameLoadingEventNotification): Calls updateIsolatedTree. (WebCore::AXObjectCache::updateIsolatedTree): Handles AXLoadingEvents. * accessibility/AXObjectCache.h: 2020-07-23 Clark Wang Added PeriodicWave constructor according to spec https://bugs.webkit.org/show_bug.cgi?id=214615 Reviewed by Chris Dumez. Re-baselined existing tests that now pass. Added PeriodicWave constructor according to spec: https://www.w3.org/TR/webaudio/#periodicwave. Added PeriodicWaveConstraints, PeriodicWaveOptions files. Updated PeriodicWave::createBandLimitedTables to normalize waveform based on spec: https://www.w3.org/TR/webaudio/#waveform-normalization. Added updated createPeriodicWave method in BaseAudioContext, and moved old createPeriodicWave method Into WebKitAudioContext. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createPeriodicWave): * Modules/webaudio/BaseAudioContext.h: (WebCore::BaseAudioContext::createPeriodicWave): * Modules/webaudio/BaseAudioContext.idl: * Modules/webaudio/PeriodicWave.cpp: (WebCore::PeriodicWave::create): (WebCore::PeriodicWave::createBandLimitedTables): * Modules/webaudio/PeriodicWave.h: * Modules/webaudio/PeriodicWave.idl: * Modules/webaudio/PeriodicWaveConstraints.h: Added. * Modules/webaudio/PeriodicWaveConstraints.idl: Added. * Modules/webaudio/PeriodicWaveOptions.h: Added. * Modules/webaudio/PeriodicWaveOptions.idl: Added. * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::createPeriodicWave): * Modules/webaudio/WebKitAudioContext.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-07-23 David Kilzer [IPC hardening] WebKit::ArgumentCoder::decode() and encode() should use enum BlobPart::Type Reviewed by Darin Adler. * platform/network/BlobPart.h: (WebCore::BlobPart::Type): - Convert to an enum class of size `bool`. (WebCore::BlobPart::BlobPart): (WebCore::BlobPart::data const): (WebCore::BlobPart::moveData): (WebCore::BlobPart::url const): - Change BlobPart::Type enums to use fully qualified name. * platform/network/BlobRegistryImpl.cpp: (WebCore::BlobRegistryImpl::registerBlobURL): - Change BlobPart::Type enums to use fully qualified name. 2020-07-23 Simon Fraser updateRendering trace point should exclude SVG https://bugs.webkit.org/show_bug.cgi?id=214649 Reviewed by Geoffrey Garen. Don't issue the trace point for SVGImage Pages. * page/Page.cpp: (WebCore::Page::updateRendering): 2020-07-23 Zalan Bujtas Unreviewed, reverting r262124. See REGRESSION(r262124) Overlapping text on Youtube's video upload page https://bugs.webkit.org/show_bug.cgi?id=214655 * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): 2020-07-23 Brady Eidson Add Gamepad tests that exercise the native frameworks and https://bugs.webkit.org/show_bug.cgi?id=214188 Reviewed by Tim Horton. * platform/gamepad/mac/MultiGamepadProvider.h: (WebCore::MultiGamepadProvider::setUsesOnlyHIDGamepadProvider): * platform/gamepad/mac/MultiGamepadProvider.mm: (WebCore::MultiGamepadProvider::startMonitoringGamepads): (WebCore::MultiGamepadProvider::stopMonitoringGamepads): 2020-07-23 Xabier Rodriguez Calvar Unreviewed, build fix after r264762. * platform/graphics/gstreamer/GStreamerCommon.cpp: Added include SharedBuffer.h. 2020-07-23 Xabier Rodriguez Calvar [GStreamer] gst_buffer_unmap: assertion 'GST_IS_BUFFER (buffer)' failed https://bugs.webkit.org/show_bug.cgi?id=213364 Reviewed by Philippe Normand. In some cases as in passing init datas around, the InitData that contains a SharedBuffer that contains a non-reffed mapped buffer can outlive the buffer itself, creating this problem. In this patch we make a new class called GstMappedOwnedBuffer that is to map read-only buffers and that is used for the InitData SharedBuffer. GstMappedBuffer does not support SharedBuffer anymore and is not ref counted anymore as it is intended for short term and quick usage. Test: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-to-multiple-video-elements.https.html * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::create): (WebCore::SharedBuffer::SharedBuffer): (WebCore::SharedBuffer::DataSegment::data const): (WebCore::SharedBuffer::DataSegment::size const): * platform/SharedBuffer.h: * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: (webKitWebAudioSrcAllocateBuffersAndRenderAudio): * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::GstMappedBuffer::createVector const): (WebCore::GstMappedOwnedBuffer::createSharedBuffer): * platform/graphics/gstreamer/GStreamerCommon.h: (WebCore::GstMappedBuffer::GstMappedBuffer): (WebCore::GstMappedBuffer::~GstMappedBuffer): (WebCore::GstMappedBuffer::isValid const): (WebCore::GstMappedBuffer::data): (WebCore::GstMappedBuffer::data const): (WebCore::GstMappedBuffer::size const): (WebCore::GstMappedBuffer::operator bool const): (WebCore::GstMappedBuffer::operator! const): (WebCore::GstMappedOwnedBuffer::create): (WebCore::GstMappedOwnedBuffer::GstMappedOwnedBuffer): (WebCore::operator==): * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp: (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample): * platform/graphics/gstreamer/eme/CDMProxyThunder.cpp: (WebCore::CDMProxyThunder::getDecryptionSession const): * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h: (WebCore::InitData::InitData): * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: (decrypt): * platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.cpp: (WebCore::MockRealtimeAudioSourceGStreamer::render): * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingVideoSourceLibWebRTC::createBlackFrame): * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: (WebCore::GStreamerVideoEncoder::Fragmentize): 2020-07-23 Mark Lam Fix missing exception checks below RTCPeerConnection.generateCertificate(). https://bugs.webkit.org/show_bug.cgi?id=214668 Reviewed by Yusuke Suzuki. Test: webrtc/missing-exception-checks-RTCPeerConnection-generateCertificate.html * bindings/js/JSCustomElementRegistryCustom.cpp: (WebCore::JSCustomElementRegistry::whenDefined): * bindings/js/JSDOMConvertUnion.h: * bindings/js/JSDOMOperationReturningPromise.h: (WebCore::IDLOperationReturningPromise::call): (WebCore::IDLOperationReturningPromise::callReturningOwnPromise): (WebCore::IDLOperationReturningPromise::callStatic): (WebCore::IDLOperationReturningPromise::callStaticReturningOwnPromise): * bindings/js/JSDOMPromiseDeferred.cpp: (WebCore::DeferredPromise::reject): (WebCore::rejectPromiseWithExceptionIfAny): * bindings/js/JSDOMPromiseDeferred.h: (WebCore::callPromiseFunction): 2020-07-22 Conrad Shultz Update macOS Version macros https://bugs.webkit.org/show_bug.cgi?id=214653 Reviewed by Tim Horton. * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: 2020-07-22 Jer Noble [Cocoa|WebM] Decode error when seeking https://bugs.webkit.org/show_bug.cgi?id=214666 Reviewed by Eric Carlson. A decoder error is hit when seeking because we think all samples coming out of the SourceBufferParserWebM are sync-samples. This is because the attachment added with CMSetAttachment() is ignored; the correct way to set sample attachments is by getting the sample attachments array with CMSampleBufferGetSampleAttachmentsArray(), and then iterating over the attachments and adding keys to the underlying mutable CFDictionary. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::OnFrame): 2020-07-22 Fujii Hironori [WinCairo][32bit] JPEG2000ImageDecoder.cpp: error C2664: 'std::unique_ptr<...>::unique_ptr(...)': cannot convert argument 2 from 'void (__stdcall *)(opj_codec_t *)' to 'const _Dx &' https://bugs.webkit.org/show_bug.cgi?id=214657 Reviewed by Darin Adler. __cdecl and __stdcall calling conventions don't match. * platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp: (WebCore::JPEG2000ImageDecoder::decode): Use decltype for the second template argument of unique_ptr. 2020-07-22 Jon Davis Add feature status for CSS Containment Module Level 1 https://bugs.webkit.org/show_bug.cgi?id=214663 Reviewed by Darin Adler. * features.json: 2020-07-22 Jon Davis Add feature status for the focus-visible pseudo-selector https://bugs.webkit.org/show_bug.cgi?id=214662 Reviewed by Darin Adler. * features.json: 2020-07-22 Wenson Hsieh Unreviewed, update feature status for async clipboard API * features.json: Move from "In Development" to "Supported". 2020-07-21 Mark Lam Disallow VM entry when doing a VMInquiry. https://bugs.webkit.org/show_bug.cgi?id=214624 Reviewed by Saam Barati. 1. Change binding to reset the DisallowVMEntry scope in PropertySlot after doing a VMInquiry. 2. Rebase bindings test results to match. * bindings/js/JSDOMAbstractOperations.h: (WebCore::isVisibleNamedProperty): (WebCore::accessVisibleNamedProperty): * bindings/scripts/CodeGeneratorJS.pm: (GeneratePut): (GeneratePutByIndex): (GenerateDefineOwnProperty): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::put): (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::putByIndex): (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::defineOwnProperty): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: (WebCore::JSTestNamedAndIndexedSetterThrowingException::put): (WebCore::JSTestNamedAndIndexedSetterThrowingException::putByIndex): (WebCore::JSTestNamedAndIndexedSetterThrowingException::defineOwnProperty): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::put): (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::putByIndex): (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::defineOwnProperty): * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: (WebCore::JSTestNamedSetterNoIdentifier::put): (WebCore::JSTestNamedSetterNoIdentifier::putByIndex): (WebCore::JSTestNamedSetterNoIdentifier::defineOwnProperty): * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: (WebCore::JSTestNamedSetterThrowingException::put): (WebCore::JSTestNamedSetterThrowingException::putByIndex): (WebCore::JSTestNamedSetterThrowingException::defineOwnProperty): * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: (WebCore::JSTestNamedSetterWithIdentifier::put): (WebCore::JSTestNamedSetterWithIdentifier::putByIndex): (WebCore::JSTestNamedSetterWithIdentifier::defineOwnProperty): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: (WebCore::JSTestNamedSetterWithIndexedGetter::put): (WebCore::JSTestNamedSetterWithIndexedGetter::putByIndex): (WebCore::JSTestNamedSetterWithIndexedGetter::defineOwnProperty): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::put): (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::putByIndex): (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::defineOwnProperty): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: (WebCore::JSTestNamedSetterWithUnforgableProperties::put): (WebCore::JSTestNamedSetterWithUnforgableProperties::putByIndex): (WebCore::JSTestNamedSetterWithUnforgableProperties::defineOwnProperty): 2020-07-22 Eric Carlson [Cocoa] canPlayType with 'codecs' parameter should never return "maybe" https://bugs.webkit.org/show_bug.cgi?id=214621 Reviewed by Jer Noble. No new tests, updated existing tests and results. * platform/graphics/MIMETypeCache.cpp: (WebCore::MIMETypeCache::canDecodeType): 2020-07-22 Kenneth Russell [WebGL2] Implement multiple render target entry points https://bugs.webkit.org/show_bug.cgi?id=211156 Reviewed by Dean Jackson. Implement the drawBuffers and clearBuffer entry points. Integrate the clearBuffer APIs with preserveDrawingBuffer:false's auto-clearing. Move some auto-clearing state from WebGLRenderingContextBase to GraphicsContextGL and GraphicsContextGLOpenGL. Rename setPreserveDrawingBuffer to enablePreserveDrawingBuffer to make it clear that arbitrary changes of preserveDrawingBuffer are not supported. setPreserveDrawingBuffer was previously added for capture of preserveDrawingBuffer:false WebGL canvases. Covered by existing WebGL conformance tests and canvas capture layout tests. * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp: (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::drawBuffers): (WebCore::WebGL2RenderingContext::clearBufferiv): (WebCore::WebGL2RenderingContext::clearBufferuiv): (WebCore::WebGL2RenderingContext::clearBufferfv): (WebCore::WebGL2RenderingContext::clearBufferfi): (WebCore::WebGL2RenderingContext::validateClearBuffer): (WebCore::WebGL2RenderingContext::updateBuffersToAutoClear): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::drawBuffersIfNecessary): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::clearIfComposited): (WebCore::WebGLRenderingContextBase::enablePreserveDrawingBuffer): * html/canvas/WebGLRenderingContextBase.h: (WebCore::WebGLRenderingContextBase::setPreserveDrawingBuffer): Deleted. * platform/graphics/GraphicsContextGL.cpp: (WebCore::GraphicsContextGL::enablePreserveDrawingBuffer): * platform/graphics/GraphicsContextGL.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::markLayerComposited): (WebCore::GraphicsContextGLOpenGL::drawBuffers): (WebCore::GraphicsContextGLOpenGL::clearBufferiv): (WebCore::GraphicsContextGLOpenGL::clearBufferuiv): (WebCore::GraphicsContextGLOpenGL::clearBufferfv): (WebCore::GraphicsContextGLOpenGL::clearBufferfi): * platform/graphics/opengl/GraphicsContextGLOpenGL.cpp: (WebCore::GraphicsContextGLOpenGL::resetBuffersToAutoClear): (WebCore::GraphicsContextGLOpenGL::setBuffersToAutoClear): (WebCore::GraphicsContextGLOpenGL::getBuffersToAutoClear const): (WebCore::GraphicsContextGLOpenGL::enablePreserveDrawingBuffer): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::markLayerComposited): (WebCore::GraphicsContextGLOpenGL::drawBuffers): 2020-07-22 Wenson Hsieh Article headlines are split across multiple lines after translating tagesschau.de https://bugs.webkit.org/show_bug.cgi?id=214652 Reviewed by Tim Horton. Treat block-level heading elements (`h1` through `h6`) as item boundaries. On this website, we currently vend the main heading and sub-heading as separate tokens in the same item, which sometimes causes the machine translation framework to try and rearrange and split tokens, since it treats the combination of the main heading and sub-heading text as a single sentence to be translated. Test: TextManipulation.StartTextManipulationExtractsHeadingElementsAsSeparateItems * editing/TextManipulationController.cpp: (WebCore::isEnclosingItemBoundaryElement): 2020-07-22 Alex Christensen Safari does not present CertificateInfo for service-worker served documents https://bugs.webkit.org/show_bug.cgi?id=206403 Reviewed by Darin Adler and Youenn Fablet. When loading a service worker JavaScript resource, we need to tell the network process to include certificate info with the response. We then pass that response to the ServiceWorkerContextData for storage. When the service worker generates responses to fetches, use that certificate chain for WKWebView.serverTrust when the page is committed. Covered by updating a test I wrote in r264687. * platform/network/ResourceResponseBase.h: (WebCore::ResourceResponseBase::setCertificateInfo): * platform/network/cf/CertificateInfo.h: * platform/network/cf/CertificateInfoCFNet.cpp: (WebCore::CertificateInfo::isolatedCopy const): * platform/network/soup/CertificateInfo.h: (WebCore::CertificateInfo::isolatedCopy const): * workers/Worker.cpp: (WebCore::Worker::create): * workers/WorkerScriptLoader.cpp: (WebCore::WorkerScriptLoader::loadAsynchronously): (WebCore::WorkerScriptLoader::didReceiveResponse): * workers/WorkerScriptLoader.h: (WebCore::WorkerScriptLoader::certificateInfo const): * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript): * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerContextData.cpp: (WebCore::ServiceWorkerContextData::isolatedCopy const): * workers/service/ServiceWorkerContextData.h: (WebCore::ServiceWorkerContextData::encode const): (WebCore::ServiceWorkerContextData::decode): * workers/service/ServiceWorkerFetchResult.h: (WebCore::ServiceWorkerFetchResult::isolatedCopy const): (WebCore::serviceWorkerFetchError): (WebCore::ServiceWorkerFetchResult::encode const): (WebCore::ServiceWorkerFetchResult::decode): * workers/service/ServiceWorkerGlobalScope.h: * workers/service/ServiceWorkerJob.cpp: (WebCore::ServiceWorkerJob::fetchScriptWithContext): (WebCore::ServiceWorkerJob::notifyFinished): * workers/service/ServiceWorkerJobClient.h: * workers/service/context/ServiceWorkerFetch.cpp: (WebCore::ServiceWorkerFetch::processResponse): (WebCore::ServiceWorkerFetch::dispatchFetchEvent): * workers/service/server/RegistrationDatabase.cpp: (WebCore::RegistrationDatabase::importRecords): * workers/service/server/SWServer.cpp: (WebCore::SWServer::addRegistrationFromStore): Also fix a possible use-after-move bug, depending on parameter evaluation order which is undefined behavior. (WebCore::SWServer::updateWorker): (WebCore::SWServer::installContextData): * workers/service/server/SWServer.h: * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::scriptFetchFinished): * workers/service/server/SWServerWorker.cpp: (WebCore::SWServerWorker::SWServerWorker): (WebCore::SWServerWorker::contextData const): * workers/service/server/SWServerWorker.h: 2020-07-22 David Kilzer Unreviewed build fix after r264710, r264719, r264721: use more HAVE_AVPLAYER_VIDEORANGEOVERRIDE. * platform/PlatformScreen.h: * platform/mac/PlatformScreenMac.mm: (WebCore::collectScreenProperties): - Guard more code with HAVE(AVPLAYER_VIDEORANGEOVERRIDE). 2020-07-22 Fujii Hironori [Win][Uniscribe] Material icons containing underscore or numbers aren't shown because ScriptItemize splits them apart https://bugs.webkit.org/show_bug.cgi?id=201214 Reviewed by Don Olmstead. ScriptItemize split "3d_rotation" into "3", "d", "_" and "rotation". It has a option fMergeNeutralItems to control it. Test: fonts/ligature.html * platform/graphics/win/ComplexTextControllerUniscribe.cpp: (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Set fMergeNeutralItems of SCRIPT_CONTROL true. 2020-07-22 Jer Noble Further unreviewed build fix after r264710; need more HAVE_AVPLAYER_VIDEORANGEOVERRIDE guards. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 2020-07-22 Jer Noble Unreviewed build fix after r264710; add a HAVE_AVPLAYER_VIDEORANGEOVERRIDE guard. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::setPreferredDynamicRangeMode): 2020-07-22 Myles C. Maxfield REGRESSION(r205826): narrowNoBreakSpace (U+202F) has zero width, regardless of font https://bugs.webkit.org/show_bug.cgi?id=214626 Reviewed by Timothy Hatcher. There's no reason to overwrite narrowNoBreakSpace with zeroWidthSpace. This is becoming much more prominent now because a lot of the French unit formatting data in CLDR - and hence in e.g. NSMeasurementFormatter - uses 202F between numeric value and unit, e.g. "37 km" It works in native content on macOS, and in all other browsers on macOS, but not in WebKit. Test: fast/text/narrowNoBreakSpace.html * platform/graphics/Font.cpp: (WebCore::overrideControlCharacters): 2020-07-22 James Darpinian Fix validation of deleted WebGL objects https://bugs.webkit.org/show_bug.cgi?id=214622 Reviewed by Dean Jackson. Programs and shaders need to be validated differently than other WebGL objects. Using a deleted WebGL object should cause an INVALID_OPERATION error, except for programs and shaders which should be INVALID_VALUE. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getFragDataLocation): (WebCore::WebGL2RenderingContext::transformFeedbackVaryings): (WebCore::WebGL2RenderingContext::getTransformFeedbackVarying): (WebCore::WebGL2RenderingContext::getUniformIndices): (WebCore::WebGL2RenderingContext::getActiveUniforms): (WebCore::WebGL2RenderingContext::getUniformBlockIndex): (WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter): (WebCore::WebGL2RenderingContext::getActiveUniformBlockName): (WebCore::WebGL2RenderingContext::uniformBlockBinding): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::attachShader): (WebCore::WebGLRenderingContextBase::bindAttribLocation): (WebCore::WebGLRenderingContextBase::compileShader): (WebCore::WebGLRenderingContextBase::detachShader): (WebCore::WebGLRenderingContextBase::validateWebGLObject): (WebCore::WebGLRenderingContextBase::validateWebGLProgramOrShader): (WebCore::WebGLRenderingContextBase::getActiveAttrib): (WebCore::WebGLRenderingContextBase::getActiveUniform): (WebCore::WebGLRenderingContextBase::getAttachedShaders): (WebCore::WebGLRenderingContextBase::getAttribLocation): (WebCore::WebGLRenderingContextBase::getProgramParameter): (WebCore::WebGLRenderingContextBase::getProgramInfoLog): (WebCore::WebGLRenderingContextBase::getShaderParameter): (WebCore::WebGLRenderingContextBase::getShaderInfoLog): (WebCore::WebGLRenderingContextBase::getShaderSource): (WebCore::WebGLRenderingContextBase::getUniform): (WebCore::WebGLRenderingContextBase::getUniformLocation): (WebCore::WebGLRenderingContextBase::linkProgramWithoutInvalidatingAttribLocations): (WebCore::WebGLRenderingContextBase::shaderSource): (WebCore::WebGLRenderingContextBase::validateProgram): * html/canvas/WebGLRenderingContextBase.h: 2020-07-22 Jon Davis Update feature status to include the inert attribute https://bugs.webkit.org/show_bug.cgi?id=214644 Reviewed by Darin Adler. * features.json: 2020-07-22 Jer Noble [macOS] Adopt AVPlayer.videoRangeOverride https://bugs.webkit.org/show_bug.cgi?id=213902 Reviewed by Youenn Fablet. AVPlayer.videoRangeOverride and also +[AVPlayer preferredVideoRangeForDisplays:] are replacements for the process-global MTShouldPlayHDR() and MTOverrideShouldPlayHDRVideo() and should be used preferentially if present. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::createMediaPlayer): (WebCore::HTMLMediaElement::setPreferredDynamicRangeMode): * html/HTMLMediaElement.h: * page/Page.cpp: (WebCore::Page::screenPropertiesDidChange): (WebCore::Page::windowScreenDidChange): * page/Page.h: * platform/PlatformScreen.h: (WebCore::preferredDynamicRangeMode): * platform/ScreenProperties.h: (WebCore::ScreenData::encode const): (WebCore::ScreenData::decode): * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::setPreferredDynamicRangeMode): * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::setPreferredDynamicRangeMode): * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::update): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::convertDynamicRangeModeEnumToAVVideoRange): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::setPreferredDynamicRangeMode): * platform/mac/PlatformScreenMac.mm: (WebCore::convertAVVideoRangeToEnum): (WebCore::collectScreenProperties): (WebCore::preferredDynamicRangeMode): 2020-07-22 Jon Davis Update status for Web App Manifest https://bugs.webkit.org/show_bug.cgi?id=204863 Reviewed by Dean Jackson. * features.json: 2020-07-21 Simon Fraser Scrolling tesla.com on iPad is not smooth https://bugs.webkit.org/show_bug.cgi?id=214627 Reviewed by Tim Horton. This is the iOS equivalent of the fix in r264203; if the user is scrolling (or we're animating for scroll snap), layout should not trigger scroll position changes via computation of the current snap location. To fix this, we need to send data from the UI process to the web process about which scrolling tree nodes the user is scrolling. That's done via RemoteScrollingUIState, which will, in the long term, become a more general UI -> WebProcess scrolling state updating mechanism. For now, it just keeps track of nodes undergoing scroll snap and user scrolls (only the latter is hooked up for now). Test: fast/scrolling/ios/adjust-scroll-snap-during-gesture.html * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::scrollingTreeNodeWillStartPanGesture): (WebCore::ScrollingTree::scrollingTreeNodeWillStartScroll): (WebCore::ScrollingTree::scrollingTreeNodeDidEndScroll): 2020-07-22 Commit Queue Unreviewed, reverting r264691. https://bugs.webkit.org/show_bug.cgi?id=214642 Regressed fast/mediastream/captureStream/canvas3d.html Reverted changeset: "[WebGL2] Implement multiple render target entry points" https://bugs.webkit.org/show_bug.cgi?id=211156 https://trac.webkit.org/changeset/264691 2020-07-22 Youenn Fablet KeepAlive fetch should not be blocked in pagehide event handlers https://bugs.webkit.org/show_bug.cgi?id=214630 Reviewed by Chris Dumez. Test: http/wpt/fetch/fetch-in-pagehide.html * loader/cache/CachedResource.cpp: (WebCore::CachedResource::load): Allow keep alive fetches to proceed similarly to ping loads. 2020-07-22 Geoffrey Garen JSRunLoopTimer should use WTF::RunLoop rather than custom CF code https://bugs.webkit.org/show_bug.cgi?id=214102 Unreviewed, re-landing r264242 with crash fixed. Since I was here, I applied Darin's previous review feedback that I had missed. * bindings/js/CommonVM.cpp: (WebCore::commonVMSlow): 2020-07-19 Darin Adler Remove live ranges from Editor.h and EditorClient.h https://bugs.webkit.org/show_bug.cgi?id=214261 Reviewed by Sam Weinig. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::misspellingRange const): Update since rangeForTextCheckingResult no longer returns a live range. (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): Update since rangeOfString no longer returns a live range. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (accessibilityTextOperationForParameterizedAttribute): Use makeSimpleRange. * dom/Document.cpp: (WebCore::acceptsEditingFocus): Use makeRangeSelectingNodeContents since shouldBeginEditing no longer takes a live range. * dom/Range.h: Exxported makeSimpleRange for use outside WebCore. * dom/SimpleRange.cpp: (WebCore::makeSimpleRange): Added. Takes two optional boundary points and returns an optional range. * dom/SimpleRange.h: Added the above. * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::timerFired): Removed calls to crateLiveRange since markAllMisspellingsAndBadGrammarInRanges no longer takes live ranges. (WebCore::AlternativeTextController::applyDictationAlternative): Updates since shouldInsertText no longer takes a live range. * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::mergeParagraphs): Updated since shouldMoveRangeAfterDelete no longer takes live ranges. * editing/Editor.cpp: (WebCore::Editor::canDeleteRange const): Updated to not take a live range. (WebCore::Editor::deleteWithDirection): Updated since addRangeToKillRing no longer takes a live range. (WebCore::Editor::pasteAsPlainTextWithPasteboard): Updated since shouldInsertText no longer takes a live range. (WebCore::Editor::shouldInsertFragment): No longer take a live range. (WebCore::Editor::replaceSelectionWithText): Updated since selectedRange no longer returns a live range. (WebCore::Editor::selectedRange): Do not return a live range. (WebCore::Editor::shouldDeleteRange const): Do not take a live range. (WebCore::Editor::shouldInsertText const): Ditto. (WebCore::Editor::shouldApplyStyle): Ditto. Also take a const& to the style instead of a non-const*. (WebCore::Editor::applyStyleToSelection): Pass a style reference and a non-live range. (WebCore::Editor::applyParagraphStyleToSelection): Updated for the change above. (WebCore::Editor::insertTextWithoutSendingTextEvent): No need to pass a live range any more. (WebCore::Editor::insertLineBreak): Ditto. (WebCore::Editor::insertParagraphSeparator): Ditto. (WebCore::Editor::performCutOrCopy): Updated to not use live range. (WebCore::Editor::performDelete): Ditto. (WebCore::Editor::shouldEndEditing): Do not take a live range. (WebCore::Editor::shouldBeginEditing): Ditto. (WebCore::Editor::willWriteSelectionToPasteboard): Ditto. (WebCore::Editor::selectComposition): Update since compositionRange is not a live range. (WebCore::Editor::markMisspellingsAfterTypingToWord): Update since we don't need to pass live ranges to markAllMisspellingsAndBadGrammarInRanges. (WebCore::Editor::markMisspellingsOrBadGrammar): Don't return a live range in tthe out argument. (WebCore::Editor::markMisspellings): Ditto. (WebCore::Editor::markBadGrammar): Update for the above. (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Do not take live ranges for the arguments. (WebCore::Editor::replaceRangeForSpellChecking): Do not take a live range. (WebCore::Editor::markAndReplaceFor): Update since shouldInsertText does not take a live range any more. (WebCore::Editor::changeBackToReplacedString): Update to not use live ranges as much. (WebCore::Editor::markMisspellingsAndBadGrammar): Updae since we don't need to pass live ranges to markAllMisspellingsAndBadGrammarInRanges. (WebCore::Editor::rangeForPoint): Don't return a live range. (WebCore::Editor::compositionRange const): Ditto. (WebCore::Editor::transpose): Updated since we don't pass a live range. (WebCore::Editor::firstRectForRange const): Don't take a live range. (WebCore::Editor::shouldChangeSelection const): Updated since we don't need to pass a live range. (WebCore::Editor::findString): Ditto. (WebCore::start): Added. Helper to make rangeOfString easier to read. (WebCore::end): Ditto. (WebCore::makeBoundaryPointAfterNodeContents): Ditto. (WebCore::makeBoundaryPointAfterNode): Ditto. (WebCore::collapseIfRootsDiffer): Ditto. (WebCore::Editor::rangeOfString): Updated to not take or return a live range and not use it internally either. (WebCore::isFrameInRange): Don't take a live range. (WebCore::Editor::countMatchesForText): Don't take or return live ranges. (WebCore::Editor::contextRangeForCandidateRequest const): Don't return a live range. (WebCore::Editor::rangeForTextCheckingResult const): Ditto. (WebCore::Editor::handleAcceptedCandidate): Update for the above. (WebCore::Editor::adjustedSelectionRange): Don't return a live range. * editing/Editor.h: Updated for all the chagnes above. * editing/EditorCommand.cpp: (WebCore::expandSelectionToGranularity): Updated to reduce the use of live ranges. (WebCore::unionRanges): Updated to no longer take or return a live range. Still uses live ranges in the algorithm for now. (WebCore::executeDeleteToMark): Updated since selectedRange no longer returns a live range. (WebCore::executeSelectToMark): Update to use the new unionRanges. * editing/FrameSelection.cpp: (WebCore::FrameSelection::shouldDeleteSelection const): Updated since shouldDeleteRange no longer requires a live range. * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::getPasteboardTypesAndDataForAttachment): Updated for changes to use fewer live ranges. (WebCore::Editor::writeSelectionToPasteboard): Ditto. (WebCore::Editor::writeSelection): Ditto. (WebCore::Editor::replaceSelectionWithAttributedString): Ditto. * editing/gtk/EditorGtk.cpp: (WebCore::Editor::pasteWithPasteboard): Ditto. * editing/ios/EditorIOS.mm: (WebCore::Editor::writeImageToPasteboard): Ditto. (WebCore::Editor::pasteWithPasteboard): Ditto. * editing/libwpe/EditorLibWPE.cpp: (WebCore::createFragmentFromPasteboardData): Ditto. (WebCore::Editor::pasteWithPasteboard): Ditto. * editing/mac/EditorMac.mm: (WebCore::Editor::pasteWithPasteboard): Ditto. (WebCore::Editor::replaceNodeFromPasteboard): Ditto. (WebCore::Editor::dataSelectionForPasteboard): Ditto. * editing/win/EditorWin.cpp: (WebCore::Editor::pasteWithPasteboard): Ditto. * html/FTPDirectoryDocument.cpp: (WebCore::FTPDirectoryDocumentParser::createTDForFilename): Removed a WTFMove that messes up the return value optimization. Noticed while fixing errors caused by live range changes. * loader/EmptyClients.cpp: Updated for changes to EditorClient. * page/ContextMenuController.cpp: (WebCore::insertUnicodeCharacter): Updated to use fewer live ranges. (WebCore::ContextMenuController::contextMenuItemSelected): DItto. * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): Ditto. (WebCore::DragController::startDrag): Ditto. * page/EditorClient.h: Don't take or return live ranges. * page/EventHandler.cpp: (WebCore::EventHandler::sendContextMenuEventForKey): Simplified since we don't need to use a live range. * page/FocusController.cpp: (WebCore::relinquishesEditingFocus): Changed argument type to be more specific, and changed to not use a live range. (WebCore::FocusController::setFocusedElement): Updated for the above. * page/Frame.cpp: (WebCore::Frame::rangeForPoint): Updated to not use live ranges. * page/Page.cpp: (WebCore::Page::findStringMatchingRanges): Updated to not use live ranges as much. (WebCore::Page::rangeOfString): Ditto. (WebCore::Page::findMatchesForText): Ditto. * testing/Internals.cpp: (WebCore::Internals::rangeOfString): Updated since return value of the Editor member function is no longer a live range. (WebCore::Internals::countMatchesForText): Ditto. 2020-07-21 Kenneth Russell [WebGL2] Implement multiple render target entry points https://bugs.webkit.org/show_bug.cgi?id=211156 Reviewed by Myles C. Maxfield. Implement the drawBuffers and clearBuffer entry points. Integrate the clearBuffer APIs with preserveDrawingBuffer:false's auto-clearing. Covered by existing WebGL conformance tests. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::drawBuffers): (WebCore::WebGL2RenderingContext::clearBufferiv): (WebCore::WebGL2RenderingContext::clearBufferuiv): (WebCore::WebGL2RenderingContext::clearBufferfv): (WebCore::WebGL2RenderingContext::clearBufferfi): (WebCore::WebGL2RenderingContext::validateClearBuffer): (WebCore::WebGL2RenderingContext::updateBuffersToAutoClear): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::drawBuffersIfNecessary): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::clearIfComposited): * platform/graphics/GraphicsContextGL.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::markLayerComposited): (WebCore::GraphicsContextGLOpenGL::drawBuffers): (WebCore::GraphicsContextGLOpenGL::clearBufferiv): (WebCore::GraphicsContextGLOpenGL::clearBufferuiv): (WebCore::GraphicsContextGLOpenGL::clearBufferfv): (WebCore::GraphicsContextGLOpenGL::clearBufferfi): * platform/graphics/opengl/GraphicsContextGLOpenGL.cpp: (WebCore::GraphicsContextGLOpenGL::resetBuffersToAutoClear): (WebCore::GraphicsContextGLOpenGL::setBuffersToAutoClear): (WebCore::GraphicsContextGLOpenGL::getBuffersToAutoClear const): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::markLayerComposited): (WebCore::GraphicsContextGLOpenGL::drawBuffers): 2020-07-21 Wenson Hsieh REGRESSION (r258871): Shift + click to extend selection loses currently selected text https://bugs.webkit.org/show_bug.cgi?id=214617 Reviewed by Megan Gardner. After the changes in r258871, shift clicking sometimes fails to preserve the existing selected text range on macOS and iOS. The logic in `EventHandler::handleMousePressEventSingleClick` uses the `textDistance` helper method to count the number of characters between the start of the current selection to the newly selected extent, as well as the number of characters between the end of the current selection and the newly selected extent position. It compares these two character counts, and attempts to choose the new selection extents in such a way that maximizes the amount of selected text. However, after r258871, `textDistance` uses `characterCount` instead of `TextIterator::rangeLength`. Unlike the former, `rangeLength` is robust in the case where the start position comes after the end position (in document order), since the process of creating a live `Range` object swaps the start and end if needed. This isn't the case when using `SimpleRange`. Instead, when given a simple range where the start comes after the end, `characterCount` will iterate text in the DOM, starting from the start position and ending at the end of the document rather than the end position. The result is that `characterCount` actually counts the number of characters between the start position and the end of the document, rather than the number of characters between the two positions. In the context of this bug, if the start of the current selection is "far away" (in terms of character count) from the end of the document and the new extent position comes after end of the current selection, we will end up choosing the end (instead of the start) as one of the new extents of the updated selection. To fix this (as well as other similar issues that might've arisen when replacing uses of `TextIterator::rangeLength` with `characterCount`), simply teach `characterCount` to flip the start and end positions if the end position of the `SimpleRange` comes before the start. Test: editing/selection/shift-click-includes-existing-selection.html * editing/TextIterator.cpp: (WebCore::characterCount): 2020-07-21 Alex Christensen Fix Windows build. https://bugs.webkit.org/show_bug.cgi?id=214623 * platform/network/curl/CertificateInfo.h: * platform/network/curl/CertificateInfoCurl.cpp: (WebCore::CertificateInfo::summary const): (WebCore::CertificateInfo::summaryInfo const): Deleted. 2020-07-21 Alex Christensen Remove unneeded CertificateInfoBase https://bugs.webkit.org/show_bug.cgi?id=214623 Reviewed by Brady Eidson. I need to make CertificateInfo::isolatedCopy and this class was making it messy. It has no shared functionality, so I removed it. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse): * platform/network/CertificateInfoBase.h: Removed. * platform/network/CertificateSummary.h: Copied from Source/WebCore/platform/network/CertificateInfoBase.h. (WebCore::CertificateInfoBase::containsNonRootSHA1SignedCertificate const): Deleted. (WebCore::CertificateInfoBase::summaryInfo const): Deleted. (WebCore::CertificateInfoBase::isEmpty const): Deleted. * platform/network/cf/CertificateInfo.h: * platform/network/cf/CertificateInfoCFNet.cpp: (WebCore::CertificateInfo::summary const): (WebCore::CertificateInfo::summaryInfo const): Deleted. * platform/network/curl/CertificateInfo.h: * platform/network/soup/CertificateInfo.h: (WebCore::CertificateInfo::summary const): (WebCore::CertificateInfo::summaryInfo const): Deleted. 2020-07-21 Jer Noble [Cocoa] Add experimental MSE WebM parser https://bugs.webkit.org/show_bug.cgi?id=214529 Reviewed by Eric Carlson. Test: media/media-source/media-source-webm.html Add an experimental MSE WebM parser to SourceBufferPrivateAVFObjC. This will require extensive refactoring of SourceBufferPrivateAVFObjC, to extract out the parser into a new, virtualized class. This new parser can take advantage of new C++>11 features such as lambdas to clean up some problematic existing code. The new virtualized SourceBufferParser class uses passed-in Function objects, rather than pure-virtual Client classes to notify it's parent object when the parser encounters initialization- or media-data. Because SourceBufferPrivateAVFObjC will now have to deal with AudioTrackPrivate and VideoTrackPrivate objects that are not necessarily Audio- and VideoTrackPrivateMediaSourceAVFObjC subclasses, move those classes notification features up into Audio- and VideoTrackPrivate, again using a Function object rather than a client class. Add a new SourceBufferParserWebM and associated AudioTrackPrivateWebM and VideoTrackPrivateWebM classes, which use libwebm via libwebrtc to parse appended buffers. SourceBufferParserWebM feeds passed-in data into a libwebm-provided parser of its own. It then builds up tracks and samples based on callbacks from that same parser, constructing CMSampleBuffers and VideoTrackPrivate objects out of the underlying libwebm primitives. Because WebM uses a UUID as its track identifier, the representation of a "trackID" inside WebCore must be increased from an int to a uint64_t, or trackIDs will be truncated or zeroed when passed between classes and when converted to and from AtomStrings. This early implementation is not yet able to pass the WebM WPT media-source/ tests, as we only have a VP9 decoder available, and those tests use both VP8 and Vorbis. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebMParserEnabled): (WebCore::RuntimeEnabledFeatures::webMParserEnabled const): * platform/graphics/AudioTrackPrivate.h: (WebCore::AudioTrackPrivate::setEnabled): (WebCore::AudioTrackPrivate::setEnabledChangedCallback): * platform/graphics/VP9Utilities.cpp: (WebCore::isValidVPColorPrimaries): (WebCore::isValidVPTransferCharacteristics): (WebCore::isValidVPMatrixCoefficients): (WebCore::parseVPCodecParameters): * platform/graphics/VP9Utilities.h: * platform/graphics/VideoTrackPrivate.h: (WebCore::VideoTrackPrivate::setSelected): (WebCore::VideoTrackPrivate::setSelectedChangedCallback): * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp: (WebCore::AudioTrackPrivateMediaSourceAVFObjC::AudioTrackPrivateMediaSourceAVFObjC): (WebCore::AudioTrackPrivateMediaSourceAVFObjC::setEnabled): * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: (WebCore::CDMSessionAVContentKeySession::update): * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::update): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: (WebCore::MediaSampleAVFObjC::create): (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer): * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.h: Added. (isType): * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm: Added. (-[WebAVStreamDataParserListener initWithParser:parent:]): (-[WebAVStreamDataParserListener dealloc]): (-[WebAVStreamDataParserListener invalidate]): (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]): (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:withDiscontinuity:]): (-[WebAVStreamDataParserListener streamDataParser:didFailToParseStreamDataWithError:]): (-[WebAVStreamDataParserListener streamDataParser:didProvideMediaData:forTrackID:mediaType:flags:]): (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]): (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]): (WebCore::SourceBufferParserAVFObjC::isContentTypeSupported): (WebCore::SourceBufferParserAVFObjC::SourceBufferParserAVFObjC): (WebCore::SourceBufferParserAVFObjC::~SourceBufferParserAVFObjC): (WebCore::SourceBufferParserAVFObjC::appendData): (WebCore::SourceBufferParserAVFObjC::flushPendingMediaData): (WebCore::SourceBufferParserAVFObjC::setShouldProvideMediaDataForTrackID): (WebCore::SourceBufferParserAVFObjC::shouldProvideMediadataForTrackID): (WebCore::SourceBufferParserAVFObjC::resetParserState): (WebCore::SourceBufferParserAVFObjC::didParseStreamDataAsAsset): (WebCore::SourceBufferParserAVFObjC::didFailToParseStreamDataWithError): (WebCore::SourceBufferParserAVFObjC::didProvideMediaDataForTrackID): (WebCore::SourceBufferParserAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferParserAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::create): (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::didParseInitializationData): (WebCore::SourceBufferPrivateAVFObjC::didEncounterErrorDuringParsing): (WebCore::SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::append): (WebCore::SourceBufferPrivateAVFObjC::appendCompleted): (WebCore::SourceBufferPrivateAVFObjC::abort): (WebCore::SourceBufferPrivateAVFObjC::resetParserState): (WebCore::SourceBufferPrivateAVFObjC::destroyParser): (WebCore::SourceBufferPrivateAVFObjC::clearTracks): (WebCore::SourceBufferPrivateAVFObjC::hasSelectedVideo const): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeSelected): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::parser const): (WebCore::SourceBufferPrivateAVFObjC::attemptToDecrypt): (WebCore::SourceBufferPrivateAVFObjC::flush): (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::canSetMinimumUpcomingPresentationTime const): * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm: (WebCore::VideoTrackPrivateMediaSourceAVFObjC::VideoTrackPrivateMediaSourceAVFObjC): * platform/graphics/cocoa/AudioTrackPrivateWebM.cpp: Copied from Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h. (WebCore::AudioTrackPrivateWebM::create): (WebCore::AudioTrackPrivateWebM::AudioTrackPrivateWebM): (WebCore::AudioTrackPrivateWebM::id const): (WebCore::AudioTrackPrivateWebM::label const): (WebCore::AudioTrackPrivateWebM::language const): (WebCore::AudioTrackPrivateWebM::trackIndex const): * platform/graphics/cocoa/AudioTrackPrivateWebM.h: Copied from Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h. * platform/graphics/cocoa/SourceBufferParser.cpp: Copied from Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h. (WebCore::SourceBufferParser::isContentTypeSupported): (WebCore::SourceBufferParser::create): * platform/graphics/cocoa/SourceBufferParser.h: Added. (WebCore::SourceBufferParser::setDidParseInitializationDataCallback): (WebCore::SourceBufferParser::setDidEncounterErrorDuringParsingCallback): (WebCore::SourceBufferParser::setDidProvideMediaDataCallback): (WebCore::SourceBufferParser::setWillProvideContentKeyRequestInitializationDataForTrackIDCallback): (WebCore::SourceBufferParser::setDidProvideContentKeyRequestInitializationDataForTrackIDCallback): * platform/graphics/cocoa/SourceBufferParserWebM.cpp: Added. (WebCore::isWebmParserAvailable): (WebCore::SourceBufferParserWebM::isContentTypeSupported): (WebCore::SourceBufferParserWebM::SourceBufferParserWebM): (WebCore::SourceBufferParserWebM::appendData): (WebCore::SourceBufferParserWebM::flushPendingMediaData): (WebCore::SourceBufferParserWebM::setShouldProvideMediaDataForTrackID): (WebCore::SourceBufferParserWebM::shouldProvideMediadataForTrackID): (WebCore::SourceBufferParserWebM::resetParserState): (WebCore::SourceBufferParserWebM::trackDataForTrackNumber): (WebCore::SourceBufferParserWebM::OnElementBegin): (WebCore::SourceBufferParserWebM::OnEbml): (WebCore::SourceBufferParserWebM::OnSegmentBegin): (WebCore::SourceBufferParserWebM::OnInfo): (WebCore::SourceBufferParserWebM::OnClusterBegin): (WebCore::SourceBufferParserWebM::OnTrackEntry): (WebCore::SourceBufferParserWebM::OnBlockBegin): (WebCore::SourceBufferParserWebM::OnBlockEnd): (WebCore::SourceBufferParserWebM::OnSimpleBlockBegin): (WebCore::SourceBufferParserWebM::OnSimpleBlockEnd): (WebCore::SourceBufferParserWebM::OnBlockGroupBegin): (WebCore::SourceBufferParserWebM::OnBlockGroupEnd): (WebCore::convertToColorPrimaries): (WebCore::convertToTransferCharacteristics): (WebCore::convertToMatrixCoefficients): (WebCore::convertSubsamplingXYToChromaSubsampling): (WebCore::createFormatDescriptionFromVP9HeaderParser): (WebCore::SourceBufferParserWebM::OnFrame): * platform/graphics/cocoa/SourceBufferParserWebM.h: Added. (WebCore::SourceBufferParserWebM::status const): (WebCore::SourceBufferParserWebM::type const): (isType): * platform/graphics/cocoa/VP9UtilitiesCocoa.h: * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: (WebCore::isVP9DecoderAvailable): (WebCore::validateVPParameters): * platform/graphics/cocoa/VideoTrackPrivateWebM.cpp: (WebCore::VideoTrackPrivateWebM::create): (WebCore::VideoTrackPrivateWebM::VideoTrackPrivateWebM): (WebCore::VideoTrackPrivateWebM::id const): (WebCore::VideoTrackPrivateWebM::label const): (WebCore::VideoTrackPrivateWebM::language const): (WebCore::VideoTrackPrivateWebM::trackIndex const): * platform/graphics/cocoa/VideoTrackPrivateWebM.h: 2020-07-21 Peng Liu Safari is unresponsive after playing a video of youtube.com playlist in picture-in-picture mode https://bugs.webkit.org/show_bug.cgi?id=214616 Reviewed by Eric Carlson. Remove the function setPreparedToReturnVideoLayerToInline() from MediaControlsHost.idl and replace all the calls to that function in Javascript code with a call in HTMLVideoElement::fullscreenModeChanged(). Calling setPreparedToReturnVideoLayerToInline() in the Javascript code of modern media controls can be problematic because the host object might have been destroyed when the webkitpresentationmodechanged event is fired. During the exit fullscreen/picture-in-picture transaction, missing a call to setPreparedToReturnVideoLayerToInline() will block the transaction, and the UI process will be stuck in a bad state. * Modules/mediacontrols/MediaControlsHost.cpp: (WebCore::MediaControlsHost::setPreparedToReturnVideoLayerToInline): Deleted. * Modules/mediacontrols/MediaControlsHost.h: * Modules/mediacontrols/MediaControlsHost.idl: * Modules/mediacontrols/mediaControlsApple.js: (Controller.prototype.handlePresentationModeChange): * Modules/modern-media-controls/media/media-controller.js: (MediaController.prototype.handleEvent): (MediaController.prototype._returnMediaLayerToInlineIfNeeded): Deleted. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::fullscreenModeChanged): 2020-07-21 Tim Horton REGRESSION (WebSQL disablement): Fudget app is unresponsive on launch https://bugs.webkit.org/show_bug.cgi?id=214620 Reviewed by Geoffrey Garen. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isFudget): 2020-07-21 Michael Catanzaro Update Chrome and Firefox versions in user agent quirks https://bugs.webkit.org/show_bug.cgi?id=214595 Reviewed by Adrian Perez de Castro. * platform/UserAgentQuirks.cpp: (WebCore::UserAgentQuirks::stringForQuirk): 2020-07-21 Yusuke Suzuki Use CatchScope in microtask execution https://bugs.webkit.org/show_bug.cgi?id=214600 Reviewed by Mark Lam. Test: js/dom/microtask-drain-should-use-catch-scope.html Use CatchScope to suppress JSC_validateExceptionChecks. * bindings/js/JSMicrotaskCallback.h: (WebCore::JSMicrotaskCallback::call): 2020-07-21 Eric Carlson Use AVRoutePickerView when available for choosing AirPlay devices https://bugs.webkit.org/show_bug.cgi?id=213497 Reviewed by Jer Noble. Use an AVRoutePickerView, the replacement for AVOutputDeviceMenuController, when it is available to allow a user to pick an AirPlay device. To do this, create an AVPlaybackTargetPicker abstract base and create a concrete class from the AVOutputDeviceMenuController-specific code from MediaPlaybackTargetPickerMac, and create a new concrete class using AVRoutePickerView. Tested manually because these changes require an AirPlay device. * Modules/mediasession/WebMediaSessionManager.cpp: (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): Pass the view to the target picker. * Modules/mediasession/WebMediaSessionManagerClient.h: * Modules/remoteplayback/RemotePlayback.cpp: (WebCore::RemotePlayback::playbackTargetPickerWasDismissed): Drive-by fix: return early if there are no pending promises. * SourcesCocoa.txt: Add new files. * WebCore.xcodeproj/project.pbxproj: Ditto. * platform/graphics/MediaPlaybackTargetPicker.cpp: (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker): Add new parameter. * platform/graphics/MediaPlaybackTargetPicker.h: * platform/graphics/avfoundation/objc/AVOutputDeviceMenuControllerTargetPicker.h: Copied from Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h. * platform/graphics/avfoundation/objc/AVOutputDeviceMenuControllerTargetPicker.mm: Copied from Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm. (WebCore::AVOutputDeviceMenuControllerTargetPicker::AVOutputDeviceMenuControllerTargetPicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::~AVOutputDeviceMenuControllerTargetPicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::devicePicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::availableDevicesDidChange): (WebCore::AVOutputDeviceMenuControllerTargetPicker::currentDeviceDidChange): (WebCore::AVOutputDeviceMenuControllerTargetPicker::showPlaybackTargetPicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::startingMonitoringPlaybackTargets): (WebCore::AVOutputDeviceMenuControllerTargetPicker::stopMonitoringPlaybackTargets): (WebCore::AVOutputDeviceMenuControllerTargetPicker::invalidatePlaybackTargets): (WebCore::AVOutputDeviceMenuControllerTargetPicker::externalOutputDeviceAvailable): (WebCore::AVOutputDeviceMenuControllerTargetPicker::outputContext): (-[WebAVOutputDeviceMenuControllerHelper initWithCallback:]): (-[WebAVOutputDeviceMenuControllerHelper clearCallback]): (-[WebAVOutputDeviceMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]): * platform/graphics/avfoundation/objc/AVPlaybackTargetPicker.h: Added. (WebCore::AVPlaybackTargetPicker::AVPlaybackTargetPicker): (WebCore::AVPlaybackTargetPicker::client const): * platform/graphics/avfoundation/objc/AVRoutePickerViewTargetPicker.h: Added. * platform/graphics/avfoundation/objc/AVRoutePickerViewTargetPicker.mm: Added. (WebCore::AVRoutePickerViewTargetPicker::isAvailable): (WebCore::AVRoutePickerViewTargetPicker::AVRoutePickerViewTargetPicker): (WebCore::AVRoutePickerViewTargetPicker::~AVRoutePickerViewTargetPicker): (WebCore::AVRoutePickerViewTargetPicker::outputContextInternal): (WebCore::AVRoutePickerViewTargetPicker::devicePicker): (WebCore::AVRoutePickerViewTargetPicker::routeDetector): (WebCore::AVRoutePickerViewTargetPicker::showPlaybackTargetPicker): (WebCore::AVRoutePickerViewTargetPicker::startingMonitoringPlaybackTargets): (WebCore::AVRoutePickerViewTargetPicker::stopMonitoringPlaybackTargets): (WebCore::AVRoutePickerViewTargetPicker::externalOutputDeviceAvailable): (WebCore::AVRoutePickerViewTargetPicker::outputContext): (WebCore::AVRoutePickerViewTargetPicker::invalidatePlaybackTargets): (WebCore::AVRoutePickerViewTargetPicker::availableDevicesDidChange): (WebCore::AVRoutePickerViewTargetPicker::currentDeviceDidChange): (WebCore::AVRoutePickerViewTargetPicker::devicePickerWasDismissed): (-[WebAVRoutePickerViewHelper initWithCallback:]): (-[WebAVRoutePickerViewHelper dealloc]): (-[WebAVRoutePickerViewHelper clearCallback]): (-[WebAVRoutePickerViewHelper routePickerViewDidEndPresentingRoutes:]): (-[WebAVRoutePickerViewHelper notificationHandler:]): * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h: * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: (WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac): (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac): (WebCore::MediaPlaybackTargetPickerMac::externalOutputDeviceAvailable): (WebCore::MediaPlaybackTargetPickerMac::playbackTarget): (WebCore::MediaPlaybackTargetPickerMac::routePicker): (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): (WebCore::MediaPlaybackTargetPickerMac::startingMonitoringPlaybackTargets): (WebCore::MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets): (WebCore::MediaPlaybackTargetPickerMac::invalidatePlaybackTargets): (WebCore::MediaPlaybackTargetPickerMac::pickerWasDismissed): (WebCore::MediaPlaybackTargetPickerMac::availableDevicesChanged): (WebCore::MediaPlaybackTargetPickerMac::currentDeviceChanged): (WebCore::MediaPlaybackTargetPickerMac::devicePicker): Deleted. (-[WebAVOutputDeviceMenuControllerHelper initWithCallback:]): Deleted. (-[WebAVOutputDeviceMenuControllerHelper clearCallback]): Deleted. (-[WebAVOutputDeviceMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]): Deleted. * platform/mock/MediaPlaybackTargetPickerMock.cpp: (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker): * platform/mock/MediaPlaybackTargetPickerMock.h: 2020-07-21 James Darpinian webgl/2.0.0/conformance2/state/gl-object-get-calls.html results appears to show an out of bounds access bug. https://bugs.webkit.org/show_bug.cgi?id=214557 Reviewed by Myles C. Maxfield. The WebGL 2 function getActiveUniformBlockName was accidentally untested because an unrelated bug caused the test to exit before reaching the part that tested it. The other bug is fixed now, and this change fixes getActiveUniformBlockName to actually work. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getActiveUniformBlockName): * platform/graphics/GraphicsContextGL.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::getActiveUniformBlockName): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::getActiveUniformBlockName): 2020-07-21 Sihui Liu REGRESSION(r264486): ASSERTION FAILED: ASSERT_NOT_REACHED() in NetworkProcessPlatformStrategies::createBlobRegistry https://bugs.webkit.org/show_bug.cgi?id=214425 Reviewed by Youenn Fablet. In SerializedScriptValue.cpp, some kind of wrappers will not be created when global object is not JSDOMGlobalObject, so they would not be created for IDB before r264486. After r264486, IDB uses JSIDBSerializationGlobalObject, which is JSDOMGlobalObject, so those wrappers start to be created. To restore the old behavior, adding checks for JSIDBSerializationGlobalObject in SerializedScriptValue.cpp. Modify and re-enable test: LayoutTests/storage/indexeddb/structured-clone.html * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::CloneDeserializer): (WebCore::CloneDeserializer::readFile): (WebCore::CloneDeserializer::readRTCCertificate): (WebCore::CloneDeserializer::readTerminal): 2020-07-21 Jer Noble [Cocoa] Adopt VTRegisterSupplementalVideoDecoderIfAvailable https://bugs.webkit.org/show_bug.cgi?id=214585 Reviewed by Youenn Fablet. * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/VideoToolboxSoftLink.cpp: * platform/cocoa/VideoToolboxSoftLink.h: * platform/graphics/cocoa/VP9UtilitiesCocoa.h: * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: (WebCore::registerSupplementalVP9Decoder): 2020-07-21 Zalan Bujtas [UI Events] Make mousemove cancelable https://bugs.webkit.org/show_bug.cgi?id=214513 Reviewed by Simon Fraser. This patch makes the mousemove event cancelable. The event was initially specified to be non-cancelable in DOM Level 2 Events, but was changed to reflect existing interoperability between browsers. The most user facing behavior change here is that when the mousemove event is prevent-defaulted (canceled) content selection is not possible. Chrome is aligned with the latest version of the spec, the mousemove event is cancelable. However they also have a TODO right at where the drag would happen: // TODO(crbug.com/346473): Since there is no default action for the mousemove // event we should consider doing drag&drop even when js cancels the // mouse move event. Firefox preforms the drag(select) operation but not sure if it’s because their mousemove event is still non-cancelable or whether they already went ahead with what the TODO says. Test: fast/text/selection-is-prevent-defaulted.html * dom/MouseEvent.cpp: (WebCore::MouseEvent::create): 2020-07-21 Clark Wang Added OfflineAudioContext constructor https://bugs.webkit.org/show_bug.cgi?id=214577 Reviewed by Chris Dumez. Added OfflineAudioContext constructor and OfflineAudioContextOptions files. Re-baselined existing tests. Lots of failures that fail because of unsupported sampleRate range. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::create): * Modules/webaudio/OfflineAudioContext.h: * Modules/webaudio/OfflineAudioContext.idl: * Modules/webaudio/OfflineAudioContextOptions.h: Added. * Modules/webaudio/OfflineAudioContextOptions.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-07-21 Rob Buis Make AnyStepHandling an enum class https://bugs.webkit.org/show_bug.cgi?id=214423 Reviewed by Darin Adler. Correct some post commit comments. * html/HTMLInputElement.h: * html/InputType.h: * html/StepRange.h: 2020-07-21 Xabier Rodriguez Calvar [GStreamer][1.18] mediastreamsrc element hits assert in gst -core https://bugs.webkit.org/show_bug.cgi?id=214150 Reviewed by Philippe Normand. Removed track pointers from observers cause the object was self-referencing a couple of times. Observers are 1-1 with the source so there is no need to keep an owned reference and there is no danger of incorrect dereferencing. Turned finalize into dispose as the work is doing is more removing the references with other objects, which what the dispose is about. Called the parent on that, which as missing as well. * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (WebKitMediaStreamTrackObserver::WebKitMediaStreamTrackObserver): (WebKitMediaStreamObserver::WebKitMediaStreamObserver): (webkitMediaStreamSrcConstructed): (webkitMediaStreamSrcDispose): (webkit_media_stream_src_class_init): 2020-07-21 Carlos Garcia Campos [FreeType] Add support for text-underline-offset and text-decoration-thickness https://bugs.webkit.org/show_bug.cgi?id=214550 Reviewed by Adrian Perez de Castro. Get the underline position and thickness from the font if it's scalable and set them in font metrics. * platform/graphics/freetype/SimpleFontDataFreeType.cpp: (WebCore::scaledFontScaleFactor): (WebCore::fontUnitsPerEm): (WebCore::Font::platformInit): 2020-07-21 Carlos Garcia Campos [GTK][WPE] imported blink large gradient tests are crashing on debug builds https://bugs.webkit.org/show_bug.cgi?id=214192 Reviewed by Žan Doberšek. The assert is: ASSERT(cairo_surface_status(m_surface.get()) == CAIRO_STATUS_SUCCESS); and the status we are getting is CAIRO_STATUS_INVALID_SIZE, because we are reaching the cairo image size limit. We should check the size before trying to create the image surface. This patch fixes the crash, but not the tests themselves that will still fail due to the cairo limitation. * platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp: (WebCore::ImageBufferCairoImageSurfaceBackend::create): Return early if the image size is bigger than the maximum allowed by cairo. 2020-07-20 Alex Christensen Revert r262776 for existing apps using UIWebView/WebView https://bugs.webkit.org/show_bug.cgi?id=214528 Reviewed by Tim Horton. r262776 removed Content-Type: application/x-www-form-urlencoded from POST requests with unspecified content type. This matches the behavior of Chrome, Firefox, and WKWebView and is a change we want to make. This doesn't match behavior of iOS 13 UIWebView, though, and given its state of being supported for compatibility until removed, we are going to keep it behaving as it always has. Updated WK1 test expectations. * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]): 2020-07-20 Peng Liu An airplaying video can enter picture-in-picture https://bugs.webkit.org/show_bug.cgi?id=214556 Reviewed by Eric Carlson. WebAVPlayerController replaces the AVPlayerController used by AVKit. Its property "pictureInPicturePossible" will always be YES after VideoFullscreenInterfaceAVKit::doSetup() sets it, even after the video enters picture-in-picture. This patch fixes the issue by checking whether the video is airplaying (isExternalPlaybackActive) in -[WebAVPlayerController isPictureInPicturePossible]. AVPlayerController has the logic to change the property "pictureInPicturePossible" to NO after a video enters picture-in-picture, but we cannot use AVPlayerController's value of "pictureInPicturePossible" as the property value of WebAVPlayerController. Because the value of "-[AVPlayerController isPictureInPicturePossible]" depends on the value of "[[AVAudioSession sharedInstance] isPiPAvailable]", which is always NO in the UI process. (AVAudioSession related code is in the web process). * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::doSetup): * platform/ios/WebAVPlayerController.h: * platform/ios/WebAVPlayerController.mm: (-[WebAVPlayerController setAllowsPictureInPicture:]): (-[WebAVPlayerController isPictureInPicturePossible]): 2020-07-20 Megan Gardner Add OK button to Date/Time form controls. https://bugs.webkit.org/show_bug.cgi?id=214195 Reviewed by Darin Adler. * en.lproj/Localizable.strings: 2020-07-20 Geoffrey Garen REGRESSION (r264242): [ macOS ] imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate.any.html is a flaky crash https://bugs.webkit.org/show_bug.cgi?id=214572 Unreviewed, reverting r264242. * bindings/js/CommonVM.cpp: (WebCore::commonVMSlow): 2020-07-20 Adrian Perez de Castro Non unified build fixes, midsummer 2020 edition https://bugs.webkit.org/show_bug.cgi?id=213616 Unreviewed build fix. No new tests needed. * inspector/InspectorInstrumentationWebKit.h: Forward-declare ResourceLoader class. 2020-07-20 Wenson Hsieh REGRESSION (r261874): Typing near the bottom of a scrollable document causes the scroll position to jump https://bugs.webkit.org/show_bug.cgi?id=214426 Reviewed by Simon Fraser. After the changes in r261874, any content size changes that trigger `FrameView::adjustViewSize` cause the scroll position to be clamped to its minimum and maximum limits after the next layout pass. In the context of edit commands, this means that the scroll position may jump erratically, since many edit commands can temporarily leave the DOM in a state where the content size is unstable. For example, in the test case below, deleting the only character in a div element on its own line first involves emptying the text node underneath the div (causing it to have no height), before inserting a BR element in its place (which restores a nonzero height). After the text node is emptied (but before we insert the BR element), the content size of view changes due to a layout update while creating visible positions (under `VisiblePosition::canonicalPosition`). If we happen to be scrolled all the way to the bottom of the main frame, this means we'll scroll up, due to the maximum scroll position temporarily decreasing. A similar effect happens when inserting the first character on a line, wherein the div is empty after BR element is removed but before it is replaced with a text node. To mitigate this, introduce a mechanism to temporarily avoid updating the scroll position, and use it when executing edit commands. See below for more details. Test: editing/execCommand/typing-should-not-trigger-scrolling-when-selection-is-visible.html * editing/CompositeEditCommand.cpp: (WebCore::EditCommandComposition::unapply): (WebCore::EditCommandComposition::reapply): (WebCore::CompositeEditCommand::apply): * editing/Editor.cpp: (WebCore::Editor::willApplyEditing const): (WebCore::Editor::appliedEditing): Add logic to specifically handle typing commands here, since we handle typing commands by adding them to the latest "open" typing command, rather than go through the more standard codepaths in EditCommandComposition above. * editing/Editor.h: * page/FrameView.cpp: (WebCore::FrameView::reset): (WebCore::FrameView::topContentDirectionDidChange): (WebCore::FrameView::handleDeferredScrollbarsUpdate): (WebCore::FrameView::handleDeferredPositionScrollbarLayers): Split existing logic for handling deferred scrollbar updates and deferred calls to `positionScrollbarLayers` into two separate methods, with separate boolean flags. `topContentDirectionDidChange` sets both of these flags (which preserves existing behavior), while `decrementProhibitsScrollingWhenChangingContentSizeCount` just requests a scrollbar update. (WebCore::FrameView::didLayout): (WebCore::FrameView::didFinishProhibitingScrollingWhenChangingContentSize): After decrementing `m_prohibitsScrollingWhenChangingContentSizeCount` back to zero, ensure that the scroll position ultimately remains clamped to the minimum and maximum values by either immediately calling `updateScrollbars` with the current scroll position if layout and style are up to date, or by scheduling a deferred scrollbar update if that is not the case. (WebCore::FrameView::handleDeferredScrollbarsUpdateAfterDirectionChange): Deleted. Rename this to just `handleDeferredScrollbarsUpdate`. * page/FrameView.h: * platform/ScrollView.cpp: (WebCore::ScrollView::setContentsSize): (WebCore::ScrollView::prohibitScrollingWhenChangingContentSizeForScope): (WebCore::ScrollView::ProhibitScrollingWhenChangingContentSizeForScope::ProhibitScrollingWhenChangingContentSizeForScope): (WebCore::ScrollView::ProhibitScrollingWhenChangingContentSizeForScope::~ProhibitScrollingWhenChangingContentSizeForScope): Introduce a new token object, `ProhibitScrollingWhenChangingContentSizeForScope`, which increments a count on `ScrollView` when created and decrements the count when destroyed. While this counter is greater than zero, we will avoid scrolling as a result of changing content size. * platform/ScrollView.h: (WebCore::ScrollView::incrementProhibitsScrollingWhenChangingContentSizeCount): (WebCore::ScrollView::decrementProhibitsScrollingWhenChangingContentSizeCount): 2020-07-20 Said Abou-Hallawa CSS clip-path is applied to the root element in the view-box coordinates https://bugs.webkit.org/show_bug.cgi?id=214418 Reviewed by Darin Adler. We need to transfer the bounding box of the SVG element renderer from the SVG coordinates system to the CSS coordinates before calculating the clip path. Then we need to transfer the clip path back to the SVG coordinates before applying it to the GraphicsContext. The GraphicsContext is already transformed by the localToPrentTransform. Test: svg/in-html/svg-view-box-css-clip-path.html * rendering/svg/SVGRenderSupport.cpp: (WebCore::SVGRenderSupport::clipContextToCSSClippingArea): 2020-07-20 Clark Wang Fixes to match BaseAudioContext.idl to spec https://bugs.webkit.org/show_bug.cgi?id=214487 Reviewed by Chris Dumez. Removed unrestricted keyword from certain attributes and parameters in BaseAudioContext. Changed createPanner to call new PannerNode constructor, removed old PannerNode constructor. Re-baselined existing tests that now pass. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createPanner): * Modules/webaudio/BaseAudioContext.idl: * Modules/webaudio/PannerNode.cpp: * Modules/webaudio/PannerNode.h: 2020-07-20 Keith Miller Add support for FinalizationRegistries https://bugs.webkit.org/show_bug.cgi?id=199888 Reviewed by Yusuke Suzuki. Refactor things for changing PromiseDeferredTimer to DeferredWorkTimer. Also, add globalObject hook for reporting uncaught exceptions from JSC's runloop callbacks. * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::reportUncaughtExceptionAtEventLoop): * bindings/js/JSDOMGlobalObject.h: * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::compileStreaming): (WebCore::JSDOMWindowBase::instantiateStreaming): * bindings/js/JSWorkerGlobalScopeBase.cpp: * bindings/js/JSWorkletGlobalScopeBase.cpp: * bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::addTimerSetNotification): (WebCore::WorkerScriptController::removeTimerSetNotification): * workers/WorkerRunLoop.cpp: * worklets/WorkletScriptController.cpp: 2020-07-20 Said Abou-Hallawa [CG] Flushing ImageBuffer IOSurface cached image can happen when creating an image for encoding only https://bugs.webkit.org/show_bug.cgi?id=214515 Reviewed by Simon Fraser. Drawing an empty rectangle after changing the bytes of the IOSurface was a hack to force CG to regenerate the IOSurface cached image. This hack was added to solve the bug in which we were getting stale data url from the ImageBuffer after calling its putImageData() function. Drawing the ImageBuffer to a GraphicsContext or getting its data url starts by getting a native image from the IOSurface. The stale cached image problem was seen only in getting the data url but when not drawing the ImageBuffer. So to save the cost of flushing the cached image, we will delay doing the empty rectangle hack till toCFData() is called. toCFData() is called for all ImageBuffer data retrieval functions including toDataURL(). This gives a 15% progression to the Images test on MacBookPro15,2 because the Images test does not call toDataURL() so it does not require flushing the IOSurface cached image. It calls getImageData(), alter the image data and then calls putImageData(). * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp: (WebCore::ImageBufferIOSurfaceBackend::toCFData const): (WebCore::ImageBufferIOSurfaceBackend::putImageData): * platform/graphics/cg/ImageBufferIOSurfaceBackend.h: 2020-07-20 Darin Adler Streamline URLDecomposition::setHash https://bugs.webkit.org/show_bug.cgi?id=214561 Reviewed by Anders Carlsson. * html/URLDecomposition.cpp: (WebCore::URLDecomposition::setHash): No need to cast to StringView since we already have a StringView. Also don't need a local variable. 2020-07-20 Darin Adler [Cocoa] MediaSampleAVFObjC::createImageSample depends on function argument evaluation order https://bugs.webkit.org/show_bug.cgi?id=214560 Reviewed by Anders Carlsson. * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::deallocateVectorBuffer): Renamed from releaseUint8Vector. (WebCore::MediaSampleAVFObjC::createImageSample): Rearranged code so that we don't call both data() and releaseBuffer() on the same vector in the same function call; that isn't safe because the order of argument evaluation is not guaranteed, and so data() could be called after the buffer is released. Also added code to deallocate the buffer if CVPixelBufferCreateWithBytes fails. The old code would have leaked it in that case. Also made some style tweaks to use adoptCF more consistently to handle reference counting, and slightly optimized a loop to only get the array count once. 2020-07-20 Philippe Normand [GStreamer] Add support for canvas captureStream, tests failing since they were added in r213598 https://bugs.webkit.org/show_bug.cgi?id=169811 Reviewed by Darin Adler. Hook captureStream support in GStreamer ports. The only missing bits were: 1. create a MediaSample from a BGRA buffer 2. convert a MediaSample to a RGBA buffer (used only for layout tests) 3. set video width and height tags not only on video capture tracks (tracks created from captureStream are not GStreamer capture device tracks) * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::toMediaSample): * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: Refactor createImageSample to use unsigned for dimensions. * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: * platform/graphics/gstreamer/MediaSampleGStreamer.cpp: (WebCore::MediaSampleGStreamer::createImageSample): (WebCore::MediaSampleGStreamer::getRGBAImageData const): * platform/graphics/gstreamer/MediaSampleGStreamer.h: * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (mediaStreamTrackPrivateGetTags): 2020-07-20 Youenn Fablet GenerateCertificateAsync should be called on signaling thread https://bugs.webkit.org/show_bug.cgi?id=214447 Reviewed by Geoffrey Garen. As per debug assert, GenerateCertificateAsync is expected to be called in the signaling thread. Covered by unskipped test. * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp: (WebCore::LibWebRTCCertificateGenerator::generateCertificate): * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::LibWebRTCProvider::prepareCertificateGenerator): We can pass generator to a background thread as it is allocated once and does not get freed. * platform/mediastream/libwebrtc/LibWebRTCProvider.h: 2020-07-20 Commit Queue Unreviewed, reverting r264596. https://bugs.webkit.org/show_bug.cgi?id=214551 hits Debug asserts Reverted changeset: "[GStreamer] Add support for canvas captureStream, tests failing since they were added in r213598" https://bugs.webkit.org/show_bug.cgi?id=169811 https://trac.webkit.org/changeset/264596 2020-07-20 Rob Buis Make AnyStepHandling an enum class https://bugs.webkit.org/show_bug.cgi?id=214423 Reviewed by Youenn Fablet. Make AnyStepHandling an enum class since this is more readable and allows us to have less includes in header files. * html/BaseDateAndTimeInputType.cpp: * html/DateInputType.cpp: * html/DateTimeLocalInputType.cpp: * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::setupDateTimeChooserParameters): * html/HTMLInputElement.h: * html/InputType.cpp: (WebCore::InputType::rangeUnderflow const): (WebCore::InputType::rangeOverflow const): (WebCore::InputType::minimum const): (WebCore::InputType::maximum const): (WebCore::InputType::isInRange const): (WebCore::InputType::isOutOfRange const): (WebCore::InputType::stepMismatch const): (WebCore::InputType::validationMessage const): (WebCore::InputType::getAllowedValueStep const): (WebCore::InputType::stepUp): (WebCore::InputType::stepUpFromRenderer): * html/InputType.h: * html/MonthInputType.cpp: * html/NumberInputType.cpp: * html/RangeInputType.cpp: (WebCore::RangeInputType::handleKeydownEvent): (WebCore::RangeInputType::fallbackValue const): (WebCore::RangeInputType::sanitizeValue const): * html/StepRange.cpp: (WebCore::StepRange::parseStep): * html/StepRange.h: * html/TimeInputType.cpp: * html/WeekInputType.cpp: * html/shadow/SliderThumbElement.cpp: (WebCore::sliderPosition): (WebCore::SliderThumbElement::setPositionFromPoint): 2020-07-20 Rob Buis Setting URL.hash to '#' should set empty fragment https://bugs.webkit.org/show_bug.cgi?id=214318 Reviewed by Youenn Fablet. Setting URL.hash to '#' should set empty fragment identifier [1], unlike setting it to the empty string which drops the fragment identifier. Behavior matches Chrome and Firefox. [1] https://html.spec.whatwg.org/#dom-hyperlink-hash Test: imported/w3c/web-platform-tests/url/url-setters.html * html/URLDecomposition.cpp: (WebCore::URLDecomposition::setHash): 2020-07-20 Philippe Normand [GStreamer] Add support for canvas captureStream, tests failing since they were added in r213598 https://bugs.webkit.org/show_bug.cgi?id=169811 Reviewed by Darin Adler. Hook captureStream support in GStreamer ports. The only missing bits were: 1. create a MediaSample from a BGRA buffer 2. convert a MediaSample to a RGBA buffer (used only for layout tests) 3. set video width and height tags not only on video capture tracks (tracks created from captureStream are not GStreamer capture device tracks) * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::toMediaSample): * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: Refactor createImageSample to use unsigned for dimensions. * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: * platform/graphics/gstreamer/MediaSampleGStreamer.cpp: (WebCore::MediaSampleGStreamer::createImageSample): (WebCore::MediaSampleGStreamer::getRGBAImageData const): * platform/graphics/gstreamer/MediaSampleGStreamer.h: * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (mediaStreamTrackPrivateGetTags): 2020-07-20 Philippe Normand [GStreamer] ImageDecoder hits more Debug ASSERTs https://bugs.webkit.org/show_bug.cgi?id=214191 Reviewed by Xabier Rodriguez-Calvar. Process decoded video samples from the decoder parent thread, in order to guarantee the underlying RefPtrs stored in the ImageDecoderGStreamerSample keep a consistent owning runloop. * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: (WebCore::ImageDecoderGStreamer::InnerDecoder::connectDecoderPad): (WebCore::ImageDecoderGStreamer::setHasEOS): (WebCore::ImageDecoderGStreamer::notifySample): (WebCore::ImageDecoderGStreamer::InnerDecoder::handleMessage): (WebCore::ImageDecoderGStreamer::pushEncodedData): * platform/graphics/gstreamer/ImageDecoderGStreamer.h: 2020-07-20 Fujii Hironori Use forward template declarations for ColorComponents instead of including ColorComponents.h https://bugs.webkit.org/show_bug.cgi?id=214540 Reviewed by Darin Adler. * platform/graphics/ColorMatrix.h: * platform/graphics/ColorTypes.h: 2020-07-19 Lauro Moura Unreviewed, fix GTK build in Debian/LTS Like r264279, include functional to provide std::invoke. * platform/graphics/ColorUtilities.h: 2020-07-19 Fujii Hironori Unreviewed, reverting r264588. It broke Mac port. Reverted changeset: "Use forward template declarations for ColorComponents instead of including ColorComponents.h as much as possible" https://bugs.webkit.org/show_bug.cgi?id=214204 https://trac.webkit.org/changeset/264588 2020-07-19 Fujii Hironori Use forward template declarations for ColorComponents instead of including ColorComponents.h as much as possible https://bugs.webkit.org/show_bug.cgi?id=214204 Unreviewed follow-up for the review feedback of r264289. * platform/graphics/ColorConversion.cpp: * platform/graphics/ColorMatrix.h: * platform/graphics/ColorTypes.h: * platform/graphics/ColorUtilities.h: 2020-07-19 Fujii Hironori Unreviewed non-unified source build fix * html/canvas/WebGLSync.cpp: * html/canvas/WebGLSync.h: 2020-07-19 Geoffrey Garen There should be only one RunLoop Timer class https://bugs.webkit.org/show_bug.cgi?id=214340 Reviewed by Darin Adler. RunLoop::Timer wins. RunLoopTimer loses. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::DocumentLoader): (WebCore::DocumentLoader::tryLoadingSubstituteData): (WebCore::DocumentLoader::cancelMainResourceLoad): (WebCore::DocumentLoader::startDataLoadTimer): Deleted. Use RunLoop::dispatch instead of a timer because we have no need to control the time period or to fire more than once. Use an explicit token so that we can still cancel. * loader/DocumentLoader.h: (WebCore::DocumentLoader::DataLoadToken::clear): Added an explicit token class to we can cancel a data load. * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::loadDataURL): page->scheduledRunLoopPairs() is never null; and if it were null, data loads would always fail. * platform/network/DataURLDecoder.cpp: (WebCore::DataURLDecoder::decode): (WebCore::DataURLDecoder::DecodingResultDispatcher::dispatch): Deleted. (WebCore::DataURLDecoder::DecodingResultDispatcher::DecodingResultDispatcher): Deleted. (WebCore::DataURLDecoder::DecodingResultDispatcher::startTimer): Deleted. (WebCore::DataURLDecoder::DecodingResultDispatcher::timerFired): Deleted. No need for two code paths, now that we can just call RunLoop::dispatch. * platform/network/DataURLDecoder.h: 2020-07-19 Sam Weinig Rename Color::transparent to Color::transparentBlack to more clearly state what it is https://bugs.webkit.org/show_bug.cgi?id=214522 Reviewed by Darin Adler. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::colorValue const): * accessibility/AccessibilityObject.h: * css/CSSValuePool.cpp: (WebCore::StaticCSSValuePool::StaticCSSValuePool): (WebCore::CSSValuePool::createColorValue): * editing/EditingStyle.cpp: (WebCore::cssValueToColor): * html/HTMLInputElement.cpp: (WebCore::autoFillStrongPasswordMaskImage): * html/InputType.cpp: (WebCore::InputType::valueAsColor const): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::State::State): (WebCore::CanvasRenderingContext2DBase::clearRect): (WebCore::CanvasRenderingContext2DBase::setShadow): (WebCore::CanvasRenderingContext2DBase::clearShadow): (WebCore::CanvasRenderingContext2DBase::applyShadow): * inspector/InspectorOverlay.cpp: (WebCore::drawShapeHighlight): * inspector/agents/InspectorDOMAgent.cpp: (WebCore::parseColor): * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintBoxDecoration): * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::captionsWindowCSS const): * page/DebugPageOverlays.cpp: (WebCore::drawRightAlignedText): * page/FrameSnapshotting.cpp: (WebCore::snapshotNode): * page/FrameView.cpp: (WebCore::FrameView::recalculateBaseBackgroundColor): * page/PageOverlay.h: * page/TextIndicator.cpp: (WebCore::estimatedBackgroundColorForRange): * page/animation/CSSPropertyAnimation.cpp: (WebCore::shadowForBlending): * platform/graphics/Color.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): * platform/graphics/cg/ColorCG.cpp: (WebCore::cachedCGColor): * platform/graphics/cg/NativeImageCG.cpp: (WebCore::nativeImageSinglePixelSolidColor): * platform/graphics/filters/FilterOperation.cpp: (WebCore::DropShadowFilterOperation::blend): * platform/graphics/mac/ColorMac.mm: (WebCore::nsColor): * platform/graphics/nicosia/NicosiaPaintingEngineBasic.cpp: (Nicosia::PaintingEngineBasic::paint): * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp: (Nicosia::paintLayer): * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp: (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper): * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::requestVideoContentLayer): (VideoFullscreenControllerContext::returnVideoContentLayer): (VideoFullscreenControllerContext::didSetupFullscreen): * rendering/RenderImage.cpp: (WebCore::RenderImage::paintIncompleteImageOutline const): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintResizer): * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::paint): * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::platformActiveSelectionBackgroundColor const): (WebCore::RenderThemeIOS::platformInactiveSelectionBackgroundColor const): * rendering/RenderTreeAsText.cpp: (WebCore::RenderTreeAsText::writeRenderObject): * rendering/mathml/RenderMathMLMenclose.cpp: (WebCore::RenderMathMLMenclose::paint): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::visitedDependentColor const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialStrokeColor): (WebCore::RenderStyle::initialBackgroundColor): * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyTextOrBoxShadowValue): * style/StyleBuilderState.cpp: (WebCore::Style::BuilderState::createFilterOperations): * svg/SVGStopElement.cpp: (WebCore::SVGStopElement::stopColorIncludingOpacity const): * testing/Internals.cpp: (WebCore::Internals::setViewIsTransparent): (WebCore::Internals::setViewBaseBackgroundColor): Color::transparent to Color::transparentBlack. 2020-07-19 Sam Weinig Remove ColorBuilder https://bugs.webkit.org/show_bug.cgi?id=214521 Reviewed by Darin Adler. ColorBuilder is unnecessary and just makes deduction contexts more complicated. Instead, we can get the same behavior by having color types inherit from a shared base class ColorType that uses the curiously recurring template pattern, which exposes the colorWithAlphaByte function (renamed from colorWithAlpha for clarity of the parameter). * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: Remove ColorBuilder. * platform/graphics/ColorBuilder.h: Removed. * platform/graphics/Color.cpp: (WebCore::Color::lightened const): * platform/graphics/Color.h: (WebCore::Color::alphaByte const): (WebCore::Color::alpha const): Deleted. Stop using ColorBuilder for color named color types and rename Color::alpha to Color:alphaByte() for consistency with colorWithAlphaByte(). * platform/graphics/ColorTypes.h: (WebCore::ColorType::colorWithAlphaByte const): (WebCore::LinearSRGBA::LinearSRGBA): (WebCore::DisplayP3::DisplayP3): (WebCore::LinearDisplayP3::LinearDisplayP3): (WebCore::HSLA::HSLA): (WebCore::CMYKA::CMYKA): (WebCore::XYZA::XYZA): Switch each color type to inheriting from new ColorWithAlphaHelper struct. Use the opertunity to give each color type the same construction interface as well. Now that each type has constructors, the deduction guides are no longer necessary. * platform/graphics/ColorBlending.cpp: (WebCore::blendSourceOver): Switch from !color.alpha() to !color.isVisible() to more clearly indicate the intent. * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::isDataTable const): Update to call alphaByte() and add FIXME indicating that it is probably incorrect and filed https://bugs.webkit.org/show_bug.cgi?id=214537 to track things further. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::createInnerTextStyle): * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::drawPaintRects): (WebCore::InspectorOverlay::drawBounds): (WebCore::InspectorOverlay::drawRulers): * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::captionsBackgroundCSS const): * page/DebugPageOverlays.cpp: (WebCore::NonFastScrollableRegionOverlay::drawRect): * page/DragController.cpp: (WebCore::DragController::insertDroppedImagePlaceholdersAtCaret): * page/linux/ResourceUsageOverlayLinux.cpp: (WebCore::ResourceUsageOverlay::platformInitialize): * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::draw): * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::getDebugBorderInfo const): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::recursiveCommitChanges): * platform/graphics/ca/PlatformCALayer.cpp: (WebCore::PlatformCALayer::drawRepaintIndicator): * platform/graphics/ca/TileCoverageMap.cpp: (WebCore::TileCoverageMap::TileCoverageMap): * platform/mock/ScrollbarThemeMock.cpp: (WebCore::ScrollbarThemeMock::paintTrackBackground): * platform/win/DragImageWin.cpp: (WebCore::createDragImageForLink): * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::resolveStyleForMarkedText): * rendering/RenderEmbeddedObject.cpp: * rendering/RenderLayerBacking.cpp: (WebCore::patternForTouchAction): (WebCore::patternForEventListenerRegionType): (WebCore::RenderLayerBacking::paintDebugOverlays): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::platformTapHighlightColor const): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintMenuListButtonDecorations): * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::paintFlow): * testing/cocoa/WebViewVisualIdentificationOverlay.mm: (-[WebViewVisualIdentificationOverlay initWithWebView:kind:deprecated:]): Update to call colorWithAlphaByte rather than colorWithAlpha. * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::addRoundedBorderClip): (WebCore::RenderThemeIOS::paintCheckboxDecorations): (WebCore::RenderThemeIOS::paintRadioDecorations): (WebCore::RenderThemeIOS::paintMenuListButtonDecorations): (WebCore::RenderThemeIOS::paintSystemPreviewBadge): Update to use colorWithAlphaByte rather than colorWithAlpha and alphaByte rather than alpha. 2020-07-19 Rob Buis Remove findCharsetInMediaType https://bugs.webkit.org/show_bug.cgi?id=214523 Reviewed by Darin Adler. Remove findCharsetInMediaType (by moving its code into extractCharsetFromMediaType) since there are no users for findCharsetInMediaType anymore. * platform/network/HTTPParsers.cpp: (WebCore::extractCharsetFromMediaType): (WebCore::findCharsetInMediaType): Deleted. * platform/network/HTTPParsers.h: 2020-07-19 Sam Weinig Additional Color related cleanups https://bugs.webkit.org/show_bug.cgi?id=214514 Reviewed by Darin Adler. * platform/graphics/ColorBuilder.h: Remove redundant "public" and use decltype() rather than more wordy typename for static_assert. * platform/graphics/ColorUtilities.h: (WebCore::clampToComponentByte): (WebCore::clampToComponentFloat): Templatize to support any input. (WebCore::clampToComponentBytes): (WebCore::clampToComponentFloats): Templatize using variadic templates to support any input and prepare for color types with more than four components. (WebCore::colorByModifingEachNonAlphaComponent): Use std::invoke to support more types of functors. (WebCore::colorWithOverridenAlpha): (WebCore::invertedColorWithOverridenAlpha): Use auto more consistently. (WebCore::invertComponent): Deleted. Replace invertComponent functions with ComponentTraits::maxValue - value inline at callsite. 2020-07-18 Philippe Normand Unreviewed, fix build warnings in the WebXR backend * platform/xr/openxr/PlatformXROpenXR.cpp: (PlatformXR::Instance::Impl::enumerateInstanceExtensionProperties const): Guard log loop with LOG_DISABLED macro, to avoid unused variable warnings in release builds. * testing/WebFakeXRDevice.h: Remove unused private class member. 2020-07-18 Commit Queue Unreviewed, reverting r264563. https://bugs.webkit.org/show_bug.cgi?id=214518 Broke the watchOS build Reverted changeset: "Add OK button to Date/Time form controls." https://bugs.webkit.org/show_bug.cgi?id=214195 https://trac.webkit.org/changeset/264563 2020-07-18 Rob Buis Only use enum classes in HTTPParsers https://bugs.webkit.org/show_bug.cgi?id=214451 Reviewed by Darin Adler. Only use enum classes in HTTPParsers by converting XFrameOptionsSameOrigin and ContentTypeOptionsDisposition. Remove HTTPVersion enum since its only use is by parseHTTPRequestLine, but this method is unused. * loader/FrameLoader.cpp: (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions): * loader/cache/CachedCSSStyleSheet.cpp: (WebCore::CachedCSSStyleSheet::mimeTypeAllowedByNosniff const): * platform/network/HTTPParsers.cpp: (WebCore::parseContentTypeOptionsHeader): (WebCore::parseXFrameOptionsHeader): (WebCore::parseHTTPRequestLine): Deleted. * platform/network/HTTPParsers.h: (): Deleted. * platform/network/ResourceResponseBase.cpp: (WebCore::isScriptAllowedByNosniff): 2020-07-17 Sam Weinig Remove final vestigates of SimpleColor https://bugs.webkit.org/show_bug.cgi?id=214439 Reviewed by Simon Fraser. Replace remaining makeSimpleColor uses: - Literal / constant colors switched to using SRGBA { ... }. - Direct construction from uint8_t values also switched to SRGBA { ... } - Where possible switched to using of named colors (e.g. Color::yellow) both directly and where an override alpha was needed. To aid this, new named colors were added for red, magenta, blue, green, darkGreen and orange. - Remaining callers switched to directly calling clampToComponentBytes, which was all that makeSimpleColor did. An overload of clampToComponentBytes that doesn't require the alpha parameter was added to simplify calls. To make construction of SRGBA values nicer, callers no longer need to specify the alpha explicitly if the color is opaque. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/SimpleColor.h: Removed. Remove SimpleColor.h * css/parser/CSSParserFastPaths.cpp: (WebCore::parseNumericColor): Switch to clampToComponentBytes, but leave a FIXME indicating this should be switched to direct SRGBA when hepler functions are fixed to return uint8_ts rather than ints. * inspector/agents/InspectorDOMAgent.cpp: (WebCore::parseColor): Switched to clampToComponentBytes and removed existing unnecessary additional clamping of the alpha component. * page/DebugPageOverlays.cpp: (WebCore::NonFastScrollableRegionOverlay::drawRect): Restructure HashMap construction to use the HashMap std::intializer_list constructor. This takes advantage of a change to WTF::KeyValuePair that allows it deduce in this context. * platform/graphics/Color.h: Remove SimpleColor.h include, but add ColorBuilder.h and ColorUtilities.h which SimpleColor was including on its behalf. Add new named colors for red, magenta, blue, green, darkGreen and orange. For all named colors, use ColorBuilder> rather than SRGBA alone to allow for callers to do things like Color::yellow.colorWithAlpha(...). In the future, it might make more sense to merge ColorBuilder's functionality directly into the color types, but for now this preserves that functionality. * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: (WebCore::SVGAnimationColorFunction::animate): (WebCore::SVGAnimationColorFunction::roundAndClampColorChannel): Deleted. Replace bespoke rounding/clamping functions in favor of ColorUtilities.h aggregate ones and directly calling std::lround. * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseRGBParameters): * editing/CompositionHighlight.h: * html/ColorInputType.cpp: (WebCore::parseSimpleColorValue): * html/HTMLElement.cpp: (WebCore::parseLegacyColorValue): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::createInnerTextStyle): * inspector/InspectorOverlay.cpp: (WebCore::drawOutlinedQuadWithClip): (WebCore::drawShapeHighlight): (WebCore::InspectorOverlay::paint): (WebCore::InspectorOverlay::drawPaintRects): (WebCore::InspectorOverlay::drawBounds): (WebCore::InspectorOverlay::drawRulers): (WebCore::InspectorOverlay::drawElementTitle): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::debugTextShadow): * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::captionsBackgroundCSS const): * page/FrameView.cpp: (WebCore::FrameView::paintContents): * page/PrintContext.cpp: (WebCore::PrintContext::spoolAllPagesWithBoundaries): * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::HistoricResourceUsageData::HistoricResourceUsageData): * page/linux/ResourceUsageOverlayLinux.cpp: (WebCore::ResourceUsageOverlay::platformInitialize): * platform/adwaita/ScrollbarThemeAdwaita.cpp: * platform/adwaita/ThemeAdwaita.cpp: (WebCore::ThemeAdwaita::activeSelectionForegroundColor const): (WebCore::ThemeAdwaita::activeSelectionBackgroundColor const): (WebCore::ThemeAdwaita::inactiveSelectionForegroundColor const): * platform/graphics/Color.cpp: * platform/graphics/ColorBlending.cpp: (WebCore::blendSourceOver): (WebCore::blendWithWhite): * platform/graphics/ColorBuilder.h: (WebCore::ColorBuilder::colorWithAlpha const): (WebCore::ColorBuilder::ColorBuilder): Deleted. * platform/graphics/ColorTypes.h: (WebCore::SRGBA::SRGBA): * platform/graphics/ColorUtilities.h: (WebCore::clampToComponentBytes): (WebCore::clampToComponentFloats): * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::getDebugBorderInfo const): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::recursiveCommitChanges): (WebCore::contentsLayerDebugBorderColor): (WebCore::cloneLayerDebugBorderColor): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): * platform/graphics/ca/PlatformCALayer.cpp: (WebCore::PlatformCALayer::drawRepaintIndicator): * platform/graphics/ca/TileCoverageMap.cpp: (WebCore::TileCoverageMap::TileCoverageMap): (WebCore::TileCoverageMap::update): * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp: (PlatformCALayerWinInternal::drawRepaintCounters): * platform/graphics/cg/NativeImageCG.cpp: (WebCore::nativeImageSinglePixelSolidColor): * platform/graphics/cocoa/GraphicsContextCocoa.mm: (WebCore::colorForMarkerLineStyle): * platform/graphics/mac/ColorMac.mm: (WebCore::makeSimpleColorFromNSColor): * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp: (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper): * platform/graphics/win/GraphicsContextCGWin.cpp: (WebCore::GraphicsContext::drawDotsForDocumentMarker): * platform/ios/DragImageIOS.mm: (WebCore::createDragImageForLink): * platform/ios/LegacyTileCache.mm: (WebCore::LegacyTileCache::colorForGridTileBorder const): * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::defaultDevices): * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawBoxes): * platform/mock/ScrollbarThemeMock.cpp: (WebCore::ScrollbarThemeMock::paintTrackBackground): * platform/playstation/ScrollbarThemePlayStation.cpp: (WebCore::ScrollbarThemePlayStation::paintTrackBackground): * platform/win/DragImageWin.cpp: (WebCore::createDragImageForLink): * rendering/RenderEmbeddedObject.cpp: * rendering/RenderFrameSet.cpp: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::beginTransparencyLayers): (WebCore::RenderLayer::paintResizer): * rendering/RenderLayerBacking.cpp: (WebCore::patternForTouchAction): (WebCore::patternForEventListenerRegionType): (WebCore::RenderLayerBacking::paintDebugOverlays): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::platformActiveSelectionBackgroundColor const): (WebCore::RenderTheme::platformInactiveSelectionBackgroundColor const): (WebCore::RenderTheme::systemColor const): (WebCore::RenderTheme::paintSystemPreviewBadge): (WebCore::RenderTheme::platformTapHighlightColor const): * rendering/RenderThemeAdwaita.cpp: * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintSliderTrack): (WebCore::RenderThemeIOS::paintProgressBar): * rendering/RenderThemeMac.mm: (WebCore::menuBackgroundColor): (WebCore::RenderThemeMac::systemColor const): (WebCore::RenderThemeMac::paintMenuListButtonDecorations): * rendering/RenderThemeWin.cpp: (WebCore::RenderThemeWin::platformActiveSelectionBackgroundColor const): (WebCore::RenderThemeWin::platformInactiveSelectionBackgroundColor const): (WebCore::RenderThemeWin::platformActiveSelectionForegroundColor const): (WebCore::RenderThemeWin::systemColor const): * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::paintFlow): * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::RenderMathMLBlock::paint): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::colorResolvingCurrentColor const): * rendering/style/SVGRenderStyle.h: (WebCore::SVGRenderStyle::initialStopColor): (WebCore::SVGRenderStyle::initialFloodColor): (WebCore::SVGRenderStyle::initialLightingColor): * testing/MockPageOverlayClient.cpp: (WebCore::MockPageOverlayClient::drawRect): * testing/cocoa/WebViewVisualIdentificationOverlay.mm: (-[WebViewVisualIdentificationOverlay initWithWebView:kind:deprecated:]): Replace makeSimpleColor uses with appropriate alternative. 2020-07-17 Megan Gardner Add OK button to Date/Time form controls. https://bugs.webkit.org/show_bug.cgi?id=214195 Reviewed by Darin Adler. * en.lproj/Localizable.strings: 2020-07-17 Wenson Hsieh Followup to r264531 https://bugs.webkit.org/show_bug.cgi?id=214488 Reviewed by Darin Adler. Elide a null check by grabbing `RenderStyle` from the renderer instead of the element, and also limit overflow hidden to the X axis. * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::completeManipulation): 2020-07-17 Clark Wang Added Fixes for AudioScheduledSourceNode https://bugs.webkit.org/show_bug.cgi?id=214381 Reviewed by Chris Dumez. Added in IDL file for AudioScheduledSourceNode, according to spec: https://www.w3.org/TR/webaudio/#AudioScheduledSourceNode Re-baselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/AudioScheduledSourceNode.idl: Added. * Modules/webaudio/OscillatorNode.idl: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-07-17 Kenneth Russell [WebGL2] ReadPixels updates https://bugs.webkit.org/show_bug.cgi?id=209516 Reviewed by Dean Jackson. Upgrade readPixels to WebGL 2.0 functionality. Handle both WebGL 2.0 pack/unpack parameters correctly. Fix preexisting bugs in texture uploads from pixel unpack buffers. Remove entry points from GraphicsContextGL that will never be used by the WebGL 2.0 implementation. Covered by existing WebGL 2.0 conformance tests. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::initializeNewContext): (WebCore::WebGL2RenderingContext::sliceArrayBufferView): (WebCore::WebGL2RenderingContext::pixelStorei): (WebCore::WebGL2RenderingContext::texImage2D): (WebCore::WebGL2RenderingContext::texImage3D): (WebCore::WebGL2RenderingContext::texSubImage2D): (WebCore::WebGL2RenderingContext::texSubImage3D): (WebCore::WebGL2RenderingContext::getPackPixelStoreParams const): (WebCore::WebGL2RenderingContext::getUnpackPixelStoreParams const): (WebCore::WebGL2RenderingContext::readPixels): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::readPixels): * html/canvas/WebGLRenderingContextBase.h: * platform/graphics/ExtensionsGL.h: * platform/graphics/GraphicsContextGL.h: * platform/graphics/angle/ExtensionsGLANGLE.cpp: (WebCore::ExtensionsGLANGLE::readnPixelsRobustANGLE): * platform/graphics/angle/ExtensionsGLANGLE.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::readRenderingResults): (WebCore::GraphicsContextGLOpenGL::texImage3D): Deleted. (WebCore::GraphicsContextGLOpenGL::texSubImage3D): Deleted. * platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp: (WebCore::ExtensionsGLOpenGLCommon::readnPixelsRobustANGLE): * platform/graphics/opengl/ExtensionsGLOpenGLCommon.h: * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::texImage3D): Deleted. (WebCore::GraphicsContextGLOpenGL::texSubImage3D): Deleted. 2020-07-17 James Darpinian [WebGL2] Sync objects https://bugs.webkit.org/show_bug.cgi?id=126942 Reviewed by Dean Jackson. Passes WebGL conformance tests webgl/2.0.0/conformance2/sync/sync-webgl-specific.html and webgl/2.0.0/deqp/functional/gles3/sync.html although the latter times out in the layout test harness. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::fenceSync): (WebCore::WebGL2RenderingContext::isSync): (WebCore::WebGL2RenderingContext::deleteSync): (WebCore::WebGL2RenderingContext::clientWaitSync): (WebCore::WebGL2RenderingContext::waitSync): (WebCore::WebGL2RenderingContext::getSyncParameter): * html/canvas/WebGLRenderingContextBase.h: * html/canvas/WebGLSync.cpp: (WebCore::WebGLSync::WebGLSync): (WebCore::WebGLSync::deleteObjectImpl): (WebCore::WebGLSync::updateCache): (WebCore::WebGLSync::getCachedResult const): (WebCore::WebGLSync::isSignaled const): (WebCore::WebGLSync::scheduleAllowCacheUpdate): * html/canvas/WebGLSync.h: * platform/graphics/GraphicsContextGL.h: * platform/graphics/GraphicsTypesGL.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::fenceSync): (WebCore::GraphicsContextGLOpenGL::isSync): (WebCore::GraphicsContextGLOpenGL::deleteSync): (WebCore::GraphicsContextGLOpenGL::clientWaitSync): (WebCore::GraphicsContextGLOpenGL::waitSync): (WebCore::GraphicsContextGLOpenGL::getSynciv): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::fenceSync): (WebCore::GraphicsContextGLOpenGL::isSync): (WebCore::GraphicsContextGLOpenGL::deleteSync): (WebCore::GraphicsContextGLOpenGL::clientWaitSync): (WebCore::GraphicsContextGLOpenGL::waitSync): (WebCore::GraphicsContextGLOpenGL::getSynciv): 2020-07-17 Lauro Moura Fix -Wformat= warnings when passing enum to integer specifiers https://bugs.webkit.org/show_bug.cgi?id=214441 Reviewed by Darin Adler. Covered by existing tests. * platform/mediastream/MediaConstraints.cpp: (WebCore::MediaConstraint::log const): (WebCore::BooleanConstraint::logAsBoolean const): (WebCore::DoubleConstraint::logAsDouble const): (WebCore::IntConstraint::logAsInt const): * platform/mediastream/MediaConstraints.h: Made uint8_t the underlying type for MediaConstraints::DataType. * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::selectSettings): * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h: Made uint8_t the underlying type for MediaConstraintType. 2020-07-17 Fujii Hironori Don't include in SVGParserUtilities.h https://bugs.webkit.org/show_bug.cgi?id=214320 Reviewed by Darin Adler. r264332 mistakenly added #include in ColorSerialization.h and SVGParserUtilities.h. It should be . See for the discussion. * platform/graphics/ColorSerialization.h: * svg/SVGParserUtilities.h: 2020-07-17 Wenson Hsieh Recommended article titles on csdn.net are clipped after translating to English https://bugs.webkit.org/show_bug.cgi?id=214488 Reviewed by Tim Horton. On csdn.net, the translation of the "荐" pill into English is "Recommended". This increase in the size of the text node after translation breaks the layout of the page by clipping content below the pill, since the page expects the element containing this text to have a fixed width and height. Add a heuristic to detect and mitigate this exact scenario by applying `overflow: hidden;` onto containers after translation, in the case where the container: 1. Did not have any visual overflow before translation. 2. Has visual overflow after translation. 3. Has both fixed width and fixed height. 4. Does not have any overflow clip. 5. Is not out-of-flow (i.e. fixed or absolute position). While it does mean that the text inside the fixed-dimension container will be clipped, this will at least prevent this overflow from breaking the rest of the page. Test: TextManipulation.CompleteTextManipulationAddsOverflowHiddenToAvoidBreakingLayout * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::completeManipulation): (WebCore::TextManipulationController::replace): While replacing content, keep track of nodes under which we're inserting content that didn't have any visual overflow prior to replacement. * editing/TextManipulationController.h: 2020-07-17 Simon Fraser Make ScrollbarControlSize an enum class https://bugs.webkit.org/show_bug.cgi?id=199325 Reviewed by Sam Weinig. Make ScrollbarControlSize an enum class, and make some RenderScrollbar methods const. * platform/ScrollTypes.h: * platform/ScrollView.cpp: (WebCore::ScrollView::createScrollbar): * platform/ScrollbarTheme.h: (WebCore::ScrollbarTheme::scrollbarThickness): * platform/ios/ScrollbarThemeIOS.h: * platform/mac/ScrollbarThemeMac.h: * platform/mac/ScrollbarThemeMac.mm: (WebCore::scrollbarControlSizeToNSControlSize): (WebCore::scrollbarSizeToIndex): (WebCore::ScrollbarThemeMac::hasButtons): (WebCore::buttonRepaintRect): (WebCore::ScrollbarThemeMac::backButtonRect): (WebCore::ScrollbarThemeMac::forwardButtonRect): (WebCore::ScrollbarThemeMac::trackRect): * platform/mock/ScrollbarThemeMock.cpp: (WebCore::ScrollbarThemeMock::scrollbarThickness): * platform/mock/ScrollbarThemeMock.h: * platform/playstation/ScrollbarThemePlayStation.h: * platform/win/PopupMenuWin.cpp: (WebCore::PopupMenuWin::show): (WebCore::PopupMenuWin::calculatePositionAndSize): * platform/win/ScrollbarThemeWin.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::createScrollbar): * rendering/RenderScrollbar.cpp: (WebCore::RenderScrollbar::RenderScrollbar): (WebCore::RenderScrollbar::buttonRect const): (WebCore::RenderScrollbar::trackRect const): (WebCore::RenderScrollbar::trackPieceRectWithMargins const): (WebCore::RenderScrollbar::minimumThumbLength const): (WebCore::RenderScrollbar::opacity const): (WebCore::RenderScrollbar::buttonRect): Deleted. (WebCore::RenderScrollbar::trackRect): Deleted. (WebCore::RenderScrollbar::trackPieceRectWithMargins): Deleted. (WebCore::RenderScrollbar::minimumThumbLength): Deleted. (WebCore::RenderScrollbar::opacity): Deleted. * rendering/RenderScrollbar.h: * rendering/RenderTheme.h: (WebCore::RenderTheme::scrollbarControlSizeForPart): * rendering/RenderThemeMac.h: 2020-07-17 Rob Buis Changing URL.host should not override port https://bugs.webkit.org/show_bug.cgi?id=151613 Reviewed by Alex Christensen. When setting host, empty/incorrect port strings should not change the existing port [1, 2]. Behavior matches Chrome and Firefox. [1] https://url.spec.whatwg.org/#host-state Step 2.4 [2] https://url.spec.whatwg.org/#port-state Step 2.2 Test: imported/w3c/web-platform-tests/url/url-setters.html * html/URLDecomposition.cpp: (WebCore::URLDecomposition::setHost): 2020-07-17 Truitt Savell Unreviewed, reverting r264477. Broke the internal build Reverted changeset: "Use AVRoutePickerView when available for choosing AirPlay devices" https://bugs.webkit.org/show_bug.cgi?id=213497 https://trac.webkit.org/changeset/264477 2020-07-17 Truitt Savell Unreviewed, reverting r264482. Part of an attempted fix for the build Reverted changeset: "Use AVRoutePickerView when available for choosing AirPlay devices" https://bugs.webkit.org/show_bug.cgi?id=213497 https://trac.webkit.org/changeset/264482 2020-07-17 Joonghun Park Unreviewed. Remove the build warning below since r264280. warning: redundant move in return statement [-Wredundant-move] No new tests, no new behaviors. * platform/graphics/Gradient.h: (WebCore::Gradient::decode): 2020-07-17 Joonghun Park Unreviewed. Remove the build warning below and redundant spaces since r264381. warning: this statement may fall through [-Wimplicit-fallthrough=] No new tests, no new behaviors. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::vertexAttribI4iv): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::getVertexAttrib): (WebCore::WebGLRenderingContextBase::vertexAttribfvImpl): 2020-07-17 Joonghun Park Remove the build warning below and redundant spaces since r263985. warning: redundant move in return statement [-Wredundant-move] No new tests, no new behaviors. * Modules/webaudio/AudioNode.h: * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::create): (WebCore::PannerNode::PannerNode): * Modules/webaudio/PannerNode.h: 2020-07-16 Rob Buis Make DocumentParser.ParserState an enum class https://bugs.webkit.org/show_bug.cgi?id=214416 Reviewed by Darin Adler. Make DocumentParser.ParserState an enum class since it is more readable. * dom/DocumentParser.cpp: (WebCore::DocumentParser::DocumentParser): (WebCore::DocumentParser::startParsing): (WebCore::DocumentParser::prepareToStopParsing): (WebCore::DocumentParser::stopParsing): (WebCore::DocumentParser::detach): * dom/DocumentParser.h: (WebCore::DocumentParser::isParsing const): (WebCore::DocumentParser::isStopping const): (WebCore::DocumentParser::isStopped const): (WebCore::DocumentParser::isDetached const): (): Deleted. 2020-07-16 Xabier Rodriguez Calvar Rename createBoxPtr into adoptBoxPtr https://bugs.webkit.org/show_bug.cgi?id=214171 Reviewed by Darin Adler. No new tests, just a rename. * platform/graphics/gstreamer/eme/CDMProxyThunder.cpp: (WebCore::CDMProxyThunder::getDecryptionSession const): Used the renamed function. 2020-07-16 Fujii Hironori [WTF] Remove the unnecessary inner class DefaultHash::Hash https://bugs.webkit.org/show_bug.cgi?id=214389 Reviewed by Darin Adler. * Modules/indexeddb/IDBDatabaseIdentifier.h: * Modules/indexeddb/shared/IDBResourceIdentifier.h: * Modules/webgpu/WHLSL/AST/WHLSLUnnamedTypeHash.h: * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp: (WebCore::WHLSL::matchResources): (WebCore::WHLSL::matchVertexAttributes): (WebCore::WHLSL::matchColorAttachments): * accessibility/AccessibilityObject.cpp: * accessibility/AccessibilityObject.h: * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::serializeActions): * contentextensions/ContentExtensionRule.h: (WebCore::ContentExtensions::TriggerHash::hash): * contentextensions/ContentExtensionStyleSheet.h: * contentextensions/DFA.cpp: (WebCore::ContentExtensions::printTransitions): * contentextensions/DFABytecodeInterpreter.h: * contentextensions/DFACombiner.cpp: (WebCore::ContentExtensions::DFAMerger::getOrCreateCombinedNode): * contentextensions/DFANode.cpp: (WebCore::ContentExtensions::DFANode::bestFallbackTarget const): * contentextensions/ImmutableNFANodeBuilder.h: * contentextensions/NFA.cpp: (WebCore::ContentExtensions::NFA::debugPrintDot const): * contentextensions/NFANode.h: * contentextensions/NFAToDFA.cpp: (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetSource::NodeIdSetToUniqueNodeIdSetSource): (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::translate): * css/makeprop.pl: * css/parser/CSSParserContext.h: * dom/GCReachableRef.h: * dom/MessagePortIdentifier.h: * dom/NodeRareData.h: (WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::hash): (WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::equal): * dom/QualifiedName.h: * history/BackForwardItemIdentifier.h: * html/canvas/WebGLRenderingContextBase.h: * layout/LayoutUnits.h: * loader/AdClickAttribution.h: * loader/ResourceCryptographicDigest.h: (WTF::DefaultHash::hash): (WTF::DefaultHash::equal): (WTF::DefaultHash::Hash::hash): Deleted. (WTF::DefaultHash::Hash::equal): Deleted. * page/ClientOrigin.h: * page/GlobalWindowIdentifier.h: * page/SecurityOriginData.h: * page/SecurityOriginHash.h: * platform/Cookie.h: * platform/RegistrableDomain.h: * platform/graphics/ColorHash.h: * platform/graphics/FloatSizeHash.h: (WTF::FloatHash::hash): * platform/graphics/FontGenericFamilies.h: * platform/graphics/IntPointHash.h: * platform/graphics/IntRectHash.h: (WTF::IntHash::hash): (WTF::IntHash::equal): * platform/graphics/IntSizeHash.h: * platform/graphics/WidthCache.h: * platform/graphics/freetype/FontCacheFreeType.cpp: (WebCore::FallbackFontDescriptionKey::computeHash const): * platform/network/HTTPParsers.h: * platform/network/ProtectionSpaceHash.h: * platform/win/COMPtr.h: * platform/win/WindowsKeyNames.h: * rendering/CSSValueKey.h: * rendering/GridBaselineAlignment.h: * rendering/GridTrackSizingAlgorithm.h: * rendering/RenderGrid.cpp: (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid const): * rendering/RenderTheme.h: * style/RuleSet.cpp: (WebCore::Style::RuleSet::evaluateDynamicMediaQueryRules): * svg/SVGElement.h: (WebCore::SVGAttributeHashTranslator::hash): * workers/service/ServiceWorkerClientIdentifier.h: * workers/service/ServiceWorkerRegistrationKey.h: 2020-07-16 Sihui Liu IDB serialization of some DOM object types crashes the Networking process due to incorrect global object type (WPT IndexedDB/structured-clone.any tests fail) https://bugs.webkit.org/show_bug.cgi?id=210735 Reviewed by Yusuke Suzuki. In r239746, IDB went back to use JSGlobalObject for serialization and deserialization. However, in our current implementation, there is a strong assumption that DOM JS objects are tied to JSDOMGlobalObject, which is derived from JSGlobalObject. For example, in SerializedScriptValue.cpp, we cast the global object to JSDOMGlobalObject in many places. We recently notice this issue when we enable some wpt test, which has been disabled since it was imported as some types were not supported. The test fails as DOMMatrix object requires its global object to be JSDOMGlobalObject. To fix this, introduce a new Class JSIDBSerializationGlobalObject, derived from JSDOMGlobalObject, and use it for IDB serialization. Tests: LayoutTests/storage/indexeddb/structured-clone.html LayoutTests/storage/indexeddb/structured-clone-private.html * Modules/indexeddb/server/IDBSerializationContext.cpp: (WebCore::IDBServer::IDBSerializationContext::initializeVM): * Modules/indexeddb/server/IDBSerializationContext.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::scriptExecutionContext const): * bindings/js/JSIDBSerializationGlobalObject.cpp: Added. (WebCore::JSIDBSerializationGlobalObject::JSIDBSerializationGlobalObject): (WebCore::JSIDBSerializationGlobalObject::create): (WebCore::JSIDBSerializationGlobalObject::finishCreation): (WebCore::JSIDBSerializationGlobalObject::subspaceForImpl): (WebCore::JSIDBSerializationGlobalObject::destroy): * bindings/js/JSIDBSerializationGlobalObject.h: Added. * bindings/js/WebCoreJSClientData.cpp: (WebCore::JSVMClientData::JSVMClientData): * bindings/js/WebCoreJSClientData.h: (WebCore::JSVMClientData::idbSerializationSpace): * dom/EmptyScriptExecutionContext.h: Added. * worklets/WorkletScriptController.h: 2020-07-16 Eric Carlson Use AVRoutePickerView when available for choosing AirPlay devices https://bugs.webkit.org/show_bug.cgi?id=213497 Unreviewed build fix. * platform/graphics/avfoundation/objc/AVRoutePickerViewTargetPicker.mm: * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: (WebCore::MediaPlaybackTargetPickerMac::routePicker): Use HAVE_AVROUTEPICKERVIEW. 2020-07-16 Eric Carlson Use AVRoutePickerView when available for choosing AirPlay devices https://bugs.webkit.org/show_bug.cgi?id=213497 Reviewed by Jer Noble. Use an AVRoutePickerView, the replacement for AVOutputDeviceMenuController, when it is available to allow a user to pick an AirPlay device. To do this, create an AVPlaybackTargetPicker abstract base and create a concrete class from the AVOutputDeviceMenuController-specific code from MediaPlaybackTargetPickerMac, and create a new concrete class using AVRoutePickerView. Tested manually because these changes require an AirPlay device. * Modules/mediasession/WebMediaSessionManager.cpp: (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): Pass the view to the target picker. * Modules/mediasession/WebMediaSessionManagerClient.h: * Modules/remoteplayback/RemotePlayback.cpp: (WebCore::RemotePlayback::playbackTargetPickerWasDismissed): Drive-by fix: return early if there are no pending promises. * SourcesCocoa.txt: Add new files. * WebCore.xcodeproj/project.pbxproj: Ditto. * platform/graphics/MediaPlaybackTargetPicker.cpp: (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker): Add new parameter. * platform/graphics/MediaPlaybackTargetPicker.h: * platform/graphics/avfoundation/objc/AVOutputDeviceMenuControllerTargetPicker.h: Copied from Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h. * platform/graphics/avfoundation/objc/AVOutputDeviceMenuControllerTargetPicker.mm: Copied from Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm. (WebCore::AVOutputDeviceMenuControllerTargetPicker::AVOutputDeviceMenuControllerTargetPicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::~AVOutputDeviceMenuControllerTargetPicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::devicePicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::availableDevicesDidChange): (WebCore::AVOutputDeviceMenuControllerTargetPicker::currentDeviceDidChange): (WebCore::AVOutputDeviceMenuControllerTargetPicker::showPlaybackTargetPicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::startingMonitoringPlaybackTargets): (WebCore::AVOutputDeviceMenuControllerTargetPicker::stopMonitoringPlaybackTargets): (WebCore::AVOutputDeviceMenuControllerTargetPicker::invalidatePlaybackTargets): (WebCore::AVOutputDeviceMenuControllerTargetPicker::externalOutputDeviceAvailable): (WebCore::AVOutputDeviceMenuControllerTargetPicker::outputContext): (-[WebAVOutputDeviceMenuControllerHelper initWithCallback:]): (-[WebAVOutputDeviceMenuControllerHelper clearCallback]): (-[WebAVOutputDeviceMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]): * platform/graphics/avfoundation/objc/AVPlaybackTargetPicker.h: Added. (WebCore::AVPlaybackTargetPicker::AVPlaybackTargetPicker): (WebCore::AVPlaybackTargetPicker::client const): * platform/graphics/avfoundation/objc/AVRoutePickerViewTargetPicker.h: Added. * platform/graphics/avfoundation/objc/AVRoutePickerViewTargetPicker.mm: Added. (WebCore::AVRoutePickerViewTargetPicker::isAvailable): (WebCore::AVRoutePickerViewTargetPicker::AVRoutePickerViewTargetPicker): (WebCore::AVRoutePickerViewTargetPicker::~AVRoutePickerViewTargetPicker): (WebCore::AVRoutePickerViewTargetPicker::outputContextInternal): (WebCore::AVRoutePickerViewTargetPicker::devicePicker): (WebCore::AVRoutePickerViewTargetPicker::routeDetector): (WebCore::AVRoutePickerViewTargetPicker::showPlaybackTargetPicker): (WebCore::AVRoutePickerViewTargetPicker::startingMonitoringPlaybackTargets): (WebCore::AVRoutePickerViewTargetPicker::stopMonitoringPlaybackTargets): (WebCore::AVRoutePickerViewTargetPicker::externalOutputDeviceAvailable): (WebCore::AVRoutePickerViewTargetPicker::outputContext): (WebCore::AVRoutePickerViewTargetPicker::invalidatePlaybackTargets): (WebCore::AVRoutePickerViewTargetPicker::availableDevicesDidChange): (WebCore::AVRoutePickerViewTargetPicker::currentDeviceDidChange): (WebCore::AVRoutePickerViewTargetPicker::devicePickerWasDismissed): (-[WebAVRoutePickerViewHelper initWithCallback:]): (-[WebAVRoutePickerViewHelper dealloc]): (-[WebAVRoutePickerViewHelper clearCallback]): (-[WebAVRoutePickerViewHelper routePickerViewDidEndPresentingRoutes:]): (-[WebAVRoutePickerViewHelper notificationHandler:]): * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h: * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: (WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac): (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac): (WebCore::MediaPlaybackTargetPickerMac::externalOutputDeviceAvailable): (WebCore::MediaPlaybackTargetPickerMac::playbackTarget): (WebCore::MediaPlaybackTargetPickerMac::routePicker): (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): (WebCore::MediaPlaybackTargetPickerMac::startingMonitoringPlaybackTargets): (WebCore::MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets): (WebCore::MediaPlaybackTargetPickerMac::invalidatePlaybackTargets): (WebCore::MediaPlaybackTargetPickerMac::pickerWasDismissed): (WebCore::MediaPlaybackTargetPickerMac::availableDevicesChanged): (WebCore::MediaPlaybackTargetPickerMac::currentDeviceChanged): (WebCore::MediaPlaybackTargetPickerMac::devicePicker): Deleted. (-[WebAVOutputDeviceMenuControllerHelper initWithCallback:]): Deleted. (-[WebAVOutputDeviceMenuControllerHelper clearCallback]): Deleted. (-[WebAVOutputDeviceMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]): Deleted. * platform/mock/MediaPlaybackTargetPickerMock.cpp: (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker): * platform/mock/MediaPlaybackTargetPickerMock.h: 2020-07-16 Jer Noble [Cocoa] Add MediaCapabilities support for SW VP9 decoder. https://bugs.webkit.org/show_bug.cgi?id=214316 Reviewed by Eric Carlson. Test: platform/mac/media/mediacapabilities/vp9-decodingInfo-sw.html Add some foundational support for SW VP9, which due to policy decisions will need information both on the system battery status and the power adapter status, and these need to be shipped into the WebContent process from the UIProcess. Add some Internal override settings to allow the policies to be effectively tested through LayouTests. This includes overrides for system battery and AC state, as well as overrides for screen size and resolution. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/PlatformScreen.cpp: (WebCore::getScreenProperties): * platform/PlatformScreen.h: * platform/ScreenProperties.h: (WebCore::ScreenData::encode const): (WebCore::ScreenData::decode): * platform/cocoa/PowerSourceNotifier.h: * platform/cocoa/PowerSourceNotifier.mm: (WebCore::PowerSourceNotifier::PowerSourceNotifier): (WebCore::PowerSourceNotifier::~PowerSourceNotifier): (WebCore::PowerSourceNotifier::notifyPowerSourceChanged): * platform/cocoa/SystemBattery.h: * platform/cocoa/SystemBattery.mm: (WebCore::systemHasBattery): (WebCore::resetSystemHasAC): (WebCore::setSystemHasAC): (WebCore::systemHasAC): (WebCore::setOverrideSystemHasBatteryForTesting): (WebCore::setOverrideSystemHasACForTesting): * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp: (WebCore::videoCodecTypeFromRFC4281Type): (WebCore::createMediaPlayerDecodingConfigurationCocoa): * platform/graphics/cocoa/VP9UtilitiesCocoa.h: Copied from Source/WebCore/PAL/pal/spi/cocoa/IOPSLibSPI.h. * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: Added. (WebCore::setOverrideVP9HardwareDecoderDisabledForTesting): (WebCore::setOverrideVP9ScreenSizeAndScaleForTesting): (WebCore::resetOverrideVP9ScreenSizeAndScaleForTesting): (WebCore::validateVPParameters): * platform/ios/PlatformScreenIOS.mm: (WebCore::collectScreenProperties): * platform/mac/PlatformScreenMac.mm: (WebCore::collectScreenProperties): * testing/Internals.cpp: (WebCore::Internals::Internals): (WebCore::Internals::setSystemHasBattery): (WebCore::Internals::setSystemHasAC): (WebCore::Internals::setHardwareVP9DecoderDisabledForTesting): (WebCore::Internals::setVP9ScreenSizeAndScale): * testing/Internals.h: * testing/Internals.idl: 2020-07-16 Brady Eidson Remove (entirely unused) hat switch dpad support in HIDGamepad. https://bugs.webkit.org/show_bug.cgi?id=214419 Reviewed by Andy Estes. Turns out these devices simply don't exist in the wild. * platform/gamepad/mac/HIDGamepad.cpp: (WebCore::HIDGamepad::initElements): (WebCore::HIDGamepad::initElementsFromArray): (WebCore::HIDGamepad::valueChanged): (WebCore::HIDGamepad::maybeAddDPad): Deleted. (WebCore::fillInButtonValues): Deleted. * platform/gamepad/mac/HIDGamepad.h: (WebCore::HIDGamepadElement::isAxis const): (WebCore::HIDGamepadElement::isDPad const): Deleted. (WebCore::HIDGamepadDPad::HIDGamepadDPad): Deleted. (WebCore::HIDGamepadDPad::normalizedValue): Deleted. 2020-07-16 Peng Liu Double tapping to zoom out a fullscreen video will zoom in slightly before zooming out https://bugs.webkit.org/show_bug.cgi?id=214400 Reviewed by Jer Noble. When changing the video gravity of a fullscreen video from AVLayerVideoGravityResizeAspectFill to AVLayerVideoGravityResizeAspect, the implicit animation of the AVPlayerLayer in the web process will conflict with the implicit animation of the _videoSublayer in the WebAVPlayerLayer in the UI process. To avoid the implicit animation in the web process because of the video gravity change, we have to let the remote hosting layer and the corresponding AVPlayerLayer in the web process to include the whole video, even when the video gravity is AVLayerVideoGravityResizeAspectFill and the video will be clipped by the superlayer. When the AVPlayerLayer has the whole video, changing the video gravity from AVLayerVideoGravityResizeAspectFill to AVLayerVideoGravityResizeAspect will not generate an implicit animation in the web process. This patch also adds an instance variable _previousVideoGravity to make sure the transform is correctly calculated when video gravity is changing. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerLayer init]): (-[WebAVPlayerLayer layoutSublayers]): (-[WebAVPlayerLayer resolveBounds]): (-[WebAVPlayerLayer setVideoGravity:]): 2020-07-16 Andres Gonzalez Crash caused by clients that don't support isolated tree mode calling on the secondary thread. https://bugs.webkit.org/show_bug.cgi?id=214409 Reviewed by Chris Fleizach. In isolated tree mode, isIsolatedTreeEnabled should return true whenever is called off of the main thread, even if the client doesn’t support isolated tree mode. Once the secondary AX thread is initialized due to a call from a client that supports isolated tree mode like VoiceOver, all calls into the accessibility API will happen on the secondary thread, including calls from clients that don't support isolated tree mode. At this point, we need to handle those clients as if they supported isolated tree mode. In other words, one client that supports isolated tree mode makes all other clients to be treated as such. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::isIsolatedTreeEnabled): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper lineTextMarkerRangeForTextMarker:forUnit:]): Minor cleanup, the cache is already in a local varriable. 2020-07-16 Oriol Brufau [css-grid] Fix line name positions after implicit tracks https://bugs.webkit.org/show_bug.cgi?id=214315 Reviewed by Manuel Rego Casasnovas. When serializing grid-template-rows/columns of a grid container, we get the list of used track sizes, and then insert line names at the corresponding indices. Before this patch, these indices were simply taken from the computed value. However, leading implicit tracks appear in the used value but not in the computed one. Therefore, we have to offset the indices so that the line names appear at the proper positions. This patch is a port of https://crrev.com/777829 Tests: imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-implicit-track.html imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-implicit-track.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::populateGridTrackList): (WebCore::valueForGridTrackList): * rendering/RenderGrid.h: 2020-07-16 Andres Gonzalez [webAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange]needs to autorelease the return value from the main thread. https://bugs.webkit.org/show_bug.cgi?id=214404 Reviewed by Chris Fleizach. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]): Call retrieveAutoreleasedValueFromMainthread instead of retrieveValueFromMainThread. The autorelease call inside the lambda doesn't do the job. 2020-07-16 Carlos Garcia Campos REGRESSION(r264280) [GTK][WPE] fast/gradients/conic-gradient-alpha.html is failing https://bugs.webkit.org/show_bug.cgi?id=214259 Reviewed by Darin Adler. * platform/graphics/ColorBlending.cpp: (WebCore::blendWithoutPremultiply): Use 'to' instead of 'from' when converting to SRGBA. * platform/graphics/cairo/GradientCairo.cpp: (WebCore::createConic): Use blendWithoutPremultiply() instead of blend() for the color stops interpolation. 2020-07-16 Carlos Garcia Campos REGRESSION(r264272) [GTK][WPE] css3/color/composited-solid-backgrounds.html is failing https://bugs.webkit.org/show_bug.cgi?id=214260 Reviewed by Darin Adler. The problem is that clampToComponentFloat is returning a uint8_t instead of a float, so we always end up returning 0. * platform/graphics/ColorUtilities.h: (WebCore::clampToComponentFloat): 2020-07-15 Yusuke Suzuki Should clear exception after microtask draining https://bugs.webkit.org/show_bug.cgi?id=214391 Reviewed by Mark Lam. Test: js/dom/microtask-drain-should-clear-exceptions.html Since microtask draining involves JS calls, potentially it can cause exception. We should clear exceptions after microtask draining since we do not handle it and suppress exception-check validation. And we also should not create ThrowScope in canAccessDocument when parameter says it never throws an error. Both cases are handled in the attached test. * bindings/js/JSDOMBindingSecurity.cpp: (WebCore::canAccessDocument): * bindings/js/JSExecState.h: (WebCore::JSExecState::~JSExecState): 2020-07-15 Devin Rousso Unreviewed followup, use `objectReplacementCharacter` instead of `0xFFFC` * editing/TextIterator.cpp: (WebCore::TextIterator::representNodeOffsetZero): 2020-07-15 Simon Fraser Flip the sense of the return value for processWheelEventForScrollSnap() https://bugs.webkit.org/show_bug.cgi?id=214328 Reviewed by Wenson Hsieh. All the other functions return "true" to mean "handled". Make this one the same. * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::handleWheelEvent): (WebCore::ScrollController::processWheelEventForScrollSnap): 2020-07-15 Devin Rousso should represent `TextPlaceholderElement` as an `NSTextAttachmentCharacter` instead of a `\n` https://bugs.webkit.org/show_bug.cgi?id=214331 Reviewed by Wenson Hsieh. * editing/TextIterator.cpp: (WebCore::shouldEmitReplacementInsteadOfNode): Added. (WebCore::shouldEmitNewlinesBeforeAndAfterNode): (WebCore::TextIterator::representNodeOffsetZero): Placeholders should eventually be removed, so stringifying them as a newline doesn't make sense as they should be treated as a "slot" in the existing flow of the surrounding content without changing the characteristics of the content (e.g. a sentence with a placeholder should remain as a sentence, not suddenly become two paragraphs separated by a placeholder). 2020-07-15 Stephan Szabo [PlayStation] Build fix after r264213 https://bugs.webkit.org/show_bug.cgi?id=214373 Unreviewed build fix No new tests, build fix only * PlatformPlayStation.cmake: Stop compiling UserAgentQuirks 2020-07-15 Daniel Bates [iOS] Caret should be before text placeholder instead of after it https://bugs.webkit.org/show_bug.cgi?id=214319 Reviewed by Wenson Hsieh. Move the caret to before the text placeholder to match UIKit. Tests: editing/text-placeholder/caret-before-zero-width-placeholder-in-content-editable-end-of-word.html editing/text-placeholder/caret-before-zero-width-placeholder-in-content-editable-start-of-word.html editing/text-placeholder/insert-into-content-editable-and-remove-via-mutation-event.html * editing/Editor.cpp: (WebCore::Editor::insertTextPlaceholder): Compute the position before the placeholder in its parent. This computation can only be done if the placeholder still has a parent. It may not after insertion because arbitrary JavaScript code can run. If this happens then bail out and return nullptr. Otherwise, set the new selection. 2020-07-15 Simon Fraser itsnicethat.com page is sometimes non-scrollable https://bugs.webkit.org/show_bug.cgi?id=214362 Reviewed by Tim Horton. This page uses 'clip-path: inset(1px); on a 1px x 1px element to hit descendants from hit-testing and compositing code turns this into a layer mask using a CAShapeLayer. Our layer/view hit-testing code failed to check for masking; if a layer has a mask, it needs to be handled like -masksToBounds, in that points outside the mask should never hit descendant layers. Make a -_web_maskContainsPoint: to test whether the point is inside the mask layer, and _web_maskMayIntersectRect: which does approximate testing using path bounds intersection (this is used for editable regions). Also convert some hard-coded winding rule strings to use the CA constants. Tests: fast/scrolling/ios/clip-path-hit-test.html fast/scrolling/mac/clip-path-hit-test.html * page/scrolling/mac/ScrollingTreeMac.mm: (collectDescendantLayersAtPoint): * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::shapeWindRule const): (WebCore::PlatformCALayerCocoa::setShapeWindRule): * platform/graphics/cocoa/WebCoreCALayerExtras.h: * platform/graphics/cocoa/WebCoreCALayerExtras.mm: (-[CALayer _web_maskContainsPoint:]): (-[CALayer _web_maskMayIntersectRect:]): 2020-07-15 Mark Lam Add handling of out of memory handling while adding a worklet module. https://bugs.webkit.org/show_bug.cgi?id=214354 Reviewed by Yusuke Suzuki and Keith Miller. Test: fast/css-custom-paint/out-of-memory-while-adding-worklet-module.html * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::createDOMException): * dom/ExceptionCode.h: * worklets/PaintWorkletGlobalScope.cpp: (WebCore::PaintWorkletGlobalScope::tryCreate): (WebCore::PaintWorkletGlobalScope::PaintWorkletGlobalScope): (WebCore::PaintWorkletGlobalScope::create): Deleted. * worklets/PaintWorkletGlobalScope.h: * worklets/Worklet.cpp: (WebCore::Worklet::addModule): * worklets/Worklet.h: * worklets/Worklet.idl: * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::WorkletGlobalScope): * worklets/WorkletGlobalScope.h: * worklets/WorkletScriptController.cpp: (WebCore::WorkletScriptController::WorkletScriptController): * worklets/WorkletScriptController.h: 2020-07-15 Oriol Brufau [css-grid] Rename SmallestTrackStart to ExplicitGridStart https://bugs.webkit.org/show_bug.cgi?id=214347 Reviewed by Manuel Rego Casasnovas. The SmallestTrackStart method used to return a signed int which was never positive, representing the smallest untranslated start among all grid items, clamped by 0 as a maximum. In practice, though, what we usually want is the index of the first explicit track/line among all tracks/lines, or equivalently, the number of leading implicit tracks/lines. That number is precisely minus the return value of SmallestTrackStart. Thus, in grid layout there were various std::abs() to invert the value. But it's a bit confusing to have an API which returns a non-positive integer, which then needs to be made non-negative. Therefore, this patch renames SmallestTrackStart to ExplicitGridStart, and makes it return the unsigned which is usually desired. This patch should have no effect in practice. This patch is a port of https://crrev.com/777768 * rendering/Grid.cpp: (WebCore::Grid::setExplicitGridStart): (WebCore::Grid::explicitGridStart const): (WebCore::Grid::setNeedsItemsPlacement): * rendering/Grid.h: * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithm::rawGridTrackSize const): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::computeEmptyTracksForAutoRepeat const): (WebCore::RenderGrid::placeItemsOnGrid const): (WebCore::RenderGrid::populateExplicitGridAndOrderIterator const): (WebCore::RenderGrid::gridAreaBreadthForOutOfFlowChild): 2020-07-15 Chris Dumez Unreviewed atttempt to fix build after r264389. * platform/gamepad/mac/HIDGamepadProvider.mm: (WebCore::HIDGamepadProvider::deviceRemoved): 2020-07-15 Zalan Bujtas [LFC][IFC] Remove Display::LineBox::isConsideredEmpty https://bugs.webkit.org/show_bug.cgi?id=214335 Reviewed by Antti Koivisto. Display classes should not have layout related bits. * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const): * layout/displaytree/DisplayLineBox.h: (WebCore::Display::LineBox::baselineOffset const): (WebCore::Display::LineBox::LineBox): (WebCore::Display::LineBox::isConsideredEmpty const): Deleted. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine): 2020-07-15 Alicia Boya García [MSE][GStreamer] Break circular reference between SourceBufferPrivateGStreamer and AppendPipeline https://bugs.webkit.org/show_bug.cgi?id=214345 Reviewed by Xabier Rodriguez-Calvar. SourceBufferPrivate is ref counted. AppendPipeline is owned exclusively by SourceBufferPrivateGStreamer: it's born and destroyed with it, managed by a never-moved unique_ptr. AppendPipeline needs a reference to SourceBufferPrivateGStreamer to notify it of essential events like samples having been parsed. This used to be a Ref<>, thus creating a circular reference leak: AppendPipeline is only destroyed in SourceBufferPrivateGStreamer destructor. AppendPipeline holds ref counted reference to SourceBufferPrivateGStreamer, therefore neither are destroyed. This patch breaks the cycle by replacing the Ref<> in AppendPipeline with a plain old reference. This is safe because SourceBufferPrivateGStreamer owns, and therefore is alive at least just as long as AppendPipeline. As a consequence of not using Ref<>, the SourceBufferPrivateGStreamer constructor does no longer need to relax the adoption requirements and unique_ptr can be replaced by a UniqueRef<>. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::AppendPipeline): (WebCore::AppendPipeline::handleErrorConditionFromStreamingThread): (WebCore::AppendPipeline::handleStateChangeMessage): (WebCore::AppendPipeline::handleEndOfAppend): (WebCore::AppendPipeline::appsinkNewSample): (WebCore::AppendPipeline::didReceiveInitializationSegment): (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink): * platform/graphics/gstreamer/mse/AppendPipeline.h: (WebCore::AppendPipeline::sourceBufferPrivate): * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected): * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::SourceBufferPrivateGStreamer): * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: 2020-07-15 Brady Eidson Resolve race between IOHIDManager and GameController framework. and https://bugs.webkit.org/show_bug.cgi?id=214245 Reviewed by Tim Horton. No automated testing available. IOHIDDevices and IOHIDServices are two separate things. An IOHIDDevice and IOHIDService often have a 1-to-1 correlation, but the IOHIDDevice might be published to the application before the IOHIDService is. WebKit's HID gamepad manager uses IOHIDDevice. GameController.framework uses IOHIDServices. When we added the ability for WebKit to switch between HID and GCF, the following happens: - Sometimes the IOHIDServiceClient will get published first. Then when the IOHIDDevice is published, and WebKit was deciding which gamepad manager to use, the device's services are available, and we get the right answer. - Sometimes, the IOHIDDevice is published first. Then when WebKit is deciding which gamepad manager to use, it can't check the IOHIDServiceClient against GameController framework. So we have the HID manager handle the device... but then GCF comes along a split second later and ALSO handles it. The "device before service" scenario results in the same gamepad showing up twice. To resolve this, we do the following: 1 - If an IOHIDDevice attaches and its services aren't available yet, we delay managing it. 2 - When we delay managing a device, we start listening for IOHIDServiceClient additions. 3 - Each time a GamePad service is published, we once again try to determine if GCF will handle the device. 4 - As long as the answer is "Maybe" - instead of "Yes" or "No" - we refuse to manage the device. 5 - After a brief delay (currently 1 second), we will give up waiting for published services and manage the device with the HID gamepad provider. In my testing, when the service publishes after the devices, it's always within 50ms, (and usually just a spin or two of the runloop) so the 1s delay seems sufficient. NOTE: The above all holds true with the "MultiGamepadProvider" on Catalina. On Big Sur, there's brand new GameController framework API that makes this much easier. 👍 * platform/gamepad/mac/HIDGamepadProvider.h: * platform/gamepad/mac/HIDGamepadProvider.mm: (WebCore::deviceAddedCallback): (WebCore::gameControllerFrameworkWillHandleHIDDevice): (WebCore::HIDGamepadProvider::waitForManagementDecisionForDevice): (WebCore::HIDGamepadProvider::removeDeviceWaitingForManagementDecision): (WebCore::HIDGamepadProvider::newGamePadServicePublished): (WebCore::HIDGamepadProvider::deviceAdded): (WebCore::HIDGamepadProvider::deviceRemoved): 2020-07-14 Zalan Bujtas Caret leaves trails behind when the editable content is subpixel positioned https://bugs.webkit.org/show_bug.cgi?id=214333 Reviewed by Simon Fraser. Replace integral rounding with pixelsnapping when painting the caret. The paint invalidation uses device pixel snapping and the actual painting needs to match it in order to not paint outside of the invalidated region. * editing/Editing.cpp: (WebCore::caretRendersInsideNode): (WebCore::rendererForCaretPainting): * editing/Editing.h: * editing/FrameSelection.cpp: (WebCore::FrameSelection::paintCaret): (WebCore::CaretBase::computeCaretColor): (WebCore::CaretBase::paintCaret const): (WebCore::DragCaretController::paintDragCaret const): * editing/FrameSelection.h: 2020-07-14 James Darpinian [WebGL2] vertexAttribI* and getFragDataLocation https://bugs.webkit.org/show_bug.cgi?id=214211 Reviewed by Dean Jackson. Passes all relevant WebGL 2 conformance tests. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getFragDataLocation): (WebCore::WebGL2RenderingContext::vertexAttribI4i): (WebCore::WebGL2RenderingContext::vertexAttribI4iv): (WebCore::WebGL2RenderingContext::vertexAttribI4ui): (WebCore::WebGL2RenderingContext::vertexAttribI4uiv): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::getVertexAttrib): (WebCore::WebGLRenderingContextBase::vertexAttribfImpl): (WebCore::WebGLRenderingContextBase::vertexAttribfvImpl): (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): * html/canvas/WebGLRenderingContextBase.h: (WebCore::WebGLRenderingContextBase::VertexAttribValue::initValue): * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::getFragDataLocation): (WebCore::GraphicsContextGLOpenGL::vertexAttribI4i): (WebCore::GraphicsContextGLOpenGL::vertexAttribI4iv): (WebCore::GraphicsContextGLOpenGL::vertexAttribI4ui): (WebCore::GraphicsContextGLOpenGL::vertexAttribI4uiv): 2020-07-14 Kenneth Russell [WebGL2] Implement compressedTex{Sub}Image*, copyTexSubImage3D https://bugs.webkit.org/show_bug.cgi?id=126449 Reviewed by Dean Jackson. Implement WebGL 2.0 entry points compressedTex{Sub}Image[23]D and copyTexSubImage3D. These require and use the ANGLE_robust_client_memory extension for size checking. Remove the associated entry points from GraphicsContextGL and subclasses, since they will never be used. Add needed pixel buffer object validation to the WebGL 1.0 versions of these APIs as well as to texImage2D and texSubImage2D. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::texImage2D): (WebCore::WebGL2RenderingContext::texSubImage2D): (WebCore::WebGL2RenderingContext::copyTexSubImage3D): (WebCore::WebGL2RenderingContext::compressedTexImage2D): (WebCore::WebGL2RenderingContext::compressedTexImage3D): (WebCore::WebGL2RenderingContext::compressedTexSubImage2D): (WebCore::WebGL2RenderingContext::compressedTexSubImage3D): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLRenderingContextBase.cpp: * html/canvas/WebGLRenderingContextBase.h: * platform/graphics/GraphicsContextGL.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::copyTexSubImage3D): (WebCore::GraphicsContextGLOpenGL::compressedTexImage3D): Deleted. (WebCore::GraphicsContextGLOpenGL::compressedTexSubImage3D): Deleted. * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::compressedTexImage3D): Deleted. (WebCore::GraphicsContextGLOpenGL::compressedTexSubImage3D): Deleted. 2020-07-14 Chris Dumez Drop cache of subframe count on the Page https://bugs.webkit.org/show_bug.cgi?id=214312 Reviewed by Geoffrey Garen. Drop cache of subframe count on the Page as it is error-prone to keep it up to date and it is not performance sensitive. We only need the subframe count when trying to load a new iframe to see if we reached the maximum number of subframes (1000). Calculating this count is also not very expensive since we merely need to iterate the frame tree, which is composed of at most 1000 frames. * history/CachedFrame.cpp: (WebCore::CachedFrame::CachedFrame): (WebCore::CachedFrame::open): * loader/FrameLoader.cpp: (WebCore::FrameLoader::closeAndRemoveChild): * page/Frame.cpp: (WebCore::Frame::Frame): (WebCore::Frame::disconnectOwnerElement): * page/FrameTree.cpp: (WebCore::FrameTree::childCount const): (WebCore::FrameTree::descendantCount const): * page/FrameTree.h: * page/Page.cpp: (WebCore::Page::subframeCount const): * page/Page.h: 2020-07-14 James Darpinian Implement uniform* and getUniform for WebGL 2 types https://bugs.webkit.org/show_bug.cgi?id=214116 Reviewed by Dean Jackson. Passes all relevant WebGL conformance tests. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getFragDataLocation): (WebCore::WebGL2RenderingContext::uniform1ui): (WebCore::WebGL2RenderingContext::uniform2ui): (WebCore::WebGL2RenderingContext::uniform3ui): (WebCore::WebGL2RenderingContext::uniform4ui): (WebCore::WebGL2RenderingContext::uniform1uiv): (WebCore::WebGL2RenderingContext::uniform2uiv): (WebCore::WebGL2RenderingContext::uniform3uiv): (WebCore::WebGL2RenderingContext::uniform4uiv): (WebCore::WebGL2RenderingContext::uniformMatrix2x3fv): (WebCore::WebGL2RenderingContext::uniformMatrix3x2fv): (WebCore::WebGL2RenderingContext::uniformMatrix2x4fv): (WebCore::WebGL2RenderingContext::uniformMatrix4x2fv): (WebCore::WebGL2RenderingContext::uniformMatrix3x4fv): (WebCore::WebGL2RenderingContext::uniformMatrix4x3fv): (WebCore::WebGL2RenderingContext::uniform1fv): (WebCore::WebGL2RenderingContext::uniform2fv): (WebCore::WebGL2RenderingContext::uniform3fv): (WebCore::WebGL2RenderingContext::uniform4fv): (WebCore::WebGL2RenderingContext::uniform1iv): (WebCore::WebGL2RenderingContext::uniform2iv): (WebCore::WebGL2RenderingContext::uniform3iv): (WebCore::WebGL2RenderingContext::uniform4iv): (WebCore::WebGL2RenderingContext::uniformMatrix2fv): (WebCore::WebGL2RenderingContext::uniformMatrix3fv): (WebCore::WebGL2RenderingContext::uniformMatrix4fv): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::getUniform): (WebCore::WebGLRenderingContextBase::uniform1fv): (WebCore::WebGLRenderingContextBase::uniform2fv): (WebCore::WebGLRenderingContextBase::uniform3fv): (WebCore::WebGLRenderingContextBase::uniform4fv): (WebCore::WebGLRenderingContextBase::uniform1iv): (WebCore::WebGLRenderingContextBase::uniform2iv): (WebCore::WebGLRenderingContextBase::uniform3iv): (WebCore::WebGLRenderingContextBase::uniform4iv): (WebCore::WebGLRenderingContextBase::uniformMatrix2fv): (WebCore::WebGLRenderingContextBase::uniformMatrix3fv): (WebCore::WebGLRenderingContextBase::uniformMatrix4fv): (WebCore::WebGLRenderingContextBase::validateUniformParameters): (WebCore::WebGLRenderingContextBase::validateUniformMatrixParameters): * html/canvas/WebGLRenderingContextBase.h: * platform/graphics/GraphicsContextGL.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::getUniformuiv): (WebCore::GraphicsContextGLOpenGL::getFragDataLocation): (WebCore::GraphicsContextGLOpenGL::uniform1ui): (WebCore::GraphicsContextGLOpenGL::uniform2ui): (WebCore::GraphicsContextGLOpenGL::uniform3ui): (WebCore::GraphicsContextGLOpenGL::uniform4ui): (WebCore::GraphicsContextGLOpenGL::uniform1uiv): (WebCore::GraphicsContextGLOpenGL::uniform2uiv): (WebCore::GraphicsContextGLOpenGL::uniform3uiv): (WebCore::GraphicsContextGLOpenGL::uniform4uiv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix2x3fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix3x2fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix2x4fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix4x2fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix3x4fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix4x3fv): (WebCore::GraphicsContextGLOpenGL::uniform1fv): (WebCore::GraphicsContextGLOpenGL::uniform2fv): (WebCore::GraphicsContextGLOpenGL::uniform3fv): (WebCore::GraphicsContextGLOpenGL::uniform4fv): (WebCore::GraphicsContextGLOpenGL::uniform1iv): (WebCore::GraphicsContextGLOpenGL::uniform2iv): (WebCore::GraphicsContextGLOpenGL::uniform3iv): (WebCore::GraphicsContextGLOpenGL::uniform4iv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix2fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix3fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix4fv): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::getUniformuiv): 2020-07-14 Per Arne Vollan [iOS] Avoid loading media libraries in Document::visibilityStateChanged() if not needed https://bugs.webkit.org/show_bug.cgi?id=214304 Unreviewed, address additional review comments. * dom/Document.cpp: (WebCore::Document::visibilityStateChanged): 2020-07-14 Jer Noble Add support for parsing VP-style codec strings. https://bugs.webkit.org/show_bug.cgi?id=214270 Reviewed by Eric Carlson. Test: media/vp-codec-parameters.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/VP9Utilities.cpp: Added. (WebCore::validVPLevels): (WebCore::validColorPrimaries): (WebCore::parseVPCodecParameters): * platform/graphics/VP9Utilities.h: Added. * testing/Internals.cpp: (WebCore::Internals::parseVPCodecParameters): * testing/Internals.h: * testing/Internals.idl: 2020-07-14 Said Abou-Hallawa When invalidating the clients of an SVG resource we should not go beyond the RenderSVGRoot https://bugs.webkit.org/show_bug.cgi?id=211804 Reviewed by Zalan Bujtas. ComplexLineLayout::layoutLineBoxes() walks through the renderers of a line. The order of this walk may include a node and its children. For example the layout of a RenderInline may be run first, then it is followed by the layout for a RenderSVGRoot which happens to be a child of the RenderInline. If the RenderSVGRoot has a dirty RenderSVGResource, e.g. RenderSVGResourceClipper, this resource will call RenderSVGResource::markForLayoutAndParentResourceInvalidation() which will invalidate its ancestors including RenderSVGRoot and RenderInline by setting the normalChildNeedsLayoutBit() for each of them. The layout of SVG is hierarchical which means RenderSVGRoot will finish its layout after finishing the layout of all its descendants including this RenderSVGResource. So dirtying the RenderSVGRoot is this scenario is okay since RenderSVGRoot will do another SVGRenderSupport::layoutChildren() and will clear its needsLayout bits before it returns. The problem happens because we set normalChildNeedsLayoutBit for the containing RenderInline and this leaves the render tree dirty. Later Document::resolveStyle() may called to invalidate an SVG element e.g. RenderSVGPath. So setNeedsLayout() is called for this object. Because the normalChildNeedsLayoutBit() is set for the RenderInline, RenderObject::markContainingBlocksForLayout() stops in the middle and do not mark the containing RenderBlock. So we end up with a render tree like this: + RenderView + HTML RenderBlock + BODY RenderBody - RenderBlock + ANY-ELEMENT RenderInline + svg RenderSVGRoot - clipPath RenderSVGResourceClipper + polygon RenderSVGPath where the '+' means needsLayout() is true and '-' means needsLayout() is false. So the layout will not run for RenderBlock with '-' sign. And we end up with dirty RenderSVGPath or even worse RenderSVGPath with uninitialized m_path. So a null pointer deref may happen. The fix is to prevent mutating the render tree while running the layout of the SVG resource. This can be done by making the RenderSVGResource not dirtying any renderer beyond the RenderSVGRoot when it finishes its layout. The SVG resource layout should not affect the intrinsic size of the SVG if it is embedded in an HTML document. In RenderObject::markContainingBlocksForLayout(), we do something similar when we break if the ancestor is objectIsRelayoutBoundary(). Test: svg/in-html/inline-svg-resource-dynamic-update.html * rendering/svg/RenderSVGResource.cpp: (WebCore::RenderSVGResource::markForLayoutAndParentResourceInvalidation): * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::layout): * rendering/svg/RenderSVGRoot.h: 2020-07-14 Per Arne Vollan [iOS] Avoid loading media libraries in Document::visibilityStateChanged() if not needed https://bugs.webkit.org/show_bug.cgi?id=214304 Reviewed by Darin Adler. When the shared PlatformMediaSessionManager is created and accessed for the first time, some media libraries are loaded. There should be no need to access the shared PlatformMediaSessionManager if no manager has been created in Document::visibilityStateChanged(). No new tests, since this patch does not change behavior. * dom/Document.cpp: (WebCore::Document::visibilityStateChanged): 2020-07-14 Jonathan Bedard [watchOS] Support armv7k build https://bugs.webkit.org/show_bug.cgi?id=214306 Reviewed by Aakash Jain. No new tests, build fix. * Configurations/Base.xcconfig: Disable 64 to 32 bit conversion warning for armv7k. 2020-07-14 Eric Carlson [macOS] Do not update ScreenTime when in private browsing mode https://bugs.webkit.org/show_bug.cgi?id=214288 Reviewed by Jer Noble. Test: media/media-usage-state-private-browsing.html * html/MediaElementSession.cpp: (WebCore::MediaElementSession::updateMediaUsageIfChanged): Return early if the page is in private mode. 2020-07-14 Clark Wang Updated AudioContext constructor according to spec https://bugs.webkit.org/show_bug.cgi?id=214267 Reviewed by Chris Dumez. Updated AudioContext constructor according to spec: https://www.w3.org/TR/webaudio/#AudioContext-constructors. Added in files accordingly to support AudioContextOptions. Re-baselined existing tests. One new test case passes, and one fails due to current accepted range for sampleRate. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::create): (WebCore::AudioContext::AudioContext): * Modules/webaudio/AudioContext.h: (WebCore::AudioContext::create): * Modules/webaudio/AudioContext.idl: * Modules/webaudio/AudioContextLatencyCategory.h: Added. * Modules/webaudio/AudioContextLatencyCategory.idl: Added. * Modules/webaudio/AudioContextOptions.h: Added. * Modules/webaudio/AudioContextOptions.idl: Added. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::BaseAudioContext): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::DefaultAudioDestinationNode): * Modules/webaudio/DefaultAudioDestinationNode.h: * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::PannerNode): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-07-14 Justin Fan [WebGL] REGRESSION (r262366): Google search photos do not render, black images https://bugs.webkit.org/show_bug.cgi?id=214156 Reviewed by Dean Jackson. http://trac.webkit.org/changeset/262366 separated WebGL canvas contents swapping and presentation into two steps. This Google search page was only running the presentation code without the swapping step, as it removes canvases from the observer Document before the Document is able to swap its canvas' contents. Ensure that re-inserted canvas elements properly register their new Documents as observers. Covered by existing tests. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::insertedIntoAncestor): * html/HTMLCanvasElement.h: 2020-07-14 Fujii Hironori Unreviewed non-unified build fixes * bindings/js/CommonVM.cpp: * html/canvas/CanvasRenderingContext2DBase.cpp: * html/canvas/CanvasStyle.cpp: * platform/graphics/GradientImage.cpp: * rendering/svg/RenderSVGPath.cpp: 2020-07-13 Fujii Hironori Unreviewed non-unified build fixes * animation/CSSTransition.cpp: * html/HTMLFormControlElement.cpp: * html/ImageData.cpp: * inspector/InspectorInstrumentationWebKit.h: * layout/FormattingContextGeometry.cpp: * layout/floats/FloatingContext.cpp: * layout/floats/FloatingState.cpp: * layout/tableformatting/TableFormattingContext.cpp: * loader/MediaResourceLoader.cpp: * platform/FrameRateMonitor.h: * platform/graphics/ColorSerialization.cpp: * platform/graphics/ColorSerialization.h: * svg/SVGNumber.h: * svg/SVGParserUtilities.h: * svg/SVGTransformList.cpp: * svg/SVGZoomAndPan.cpp: 2020-07-13 Peng Liu Keyboard remains on full screen video view after back from PiP https://bugs.webkit.org/show_bug.cgi?id=214287 Reviewed by Daniel Bates. Make the window for video fullscreen and picture-in-picture support the key window after the video returns to fullscreen from the picture-in-picture mode. Otherwise, the WebAVPlayerViewController cannot become the first responder. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::didStopPictureInPicture): 2020-07-13 Zalan Bujtas [RenderTreeNeedsLayoutChecker] imported/w3c/web-platform-tests/html/rendering/replaced-elements/embedded-content/video-controls-vertical-writing-mode.html asserts https://bugs.webkit.org/show_bug.cgi?id=214281 Reviewed by Simon Fraser. While percentage height descendant computation runs on the containing block chain, when we mark the ancestors for layout, we need to traverse the parent (container) chain rather than the containing block chain. Containing block traversal skips certain non-block renderers which leaves gap between dirty renderers. Renderer[A] + dirty Renderer[B] - not dirty Renderer[C] + dirty During layout this gap (Renderer[B]) makes us exit early, resulting dirty leftover renderers (Renderer[C]). This is similar to what we do in RenderObject::markContainingBlocksForLayout. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::dirtyForLayoutFromPercentageHeightDescendants): 2020-07-13 Andres Gonzalez REGRESSION: (r257915?) [ Mac ] accessibility/accessibility-node-memory-management.html is flaky failing. https://bugs.webkit.org/show_bug.cgi?id=208930 Reviewed by Chris Fleizach. Test: accessibility/accessibility-node-memory-management.html In some cases, such as the empty canvas in this test, the algorithm in AXIsolatedTree::updateChildren to only update the children that are added or removed does not work. In those cases, fallback to updating the entire subtree. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateChildren): 2020-07-13 Keith Miller ScriptController needs to SetForScope m_sourceURL after Refing its Frame https://bugs.webkit.org/show_bug.cgi?id=214276 Reviewed by Chris Dumez. The SetForScopes in ScriptController need to be constructed after the Frame is retained otherwise the Ref to the frame may be destroyed before m_sourceURL is restored. Since the Frame owns the ScriptController we end up writing the SourceURL after the ScriptController has been freed. No new tests because my recent code change already caused ASAN failures. * bindings/js/ScriptController.cpp: (WebCore::ScriptController::evaluateInWorld): (WebCore::ScriptController::evaluateModule): (WebCore::ScriptController::callInWorld): 2020-07-13 Geoffrey Garen Unreviewed, re-landing r264242 with crash fixed. Re-landed changeset: "JSRunLoopTimer should use WTF::RunLoop rather than custom CF code" https://bugs.webkit.org/show_bug.cgi?id=214102 https://trac.webkit.org/changeset/264242 * bindings/js/CommonVM.cpp: (WebCore::commonVMSlow): 2020-07-13 Eric Carlson Impossible to pause playback of MediaStream video track https://bugs.webkit.org/show_bug.cgi?id=214262 Reviewed by Jer Noble. These changes were tested manually because they don't change the behavior when snapshotting or rendering to canvas. * platform/graphics/avfoundation/SampleBufferDisplayLayer.h: Add pure virtual play and pause methods. * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.h: (WebCore::LocalSampleBufferDisplayLayer::play): New, toggle m_paused. (WebCore::LocalSampleBufferDisplayLayer::pause): Ditto. * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm: (WebCore::LocalSampleBufferDisplayLayer::enqueueSample): Return early if paused. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): Pause the display layer if necessary. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Start display layer. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Pause display layer. 2020-07-13 Sam Weinig Replace single argument makeSimpleColor uses with their implementation https://bugs.webkit.org/show_bug.cgi?id=214240 Reviewed by Darin Adler. Remove makeSimpleColor overloads that took SRGBA and SRGBA: - makeSimpleColor(SRGBA) was a no-op, so is replaced with nothing. - makeSimpleColor(SRGBA) is replaced by the function it called, convertToComponentBytes(). * css/StyleColor.cpp: (WebCore::StyleColor::colorFromKeyword): * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseHSLParameters): * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::detectContentInRange): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::setShadow): * html/canvas/CanvasStyle.cpp: (WebCore::CanvasStyle::CanvasStyle): (WebCore::CanvasStyle::isEquivalent const): * platform/graphics/Color.cpp: (WebCore::Color::lightened const): (WebCore::Color::darkened const): * platform/graphics/SimpleColor.h: * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::makeSimpleColorFromARGBCFArray): * platform/graphics/filters/FilterOperations.cpp: (WebCore::FilterOperations::transformColor const): (WebCore::FilterOperations::inverseTransformColor const): * platform/graphics/mac/ColorMac.mm: (WebCore::makeSimpleColorFromNSColor): (WebCore::colorFromNSColor): (WebCore::semanticColorFromNSColor): * platform/graphics/win/PlatformContextDirect2D.cpp: (WebCore::PlatformContextDirect2D::brushWithColor): * platform/ios/ColorIOS.mm: (WebCore::colorFromUIColor): 2020-07-13 Sihui Liu Text manipulation does not observe manipulated text after update https://bugs.webkit.org/show_bug.cgi?id=213318 Reviewed by Geoffrey Garen. Make TextManipulationController be aware of content replacement on Text and extract the new content. Test: TextManipulation.CompleteTextManipulationForManipulatedTextWithNewContent * dom/CharacterData.h: * dom/Text.cpp: (WebCore::Text::setDataAndUpdate): * dom/Text.h: * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::didCreateRendererForElement): (WebCore::TextManipulationController::didUpdateContentForText): (WebCore::TextManipulationController::scheduleObservationUpdate): * editing/TextManipulationController.h: * editing/markup.cpp: 2020-07-13 Keith Miller Clean up SourceProvider and add caller relative load script to jsc.cpp https://bugs.webkit.org/show_bug.cgi?id=214205 Reviewed by Yusuke Suzuki. Refactor WebCore <-> JSC binding layer now that JSC uses WTF::URLs for SourceOrigins. Also, improve module loading error messages to include the specifier and referrer when producing errors around bare-name specifiers. New error message behavior is already tested so existing tests have been updated. * bindings/js/CachedScriptSourceProvider.h: (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider): * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::handleEvent): * bindings/js/JSEventListener.h: (WebCore::JSEventListener::sourceURL const): * bindings/js/JSLazyEventListener.cpp: (WebCore::JSLazyEventListener::JSLazyEventListener): (WebCore::JSLazyEventListener::initializeJSFunction const): (WebCore::JSLazyEventListener::create): * bindings/js/JSLazyEventListener.h: * bindings/js/ScriptController.cpp: (WebCore::ScriptController::evaluateInWorld): (WebCore::ScriptController::evaluateModule): (WebCore::ScriptController::callInWorld): * bindings/js/ScriptController.h: (WebCore::ScriptController::sourceURL const): * bindings/js/ScriptModuleLoader.cpp: (WebCore::resolveModuleSpecifier): (WebCore::rejectPromise): * bindings/js/ScriptSourceCode.h: (WebCore::ScriptSourceCode::ScriptSourceCode): (WebCore::ScriptSourceCode::url const): 2020-07-13 Alicia Boya García [MSE][GStreamer] Discard PTS-less samples https://bugs.webkit.org/show_bug.cgi?id=214252 Reviewed by Philippe Normand. In some cases GStreamer demuxers emit PTS-less samples with metadata at the beginning of the container. These are fortunately not necessary for playback, and in fact incompatible with the way MSE works, where you should be able to start playing a stream from the middle. This patch skips these frames in the AppendPipeline so they don't pollute other parts of the MSE codebase. Since these frames were not necessary and were later overwritten, this patch is just a cleanup introducing no notable behavior changes. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::appsinkNewSample): 2020-07-13 Carlos Garcia Campos [WPE][GTK4] Form controls are not painted when using threaded rendering https://bugs.webkit.org/show_bug.cgi?id=214178 Reviewed by Žan Doberšek. Which is the default for GTK4 since r263888. The problem is that RenderTheme::paint() returns early if the given GraphicsContext doesn't have a platform context, assuming all RenderTheme implementations paint directly to the platform context. This patch adds a pure virtual canPaint() to RenderTheme to be used as the early return. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::paint): * rendering/RenderTheme.h: * rendering/RenderThemeAdwaita.h: * rendering/RenderThemeCocoa.h: * rendering/RenderThemeCocoa.mm: (WebCore::RenderThemeCocoa::canPaint const): * rendering/RenderThemePlayStation.h: * rendering/RenderThemeWin.h: 2020-07-13 Xabier Rodriguez Calvar [GStreamer] Unreviewed, remove private debug code When I landed the OpenCDM code I accidentally landed a couple of things that were internal debug that is not useful upstream. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): (WebCore::MediaPlayerPrivateGStreamer::handleMessage): 2020-07-12 Darin Adler Some further streamlining of Gradient handling code https://bugs.webkit.org/show_bug.cgi?id=214239 Reviewed by Sam Weinig. * platform/graphics/cairo/GradientCairo.cpp: (WebCore::interpolateColorStop): Deleted. (WebCore::createConic): Rewrite the interpolation code to create a new vector rather than edit the existing one and to use a more straightforward idiom, and a lambda rather than a helper function. Also removed an explicit conversion to Gradient::ColorStop, no longer needed because of the overload added to Vector::insert. * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::RenderSVGResourceGradient::applyResource): Use ensure rather than add to initialize gradient data in the gradient map. Change the #if for USE(CG) so it doesn't confuse brace matching from the syntax handling of text editors like the one in Xcode. Update for the changes to the buildGradient and gradientTransform functions. Use auto a bit more. (WebCore::RenderSVGResourceGradient::postApplyResource): Update since the map now contains GradientData rather than unique_ptr. Use std::exchange when fetching m_savedContext and a local variable to make the gradient-related code a bit less wordy. (WebCore::RenderSVGResourceGradient::addStops): Updated to take Gradient& rather than GradientData* and made this a static member function. (WebCore::RenderSVGResourceGradient::platformSpreadMethodFromSVGType): Made this a static member function. * rendering/svg/RenderSVGResourceGradient.h: Made more functions private. Converted addStops and platformSpreadMethodFromSVGType to static member functions. Made GradientData a member class, and put directly into the HashMap rather than putting unique_ptr into the map. Changed calculateGradientTransform to gradientTransform, which uses a return value rather than an out argument. Changed buildGradient to return Ref rather than taking a GradientData* to store it in. * rendering/svg/RenderSVGResourceLinearGradient.cpp: (WebCore::RenderSVGResourceLinearGradient::buildGradient const): Changed to return the gradient instead of modifying an argument and updated for the change to addStops. * rendering/svg/RenderSVGResourceLinearGradient.h: Made more functions private and updated for changes to gradientTransform and buildGradient. * rendering/svg/RenderSVGResourceRadialGradient.cpp: (WebCore::RenderSVGResourceRadialGradient::buildGradient const): Changed to return the gradient instead of modifying an argument and updated for the change to addStops. * rendering/svg/RenderSVGResourceRadialGradient.h: Made more functions private and updated for changes to gradientTransform and buildGradient. * svg/GradientAttributes.h: Removed the stopsSet boolean since the stops vector is empty if and only if it's not set. Made the setStops function take an rvalue reference so it doesn't always copy a vector. Also use the ColorStopVector type, sharing the same inline capacity policy with the Gradient class; both are optimizing the same thing. * svg/SVGGradientElement.cpp: (WebCore::SVGGradientElement::buildStops): Use the ColorStopVector type. * svg/SVGGradientElement.h: Update for the above. * svg/SVGLinearGradientElement.cpp: (WebCore::setGradientAttributes): Update for changes to buildStops and removed an unnecessary check for an empty vector now that an empty vector has the same semantics as "no stops". * svg/SVGRadialGradientElement.cpp: (WebCore::setGradientAttributes): Ditto. 2020-07-12 Fujii Hironori [WinCairo][Clang] Unreviewed build fix for r264272 https://bugs.webkit.org/show_bug.cgi?id=214204 clang-cl reported: > ..\..\Source\WebCore\platform\graphics/ColorUtilities.h(200,26): error: no template named 'ComponentTraits' > constexpr auto min = ComponentTraits::minValue; > ^ * platform/graphics/ColorUtilities.cpp: Removed #include "ColorTypes.h". * platform/graphics/ColorUtilities.h: Added #include "ColorTypes.h". 2020-07-12 Said Abou-Hallawa [macOS]: A HEIF image, selected from the OpenPanel, should be converted to an accepted MIME type https://bugs.webkit.org/show_bug.cgi?id=213347 Reviewed by Darin Adler. Tests: fast/forms/file/entries-api/image-no-transcode-open-panel.html fast/forms/file/entries-api/image-transcode-open-panel.html * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::allowedMIMETypes): Make sure this function returns lowercase MIME types. * platform/MIMETypeRegistry.h: * platform/graphics/NativeImage.h: * platform/graphics/cg/NativeImageCG.cpp: (WebCore::drawNativeImage): 2020-07-12 Sam Weinig Tidy up color usage in accessibility code https://bugs.webkit.org/show_bug.cgi?id=214226 Reviewed by Darin Adler. Rather than passing around r, g, b components as out-parameters, use SRGBA return values. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::colorValue const): * accessibility/AccessibilityNodeObject.h: * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (webkitAccessibleTextGetText): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): (WebCore::AXIsolatedObject::colorValue const): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): 2020-07-12 Rob Buis Improve IPv6 detection when setting host/hostname https://bugs.webkit.org/show_bug.cgi?id=214218 Reviewed by Darin Adler. Improve IPv6 detection when setting host/hostname by checking for '[' and ']' as well as using reverse find for ':' separators, to ensure we are not finding a separator within the IPv6 section of the url. Behavior matches Chrome and Firefox. Test: imported/w3c/web-platform-tests/url/url-setters.html * html/URLDecomposition.cpp: (WebCore::URLDecomposition::setHost): 2020-07-12 Zalan Bujtas [LFC][BFC][Min-Max width] Regular block level box resets the horizontal stacking https://bugs.webkit.org/show_bug.cgi?id=214225 Reviewed by Antti Koivisto. Non-floating block level boxes reset the current horizontal float stacking. e.g. with a shrink-to-fit width container:
will produce a max width of 40px which makes the floats vertically stacked. Test: fast/layoutformattingcontext/min-max-content-width-with-nested-floats-simple.html * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computedIntrinsicWidthConstraints): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): 2020-07-12 Darin Adler Simplify and improve Gradient, some other small color-related removals https://bugs.webkit.org/show_bug.cgi?id=214221 Reviewed by Sam Weinig. * css/CSSGradientValue.cpp: Removed some unneeded includes. * html/ColorInputType.cpp: (WebCore::ColorInputType::currentColor): Deleted. (WebCore::ColorInputType::shouldShowSuggestions const): Deleted. * html/ColorInputType.h: Updated for the above. * html/HTMLDocument.cpp: Removed unneeded include of HashTools.h. * html/canvas/CanvasGradient.cpp: (WebCore::CanvasGradient::create): Moved these functions out of the header since inlining should be the same or better with them here. (WebCore::CanvasGradient::~CanvasGradient): Moved this out of the header so we don't need to include Gradient.h in the header. (WebCore::CanvasGradient::addColorStop): Updated for change to Gradient::addColorStop and move Color rather than copying it. * html/canvas/CanvasGradient.h: Removed include of Gradient.h. Moved things out of the header to make that work. * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildArrayForCanvasGradient): Removed use of Gradient::type and instead unify the type string code with the code that interprets the data for the different types. * page/FrameView.cpp: (WebCore::FrameView::recalculateScrollbarOverlayStyle): Refactored to eliminate the multiple redundant code paths, otherwising leaving the logic unchanged. * platform/ColorChooserClient.h: Remove unneeded includes and unused currentColor and shouldShowSuggestions functions. * platform/graphics/Gradient.cpp: (WebCore::Gradient::create): Replaced create functions that take type-specific data structure with one that takes the variant Data. (WebCore::Gradient::Gradient): Ditto. Also removed platformInit. (WebCore::Gradient::~Gradient): Removed platformDestroy. (WebCore::Gradient::type const): Deleted. (WebCore::Gradient::addColorStop): Take an rvalue reference to cut down a little bit on reference count churn. Replaced the platformDestroy function with a new stopsChanged function. Removed an unneeded overload that takes the two parts of a ColorStop separately. (WebCore::Gradient::setSortedColorStops): Use stopsChanged. (WebCore::Gradient::sortStops const): Simplify a bit, using a lambda. Also gave this a shorter name; it still optimizes by not sorting if the vector is already sorted. (WebCore::Gradient::hasAlpha const): Deleted. (WebCore::Gradient::setSpreadMethod): Removed some slightly overzealous code checking this isn't used after creating the platform-specific gradient. Decided not to bother with this for now. (WebCore::Gradient::setGradientSpaceTransform): Tweaked formatting. (WebCore::add): Added overloads to add(Hasher&) so we can use computeHash. (WebCore::Gradient::hash const): Use computeHash instead of hashMemory. * platform/graphics/Gradient.h: Use RetainPtr, COMPtr, and RefPtr instead of manually managing the lifetimes of the platform-specific underlying gradient objects. Also removed the unhelpful PlatformGradient type. This pattern, all too common in our platform library, provides no useful abstraction here. Removed unneeded constructors from ColorStop. Updated for changes above. Added platform-specific functions createBrush, createPattern, and createCGGradient. Simplify encoding and decoding by taking advantage of the support for encoding/decoding variants. Remove the enum Gradient::Type entirely. Removed the invalidateHash function because it's only used in a few setters and setting the hash to 0 is a fine way to write it there. * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContextState::GraphicsContextState): Moved here from the header so we don't need to include Gradient.h in the header. (WebCore::GraphicsContextState::~GraphicsContextState): Ditto. (WebCore::GraphicsContextState::operator=): Ditto. * platform/graphics/GraphicsContext.h: Removed include of Gradient.h. Moved things out of the header to make that work. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::FillSource::FillSource): Use createPattern instead of createPlatformGradient. (WebCore::Cairo::StrokeSource::StrokeSource): Ditto. * platform/graphics/cairo/GradientCairo.cpp: (WebCore::Gradient::stopsChanged): Renamed from platformDestroy. (WebCore::interpolateColorStop): Rewrote to use existing blend functions. (WebCore::createConic): Changed return type to RefPtr. Tweaked to match WebKit coding style a bit better, use auto, use Vector::first/last, and updated for removal of the Gradient::ColorStop constructor. (WebCore::Gradient::createPattern): Renamed from createPlatformGradient. Changed to return a RefPtr instead of a raw pointer the caller needs to adopt at each call site. Refactored so it no longer uses Gradient::type. (WebCore::Gradient::fill): Use createPattern. * platform/graphics/cairo/GraphicsContextImplCairo.cpp: (WebCore::GraphicsContextImplCairo::fillRect): Ditto. * platform/graphics/cg/GradientCG.cpp: (WebCore::Gradient::stopsChanged): Renamed from platformDestroy, and simplified implementation now that we use RetainPtr. (WebCore::Gradient::createCGGradient): Renamed from platformGradient, got rid of the return value, and made it caller responsibility to only call this when a gradeitn needs to be allocated. (WebCore::Gradient::paint): Updated to use the above. * platform/graphics/cg/GraphicsContextCG.cpp: Add include of Gradient.h. * platform/graphics/displaylists/DisplayListItems.h: Added include of Gradient.h since the function templates in this file encode and decode gradients. * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: (Nicosia::CairoOperationRecorder::fillRect): Use createPattern. * platform/graphics/win/Direct2DOperations.cpp: (WebCore::Direct2D::FillSource::FillSource): Use createBrush (WebCore::Direct2D::StrokeSource::StrokeSource): Ditto. * platform/graphics/win/GradientDirect2D.cpp: (WebCore::Gradient::stopsChanged): Renamed from platformDestroy and simplified implementation now that we use COMPtr. (WebCore::Gradient::platformGradient): Deleted. (WebCore::Gradient::createPlatformGradientIfNecessary): Deleted. (WebCore::Gradient::createBrush): Renamed from generateGradient and added a return value. Simplified now that we use COMPtr, optimized the code a bit, and added some FIXME about mistakes I noticed. (WebCore::Gradient::fill): Use createBrush and m_brush. * platform/graphics/win/GraphicsContextImplDirect2D.cpp: (WebCore::GraphicsContextImplDirect2D::fillRect): Use createBrush. * platform/mac/ScrollAnimatorMac.mm: Added include of Gradient.h. * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintProgressBar): Updated for changes to addColorStop. Also remove a lot of unnecessary conversion from float to double and back to float. * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::RenderSVGResourceGradient::addStops): Update to make and move a new color stop instead of copying it, modifying it in place, and then copying it again. * rendering/svg/RenderSVGResourceGradient.cpp: Removed include of Gradient.h. * svg/SVGGradientElement.cpp: (WebCore::SVGGradientElement::buildStops): Use std::clamp to convert the offsets into monotonically increasing ones in a more direct way, using variable names instead of comments to clarify what we are doing. 2020-07-12 Yusuke Suzuki Unreviewed, fix GTK debian builds Include in ExtendedColor.h since it uses std::invoke. * platform/graphics/ExtendedColor.h: 2020-07-11 Fujii Hironori [WinCairo] Conic gradients support https://bugs.webkit.org/show_bug.cgi?id=214216 Reviewed by Sam Weinig. * platform/graphics/cairo/GradientCairo.cpp: (WebCore::addConicSector): Replaced M_PI with piDouble of WTF. (WebCore::Gradient::createPlatformGradient): Don't use C++20 designated initializers. 2020-07-11 Sam Weinig Reduce surface area of the ExtendedColor class to a bare minimum https://bugs.webkit.org/show_bug.cgi?id=214204 Reviewed by Darin Adler. - Add helper function to Color to operate on the underlying color type and reimplement a bunch of functionality using it, reducing the need for duplicate implementations in ExtendedColor. - Add constructors to Color that take extended color types, replacing the makeExtendedColor helper function. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Remove ExtenedColor.cpp * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters): Use new Color constructor taking ColorComponents and ColorSpace. * platform/graphics/Color.cpp: (WebCore::Color::colorWithAlpha const): Reimpliment using callOnUnderlyingType. (WebCore::Color::invertedColorWithAlpha const): Reimpliment using callOnUnderlyingType. * platform/graphics/Color.h: (WebCore::Color::Color): (WebCore::Color::hash const): (WebCore::Color::callOnUnderlyingType const): (WebCore::Color::toSRGBALossy const): (WebCore::Color::setColor): (WebCore::Color::isBlackColor): (WebCore::Color::isWhiteColor): - Add new constructors taking extended color types: SRGBA, LinearSRGBA and DiplayP3. - Add new function, callOnUnderlyingType, to make working with any underlying type more streamlined. * platform/graphics/ColorConversion.h: (WebCore::toSRGBA): (WebCore::toLinearSRGBA): (WebCore::toDisplayP3): (WebCore::toLinearDisplayP3): (WebCore::toHSLA): Add identity conversion functions to make implementing generic functions like Color::toSRGBALossy more straigtforward. * platform/graphics/ColorSerialization.cpp: (WebCore::serialization): (WebCore::serializationForCSS): (WebCore::serializationForHTML): (WebCore::serializationForRenderTreeAsText): * platform/graphics/ColorSerialization.h: Replace serialization of the ExtendedColor type itself, with serialization for the underlying color types. Use callOnUnderlyingType to dispatch to the right one. * platform/graphics/ColorTypes.h: - Adds ComponentTraits struct to get information like min/max value of the component types. - Adds `using ComponentType = T;` to each color type, to allow easy access to the type in deduced contexts. - Adds static constexpr ColorSpace to each color type that currently has a ColorSpace mapping. * platform/graphics/ColorUtilities.h: (WebCore::isBlack): (WebCore::isWhite): Add helpers to implement Color::isBlack/Color::isWhiteColor for each color type. * platform/graphics/ExtendedColor.cpp: Removed. * platform/graphics/ExtendedColor.h: (WebCore::ExtendedColor::create): (WebCore::ExtendedColor::ExtendedColor): (WebCore::ExtendedColor::callOnUnderlyingType const): (WebCore::ExtendedColor::toSRGBALossy const): Deleted. Reduce down to just construction, member access and the callOnUnderlyingType helper. In future revisions, ExtendedColor should be converted to an internal class of Color. * platform/graphics/gtk/ColorGtk.cpp: (WebCore::Color::Color): * platform/graphics/win/ColorDirect2D.cpp: (WebCore::Color::Color): Update to use constructor delegation. 2020-07-11 Darin Adler Remove live ranges from AccessibilityObject.h, AccessibilityObjectInterface.h, AccessibilityRenderObject.h, AXIsolatedObject.h https://bugs.webkit.org/show_bug.cgi?id=214215 Reviewed by Sam Weinig. Also use the IntPoint and LayoutPoint center() functions instead of rolling our own. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::misspellingRange const): Return SimpleRange. Also renamed from getMisspellingRange. (WebCore::rangeClosestToRange): Take and return SimpleRange. (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): Ditto. (WebCore::AccessibilityObject::elementRange const): Return SimpleRange. (WebCore::AccessibilityObject::findTextRange const): Take and return SimpleRange. (WebCore::AccessibilityObject::findTextRanges const): Ditto. (WebCore::AccessibilityObject::performTextOperation): Use SimpleRange. (WebCore::AccessibilityObject::clickPoint): Use center(). (WebCore::AccessibilityObject::rangeForPlainTextRange const): Return SimpleRange. (WebCore::AccessibilityObject::stringForRange const): Take SimpleRange. (WebCore::AccessibilityObject::stringForVisiblePositionRange): Use SimpleRange. (WebCore::AccessibilityObject::lengthForVisiblePositionRange const): Ditto. (WebCore::AccessibilityObject::replaceTextInRange): Use SimpleRange. * accessibility/AccessibilityObject.h: Update for above. * accessibility/AccessibilityObjectInterface.h: Take and return SimpleRange. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::linkClickPoint): Use SimpleRange. (WebCore::AccessibilityRenderObject::clickPoint): Ditto. (WebCore::AccessibilityRenderObject::setSelectedTextRange): Ditto. (WebCore::AccessibilityRenderObject::boundsForRange const): Take SimpleRange. (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange const): Use SimpleRange. (WebCore::AccessibilityRenderObject::doAXBoundsForRangeUsingCharacterOffset const): Use SimpleRange. * accessibility/AccessibilityRenderObject.h: Update for above. * accessibility/atk/WebKitAccessibleInterfaceText.cpp: Include Range.h. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper stringForTextMarkers:]): Use SimpleRange. (-[WebAccessibilityObjectWrapper textMarkerRange]): Ditto. (-[WebAccessibilityObjectWrapper stringForRange:]): Ditto. (-[WebAccessibilityObjectWrapper misspellingTextMarkerRange:forward:]): Ditto. (-[WebAccessibilityObjectWrapper frameForTextMarkers:]): Ditto. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::stringForRange const): Take SimpleRange. (WebCore::AXIsolatedObject::findTextRanges const): Return SimpleRange. * accessibility/isolatedtree/AXIsolatedObject.h: Update for above. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (accessibilityTextOperationForParameterizedAttribute): Use SimpleRange. (-[WebAccessibilityObjectWrapper doAXAttributedStringForRange:]): Ditto. (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): Ditto. * dom/Range.cpp: (WebCore::makeSimpleRange): Added. * dom/Range.h: Added makeSimpleRange so we can explicitly convert from live ranges to simple ranges. * editing/Editing.cpp: (WebCore::indexForVisiblePosition): Use separate returns for start and end. * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingParagraph::offsetTo const): Ditto. (WebCore::TextCheckingParagraph::automaticReplacementStart const): Ditto. * page/FocusController.cpp: (WebCore::updateFocusCandidateIfNeeded): Use center(). 2020-07-11 Simon Fraser REGRESSION(r260276): Overflow scrolling layers misplaced inside SVG foreign object https://bugs.webkit.org/show_bug.cgi?id=213788 Reviewed by Zalan Bujtas. RenderLayers inside SVG don't display correctly, so don't use accelerated overflow scroll (which requires layers) inside . This reverts behavior to macOS Catalina behavior (i.e. as soon as the overflow becomes scrollable, rendering problems appear), and to pre-iOS 13 behavior. Test: fast/scrolling/overflow-inside-foreignobject.html * dom/Document.h: (WebCore::Document::mayHaveRenderedSVGForeignObjects const): (WebCore::Document::setMayHaveRenderedSVGForeignObjects): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::RenderLayer): (WebCore::RenderLayer::addChild): (WebCore::RenderLayer::updateAncestorDependentState): (WebCore::RenderLayer::canUseCompositedScrolling const): * rendering/RenderLayer.h: * rendering/svg/RenderSVGForeignObject.h: * svg/SVGForeignObjectElement.cpp: (WebCore::SVGForeignObjectElement::createElementRenderer): 2020-07-11 Zalan Bujtas [LFC][BFC][Min-Max width] Add support for float avoiders https://bugs.webkit.org/show_bug.cgi?id=214220 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/min-max-content-width-with-floats-simple.html Float avoiders (including the float boxes) with infinite constraint form a horizontal float stack. (This does not yet support clear property/non-direct children.) * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computedIntrinsicWidthConstraints): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): 2020-07-10 Chris Dumez Unreviewed, reverting r264242. Caused many crashes on iOS bots Reverted changeset: "JSRunLoopTimer should use WTF::RunLoop rather than custom CF code" https://bugs.webkit.org/show_bug.cgi?id=214102 https://trac.webkit.org/changeset/264242 2020-07-10 Brady Eidson Cleanup GameController framework button binding with some constants https://bugs.webkit.org/show_bug.cgi?id=214210 Reviewed by Darin Adler. No new tests (No behavior change) * platform/gamepad/cocoa/GameControllerGamepad.mm: (WebCore::GameControllerGamepad::setupAsExtendedGamepad): Use named constants instead of magic numbers. 2020-07-10 Darin Adler Fix build for PLATFORM(IOS_FAMILY) && !ENABLE(REVEAL), for example, tvOS * editing/cocoa/DictionaryLookup.mm: Added include of "SimpleRange.h". 2020-07-10 Darin Adler Fix build for PLATFORM(IOS_FAMILY) && !ENABLE(REVEAL), for example, tvOS * editing/cocoa/DictionaryLookup.mm: (WebCore::DictionaryLookup::rangeForSelection): Update to return SimpleRange. (WebCore::DictionaryLookup::rangeAtHitTestResult): Ditto. 2020-07-08 Darin Adler Remove live ranges from Document.h, AlternativeTextController.h, DictionaryLookup.h, and WebPage.h https://bugs.webkit.org/show_bug.cgi?id=214109 Reviewed by Sam Weinig. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::characterOffsetForPoint): Updated to call caretPositionFromPoint, internal function, instead of caretRangeFromPoint, public DOM function. * dom/Document.cpp: (WebCore::Document::Document): Changed documentClasses argument to DocumentClassFlags. (WebCore::Document::caretRangeFromPoint): Refactored so this calls createLiveRange, since it's a DOM function that returns a live range. (WebCore::Document::caretPositionFromPoint): Renamed so this is not just an overload and changed to return a BoundaryPoint rather than a live range. * dom/Document.h: Simplified forward declarations by getting rid of all the conditionals. Tweaked a few typedef things. Updated for the changes above. * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::startAlternativeTextUITimer): Updated since m_rangeWithAlternative is an Optional. (WebCore::AlternativeTextController::stopAlternativeTextUITimer): Ditto. (WebCore::AlternativeTextController::applyPendingCorrection): Ditto. (WebCore::AlternativeTextController::hasPendingCorrection const): Ditto. (WebCore::AlternativeTextController::isSpellingMarkerAllowed const): Take SimpleRange. (WebCore::AlternativeTextController::show): Ditto. (WebCore::AlternativeTextController::applyAutocorrectionBeforeTypingIfAppropriate): Updated since m_rangeWithAlternative is an Optional. (WebCore::AlternativeTextController::timerFired): Ditto. (WebCore::AlternativeTextController::handleAlternativeTextUIResult): Ditto. (WebCore::AlternativeTextController::markReversed): Take SimpleRange. (WebCore::AlternativeTextController::markCorrection): Ditto. (WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection): Ditto. (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult): Ditto. (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord): Use SimpleRange instead of a live range. (WebCore::AlternativeTextController::applyAlternativeTextToRange): Take SimpleRange. * editing/AlternativeTextController.h: Use SimpleRange instead of live ranges. * editing/cocoa/DictionaryLookup.mm: (WebCore::DictionaryLookup::rangeForSelection): Return SimpleRange. (WebCore::DictionaryLookup::rangeAtHitTestResult): Ditto. (WebCore::showPopupOrCreateAnimationController): Renamed type from RevealView to CocoaView. (WebCore::DictionaryLookup::showPopup): Ditto. * editing/mac/DictionaryLookup.h: Simplified header since it is included only from Objective-C files. Use SimpleRange instead of live ranges. * editing/mac/DictionaryLookupLegacy.mm: (WebCore::DictionaryLookup::rangeForSelection): Return SimpleRange. (WebCore::DictionaryLookup::rangeAtHitTestResult): Ditto. * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup): Updated since DictionaryLookup::rangeAtHitTestResult returns SimpleRange. (WebCore::autoscrollAdjustmentFactorForScreenBoundaries): Use constexpr instead of macros for constants. * testing/Internals.mm: (WebCore::Internals::rangeForDictionaryLookupAtLocation): Updated since DictionaryLookup::rangeAtHitTestResult returns SimpleRange. (WebCore::Internals::encodedPreferenceValue): Removed unneeded error local, and fixed formatting. 2020-07-10 Brady Eidson GameController.framework gamepads should support Home buttons. and https://bugs.webkit.org/show_bug.cgi?id=212933 Reviewed by Tim Horton. No new tests (Cannot yet drive GameController framework directly in tests) * platform/gamepad/cocoa/GameControllerGamepad.mm: (WebCore::homeButtonFromExtendedGamepad): Try a few different techniques of extracting the home button from a GCExtendedGamepad. (WebCore::GameControllerGamepad::setupAsExtendedGamepad): If there's a home button, put it at button index 16, defined by the spec as "Center button in center cluster" * platform/gamepad/cocoa/GameControllerSoftLink.h: * platform/gamepad/cocoa/GameControllerSoftLink.mm: 2020-07-10 Chris Fleizach AX: Build failure for catalyst https://bugs.webkit.org/show_bug.cgi?id=214202 Reviewed by Zalan Bujtas. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityIsInDescriptionListTerm]): (-[WebAccessibilityObjectWrapper accessibilityIsInDescriptionListDefinition]): 2020-07-10 Geoffrey Garen JSRunLoopTimer should use WTF::RunLoop rather than custom CF code https://bugs.webkit.org/show_bug.cgi?id=214102 Reviewed by Darin Adler. * bindings/js/CommonVM.cpp: (WebCore::commonVMSlow): Supply a RunLoop at construction time since JSC requires that now. 2020-07-10 Guowei Yang Removing usage of "using namespace WebCore" from TextTrackRepresentationCocoa.mm https://bugs.webkit.org/show_bug.cgi?id=214196 Reviewed by Tim Horton. The line "using namespace WebCore" will cause problems when compiling unified source. Removing this line and replace it with WebCore::prefix and namespace WebCore{ } to enclose C++ calls. No new tests are requied as this is a code style fix * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm: removed usage of "using namespace WebCore" to avoid future errors while compiling (-[WebCoreTextTrackRepresentationCocoaHelper initWithParent:]): added "WebCore::" prefix (-[WebCoreTextTrackRepresentationCocoaHelper setParent:]): ditto (-[WebCoreTextTrackRepresentationCocoaHelper parent]): ditto (TextTrackRepresentation::create): enclosed inside namespace WebCore{ } (TextTrackRepresentationCocoa::TextTrackRepresentationCocoa): Deleted. enclosed inside namespace WebCore{ } (TextTrackRepresentationCocoa::~TextTrackRepresentationCocoa): ditto (TextTrackRepresentationCocoa::update): ditto (TextTrackRepresentationCocoa::setContentScale): ditto (TextTrackRepresentationCocoa::setHidden const): ditto (TextTrackRepresentationCocoa::bounds const): ditto (TextTrackRepresentationCocoa::boundsChanged): ditto 2020-07-10 Peng Liu MobileSafari rotates its scene to portrait upside down if it has a PiP on screen https://bugs.webkit.org/show_bug.cgi?id=214169 Reviewed by Jer Noble. The UIViewController for video fullscreen/picture-in-picture should not ignore the App's supported orientations when the video element is in picture-in-picture. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::doSetup): 2020-07-10 Don Olmstead and Fujii Hironori [WinCairo] WOFF2 font support https://bugs.webkit.org/show_bug.cgi?id=214174 Reviewed by Per Arne Vollan. * PlatformWinCairo.cmake: Added additional libraries for static WOFF2 library to WebCore_LIBRARIES. * platform/graphics/win/FontCustomPlatformDataCairo.cpp: (WebCore::FontCustomPlatformData::supportsFormat): Added woff2. 2020-07-10 Chris Fleizach AX: iOS VoiceOver should support definition lists https://bugs.webkit.org/show_bug.cgi?id=210214 Reviewed by Darin Adler. Expose bits to make definition lists accessibility on iOS. Test: accessibility/ios-simulator/definition-list.html * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper _accessibilityDescriptionListAncestor]): (-[WebAccessibilityObjectWrapper accessibilityIsInDescriptionListTerm]): (-[WebAccessibilityObjectWrapper accessibilityIsInDescriptionListDefinition]): 2020-07-10 Brady Eidson Limit MultiGamepadProvider to Catalina and Big Sur. https://bugs.webkit.org/show_bug.cgi?id=214190 Unreviewed build fix. * platform/gamepad/cocoa/GameControllerSPI.h: * platform/gamepad/cocoa/GameControllerSoftLink.h: * platform/gamepad/cocoa/GameControllerSoftLink.mm: * platform/gamepad/mac/HIDGamepadProvider.mm: (WebCore::HIDGamepadProvider::deviceAdded): * platform/gamepad/mac/MultiGamepadProvider.h: * platform/gamepad/mac/MultiGamepadProvider.mm: 2020-07-10 Sam Weinig Part 4 of SimpleColor and SRGBA are essentially the same - let's converge them https://bugs.webkit.org/show_bug.cgi?id=214158 Reviewed by Darin Adler. Removes SimpleColor! Alas, makeSimpleColor() remains for now, seeking a new name in a follow up. * platform/graphics/SimpleColor.h: (WebCore::SimpleColor::SimpleColor): Deleted. (WebCore::SimpleColor::alphaComponent const): Deleted. (WebCore::SimpleColor::alphaComponentAsFloat const): Deleted. (WebCore::SimpleColor::isOpaque const): Deleted. (WebCore::SimpleColor::isVisible const): Deleted. (WebCore::SimpleColor::colorWithAlpha const): Deleted. (WebCore::SimpleColor::invertedColorWithAlpha const): Deleted. (WebCore::SimpleColor::asSRGBA const): Deleted. (WebCore::SimpleColor::get const): Deleted. (): Deleted. (WebCore::operator==): Deleted. (WebCore::operator!=): Deleted. Remove the SimpleColor class. * platform/graphics/Color.cpp: (WebCore::Color::operator=): (WebCore::Color::lightened const): (WebCore::Color::darkened const): (WebCore::Color::colorWithAlpha const): (WebCore::Color::invertedColorWithAlpha const): (WebCore::Color::colorSpaceAndComponents const): * platform/graphics/Color.h: (WebCore::Color::isHashTableDeletedValue const): (WebCore::Color::isValid const): (WebCore::Color::isSemantic const): (WebCore::Color::isOpaque const): (WebCore::Color::isVisible const): (WebCore::Color::alpha const): (WebCore::Color::alphaAsFloat const): (WebCore::Color::isExtended const): (WebCore::Color::isInline const): (WebCore::Color::tagAsSemantic): (WebCore::Color::tagAsValid): (WebCore::operator==): (WebCore::equalIgnoringSemanticColor): (WebCore::Color::Color): (WebCore::Color::~Color): (WebCore::Color::hash const): (WebCore::Color::toSRGBALossy const): (WebCore::Color::asInline const): (WebCore::Color::setInlineColor): (WebCore::Color::setExtendedColor): (WebCore::Color::isBlackColor): (WebCore::Color::isWhiteColor): (WebCore::Color::encode const): (WebCore::Color::isSimple const): Deleted. (WebCore::Color::asSimple const): Deleted. (WebCore::Color::setSimpleColor): Deleted. - Rename existing uses of Simple with Inline, denoting the inline SRGBA. - Move multiline functions out of line in the header. - Adds new constructor functions taking Optional> to make Color(CGColorRef) constructors more straightforward. - Replaces uses of SimpleColor's interface with use of ColorUtilities.h helpers. e.g. Color::invertedColorWithAlpha() now uses the new invertedColorWithOverridenAlpha() helper function. Use of these utilities will be expanded to ExtendedColor in a follow up, allowing us to have just one implementation of these algorithms. * platform/graphics/ColorSerialization.cpp: (WebCore::serializationForCSS): (WebCore::serializationForHTML): (WebCore::serializationForRenderTreeAsText): * platform/graphics/ColorSerialization.h: Replace serialization of SimpleColor with serialization of SRGBA. * platform/graphics/ColorTypes.h: (WebCore::forEachNonAlphaComponent): Deleted. Removed forEachNonAlphaComponent. Uses replaced by new colorByModifingEachNonAlphaComponent function in ColorUtilities.h * platform/graphics/ColorUtilities.h: (WebCore::colorByModifingEachNonAlphaComponent): (WebCore::convertComponentByteTo): (WebCore::convertComponentByteTo): (WebCore::convertComponentFloatTo): (WebCore::convertComponentFloatTo): (WebCore::colorWithOverridenAlpha): (WebCore::invertComponent): (WebCore::invertedColorWithOverridenAlpha): Added heplers to implement color mutation behaviors. * platform/graphics/cg/ColorCG.cpp: (WebCore::makeSimpleColorFromCGColor): (WebCore::Color::Color): (WebCore::cachedCGColor): Switch makeSimpleColorFromCGColor to return an Optional> to streamline the constructors. Update to use is/asInline functions. * platform/graphics/mac/ColorMac.mm: (WebCore::nsColor): Update to use is/asInline functions. * platform/graphics/filters/FilterOperation.cpp: (WebCore::BasicComponentTransferFilterOperation::transformColor const): Switch to using colorByModifingEachNonAlphaComponent(). 2020-07-10 Philippe Normand [GStreamer] Unreviewed, prospective API test bot fix... * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::setVolume): I suppose changing the audio volume to 0 wasn't intended :) 2020-07-10 Philippe Normand Unreviewed, remove debug printf after r264219. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): 2020-07-10 Zalan Bujtas [LFC][Floats] Normal flow element that establishes a new block formatting context must not overlap the margin box of any floats https://bugs.webkit.org/show_bug.cgi?id=214185 Reviewed by Antti Koivisto. BFCs in general should avoid floats. This code was confusing the cases where the block container box (not necessarily a BFC) establishes an IFC.
The div establishes an IFC only. It should not avoid floats.
The div establishes both a new BFC and an IFC. It should avoid floats.
Test: fast/layoutformattingcontext/float-avoider-with-inline-content.html * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::isFloatAvoider const): 2020-07-10 Xabier Rodriguez Calvar [GStreamer][EME][OpenCDM] Implement OpenCDM support https://bugs.webkit.org/show_bug.cgi?id=213550 Reviewed by Philippe Normand. Implemented the OpenCDM support in the CDMOpenCDM and CDMProxyOpenCDM related classes. CDMOpenCDM classes check for Widevine support in OpenCDM and glues the JavaScript API to the OpenCDM/Thunder framework. Building this is optional and --opencdm parameter needs to be passed to build-webkit to get it. CDMProxy related needed changes because of several reasons. First is that Key was considering only a Vector as a type and OpenCDM has session objects. Key is also renamed to KeyHandle as this name reflects in a better way the purpose of the class. This bleeds out to all CDMProxy related classes. CDMInstanceSessionProxy gets support to remove itself from the CDMSessionProxy. Regarding ClearKey, we adapt the changes to the CDMProxy classes and de-cable protection system from the decryptors as the OpenCDM decryptor could handle more than one system. No new tests. YouTube TV 2019 tests are green. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * platform/GStreamer.cmake: * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::dataAsUInt8Ptr const): * platform/SharedBuffer.h: * platform/encryptedmedia/CDMInstance.h: * platform/encryptedmedia/CDMOpenCDMTypes.h: Copied from Source/WebCore/platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp. * platform/encryptedmedia/CDMProxy.cpp: (WebCore::KeyHandle::idAsString const): (WebCore::KeyHandle::takeValueIfDifferent): (WebCore::KeyStore::containsKeyID const): (WebCore::KeyStore::merge): (WebCore::KeyStore::allKeysAs const): (WebCore::KeyStore::addKeys): (WebCore::KeyStore::add): (WebCore::KeyStore::remove): (WebCore::KeyStore::keyHandle const): (WebCore::CDMProxy::keyHandle const): (WebCore::CDMProxy::tryWaitForKeyHandle const): (WebCore::CDMProxy::keyAvailableUnlocked const): (WebCore::CDMProxy::keyAvailable const): (WebCore::CDMProxy::getOrWaitForKeyHandle const): (WebCore::CDMProxy::getOrWaitForKeyValue const): (WebCore::CDMInstanceSessionProxy::CDMInstanceSessionProxy): (WebCore::CDMInstanceSessionProxy::removeFromInstanceProxy): * platform/encryptedmedia/CDMProxy.h: (WebCore::KeyHandle::create): (WebCore::KeyHandle::id const): (WebCore::KeyHandle::value const): (WebCore::KeyHandle::value): (WebCore::KeyHandle::isStatusCurrentlyValid): (WebCore::KeyHandle::operator==): (WebCore::KeyHandle::operator<): (WebCore::KeyHandle::KeyHandle): (WebCore::KeyStore::isEmpty const): (WebCore::CDMProxy::instance const): (WebCore::CDMInstanceSessionProxy::releaseDecryptionResources): (WebCore::CDMInstanceSessionProxy::cdmInstanceProxy const): (WebCore::CDMInstanceProxy::proxy const): (WebCore::CDMInstanceProxy::removeSession): * platform/encryptedmedia/CDMUtilities.cpp: Copied from Source/WebCore/platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp. (WebCore::CDMUtilities::parseJSONObject): * platform/encryptedmedia/CDMUtilities.h: Copied from Source/WebCore/platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp. * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::parseLicenseFormat): (WebCore::CDMPrivateClearKey::supportsInitData const): (WebCore::CDMPrivateClearKey::sanitizeResponse const): (WebCore::CDMInstanceSessionClearKey::updateLicense): (WebCore::CDMInstanceSessionClearKey::removeSessionData): (WebCore::CDMInstanceSessionClearKey::parentInstance const): * platform/encryptedmedia/clearkey/CDMClearKey.h: * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::isOpenCDMRanked): (WebCore::initializeGStreamerAndRegisterWebKitElements): (WebCore::GstMappedBuffer::createVector): * platform/graphics/gstreamer/GStreamerCommon.h: (WebCore::GstMappedBuffer::create): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): (WebCore::MediaPlayerPrivateGStreamer::waitForCDMAttachment): * platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp: (WebCore::CDMFactory::platformRegisterFactories): * platform/graphics/gstreamer/eme/CDMOpenCDM.cpp: Added. (openCDMLicenseType): (WebCore::initDataMD5): (WebCore::sessionLoadFailureFromOpenCDM): (WebCore::OpenCDM::destructOpenCDMSession): (WebCore::OpenCDM::createSharedOpenCDMSession): (WebCore::CDMFactoryOpenCDM::singleton): (WebCore::CDMFactoryOpenCDM::createCDM): (WebCore::CDMFactoryOpenCDM::createCDMProxy): (WebCore::CDMFactoryOpenCDM::supportedKeySystems const): (WebCore::CDMFactoryOpenCDM::supportsKeySystem): (WebCore::CDMPrivateOpenCDM::supportedInitDataTypes const): (WebCore::CDMPrivateOpenCDM::supportsConfiguration const): (WebCore::CDMPrivateOpenCDM::supportedRobustnesses const): (WebCore::CDMPrivateOpenCDM::distinctiveIdentifiersRequirement const): (WebCore::CDMPrivateOpenCDM::persistentStateRequirement const): (WebCore::CDMPrivateOpenCDM::distinctiveIdentifiersAreUniquePerOriginAndClearable const): (WebCore::CDMPrivateOpenCDM::createInstance): (WebCore::CDMPrivateOpenCDM::loadAndInitialize): (WebCore::CDMPrivateOpenCDM::supportsServerCertificates const): (WebCore::CDMPrivateOpenCDM::supportsSessions const): (WebCore::CDMPrivateOpenCDM::supportsInitData const): (WebCore::CDMPrivateOpenCDM::sanitizeResponse const): (WebCore::CDMPrivateOpenCDM::sanitizeSessionId const): (WebCore::CDMInstanceOpenCDM::CDMInstanceOpenCDM): (WebCore::CDMInstanceOpenCDM::initializeWithConfiguration): (WebCore::CDMInstanceOpenCDM::setServerCertificate): (WebCore::CDMInstanceOpenCDM::setStorageDirectory): (WebCore::CDMInstanceSessionOpenCDM::CDMInstanceSessionOpenCDM): (WebCore::CDMInstanceOpenCDM::createSession): (WebCore::ParsedResponseMessage::ParsedResponseMessage): (WebCore::ParsedResponseMessage::hasPayload const): (WebCore::ParsedResponseMessage::payload const): (WebCore::ParsedResponseMessage::payload): (WebCore::ParsedResponseMessage::hasType const): (WebCore::ParsedResponseMessage::type const): (WebCore::ParsedResponseMessage::typeOr const): (WebCore::CDMInstanceSessionOpenCDM::challengeGeneratedCallback): (WebCore::toString): (WebCore::CDMInstanceSessionOpenCDM::status const): (WebCore::CDMInstanceSessionOpenCDM::keyUpdatedCallback): (WebCore::CDMInstanceSessionOpenCDM::keysUpdateDoneCallback): (WebCore::CDMInstanceSessionOpenCDM::errorCallback): (WebCore::CDMInstanceSessionOpenCDM::requestLicense): (WebCore::CDMInstanceSessionOpenCDM::sessionFailure): (WebCore::CDMInstanceSessionOpenCDM::updateLicense): (WebCore::CDMInstanceSessionOpenCDM::loadSession): (WebCore::CDMInstanceSessionOpenCDM::closeSession): (WebCore::CDMInstanceSessionOpenCDM::removeSessionData): (WebCore::CDMInstanceSessionOpenCDM::storeRecordOfKeyUsage): (WebCore:: const): * platform/graphics/gstreamer/eme/CDMOpenCDM.h: Added. (WebCore::OpenCDM::OpenCDMSystemDeleter::operator() const): (WebCore::OpenCDM::OpenCDMSessionDeleter::operator() const): * platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp: (WebCore::CDMProxyClearKey::cencSetDecryptionKey): * platform/graphics/gstreamer/eme/CDMProxyOpenCDM.cpp: Added. (WebCore::CDMProxyOpenCDM::getDecryptionSession const): (WebCore::CDMProxyOpenCDM::decrypt): * platform/graphics/gstreamer/eme/CDMProxyOpenCDM.h: Copied from Source/WebCore/platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp. * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h: (WebCore::InitData::InitData): (WebCore::InitData::payload const): (WebCore::GStreamerEMEUtilities::isWidevineKeySystem): (WebCore::GStreamerEMEUtilities::keySystemToUuid): * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: (webkit_media_clear_key_decrypt_class_init): (protectionSystemId): * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (transformCaps): (transformInPlace): * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h: * platform/graphics/gstreamer/eme/WebKitOpenCDMDecryptorGStreamer.cpp: Added. (webkit_media_opencdm_decrypt_class_init): (webkit_media_opencdm_decrypt_init): (finalize): (protectionSystemId): (cdmProxyAttached): (decrypt): * platform/graphics/gstreamer/eme/WebKitOpenCDMDecryptorGStreamer.h: Added. 2020-07-10 Zalan Bujtas [LFC][TreeConstruction] Create block level container for unsupported renderer https://bugs.webkit.org/show_bug.cgi?id=214182 Reviewed by Antti Koivisto. It makes full LFC rendering on random pages less crashy. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createLayoutBox): 2020-07-02 Sergio Villar Senin [WebXR] Retrieve WebGL framebuffer resolution from XR devices https://bugs.webkit.org/show_bug.cgi?id=213886 Reviewed by Carlos Garcia Campos. The recommended WebGL framebuffer resolution should be retrieved from the actual XR device being used. Implemented the OpenXR machinery to retrieve it from the XR system. We are also moving the methods that call the platform code to the XRSession as specs define, instead of having them inside the XRWebGLLayer. Finally this patch is also removing a unused definition in OpenXR plaform code and properly initializing a OpenXR struct. The missing initialization was the source of errors when querying api layer properties. The patch is also properly setting the SessionMode::Inline when XR_VIEW_CONFIGURATION_TYPE_PRIMARY_MONO is found. It used to set SessionMode::ImmersiveAr instead, but that's wrong, we should only care about ImmersiveAr session mode once the WebXR AR module is implemented. * Modules/webxr/WebXRRenderState.cpp: (WebCore::WebXRRenderState::outputCanvas const): Return render state's canvas. * Modules/webxr/WebXRRenderState.h: Added a m_outputCanvas member with its getter. * Modules/webxr/WebXRSession.cpp: (WebCore::WebXRSession::nativeWebGLFramebufferResolution const): Moved from WebXRWebGLLayer and reimplemented. (WebCore::WebXRSession::recommendedWebGLFramebufferResolution const): Ditto. * Modules/webxr/WebXRSession.h: * Modules/webxr/WebXRWebGLLayer.cpp: (WebCore::WebXRWebGLLayer::WebXRWebGLLayer): (WebCore::WebXRWebGLLayer::getNativeFramebufferScaleFactor): Call the session to get native and recommended resolutions. (WebCore::WebXRWebGLLayer::computeNativeWebGLFramebufferResolution): Deleted. (WebCore::WebXRWebGLLayer::computeRecommendedWebGLFramebufferResolution): Ditto. * platform/xr/PlatformXR.h: (PlatformXR::Device::recommendedResolution): New virtual method with default implementation. * platform/xr/openxr/PlatformXROpenXR.cpp: (PlatformXR::Instance::Impl::enumerateApiLayerProperties const): Added initialization of the XrApiLayerProperties objects. The call to xrEnumerateApiLayerProperties succeeds now. (PlatformXR::OpenXRDevice::OpenXRDevice): Call enumerateConfigurationViews(). (PlatformXR::OpenXRDevice::collectSupportedSessionModes): Fill in the m_viewConfigurationProperties map. (PlatformXR::OpenXRDevice::enumerateConfigurationViews): New method that retrieves the XR device views for each supported configuration. (PlatformXR::OpenXRDevice::recommendedResolution): Return the recommended resolution for a given SessionMode. * platform/xr/openxr/PlatformXROpenXR.h: Added some new methods and attributes. 2020-07-10 Zalan Bujtas [LFC][MarginCollapsing] Margins do not collapse through when the box has clearance. https://bugs.webkit.org/show_bug.cgi?id=214172 Reviewed by Antti Koivisto. https://www.w3.org/TR/CSS22/box.html#collapsing-margins "Two margins are adjoining if and only if: no line boxes, no clearance, no padding and no border separate them" Only adjoining margins can collapse through. Test: fast/layoutformattingcontext/empty-block-level-box-with-clearance.html * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const): 2020-07-10 Jan-Michael Brummer [GTK][WPE] Use mobile user-agent on tablet https://bugs.webkit.org/show_bug.cgi?id=149496 Reviewed by Carlos Garcia Campos. * platform/UserAgentQuirks.cpp: (WebCore::urlRequiresMacintoshPlatform): (WebCore::urlRequiresLinuxDesktopPlatform): (WebCore::UserAgentQuirks::quirksForURL): * platform/UserAgentQuirks.h: * platform/glib/UserAgentGLib.cpp: (WebCore::getChassisType): (WebCore::platformForUAString): (WebCore::platformVersionForUAString): (WebCore::buildUserAgentString): (WebCore::standardUserAgent): (WebCore::standardUserAgentForURL): 2020-07-10 Alicia Boya García [MSE][GStreamer] Inline MediaSourceClientGStreamerMSE away https://bugs.webkit.org/show_bug.cgi?id=214140 Reviewed by Xabier Rodriguez-Calvar. MediaSourceClientGStreamerMSE is a superfluous class that adds a layer of indirection and complexity to the GStreamer MSE codebase for no gain. This patch gets rid of it. This also gets rid of the friend access layer violations that MediaSourceClientGStreamerMSE relied upon. This patch is a refactor that doesn't introduce behavior changes and it's covered by existing tests. * platform/GStreamer.cmake: * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::AppendPipeline): * platform/graphics/gstreamer/mse/AppendPipeline.h: * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged): (WebCore::MediaPlayerPrivateGStreamerMSE::setMediaSourceClient): Deleted. (WebCore::MediaPlayerPrivateGStreamerMSE::mediaSourceClient): Deleted. * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: (WebCore::MediaPlayerPrivateGStreamerMSE::playbackPipeline const): * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp: Removed. * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h: Removed. * platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp: (WebCore::MediaSourcePrivateGStreamer::MediaSourcePrivateGStreamer): (WebCore::MediaSourcePrivateGStreamer::addSourceBuffer): (WebCore::MediaSourcePrivateGStreamer::durationChanged): (WebCore::MediaSourcePrivateGStreamer::markEndOfStream): * platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h: * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::create): (WebCore::SourceBufferPrivateGStreamer::SourceBufferPrivateGStreamer): (WebCore::SourceBufferPrivateGStreamer::finishCreation): (WebCore::SourceBufferPrivateGStreamer::append): (WebCore::SourceBufferPrivateGStreamer::abort): (WebCore::SourceBufferPrivateGStreamer::resetParserState): (WebCore::SourceBufferPrivateGStreamer::removedFromMediaSource): (WebCore::SourceBufferPrivateGStreamer::flush): (WebCore::SourceBufferPrivateGStreamer::enqueueSample): (WebCore::SourceBufferPrivateGStreamer::allSamplesInTrackEnqueued): * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: 2020-07-09 Brady Eidson Multiplex the HID and GameController gamepad providers on Mac. and https://bugs.webkit.org/show_bug.cgi?id=214126 Reviewed by Tim Horton. Mac has already supported both the HID provider and GameController provider. By adding an intermediate provider to multiplex both and tweaking a few other things, it can support both at the same time. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/gamepad/PlatformGamepad.h: (WebCore::PlatformGamepad::lastUpdateTime const): (WebCore::PlatformGamepad::source const): * platform/gamepad/cocoa/GameControllerGamepad.h: * platform/gamepad/cocoa/GameControllerGamepadProvider.h: * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::controllerDidConnect): (WebCore::GameControllerGamepadProvider::gamepadHadInput): (WebCore::GameControllerGamepadProvider::makeInvisibleGamepadsVisible): (WebCore::GameControllerGamepadProvider::inputNotificationTimerFired): (WebCore::GameControllerGamepadProvider::makeInvisibileGamepadsVisible): Deleted. * platform/gamepad/cocoa/GameControllerSPI.h: * platform/gamepad/cocoa/GameControllerSoftLink.h: * platform/gamepad/cocoa/GameControllerSoftLink.mm: * platform/gamepad/mac/HIDGamepad.h: * platform/gamepad/mac/HIDGamepadProvider.h: (WebCore::HIDGamepadProvider::ignoreGameControllerFrameworkDevices): * platform/gamepad/mac/HIDGamepadProvider.mm: Renamed from Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.cpp. (WebCore::deviceMatchingDictionary): (WebCore::deviceAddedCallback): (WebCore::deviceRemovedCallback): (WebCore::deviceValuesChangedCallback): (WebCore::HIDGamepadProvider::singleton): (WebCore::HIDGamepadProvider::HIDGamepadProvider): (WebCore::HIDGamepadProvider::stopMonitoringInput): (WebCore::HIDGamepadProvider::startMonitoringInput): (WebCore::HIDGamepadProvider::indexForNewlyConnectedDevice): (WebCore::HIDGamepadProvider::initialGamepadsConnectedTimerFired): (WebCore::HIDGamepadProvider::openAndScheduleManager): (WebCore::HIDGamepadProvider::closeAndUnscheduleManager): (WebCore::HIDGamepadProvider::startMonitoringGamepads): (WebCore::HIDGamepadProvider::stopMonitoringGamepads): (WebCore::gameControllerFrameworkWillHandleHIDDevice): (WebCore::HIDGamepadProvider::deviceAdded): (WebCore::HIDGamepadProvider::deviceRemoved): (WebCore::HIDGamepadProvider::valuesChanged): (WebCore::HIDGamepadProvider::inputNotificationTimerFired): (WebCore::HIDGamepadProvider::removeGamepadForDevice): * platform/gamepad/mac/MultiGamepadProvider.h: Added. (WebCore::MultiGamepadProvider::isMockGamepadProvider const): (WebCore::MultiGamepadProvider::PlatformGamepadWrapper::PlatformGamepadWrapper): * platform/gamepad/mac/MultiGamepadProvider.mm: Added. (WebCore::MultiGamepadProvider::singleton): (WebCore::MultiGamepadProvider::startMonitoringGamepads): (WebCore::MultiGamepadProvider::stopMonitoringGamepads): (WebCore::MultiGamepadProvider::indexForNewlyConnectedDevice): (WebCore::MultiGamepadProvider::platformGamepadConnected): (WebCore::MultiGamepadProvider::platformGamepadDisconnected): (WebCore::MultiGamepadProvider::platformGamepadInputActivity): 2020-07-09 Tim Horton "ESPN Fantasy Sports" does not respond to mouse events, only touch events https://bugs.webkit.org/show_bug.cgi?id=214165 Reviewed by Wenson Hsieh. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isESPNFantasySports): 2020-07-09 Simon Fraser [macOS] Stuttery scrolling on tesla.com https://bugs.webkit.org/show_bug.cgi?id=214159 Reviewed by Wenson Hsieh. tesla.com uses scroll snapping, and also triggers layout during scrolling that could cause scroll snap to yank the scroll position. This manifested as a change that affected getBoundingClientRect which is used an an input to some transform math, causing the images to move around. Fix by ensuring that layout-triggered scroll snap does not happen if a user scroll is in progress, when that scroll occurs via the scrolling thread. ScrollingTreeScrollingNodeDelegateMac has a ScrollController that tracks when a gesture is in progress; push this state to the ScrollingTree so it can be consulted from the main thread. The two subclasses of ScrollableArea, RenderLayer and FrameView, then consult the ScrollingCoordinator to ask whether a user scroll is in progress for their scrolling tree node. Test: fast/scrolling/mac/adjust-scroll-snap-during-gesture.html * page/FrameView.cpp: (WebCore::FrameView::isUserScrollInProgress const): * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::isUserScrollInProgress const): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::isUserScrollInProgress const): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::handleWheelEvent): (WebCore::ScrollingTree::isUserScrollInProgressForNode): (WebCore::ScrollingTree::setUserScrollInProgressForNode): (WebCore::ScrollingTree::clearNodesWithUserScrollInProgress): * page/scrolling/ScrollingTree.h: * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::isUserScrollProgress const): (WebCore::ScrollingTreeScrollingNode::setUserScrollInProgress): (WebCore::ScrollingTreeScrollingNode::setScrollSnapInProgress): * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::isUserScrollInProgress const): 2020-07-09 Chris Dumez [Bindings] Add default value support for union types in dictionary members https://bugs.webkit.org/show_bug.cgi?id=214160 Reviewed by Sam Weinig. Add default value support for union types in dictionary members. This is needed for the WebAudio specification: - https://www.w3.org/TR/webaudio/#AudioContextOptions """ (AudioContextLatencyCategory or double) latencyHint = "interactive"; """ * bindings/scripts/CodeGeneratorJS.pm: (GenerateDefaultValue): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion1Body): * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp: (WebCore::convertDictionary): (WebCore::convertDictionaryToJS): * bindings/scripts/test/TestStandaloneDictionary.idl: 2020-07-09 Per Arne Vollan Move XPCEndpoint and XPCEndpointClient classes from WebCore to WebKit https://bugs.webkit.org/show_bug.cgi?id=214099 Reviewed by Alex Christensen. These classes should not be in WebCore, but in WebKit, since they are only expected to be used there. No new tests, since this patch is only moving source files. * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/XPCEndpoint.h: Removed. * platform/cocoa/XPCEndpoint.mm: Removed. * platform/cocoa/XPCEndpointClient.h: Removed. * platform/cocoa/XPCEndpointClient.mm: Removed. 2020-07-09 Simon Fraser After a scroll gesture, content changes don't trigger re-snapping with scroll snap https://bugs.webkit.org/show_bug.cgi?id=214123 Reviewed by Wenson Hsieh. ScrollController::m_inScrollGesture could get stuck as true after a scroll gesture, because ScrollAnimatorMac::handleWheelEvent() didn't reliably call m_scrollController.handleWheelEvent() for the event event based on the hokey shouldForwardWheelEventsToParent() code. Fix by explicitly calling m_scrollController.updateGestureInProgressState() which maintains m_inScrollGesture. When m_inScrollGesture was stuck as true, ScrollableArea::updateScrollSnapState() would return early because isScrollSnapInProgress() would return true. In addition, ScrollController::isScrollSnapInProgress() was a lie for non-scroll-snapping scrollable areas, so explicitly check for snap points there, using an explicit usesScrollSnap() function. Rename some WheelEventStatus values to use "momentum" rather than "inertia". Test: fast/scrolling/mac/adjust-scroll-snap-after-gesture.html * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent): * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::usesScrollSnap const): (WebCore::ScrollableArea::updateScrollSnapState): * platform/ScrollableArea.h: * platform/cocoa/ScrollController.h: * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::handleWheelEvent): (WebCore::ScrollController::usesScrollSnap const): (WebCore::ScrollController::isScrollSnapInProgress const): (WebCore::ScrollController::snapRubberBand): (WebCore::toWheelEventStatus): (WebCore::operator<<): (WebCore::ScrollController::shouldOverrideMomentumScrolling const): (WebCore::ScrollController::scheduleStatelessScrollSnap): (WebCore::ScrollController::statelessSnapTransitionTimerFired): (WebCore::ScrollController::processWheelEventForScrollSnap): (WebCore::ScrollController::updateGestureInProgressState): (WebCore::ScrollController::scrollSnapTimerFired): (WebCore::ScrollController::activeScrollSnapIndexForAxis const): (WebCore::ScrollController::setActiveScrollSnapIndexForAxis): (WebCore::ScrollController::setNearestScrollSnapIndexForAxisAndOffset): (WebCore::ScrollController::setActiveScrollSnapIndicesForOffset): (WebCore::ScrollController::shouldOverrideInertialScrolling const): Deleted. * platform/mac/ScrollAnimatorMac.mm: (WebCore::ScrollAnimatorMac::handleWheelEvent): 2020-07-09 Fujii Hironori [WinCairo][MediaFoundation] Use /DELAYLOAD for mf.dll https://bugs.webkit.org/show_bug.cgi?id=213330 Reviewed by Per Arne Vollan. WinCairo failed to start up due to a missing dependency on some versions of Windows in which Media Foundation is not available such like Windows 10 N. Use delay load for Media Foundation. And, check the availability. * PlatformWinCairo.cmake: Link with delayimp.lib. Added /DELAYLOAD linker options. * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: (WebCore::MediaPlayerPrivateMediaFoundation::isAvailable): Check mf.dll is available. 2020-07-09 Eric Carlson Reset AVSystemController_PIDToInheritApplicationStateFrom when mediaserverd dies https://bugs.webkit.org/show_bug.cgi?id=214112 Reviewed by Jer Noble. Tested manually because this can only be tested by killing a system process while capturing on iOS hardware. * platform/audio/cocoa/MediaSessionManagerCocoa.h: Add task queue accessor. (WebCore::MediaSessionManagerCocoa::taskQueue): * platform/audio/ios/MediaSessionHelperIOS.h: (WebCore::MediaSessionHelperClient::mediaServerConnectionDied): * platform/audio/ios/MediaSessionHelperIOS.mm: (MediaSessionHelperiOS::mediaServerConnectionDied): Renamed from carPlayServerDied. Inform clients if we previously set the PID proxy. (-[WebMediaSessionHelper initWithCallback:]): Call mediaServerConnectionDied. (-[WebMediaSessionHelper mediaServerConnectionDied:]): Ditto. (MediaSessionHelperiOS::carPlayServerDied): Deleted. (-[WebMediaSessionHelper carPlayServerDied:]): Deleted. * platform/audio/ios/MediaSessionManagerIOS.h: * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::mediaServerConnectionDied): Call providePresentingApplicationPID if we previously set the PID proxy. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::captureSessionRuntimeError): Don't try to restart the session immediately since this is called directly from the notification handler. 2020-07-09 Clark Wang Set Restrictions for channelCount, channelCountMode for PannerNode https://bugs.webkit.org/show_bug.cgi?id=213992 Reviewed by Chris Dumez. Added setter methods to PannerNode that handle exceptions for channelCount, channelCountMode, according to spec: https://www.w3.org/TR/webaudio/#dom-audionode-channelcount. Moved ChannelCount, ChannelCountMode enums into their own files. Re-baselined tests that now pass. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::AudioNode): (WebCore::AudioNode::setChannelCount): (WebCore::AudioNode::setChannelCountMode): (WebCore::AudioNode::setChannelInterpretation): (WebCore::AudioNode::channelCount): Deleted. (WebCore::AudioNode::channelCountMode): Deleted. (WebCore::AudioNode::channelInterpretation): Deleted. * Modules/webaudio/AudioNode.h: (WebCore::AudioNode::channelCount const): (WebCore::AudioNode::channelCountMode const): (WebCore::AudioNode::channelInterpretation const): (WebCore::AudioNode::internalChannelCountMode const): Deleted. (WebCore::AudioNode::internalChannelInterpretation const): Deleted. * Modules/webaudio/AudioNode.idl: * Modules/webaudio/AudioNodeInput.cpp: (WebCore::AudioNodeInput::numberOfChannels const): (WebCore::AudioNodeInput::bus): (WebCore::AudioNodeInput::sumAllConnections): (WebCore::AudioNodeInput::pull): * Modules/webaudio/AudioNodeOptions.h: * Modules/webaudio/AudioNodeOptions.idl: * Modules/webaudio/ChannelCountMode.h: Copied from Source/WebCore/Modules/webaudio/AudioNodeOptions.h. * Modules/webaudio/ChannelCountMode.idl: Copied from Source/WebCore/Modules/webaudio/AudioNodeOptions.idl. * Modules/webaudio/ChannelInterpretation.h: Copied from Source/WebCore/Modules/webaudio/AudioNodeOptions.h. * Modules/webaudio/ChannelInterpretation.idl: Copied from Source/WebCore/Modules/webaudio/AudioNodeOptions.idl. * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::ConvolverNode): * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::DefaultAudioDestinationNode): * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::PannerNode): (WebCore::PannerNode::create): (WebCore::PannerNode::setChannelCount): (WebCore::PannerNode::setChannelCountMode): * Modules/webaudio/PannerNode.h: * Modules/webaudio/WebKitAudioPannerNode.cpp: (WebCore::WebKitAudioPannerNode::WebKitAudioPannerNode): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/AudioBus.cpp: (WebCore::AudioBus::copyFrom): (WebCore::AudioBus::sumFrom): * platform/audio/AudioBus.h: 2020-07-09 Alicia Boya García [MSE][GStreamer] Remove m_appendPipelinesMap https://bugs.webkit.org/show_bug.cgi?id=214132 Reviewed by Xabier Rodriguez-Calvar. m_appendPipelinesMap was owned by MediaPlayerPrivateGStreamerMSE but was only used by MediaPlayerPrivateGStreamerMSE to clear it during destruction, while the other uses were in MediaSourceClientGStreamerMSE. After analysis, it was found keeping a HashMap of AppendPipelines is not necessary. An AppendPipeline only needs to be used by the SourceBuffer receiving the muxed data: making AppendPipeline a member of SourceBufferPrivateGStreamer reflects this dependency in a much clearer way. No need for a HashMap of AppendPipeline's. Moreso, there are no other users of AppendPipeline, which means AppendPipeline doesn't need to be ref counted. This patch removes that feature, using std::unique_ptr for ownership instead. This patch is a refactor: it doesn't introduce behavior changes and it's covered by existing tests. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::appsinkCapsChanged): (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink): * platform/graphics/gstreamer/mse/AppendPipeline.h: * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::~MediaPlayerPrivateGStreamerMSE): (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected): * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp: (WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer): (WebCore::MediaSourceClientGStreamerMSE::abort): (WebCore::MediaSourceClientGStreamerMSE::resetParserState): (WebCore::MediaSourceClientGStreamerMSE::append): (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource): * platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp: (WebCore::MediaSourcePrivateGStreamer::addSourceBuffer): * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::create): (WebCore::SourceBufferPrivateGStreamer::SourceBufferPrivateGStreamer): (WebCore::SourceBufferPrivateGStreamer::finishCreation): * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: 2020-07-09 Zalan Bujtas [LFC][Verification] Use the table wrapper box's margin when checking the table box https://bugs.webkit.org/show_bug.cgi?id=214119 Reviewed by Darin Adler. Table margins are propagated to the table wrapper box. Test: fast/layoutformattingcontext/table-with-margin-simple.html * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): 2020-07-09 Alicia Boya García [MSE][GStreamer] Don't cache duration in MediaSourceClientGStreamerMSE https://bugs.webkit.org/show_bug.cgi?id=214128 Reviewed by Xabier Rodriguez-Calvar. MediaSource should be the single source of truth for the duration of the MediaSource, and querying it to MediaSource is efficient enough (trivial getter). There is no reason for MediaSourceClientGStreamerMSE to store a separate m_duration field. This patch introduces no behavior changes. * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp: (WebCore::MediaSourceClientGStreamerMSE::MediaSourceClientGStreamerMSE): (WebCore::MediaSourceClientGStreamerMSE::duration): (WebCore::MediaSourceClientGStreamerMSE::durationChanged): * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h: 2020-07-09 Alicia Boya García [MSE][GStreamer] Make duration changes one way https://bugs.webkit.org/show_bug.cgi?id=214083 Reviewed by Xabier Rodriguez-Calvar. Until now, AppendPipeline emitted duration changes for the MediaSource. This was done with MediaSourcePrivateClient::durationChanged(const MediaTime&), a method which was added to MediaSource in r207889 just to implement this in the GStreamer port. This is not necessary though. AppendPipeline only needs to inform MediaSource of the duration of the initialization segment, and MediaSource will in turn set duration from the multi-platform code. This patch removes MediaSourcePrivateClient::durationChanged(const MediaTime&) from the multi-platform API, along with its usages in the GStreamer port, giving the multi-platform code sole responsibility on duration changes. This is a code cleanup and it's covered by existing tests. * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::durationChanged): Deleted. * Modules/mediasource/MediaSource.h: * platform/graphics/MediaSourcePrivateClient.h: * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::didReceiveInitializationSegment): (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink): * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged): 2020-07-09 Philippe Normand [GStreamer][MSE] AV1 support https://bugs.webkit.org/show_bug.cgi?id=207547 Reviewed by Xabier Rodriguez-Calvar. If only the av1dec decoder is available, consider AV1 decoding support as disabled, because this plugin performs really badly. However, if any other AV1 decoder is present, such as the dav1d-based Rust decoder for instance, consider AV1 support as enabled. These checks are now performed by both RegistryScanner instances, for MSE and non-MSE players. * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: (WebCore::GStreamerRegistryScanner::hasElementForMediaType const): (WebCore::GStreamerRegistryScanner::initialize): * platform/graphics/gstreamer/GStreamerRegistryScanner.h: 2020-07-09 Alicia Boya García [MSE][GStreamer] Remove orphan code in SourceBufferPrivateGStreamer::append() https://bugs.webkit.org/show_bug.cgi?id=214086 Reviewed by Xabier Rodriguez-Calvar. A refactor in r240784 missed this line, which was unreachable code before and should have removed. Instead, it has been run every time after sending an append to the AppendPipeline, and it just happens it doesn't have visible consequences. This patch cleans that up removing that line. No visible behavior changes are introduced. * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::append): 2020-07-09 Carlos Garcia Campos [SOUP] Initialize m_allowCookies and m_acceptEncoding in ResourceRequest::updateFromSoupMessage https://bugs.webkit.org/show_bug.cgi?id=214077 Reviewed by Michael Catanzaro. Check if SOUP_TYPE_CONTENT_DECODER and SOUP_TYPE_COOKIE_JAR are disabled in the given message. * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::ResourceRequest::updateFromSoupMessage): 2020-07-09 Carlos Garcia Campos [SOUP] Add support for HTTPCookieAcceptPolicy::OnlyFromMainDocumentDomain https://bugs.webkit.org/show_bug.cgi?id=213954 Reviewed by Michael Catanzaro. Handle both OnlyFromMainDocumentDomain and ExclusivelyFromMainDocumentDomain. * platform/network/soup/NetworkStorageSessionSoup.cpp: (WebCore::NetworkStorageSession::NetworkStorageSession): (WebCore::NetworkStorageSession::setCookieAcceptPolicy): (WebCore::NetworkStorageSession::cookieAcceptPolicy const): (WebCore::NetworkStorageSession::setResourceLoadStatisticsEnabled): 2020-07-08 Simon Fraser Allow ScrollableArea to ask if a user scroll is in progress https://bugs.webkit.org/show_bug.cgi?id=214121 Reviewed by Wenson Hsieh. Work towards fixing scrolling stutters on layouting pages using scroll snap, like tesla.com. ScrollableArea::updateScrollSnapState(), which happens as a result of layout, should not set a new scroll position if a user scroll is in progress. ScrollController already tracks m_inScrollGesture, so in the first instance just refactor the code to return that. Future changes will check for scrolling thread activity. * page/FrameView.cpp: (WebCore::FrameView::isUserScrollInProgress const): (WebCore::FrameView::isRubberBandInProgress const): * page/FrameView.h: * platform/ScrollAnimator.h: (WebCore::ScrollAnimator::ScrollAnimator::isUserScrollInProgress const): * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::updateScrollSnapState): * platform/ScrollableArea.h: (WebCore::ScrollableArea::isUserScrollInProgress const): * platform/cocoa/ScrollController.h: * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::isUserScrollInProgress const): * platform/mac/ScrollAnimatorMac.h: * platform/mac/ScrollAnimatorMac.mm: (WebCore::ScrollAnimatorMac::isUserScrollInProgress const): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::isUserScrollInProgress const): (WebCore::RenderLayer::isRubberBandInProgress const): * rendering/RenderLayer.h: 2020-07-08 Andres Gonzalez Implementation of AXIsolatedObject::setSelectedVisiblePositionRange. https://bugs.webkit.org/show_bug.cgi?id=214118 Reviewed by Chris Fleizach. Covered by test: accessibility/mac/selected-visible-position-range.html. Implemented AXIsolatedObject::setSelectedVisiblePositionRange() and selection() by forwarding the call to the associated AX object. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::selection const): (WebCore::AXIsolatedObject::setSelectedVisiblePositionRange const): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]): call to the backing object should happen on the main thread since it takes a VisiblePositionRange parameter. 2020-07-08 Simon Fraser Clean up time values in ScrollController https://bugs.webkit.org/show_bug.cgi?id=214117 Reviewed by Wenson Hsieh. ScrollController used a mixture of [NSDate timeIntervalSinceReferenceDate], [NSProcessInfo processInfo].systemUptime and wheelEvent.timestamp().secondsSinceEpoch(). Standardize on Seconds/MonotonicTime/WallTime. * platform/cocoa/ScrollController.h: * platform/cocoa/ScrollController.mm: (WebCore::elasticDeltaForTimeDelta): (WebCore::ScrollController::handleWheelEvent): (WebCore::ScrollController::snapRubberBandTimerFired): (WebCore::ScrollController::snapRubberBand): 2020-07-08 Brady Eidson Aggressively prime GameController.framework gamepad provider. https://bugs.webkit.org/show_bug.cgi?id=214094 Reviewed by Darin Adler. GameController.framework gets itself going by listening for application activation, assuming that it is hard linked. Soft linking breaks this. There's an SPI to manually kickstart it. Also add some logging I'd added while exploring issues around this. * platform/gamepad/cocoa/GameControllerGamepadProvider.h: * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::controllerDidConnect): (WebCore::GameControllerGamepadProvider::prewarmGameControllerDevicesIfNecessary): (WebCore::GameControllerGamepadProvider::startMonitoringGamepads): * platform/gamepad/cocoa/GameControllerSPI.h: 2020-07-08 Sam Weinig Part 3 of SimpleColor and SRGBA are essentially the same - let's converge them https://bugs.webkit.org/show_bug.cgi?id=214082 Reviewed by Darin Adler. - Replaces all uses of SimpleColor that are not implementation details of Color, with SRGBA. - Adds ColorBuilder to allow maintaining the syntax SimpleColor for constant colors. e.g: Color color = Color::yellow.colorWithAlpha(128); * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: Add ColorBuilder.h * platform/graphics/Color.cpp: (WebCore::Color::lightened const): (WebCore::Color::darkened const): (WebCore::Color::semanticColor const): * platform/graphics/Color.h: (WebCore::Color::Color): (WebCore::Color::asSimple const): (WebCore::Color::setSimpleColor): (WebCore::Color::isBlackColor): (WebCore::Color::isWhiteColor): (WebCore::Color::encode const): (WebCore::Color::decode): - Make constructor taking a SimpleColor private. - Add / modifiy constructors to take SRGBA. - Make setSimpleColor() take a SRGBA (this will be renamed along with other aspects of Color's internals in a subsequent change). - Update calls that still need SimpleColor to use an explicit construction from SRGBA. * platform/graphics/ColorBuilder.h: Added. (WebCore::ColorBuilder::ColorBuilder): (WebCore::ColorBuilder::color const): (WebCore::ColorBuilder::colorWithAlpha const): Added to help maintain current syntax why constructing colors. Currently it only supports color type with uint8_t components, but can be expanded to support more. * platform/graphics/ColorUtilities.h: (WebCore::clampToComponentByte): Remove unnecessary cast. * platform/graphics/SimpleColor.h: (WebCore::SimpleColor::SimpleColor): Restrict to explicit construction via a SRGBA. (WebCore::makeSimpleColor): Update to return ColorBuilder>. A future change will update the function name, but kept the same here to limit the size of the change. * platform/graphics/mac/ColorMac.mm: (WebCore::makeSimpleColorFromNSColor): (WebCore::nsColor): * platform/graphics/cg/ColorCG.cpp: (WebCore::makeSimpleColorFromCGColor): (WebCore::cachedCGColor): Replace direct SimpleColor usage with SRGBA and simplify Packed construction now that .asSRGBA() is not needed for color constants. * css/DeprecatedCSSOMRGBColor.h: * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseNamedColor): (WebCore::CSSParser::parseHexColor): * css/parser/CSSParser.h: * css/parser/CSSParserFastPaths.cpp: (WebCore::finishParsingHexColor): (WebCore::parseHexColorInternal): (WebCore::parseNumericColor): (WebCore::finishParsingNamedColor): (WebCore::parseNamedColorInternal): (WebCore::parseSimpleColorInternal): (WebCore::CSSParserFastPaths::parseSimpleColor): (WebCore::CSSParserFastPaths::parseHexColor): (WebCore::CSSParserFastPaths::parseNamedColor): * css/parser/CSSParserFastPaths.h: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseHexColor): * html/ColorInputType.cpp: (WebCore::parseSimpleColorValue): * html/HTMLElement.cpp: (WebCore::parseLegacyColorValue): * page/DebugPageOverlays.cpp: (WebCore::touchEventRegionColors): * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::HistoricMemoryCategoryInfo::HistoricMemoryCategoryInfo): * platform/graphics/ColorBlending.cpp: (WebCore::blendWithWhite): (WebCore::blend): (WebCore::blendWithoutPremultiply): * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::makeSimpleColorFromARGBCFArray): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::cloneLayerDebugBorderColor): * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawBoxes): * rendering/RenderLayerBacking.cpp: * rendering/RenderThemeMac.mm: (WebCore::menuBackgroundColor): Replace direct SimpleColor usage with SRGBA. 2020-07-08 Simon Fraser Make a logging channel for ScrollSnap and improve its logging https://bugs.webkit.org/show_bug.cgi?id=214096 Reviewed by Wenson Hsieh. Pull existing scroll snap logging out of the Scrolling log channel into a new ScrollSnap channel, add more logging, and make better use of TextStream-based logging. * page/scrolling/AxisScrollSnapOffsets.cpp: (WebCore::operator<<): (WebCore::updateSnapOffsetsForScrollableArea): (WebCore::snapOffsetsToString): Deleted. (WebCore::snapOffsetRangesToString): Deleted. (WebCore::snapPortOrAreaToString): Deleted. * platform/Logging.h: * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::updateScrollSnapState): * platform/cocoa/ScrollController.mm: (WebCore::operator<<): (WebCore::ScrollController::processWheelEventForScrollSnap): (WebCore::ScrollController::startScrollSnapTimer): (WebCore::ScrollController::stopScrollSnapTimer): (WebCore::ScrollController::scrollSnapTimerFired): (WebCore::ScrollController::updateScrollSnapState): * platform/cocoa/ScrollSnapAnimatorState.h: * platform/cocoa/ScrollSnapAnimatorState.mm: (WebCore::operator<<): 2020-07-08 Per Arne Vollan [Cocoa] Make it possible to establish direct XPC connections between WebKit processes https://bugs.webkit.org/show_bug.cgi?id=214079 Reviewed by Brent Fulgham. Add abstract classes XPCEndpoint and XPCEndpointClient to handle the creation of direct xpc connections between WebKit processes. In order to create a direct xpc connection between two processes, these two classes can be subclassed, and the xpc endpoint created by the XPCEndpoint object, can be sent via the UI process over the bootstrap xpc connection. The UI process can then forward this endpoint to another WebKit process by sending it over the bootstrap xpc connection. The receiving process can then initialize an XPCEndpointClient object with this endpoint, and a new direct connection will then be available, over which the two processes can communicate. API test: WebKit.XPCEndpoint * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/XPCEndpoint.h: Added. * platform/cocoa/XPCEndpoint.mm: Added. (WebCore::XPCEndpoint::XPCEndpoint): (WebCore::XPCEndpoint::sendEndpointToConnection): (WebCore::XPCEndpoint::endpoint const): * platform/cocoa/XPCEndpointClient.h: Added. (WebCore::XPCEndpointClient::~XPCEndpointClient): * platform/cocoa/XPCEndpointClient.mm: Added. (WebCore::XPCEndpointClient::setEndpoint): (WebCore::XPCEndpointClient::connection): 2020-07-08 Stephan Szabo [PlayStation] Build fix after r264050 https://bugs.webkit.org/show_bug.cgi?id=214091 Unreviewed build fix No new tests, only build fix. * platform/playstation/ScrollbarThemePlayStation.cpp: 2020-07-08 Sihui Liu Text manipulation should ignore white spaces between nodes https://bugs.webkit.org/show_bug.cgi?id=213907 Reviewed by Wenson Hsieh. Text returned by TextIterator contains white spaces (including tabs and line breaks) that do not belong to content of nodes. Those spaces are emitted based on style of nodes. For example, line breaks can be emitted before and after block-level element. These spaces should not be extracted as part of the content, because they could change based on the style of nodes or range of TextIterator, and manipulation fails if content is changed. We want to make sure TextManipulationController monitors the real content of nodes. r262778 tried solving this issue by excluding text with empty node from TextIterator's result. That worked with line break, but not space and tab. See radar and new test. To solve this, now we exclude text with zero-length range. This patch does not change the behavior of line breaks, which is covered by: TextManipulation.StartTextManipulationExtractsVisibleLineBreaksInTextAsExcludedTokens TextManipulation.CompleteTextManipulationCanMergeContentAndPreserveLineBreaks TextManipulation.CompleteTextManipulationReplaceTwoSimpleParagraphs New test: TextManipulation.CompleteTextManipulationIgnoreWhiteSpacesBetweenParagraphs Modified existing tests: TextManipulation.StartTextManipulationExtractsValuesByNode * editing/TextManipulationController.cpp: (WebCore::ParagraphContentIterator::ParagraphContentIterator): (WebCore::ParagraphContentIterator::shouldAdvanceIteratorPastCurrentNode const): (WebCore::ParagraphContentIterator::advanceIteratorNodeAndUpdateText): 2020-07-08 Darin Adler Remove use of live ranges from AXObject.h https://bugs.webkit.org/show_bug.cgi?id=214053 Reviewed by Sam Weinig. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::traverseToOffsetInRange): Take SimpleRange. (WebCore::AXObjectCache::lengthForRange): Take Optional. (WebCore::AXObjectCache::rangeForNodeContents): Return SimpleRange, take reference rather than pointer. (WebCore::characterOffsetsInOrder): Use SimpleRange. (WebCore::resetNodeAndOffsetForReplacedNode): Take a reference to the node rather than a pointer. (WebCore::boundaryPoint): Added. Could be used to replace calls to setRangeStartOrEndWithCharacterOffset. (WebCore::setRangeStartOrEndWithCharacterOffset): Take SimpleRange. Also use the new boundaryPoint function above. (WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets): Return Optional. (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange): Take SimpleRange. (WebCore::AXObjectCache::startOrEndTextMarkerDataForRange): Take SimpleRange. (WebCore::AXObjectCache::characterOffsetForNodeAndOffset): Use SimpleRange. (WebCore::AXObjectCache::textMarkerDataForNextCharacterOffset): Ditto. (WebCore::AXObjectCache::textMarkerDataForPreviousCharacterOffset): Ditto. (WebCore::AXObjectCache::visiblePositionFromCharacterOffset): (WebCore::AXObjectCache::characterOffsetFromVisiblePosition): (WebCore::AXObjectCache::leftWordRange): Return Optional. (WebCore::AXObjectCache::rightWordRange): Ditto. (WebCore::AXObjectCache::nextBoundary): Ditto. (WebCore::AXObjectCache::previousBoundary): Ditto. (WebCore::AXObjectCache::startCharacterOffsetOfParagraph): Use SimpleRange. (WebCore::AXObjectCache::endCharacterOffsetOfParagraph): Ditto. (WebCore::AXObjectCache::paragraphForCharacterOffset): Ditto. (WebCore::AXObjectCache::sentenceForCharacterOffset): Ditto. (WebCore::AXObjectCache::localCaretRectForCharacterOffset): Ditto. (WebCore::AXObjectCache::characterOffsetForPoint): Ditto. (WebCore::AXObjectCache::characterOffsetForIndex): Ditto. (WebCore::AXObjectCache::indexForCharacterOffset): Ditto. * accessibility/AXObjectCache.h: Remove uses of Range and include of "Range.h". * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::elementRange const): Call createLiveRange. (WebCore::AccessibilityObject::rangeForPlainTextRange const): Ditto. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::boundsForRange const): Pass SimpleRange. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (+[WebAccessibilityTextMarker startOrEndTextMarkerForRange:isStart:cache:]): Pass SimpleRange. (-[WebAccessibilityObjectWrapper positionForTextMarker:]): Call createLiveRange. (-[WebAccessibilityObjectWrapper textMarkerRangeForSelection]): Pass SimpleRange. (-[WebAccessibilityObjectWrapper textMarkerForPosition:]): Ditto. (-[WebAccessibilityObjectWrapper rangeForTextMarkers:]): Call createLiveRange. (-[WebAccessibilityObjectWrapper lengthForTextMarkers:]): Pass SimpleRange. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (startOrEndTextmarkerForRange): (-[WebAccessibilityObjectWrapper rangeForTextMarkerRange:]): Pass SimpleRange. (-[WebAccessibilityObjectWrapper _indexForTextMarker:]): Call createLiveRange. (-[WebAccessibilityObjectWrapper textMarkerRangeAtTextMarker:forUnit:]): Ditto. (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): Ditto. * dom/BoundaryPoint.h: Added makeBoundaryPointBefore/AfterNode. * dom/SimpleRange.cpp: (WebCore::makeBoundaryPointBeforeNode): Added. (WebCore::makeBoundaryPointAfterNode): Ditto. 2020-07-08 Zalan Bujtas [LFC][IFC] Do not use the initial strut baseline values when the text content is inside an inline container https://bugs.webkit.org/show_bug.cgi?id=214069 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/line-heigt-when-text-is-inside-inline-container.html * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::close): (WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight): * layout/inlineformatting/InlineLineBuilder.h: 2020-07-08 Zalan Bujtas [LFC][TFC] Table width is computed as if box-sizing was border-box https://bugs.webkit.org/show_bug.cgi?id=214070 Reviewed by Antti Koivisto. Apparently the width property of the works as if box-sizing were set to border-box (and
[iOS] Sharing an element with a base64-encoded URL shares the URL as raw text instead of an image https://bugs.webkit.org/show_bug.cgi?id=214042 Reviewed by Wenson Hsieh. * en.lproj/Localizable.strings: 2020-07-08 Philippe Normand REGRESSION(r263836): [GStreamer] Debug ASSERT hits https://bugs.webkit.org/show_bug.cgi?id=214047 Reviewed by Xabier Rodriguez-Calvar. Reduce the element dependency on RefPtr which is not MT-safe. The data we need from it are its ID and the contents required to build a GstTagList. So we now create this tag-list upfront and keep track of the trackID as well. * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (webkitMediaStreamSrcAddPad): (ProbeData::ProbeData): (webkitMediaStreamSrcPadProbeCb): (webkitMediaStreamSrcSetupSrc): 2020-07-07 Andy Estes [Apple Pay] Fix the build on Catalina internal SDKs https://bugs.webkit.org/show_bug.cgi?id=214066 Unreviewed build fix for the 10.15.0 Internal SDK. * Modules/applepay/ApplePaySetupFeature.mm: (WebCore::ApplePaySetupFeature::supportsInstallments const): 2020-07-07 Alex Christensen Allow WebCoreNSURLSession sendH2Ping:pongHandler: to be called from any thread like the rest of WebCoreNSURLSession methods https://bugs.webkit.org/show_bug.cgi?id=214065 Reviewed by Jer Noble. Otherwise horrible crashes happen. The WebCore function calls and loading IPC calls need to happen on the main thread, and the callback should happen on the NSOperationQueue given when constructing the WebCoreNSURLSession. * platform/network/cocoa/WebCoreNSURLSession.mm: (-[WebCoreNSURLSession sendH2Ping:pongHandler:]): 2020-07-07 Sam Weinig Part 2 of SimpleColor and SRGBA are essentially the same - let's converge them https://bugs.webkit.org/show_bug.cgi?id=213981 Reviewed by Darin Adler. - Replaces internal representation of SimpleColor based on an ARGB uint32_t with SRGBA. - Removes SimpleColor constructor taking a uint32_t. Callers that still need to convert from ARGB now do makeSimpleColor(asSRGBA(Packed::ARGB { value })). - Removes value() and valueAsARGB() member functions from SimpleColor. Callers that need a packed representation now do Packed::ARGB { simpleColor.asSRGBA() }.value. * css/StyleColor.cpp: (WebCore::StyleColor::colorFromKeyword): Use asSRGBA(Packed::ARGB{...}) to constuct the color. * css/parser/CSSParserFastPaths.cpp: (WebCore::finishParsingNamedColor): Use asSRGBA(Packed::ARGB{...}) (or in one case, Packed::RGBA) to constuct the color. These can almost certainly be simplified, but in the interest of keeping things smallish, I have left that for a subsequent change. * editing/CompositionHighlight.h: Switch to using auto/makeSimpleColor. * page/cocoa/ResourceUsageOverlayCocoa.mm: Switch to using makeSimpleColor. (WebCore::HistoricMemoryCategoryInfo::HistoricMemoryCategoryInfo): (WebCore::HistoricResourceUsageData::HistoricResourceUsageData): Switch to using auto/makeSimpleColor. * platform/adwaita/ScrollbarThemeAdwaita.cpp: Switch to using auto/makeSimpleColor. * platform/graphics/Color.cpp: * platform/graphics/Color.h: - Switch to using auto/makeSimpleColor for named colors. - Switch to storing/encoding the inline SimpleColor as a Packed::RGBA value. * platform/graphics/ColorBlending.cpp: (WebCore::blend): Update for new name of clampToComponentBytes. * platform/graphics/ColorTypes.h: (WebCore::Packed::RGBA::RGBA): (WebCore::Packed::ARGB::ARGB): (WebCore::asSRGBA): Rename WebCore::ARGB to WebCore::Packed::ARGB. Adds companion, WebCore::Packed::RGBA. And adds constructors which make a packed type from an SRGBA. * platform/graphics/ColorUtilities.h: (WebCore::clampToComponentByte): (WebCore::clampToComponentFloat): Extract out helper functions which just do the clamping for the type. (WebCore::clampToComponentBytes): (WebCore::clampToComponentFloats): Rename conversion functions that just clamp to use "clamp" prefix rather than "convert". Make use of extracted helpers. * platform/graphics/ImageBackingStore.h: (WebCore::ImageBackingStore::blendPixel): (WebCore::ImageBackingStore::pixelValue const): Update using new packed color types and funtions. * platform/graphics/SimpleColor.h: (WebCore::SimpleColor::SimpleColor): (WebCore::SimpleColor::alphaComponent const): (WebCore::SimpleColor::alphaComponentAsFloat const): (WebCore::SimpleColor::isOpaque const): (WebCore::SimpleColor::isVisible const): (WebCore::SimpleColor::colorWithAlpha const): (WebCore::SimpleColor::invertedColorWithAlpha const): (WebCore::SimpleColor::asSRGBA const): (WebCore::SimpleColor::get const): (WebCore::makeSimpleColor): (WebCore::SimpleColor::valueAsARGB const): Deleted. (WebCore::SimpleColor::value const): Deleted. (WebCore::SimpleColor::redComponent const): Deleted. (WebCore::SimpleColor::greenComponent const): Deleted. (WebCore::SimpleColor::blueComponent const): Deleted. - Removes constructor taking an ARGB uint32_t. - Removes valueAsARGB()/value() functions (can use Packed::ARGB directly if needed). - Switches internal representation to SRGBA. - Streamline makeSimpleColor functions to use shared helpers from ColorUtilities.h * platform/graphics/cg/ColorCG.cpp: (WebCore::cachedCGColor): * platform/graphics/mac/ColorMac.mm: (WebCore::nsColor): Use Packed::RGBA to extract uint32_t for quick lookup of transparent/white/black SimpleColors. Despite the length of the calls, SimpleColor is fully constexpr, so these actually collapse down to the uint32_t representation at compile time. * platform/graphics/win/GraphicsContextCGWin.cpp: (WebCore::GraphicsContext::drawDotsForDocumentMarker): Switch to using auto/makeSimpleColor. * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::defaultDevices): Switch to using makeSimpleColor. * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawBoxes): Switch to using auto/makeSimpleColor. * platform/mock/ScrollbarThemeMock.cpp: (WebCore::ScrollbarThemeMock::paintTrackBackground): Switch to using makeSimpleColor. * rendering/RenderObject.cpp: (WebCore::RenderObject::calculateBorderStyleColor): Update comment to use per-component values. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::systemColor const): Switch to using makeSimpleColor. * rendering/RenderThemeAdwaita.cpp: Switch to using auto/makeSimpleColor. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintProgressBar): Switch to using auto/makeSimpleColor. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::systemColor const): Switch to using auto/makeSimpleColor. 2020-07-07 Andres Gonzalez Web content process hangs in AccessibilityRenderObject::setSelectedVisiblePositionRange in some corner cases. https://bugs.webkit.org/show_bug.cgi?id=214017 Reviewed by Chris Fleizach. Ensures that in the case of collapsed ranges, the VisiblePosition that the selection is being set to, is contained in the Element object. Test: accessibility/mac/selected-visible-position-range.html * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange const): 2020-07-07 Youenn Fablet Fix potential pixel buffer leak in ImageRotationSessionVT::rotate https://bugs.webkit.org/show_bug.cgi?id=213922 Reviewed by Eric Carlson. Fix a potential memory leak in an error case. Add more logging to be able to see errors. Remove the kCVPixelBufferIOSurfacePropertiesKey key on iOS from the buffer pool to revert part of https://trac.webkit.org/changeset/258504/webkit that seems problematic in iOS. * platform/graphics/cv/ImageRotationSessionVT.mm: (WebCore::ImageRotationSessionVT::initialize): (WebCore::ImageRotationSessionVT::rotate): 2020-07-07 Simon Fraser Unable to scroll elcomerico.pe page until the page finishes loading https://bugs.webkit.org/show_bug.cgi?id=214027 Reviewed by Antti Koivisto. had a scaleX(0) element as an ancestor of an overflow:scroll. The CALayer hit-testing code failed to take non-invertible transforms into account, causing the overflow:scroll to intercept scrolling events. Fix by explicitly testing for non-invertible transforms, and, when found, bailing from the sublayer walk. A non-invertible layer transform makes all its descendants non hit-testable. Tests: fast/scrolling/ios/non-invertible-transformed-scroller-ancestor.html fast/scrolling/mac/non-invertible-transform-hit-testing.html * page/scrolling/mac/ScrollingTreeMac.mm: (collectDescendantLayersAtPoint): * platform/graphics/transforms/TransformationMatrix.h: 2020-07-07 Peng Liu Function didCleanupFullscreencreen() should be called at the end of VideoFullscreenInterfaceAVKit::cleanupFullscreen() https://bugs.webkit.org/show_bug.cgi?id=214032 Reviewed by Eric Carlson. VideoFullscreenManagerProxy::didCleanupFullscreen() may destroy an instance of VideoFullscreenInterfaceAVKit. So we should not access member variables of VideoFullscreenInterfaceAVKit after calling didCleanupFullscreen() in VideoFullscreenInterfaceAVKit::cleanupFullscreen(). Fix a flaky test crash: media/video-autoplay.html * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::cleanupFullscreen): 2020-07-07 Tim Horton layout does not scale with Dynamic Type size changes https://bugs.webkit.org/show_bug.cgi?id=214023 Reviewed by Sam Weinig. Test: fast/attachment/attachment-dynamic-type.html * rendering/RenderThemeIOS.mm: (WebCore::shortCaptionPointSizeWithContentSizeCategory): (WebCore::attachmentDynamicTypeScaleFactor): (WebCore::RenderAttachmentInfo::buildWrappedLines): (WebCore::RenderThemeIOS::attachmentIntrinsicSize const): Scale the overall size and text line width by the Dynamic Type scaling factor, determined by dividing the resolved point size of two font descriptors created with the Large (default) category and the Current category. * rendering/RenderAttachment.cpp: (WebCore::RenderAttachment::layout): * rendering/RenderTheme.h: (WebCore::RenderTheme::attachmentShouldAllowWidthToShrink const): * rendering/RenderThemeIOS.h: Add a RenderTheme bit controlling the behavior introduced in r202117. After r202117, elements are never allowed to shrink. This is fine for macOS, where we don't vary the Dynamic Type size, only the content, but undesirable on iOS, where the size of the is based solely on Dynamic Type size (and thus can shrink when the size is reduced), and not the content. * Configurations/WebCoreTestSupport.xcconfig: * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::setContentSizeCategory): * testing/Internals.h: * testing/Internals.idl: Add a Internals method to change the current Dynamic Type category. 2020-07-07 Alex Christensen Add WebCoreNSURLSession SPI to send HTTP/2 ping https://bugs.webkit.org/show_bug.cgi?id=214030 Reviewed by Jer Noble. Add lots of plumbing, move internalError from WebKit to WebCore. Covered by an API test that requires some future CFNetwork behavior. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMPromiseDeferred.h: * loader/FrameLoaderClient.cpp: Added. (WebCore::FrameLoaderClient::sendH2Ping): * loader/FrameLoaderClient.h: * loader/MediaResourceLoader.cpp: (WebCore::MediaResourceLoader::sendH2Ping): * loader/MediaResourceLoader.h: * platform/graphics/PlatformMediaResourceLoader.cpp: Added. (WebCore::PlatformMediaResourceLoader::sendH2Ping): * platform/graphics/PlatformMediaResourceLoader.h: * platform/network/ResourceErrorBase.cpp: (WebCore::internalError): * platform/network/ResourceErrorBase.h: * platform/network/cocoa/WebCoreNSURLSession.h: * platform/network/cocoa/WebCoreNSURLSession.mm: (-[WebCoreNSURLSession sendH2Ping:pongHandler:]): * testing/Internals.cpp: (WebCore::Internals::sendH2Ping): * testing/Internals.h: * testing/Internals.idl: 2020-07-07 Tomoki Imai [Win] Implement Pasteboard::writeCustomData for Web Inspector Console tab https://bugs.webkit.org/show_bug.cgi?id=213986 Reviewed by Fujii Hironori. Implement Pasteboard::writeCustomData and Pasteboard::typesSafeForBindings. This fixes the issue which we cannot copy text in WebInspector's Console tab. We enable some existing testcases for pasteboard. * platform/Pasteboard.h: * platform/PasteboardCustomData.cpp: (WebCore::PasteboardCustomData::fromPersistenceDecoder): Construct PasteboardCustomData from WTF::Persistence::Decoder. (WebCore::PasteboardCustomData::fromSharedBuffer): Use fromPersistenceDecoder function to implement. * platform/PasteboardCustomData.h: * platform/win/ClipboardUtilitiesWin.cpp: (WebCore::createGlobalData): Add uint8_t* variant. * platform/win/ClipboardUtilitiesWin.h: * platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::finishCreatingPasteboard): Register new clipboard format CustomDataClipboardFormat. (WebCore::Pasteboard::readPasteboardCustomData): Helper function to read PasteboardCustomData from the pasteboard. (WebCore::Pasteboard::typesSafeForBindings): Implemented. (WebCore::Pasteboard::readOrigin): Implemented. (WebCore::Pasteboard::readStringInCustomData): Implemented. (WebCore::Pasteboard::writeCustomData): Implemented. 2020-07-06 Simon Fraser High CPU usage on Stash search results pages https://bugs.webkit.org/show_bug.cgi?id=214018 Reviewed by Tim Horton. Stash search results pages can contain a lot of overflow:scroll areas, so scrolling thread CA commits would take a long time because ScrollingTreeScrollingNodeDelegateMac::updateScrollbarPainters() would open and close a CA commit for each scroller. Fix by not explicitly starting a CA commit, and only entering this code if a gesture is active and in the momentum phase. Also sprinkle BEGIN_BLOCK_OBJC_EXCEPTIONS/END_BLOCK_OBJC_EXCEPTIONS in more places that call into Core Animation. * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers): (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers): * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers): * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent): (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateScrollbarPainters): 2020-07-06 Simon Fraser BEGIN_BLOCK_OBJC_EXCEPTIONS/END_BLOCK_OBJC_EXCEPTIONS should not have trailing semicolons https://bugs.webkit.org/show_bug.cgi?id=214019 Reviewed by Tim Horton. These macros are defined as: #define BEGIN_BLOCK_OBJC_EXCEPTIONS @try { #define END_BLOCK_OBJC_EXCEPTIONS } @catch(NSException *localException) { ReportBlockedObjCException(localException); } so they should not be used with trailing semicolons. * editing/cocoa/DictionaryLookup.mm: (WebCore::expandSelectionByCharacters): (WebCore::showPopupOrCreateAnimationController): * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::dataInRTFDFormat): (WebCore::Editor::dataInRTFFormat): * editing/mac/DictionaryLookupLegacy.mm: (WebCore::tokenRange): (WebCore::expandSelectionByCharacters): (WebCore::showPopupOrCreateAnimationController): (WebCore::DictionaryLookup::hidePopup): * page/ios/EventHandlerIOS.mm: (WebCore::EventHandler::keyEvent): (WebCore::lastEventIsMouseUp): (WebCore::EventHandler::passMouseDownEventToWidget): (WebCore::findViewInSubviews): (WebCore::EventHandler::eventLoopHandleMouseUp): (WebCore::EventHandler::passSubframeEventToSubframe): (WebCore::EventHandler::passWheelEventToWidget): (WebCore::EventHandler::mouseDown): (WebCore::EventHandler::mouseUp): (WebCore::EventHandler::mouseMoved): * page/mac/ChromeMac.mm: (WebCore::Chrome::focusNSView): * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::keyEvent): (WebCore::lastEventIsMouseUp): (WebCore::EventHandler::passMouseDownEventToWidget): (WebCore::findViewInSubviews): (WebCore::EventHandler::eventLoopHandleMouseDragged): (WebCore::EventHandler::eventLoopHandleMouseUp): (WebCore::EventHandler::passSubframeEventToSubframe): (WebCore::EventHandler::passWheelEventToWidget): (WebCore::EventHandler::mouseDown): (WebCore::EventHandler::mouseDragged): (WebCore::EventHandler::mouseUp): (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking): (WebCore::EventHandler::mouseMoved): (WebCore::EventHandler::pressureChange): (WebCore::EventHandler::passMouseMovedEventToScrollbars): * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm: (WebCore::ContentFilterUnblockHandler::encode const): (WebCore::ContentFilterUnblockHandler::decode): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): * platform/graphics/gpu/cocoa/GPUBindGroupAllocatorMetal.mm: (WebCore::GPUBindGroupAllocator::allocateAndSetEncoders): (WebCore::GPUBindGroupAllocator::reallocate): * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: (WebCore::appendArgumentToArray): (WebCore::tryCreateMtlArgumentEncoder): (WebCore::argumentDescriptor): (WebCore::GPUBindGroupLayout::tryCreate): * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm: (WebCore::setBufferOnEncoder): (WebCore::setSamplerOnEncoder): (WebCore::setTextureOnEncoder): * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: (WebCore::GPUBuffer::tryCreate): (WebCore::GPUBuffer::commandBufferCommitted): (WebCore::GPUBuffer::copyStagingBufferToGPU): * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: (WebCore::GPUCommandBuffer::tryCreate): (WebCore::GPUCommandBuffer::endBlitEncoding): (WebCore::GPUCommandBuffer::copyBufferToBuffer): (WebCore::GPUCommandBuffer::copyBufferToTexture): (WebCore::GPUCommandBuffer::copyTextureToBuffer): (WebCore::GPUCommandBuffer::copyTextureToTexture): * platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm: (WebCore::GPUComputePassEncoder::tryCreate): (WebCore::GPUComputePassEncoder::setPipeline): (WebCore::GPUComputePassEncoder::dispatch): (WebCore::GPUComputePassEncoder::useResource): (WebCore::GPUComputePassEncoder::setComputeBuffer): * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm: (WebCore::trySetMetalFunctions): (WebCore::trySetFunctions): (WebCore::convertComputePipelineDescriptor): (WebCore::tryCreateMTLComputePipelineState): * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm: (WebCore::GPUDevice::tryCreate): * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: (WebCore::GPUProgrammablePassEncoder::endPass): * platform/graphics/gpu/cocoa/GPUQueueMetal.mm: (WebCore::GPUQueue::tryCreate): (WebCore::GPUQueue::submit): * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: (WebCore::populateMtlColorAttachmentsArray): (WebCore::populateMtlDepthStencilAttachment): (WebCore::GPURenderPassEncoder::tryCreate): (WebCore::GPURenderPassEncoder::setPipeline): (WebCore::GPURenderPassEncoder::setBlendColor): (WebCore::GPURenderPassEncoder::setViewport): (WebCore::GPURenderPassEncoder::setScissorRect): (WebCore::GPURenderPassEncoder::setVertexBuffers): (WebCore::GPURenderPassEncoder::draw): (WebCore::GPURenderPassEncoder::drawIndexed): (WebCore::GPURenderPassEncoder::useResource): (WebCore::GPURenderPassEncoder::setVertexBuffer): (WebCore::GPURenderPassEncoder::setFragmentBuffer): * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: (WebCore::tryCreateMtlDepthStencilState): (WebCore::trySetVertexInput): (WebCore::trySetColorStates): (WebCore::trySetMetalFunctions): (WebCore::trySetFunctions): (WebCore::convertRenderPipelineDescriptor): (WebCore::tryCreateMtlRenderPipelineState): * platform/graphics/gpu/cocoa/GPUSamplerMetal.mm: (WebCore::tryCreateMtlSamplerState): * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm: (WebCore::GPUShaderModule::tryCreate): * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: (WebCore::tryCreateWebGPULayer): (WebCore::GPUSwapChain::tryGetCurrentTexture): * platform/graphics/gpu/cocoa/GPUTextureMetal.mm: (WebCore::tryCreateMtlTextureDescriptor): (WebCore::GPUTexture::tryCreate): (WebCore::GPUTexture::tryCreateDefaultTextureView): * platform/graphics/mac/ColorMac.mm: (WebCore::makeSimpleColorFromNSColor): * platform/ios/ScrollViewIOS.mm: (WebCore::ScrollView::documentView const): (WebCore::ScrollView::platformSetScrollbarModes): (WebCore::ScrollView::platformScrollbarModes const): (WebCore::ScrollView::platformSetCanBlitOnScroll): (WebCore::ScrollView::platformUnobscuredContentRect const): (WebCore::ScrollView::platformExposedContentRect const): (WebCore::ScrollView::setActualScrollPosition): (WebCore::ScrollView::platformVisibleContentRect const): (WebCore::ScrollView::platformVisibleContentSize const): (WebCore::ScrollView::legacyTileCache): (WebCore::ScrollView::platformSetContentsSize): (WebCore::ScrollView::platformSetScrollbarsSuppressed): (WebCore::ScrollView::platformSetScrollPosition): (WebCore::ScrollView::platformRepaintContentRectangle): (WebCore::ScrollView::platformContentsToScreen const): (WebCore::ScrollView::platformScreenToContents const): (WebCore::ScrollView::platformSetScrollOrigin): * platform/ios/WidgetIOS.mm: (WebCore::Widget::show): (WebCore::Widget::hide): (WebCore::Widget::frameRect const): (WebCore::Widget::setFrameRect): (WebCore::Widget::paint): (WebCore::Widget::addToSuperview): (WebCore::Widget::removeFromSuperview): (WebCore::Widget::convertFromRootToContainingWindow): (WebCore::Widget::convertFromContainingWindowToRoot): * platform/mac/CursorMac.mm: (WebCore::createCustomCursor): * platform/mac/ScrollAnimatorMac.mm: (-[WebScrollbarPartAnimation invalidate]): (-[WebScrollerImpDelegate cancelAnimations]): (-[WebScrollerImpDelegate invalidate]): (WebCore::ScrollAnimatorMac::~ScrollAnimatorMac): * platform/mac/ScrollViewMac.mm: (WebCore::ScrollView::documentView const): (WebCore::ScrollView::platformAddChild): (WebCore::ScrollView::platformSetScrollbarModes): (WebCore::ScrollView::platformScrollbarModes const): (WebCore::ScrollView::platformSetCanBlitOnScroll): (WebCore::ScrollView::platformTopContentInset const): (WebCore::ScrollView::platformSetTopContentInset): (WebCore::ScrollView::platformVisibleContentRect const): (WebCore::ScrollView::platformVisibleContentRectIncludingObscuredArea const): (WebCore::ScrollView::platformSetContentsSize): (WebCore::ScrollView::platformSetScrollbarsSuppressed): (WebCore::ScrollView::platformSetScrollPosition): (WebCore::ScrollView::platformRepaintContentRectangle): (WebCore::ScrollView::platformContentsToScreen const): (WebCore::ScrollView::platformScreenToContents const): (WebCore::ScrollView::platformSetScrollOrigin): * platform/mac/ScrollbarThemeMac.mm: (WebCore::ScrollbarThemeMac::scrollbarThickness): (WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle): (WebCore::ScrollbarThemeMac::minimumThumbLength): (WebCore::ScrollbarThemeMac::updateEnabledState): (WebCore::ScrollbarThemeMac::setPaintCharacteristicsForScrollbar): (WebCore::scrollerImpPaint): (WebCore::linenBackgroundColor): * platform/mac/WidgetMac.mm: (WebCore::Widget::setFocus): (WebCore::Widget::show): (WebCore::Widget::hide): (WebCore::Widget::frameRect const): (WebCore::Widget::setFrameRect): (WebCore::Widget::paint): (WebCore::Widget::setIsSelected): (WebCore::Widget::removeFromSuperview): (WebCore::Widget::convertFromRootToContainingWindow): (WebCore::Widget::convertFromContainingWindowToRoot): * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::setCookie): (WebCore::NetworkStorageSession::setCookies): (WebCore::NetworkStorageSession::setAllCookiesToSameSiteStrict): (WebCore::NetworkStorageSession::cookiesForSession const): (WebCore::NetworkStorageSession::setCookiesFromDOM const): (WebCore::NetworkStorageSession::cookieAcceptPolicy const): (WebCore::NetworkStorageSession::getRawCookies const): (WebCore::NetworkStorageSession::deleteCookie const): (WebCore::NetworkStorageSession::getHostnamesWithCookies): (WebCore::NetworkStorageSession::deleteCookiesForHostnames): * platform/network/mac/ResourceErrorMac.mm: (WebCore::ResourceError::platformLazyInit): * platform/network/mac/ResourceHandleMac.mm: (WebCore::ResourceHandle::start): * rendering/RenderThemeCocoa.mm: (WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration): 2020-07-06 Chris Fleizach AX: Add ability for AX objects to output html in debug https://bugs.webkit.org/show_bug.cgi?id=214020 Reviewed by Darin Adler. * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase innerHTML]): (-[WebAccessibilityObjectWrapperBase outerHTML]): 2020-07-06 Brady Eidson Get rid of concept of "initial connected gamepads" https://bugs.webkit.org/show_bug.cgi?id=214010 Reviewed by Tim Horton. No new tests (Refactor, no behavior change) When a page starts using gamepads and some were already connected, this concept was meant to manage when the already-connected gamepads could be revealed to the page. It obviously wasn't needed, as only the HID provider used them (GameController provider didn't) Instead, we should just always include a "does this event make gamepads visible?" bit. This cleans up a lot of weird code gets both providers working closer to each other. * Modules/gamepad/GamepadManager.cpp: (WebCore::GamepadManager::platformGamepadConnected): (WebCore::GamepadManager::platformGamepadInputActivity): * Modules/gamepad/GamepadManager.h: * platform/gamepad/GamepadProvider.cpp: (WebCore::GamepadProvider::dispatchPlatformGamepadInputActivity): * platform/gamepad/GamepadProviderClient.h: (WebCore::GamepadProviderClient::setInitialConnectedGamepads): Deleted. * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::controllerDidConnect): (WebCore::GameControllerGamepadProvider::makeInvisibileGamepadsVisible): * platform/gamepad/mac/HIDGamepadProvider.cpp: (WebCore::HIDGamepadProvider::HIDGamepadProvider): (WebCore::HIDGamepadProvider::initialGamepadsConnectedTimerFired): (WebCore::HIDGamepadProvider::openAndScheduleManager): (WebCore::HIDGamepadProvider::closeAndUnscheduleManager): (WebCore::HIDGamepadProvider::deviceAdded): (WebCore::HIDGamepadProvider::deviceRemoved): (WebCore::HIDGamepadProvider::inputNotificationTimerFired): (WebCore::HIDGamepadProvider::connectionDelayTimerFired): Deleted. * platform/gamepad/mac/HIDGamepadProvider.h: * testing/MockGamepadProvider.cpp: (WebCore::MockGamepadProvider::connectMockGamepad): 2020-07-06 Wenson Hsieh Web process sometimes crashes when translating an article on spiegel.de https://bugs.webkit.org/show_bug.cgi?id=214014 Reviewed by Tim Horton. The crash happens because we try to make a BoundaryPoint (using `makeBoundaryPoint`) out of an orphaned `Position` that is anchored before or after the anchor node (more specifically, either `PositionIsBeforeAnchor` or `PositionIsAfterAnchor`). In `makeBoundaryPoint`, we'll avoid the early `WTF::nullopt` return since the position is non-null, but then try to access the container node, which is null in this case because the anchor node has been unparented. Fix this by not attempting to observe orphaned DOM positions when extracting content for translation. Test: TextManipulation.StartTextManipulationAvoidCrashWhenExtractingOrphanedPositions * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::observeParagraphs): 2020-07-06 John Wilander Follow-up to r263992: Make isKinjaLoginAvatarElement() a free function https://bugs.webkit.org/show_bug.cgi?id=214015 Unreviewed follow-up to a quirk. Just changing isKinjaLoginAvatarElement() from member to free function. As requested in https://bugs.webkit.org/show_bug.cgi?id=213910#c10. * page/Quirks.cpp: (WebCore::isKinjaLoginAvatarElement): (WebCore::Quirks::isKinjaLoginAvatarElement const): Deleted. * page/Quirks.h: 2020-07-06 Chris Fleizach AX: Implement user action spec for Escape action https://bugs.webkit.org/show_bug.cgi?id=213875 Reviewed by Darin Adler. Implement the Escape action for the user action events. https://github.com/WICG/aom/blob/gh-pages/explainer.md#user-action-events-from-assistive-technology Test: accessibility/keyevents-posted-for-dismiss-action.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::performEscape): (WebCore::AccessibilityNodeObject::dispatchSimulatedKeyboardUpDownEvent): (WebCore::AccessibilityNodeObject::postKeyboardKeysForValueChange): * accessibility/AccessibilityNodeObject.h: * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityPerformEscape]): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::performEscape): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]): 2020-07-06 James Darpinian Fix transform feedback tests https://bugs.webkit.org/show_bug.cgi?id=213906 Reviewed by Dean Jackson. Fix transform feedback conformance tests by implementing missing functionality such as: - Transform feedback object state tracking - Validation for all GL errors that can affect state tracking before calling ANGLE - Default transform feedback object - Pause/resume - Fix vertexAttribDivisor in WebGL 2 (unrelated to transform feedback) After this, all related tests pass except for a few that also fail in Chrome, and one that uses PIXEL_PACK_BUFFER which is not yet supported. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::~WebGL2RenderingContext): (WebCore::WebGL2RenderingContext::initializeNewContext): (WebCore::WebGL2RenderingContext::deleteTransformFeedback): (WebCore::WebGL2RenderingContext::bindTransformFeedback): (WebCore::ValidateTransformFeedbackPrimitiveMode): (WebCore::WebGL2RenderingContext::beginTransformFeedback): (WebCore::WebGL2RenderingContext::endTransformFeedback): (WebCore::WebGL2RenderingContext::transformFeedbackVaryings): (WebCore::WebGL2RenderingContext::pauseTransformFeedback): (WebCore::WebGL2RenderingContext::resumeTransformFeedback): (WebCore::WebGL2RenderingContext::setIndexedBufferBinding): (WebCore::WebGL2RenderingContext::getIndexedParameter): (WebCore::WebGL2RenderingContext::getMaxTransformFeedbackSeparateAttribs): (WebCore::WebGL2RenderingContext::getParameter): (WebCore::WebGL2RenderingContext::uncacheDeletedBuffer): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLProgram.cpp: (WebCore::WebGLProgram::cacheInfoIfNeeded): * html/canvas/WebGLProgram.h: * html/canvas/WebGLTransformFeedback.cpp: (WebCore::WebGLTransformFeedback::create): (WebCore::WebGLTransformFeedback::WebGLTransformFeedback): (WebCore::WebGLTransformFeedback::setProgram): (WebCore::WebGLTransformFeedback::setBoundIndexedTransformFeedbackBuffer): (WebCore::WebGLTransformFeedback::getBoundIndexedTransformFeedbackBuffer): (WebCore::WebGLTransformFeedback::hasEnoughBuffers const): (WebCore::WebGLTransformFeedback::usesBuffer): (WebCore::WebGLTransformFeedback::unbindBuffer): (WebCore::WebGLTransformFeedback::validateProgramForResume const): * html/canvas/WebGLTransformFeedback.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::vertexAttribDivisor): 2020-07-06 Myles C. Maxfield Locale-specific quotes infrastructure needs to compare locale strings properly https://bugs.webkit.org/show_bug.cgi?id=213827 Reviewed by Darin Adler. Before this patch, WebKit is selecting which quotes to display on elements by doing a raw strcmp() on the locale string with a big table of locale strings. strcmp() is the wrong way to compare locale strings. The HTML spec has a list of locales and their associated quotes[1]. It is formulated in terms of CSS using the "lang()" pseudoclass. The spec of the lang() pseudoclass[2] describes that locale comparison needs to be done according to section 3.3.2 in RFC4647[3]. This algorithm is a pretty general algorithm, and implementing it naively would mean turning our O(log(n)) algorithm into a O(n) algorithm, which would be unfortunate. Instead, we can use a few observations about the set of locale strings we are comparing against, in order to preserve the O(log(n)) runtime: - All the locales have either 1 or 2 subtags - None of the subtags in any of the ranges are wildcards - The list is sorted, so a locale string that is a prefix of another one is listed before it. [1] https://html.spec.whatwg.org/multipage/rendering.html#quotes [2] https://drafts.csswg.org/selectors-4/#the-lang-pseudo [3] https://tools.ietf.org/html/rfc4647#page-10 Test: fast/css-generated-content/quotes-lang-2.html * WebCore.xcodeproj/xcshareddata/xcschemes/WebCore.xcscheme: * rendering/RenderQuote.cpp: (WebCore::subtagCompare): (WebCore::quoteTableLanguageComparisonFunction): (WebCore::quotesForLanguage): (WebCore::RenderQuote::computeText const): 2020-07-06 Daniel Bates [iOS] WAKWindow should override -resignFirstResponder and clear state https://bugs.webkit.org/show_bug.cgi?id=214011 Reviewed by Tim Horton. This is part of the fix for . Override -resignFirstResponder to clear out internal state that tracks the first responder in the iOS Legacy WebKit world. * platform/ios/wak/WAKWindow.mm: (-[WAKWindow resignFirstResponder]): 2020-07-06 Sam Weinig REGRESSION: (r263977): [ iOS Debug WK2 ] 36 fast form and web-platform test consistently crashing https://bugs.webkit.org/show_bug.cgi?id=214009 * rendering/RenderTheme.cpp: (WebCore::RenderTheme::weekInputStyleSheet const): Replace ""_s with emptyString() to fix crashing tests. 2020-07-06 John Wilander Storage Access API: Add the capability to open a popup and get user interaction so we can call the Storage Access API as a quirk, on behalf of websites that should be doing it themselves https://bugs.webkit.org/show_bug.cgi?id=213910 Reviewed by Darin Adler. This patch not only adds the capability but also adds a site-specific quirk for the family of Kinja sites so that no previous user interaction with kinja.com results in a login popup for kinja.com. No new tests. This is for site-specific quirks. * dom/Element.cpp: (WebCore::Element::dispatchMouseEvent): Just a change in the call into the quirk function. * page/Quirks.cpp: (WebCore::Quirks::isKinjaLoginAvatarElement const): Convenience function for telling if the given element is the Kinja login avatar. (WebCore::Quirks::triggerOptionalStorageAccessQuirk const): Now takes the whole Element to be able to look at both classes and attributes. * page/Quirks.h: 2020-07-06 Peng Liu Cleanup WebVideoFullscreenControllerAVKit.mm and PlaybackSessionInterfaceAVKit.mm https://bugs.webkit.org/show_bug.cgi?id=214005 Reviewed by Daniel Bates. No new tests, no behavior change. * platform/ios/PlaybackSessionInterfaceAVKit.mm: * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::setUpFullscreen): Remove a redundant line. 2020-07-06 Clark Wang Added PannerNode constructor according to spec https://bugs.webkit.org/show_bug.cgi?id=213801 Reviewed by Chris Dumez. Added in new PannerNode constructor to match spec: https://www.w3.org/TR/webaudio/#dom-pannernode-pannernode. Added in AudioNodeOptions and PannerOptions files. Modified some previous code in order to pass compilation. Re-baselined existing tests now that new ones are passing. New ones that fail are due to accepted range of values that attributes can take on, which are to be implemented in a future patch. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioDestinationNode.h: * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::AudioNode): * Modules/webaudio/AudioNode.h: * Modules/webaudio/AudioNodeOptions.h: Added. * Modules/webaudio/AudioNodeOptions.idl: Added. * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::PannerNode): (WebCore::PannerNodeBase::PannerNodeBase): (WebCore::PannerNode::create): * Modules/webaudio/PannerNode.h: * Modules/webaudio/PannerNode.idl: * Modules/webaudio/PannerOptions.h: Added. * Modules/webaudio/PannerOptions.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-07-06 Simon Fraser ASSERT_NOT_REACHED() in EventRegionContext::popClip() https://bugs.webkit.org/show_bug.cgi?id=213905 Reviewed by Daniel Bates. Fix an assertion seen on bing.com, tesla.com etc where event region painting would have mismatched push/pop because of an obvious code error. I spent too long trying to make a testcase and gave up. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::restoreClip): 2020-07-06 Sam Weinig Compile-time enable (but leave disabled at runtime by default) date/time input types on macOS to allow testing of cross platform (e.g. DOM) aspects of the controls https://bugs.webkit.org/show_bug.cgi?id=213949 Reviewed by Darin Adler. Enable date/time related input element types on all Cocoa platforms, but disable them at runtime. To make runtime disabling work completely, the user agent style for these element types was extracted from html.css and is now only added when needed via UserAgentStyle::ensureDefaultStyleSheetsForElement. This is the first step to allowing us to run a subset of the date/time related input element tests on more platforms. If this is successful, we should consider do this for all platforms, not just Cocoa. * css/html.css: Move to RenderTheme accessors for conditional inclusion based on Settings. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::isDateTimeField const): Deleted. * html/HTMLInputElement.h: Removed dead isDateTimeField() code. This should have been removed when datetime was removed. * html/InputType.cpp: (WebCore::createInputTypeFactoryMap): (WebCore::InputType::create): Switch from using RuntimeEnabledFeatures to Settings for checking for enabling (Settings allows us to write less boilerplate code and is more versatile for testing) and switch to checking the condition on each InputType construction, rather than just on map's creation (again, this allows us to have more flexibility in testing). * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::inputTypeColorEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInputTypeColorEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::inputTypeDateEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInputTypeDateEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::inputTypeDateTimeLocalEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInputTypeDateTimeLocalEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::inputTypeMonthEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInputTypeMonthEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::inputTypeTimeEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInputTypeTimeEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::inputTypeWeekEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInputTypeWeekEnabled): Deleted. Remove hand written code infavor of code genreated from Settings.yaml. * page/Settings.yaml: Moved from RuntimeEnabledFeatures. * platform/LocalizedStrings.h: Remove weekFormatInLDML() declaration, which had not implementation. * platform/text/PlatformLocale.cpp: (WebCore::Locale::formatDateTime): * platform/text/PlatformLocale.h: Simplify code by marking formatDateTime() virtual on all platforms and un-#ifdefing the base implementation. Platforms that wish to override it still can. * platform/text/cocoa/LocaleCocoa.h: * platform/text/cocoa/LocaleCocoa.mm: * platform/text/ios/LocalizedDateCache.h: * platform/text/ios/LocalizedDateCache.mm: Remove iOS specific #ifdefs around code that should work on all Cocoa platforms. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::colorInputStyleSheet const): (WebCore::RenderTheme::dateInputStyleSheet const): (WebCore::RenderTheme::dateTimeLocalInputStyleSheet const): (WebCore::RenderTheme::monthInputStyleSheet const): (WebCore::RenderTheme::timeInputStyleSheet const): (WebCore::RenderTheme::weekInputStyleSheet const): * rendering/RenderTheme.h: Add default user agent stylesheet strings for input types. All moved from html.css. * style/UserAgentStyle.cpp: (WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement): * style/UserAgentStyle.h: Conditionally add the input type specific user agent stylesheets only if the actual input type is being passed in. Since creation of the input types is guarded by a Setting, this can only happen if the type has been enabled. 2020-07-06 Rob Buis Allow setting empty host/hostname on URLs if they use file scheme https://bugs.webkit.org/show_bug.cgi?id=213983 Reviewed by Alex Christensen. Allow setting empty host/hostname on URLs if they use file scheme [1, 2, 3]. Behavior matches Firefox. [1] https://url.spec.whatwg.org/#dom-url-host [2] https://url.spec.whatwg.org/#dom-url-hostname [3] https://url.spec.whatwg.org/#host-state Step 1 Test: imported/w3c/web-platform-tests/url/url-setters.html * html/URLDecomposition.cpp: (WebCore::URLDecomposition::setHost): (WebCore::URLDecomposition::setHostname): 2020-07-06 Matt Gilligan Update the user agent on iPadOS to use 11 to match macOS Safari https://bugs.webkit.org/show_bug.cgi?id=213753 Reviewed by Alex Christensen. Update the version number in the desktop user agent string to 11_0. * platform/ios/UserAgentIOS.mm: (WebCore::standardUserAgentWithApplicationName): 2020-07-06 Daniel Bates Use RenderObject::positionForPoint instead of hit testing the entire view in closestEditablePositionInElementForAbsolutePoint https://bugs.webkit.org/show_bug.cgi?id=213975 Reviewed by Wenson Hsieh. The target renderer is known a priori so it is more efficient to hit test this directly instead of indirectly by hit testing the entire view. * editing/Editing.cpp: (WebCore::closestEditablePositionInElementForAbsolutePoint): 2020-07-06 Carlos Garcia Campos [GTK][WPE] Change the cookies accept policy when ITP is enabled https://bugs.webkit.org/show_bug.cgi?id=213502 Reviewed by Michael Catanzaro. Set the accept policy to always when ITP is enabled and no-third-party is set, otherwise cookies access granted by request storage access would still be rejected by libsoup if policy is set to no-third-party. * platform/network/NetworkStorageSession.cpp: (WebCore::NetworkStorageSession::setResourceLoadStatisticsEnabled): Move here the implementation for ports not using soup. * platform/network/NetworkStorageSession.h: * platform/network/soup/NetworkStorageSessionSoup.cpp: (WebCore::NetworkStorageSession::NetworkStorageSession): Initialize cookie accept policy. (WebCore::NetworkStorageSession::setCookieStorage): Set here the accept policy of the new jar. (WebCore::NetworkStorageSession::setCookieAcceptPolicy): Set the cookie accept policy taking into account that if ITP is enabled and no-third-party is set we save the policy but use always instead. (WebCore::NetworkStorageSession::cookieAcceptPolicy const): Remove the default case of the switch. (WebCore::NetworkStorageSession::setResourceLoadStatisticsEnabled): When enabled, save current policy and set always if no-third-party is set. When disabled, restore the saved policy. 2020-07-06 Alicia Boya García [MSE][GStreamer] Don't skip samples past media duration in AppendPipeline https://bugs.webkit.org/show_bug.cgi?id=213888 Reviewed by Xabier Rodriguez-Calvar. appsinkNewSample() contained code to skip samples whose presentation time starts after media duration. This is paradoxical, because later sourceBufferPrivateDidReceiveSample() extends media duration whenever the presentation end time of the sample is past the original one. It does not sound reasonable that samples extending the duration are okay on one case but outright rejected in the other. Also, if it was about skipping samples, sourceBufferPrivateDidReceiveSample() could do it itself, and already does in other cases. For all these reasons I was very doubtful of the need for this if() and indeed removing this condition didn't cause any new test failure. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::appsinkNewSample): 2020-07-05 Commit Queue Unreviewed, reverting r263960. https://bugs.webkit.org/show_bug.cgi?id=213980 Re-land, because r263959 somehow fixed the build issue caused by r263953 Reverted changeset: "Unreviewed, reverting r263953 and r263959." https://bugs.webkit.org/show_bug.cgi?id=213979 https://trac.webkit.org/changeset/263960 2020-07-05 Commit Queue Unreviewed, reverting r263953 and r263959. https://bugs.webkit.org/show_bug.cgi?id=213979 Broke internal build Reverted changesets: "[Cocoa] Move almost all features from FeatureDefines.xcconfig to PlatformEnableCocoa.h" https://bugs.webkit.org/show_bug.cgi?id=212542 https://trac.webkit.org/changeset/263953 "[Cocoa] Remove FEATURE_DEFINES from the Cocoa/Xcode build system" https://bugs.webkit.org/show_bug.cgi?id=213976 https://trac.webkit.org/changeset/263959 2020-07-05 Darin Adler [Cocoa] Remove FEATURE_DEFINES from the Cocoa/Xcode build system https://bugs.webkit.org/show_bug.cgi?id=213976 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: Removed everything except for ENABLE_WEB_RTC. * Configurations/WebCore.xcconfig: Removed FEATURE_DEFINES. * DerivedSources-input.xcfilelist: Removed FeatureDefines.xcconfig. * DerivedSources.make: Removed FEATURE_DEFINES, FEATURE_DEFINE_FLAGS, and the dependency on FeatureDefines.xcconfig. 2020-07-05 Sihui Liu Text manipulation: add a new heuristic to decide paragraph boundary https://bugs.webkit.org/show_bug.cgi?id=213918 Reviewed by Wenson Hsieh. Modified test: TextManipulation.StartTextManipulationTreatsInlineBlockLinksAndButtonsAndSpansAsParagraphs. * editing/TextManipulationController.cpp: (WebCore::isEnclosingItemBoundaryElement): 2020-07-05 Darin Adler [Cocoa] REGRESSION (r263914): Non-Apple-Pay Cocoa builds failing https://bugs.webkit.org/show_bug.cgi?id=213977 * Modules/applepay/cocoa/PaymentMethodCocoa.mm: Fixed messed up #endif and unnecessary #undef at end of file. 2020-07-05 Andy Estes [iOS] La Banque Postale app does not respect safe area insets on iOS 14 https://bugs.webkit.org/show_bug.cgi?id=213974 Reviewed by Darin Adler. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isLaBanquePostale): Added. 2020-07-05 Darin Adler [Cocoa] Move almost all features from FeatureDefines.xcconfig to PlatformEnableCocoa.h https://bugs.webkit.org/show_bug.cgi?id=212542 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: Delete everything except ENABLE_EXPERIMENTAL_FEATURES and ENABLE_WEBRTC. 2020-07-05 Wenson Hsieh [macOS 11] Indeterminate progress bar animation periodically jumps https://bugs.webkit.org/show_bug.cgi?id=213967 Reviewed by Sam Weinig. The animation for an indeterminate progress bar occasionally jumps to the starting frame on macOS 11. This is because the indeterinate progress bar animation only lasts for 120 frames on macOS 11, so our current hard-coded value of 256 frames results in 16 extra frames of animation, before abruptly looping back to the starting frame. To fix this, instead of specifying the animation frame index when painting progress bars on macOS, specify the starting time and current time for the animation, and let CoreUI determine which frame to use. * rendering/RenderProgress.cpp: (WebCore::RenderProgress::animationProgress): Assert that this never gets called with a zero animation duration. (WebCore::RenderProgress::updateAnimationState): Instead of checking for the animation duration to determine whether or not we should try and animate progress bar painting, check for the animation repeat interval instead. This is because on macOS, we no longer hard-code the animation duration, but still want to be able to animate progress bars. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::animationRepeatIntervalForProgressBar const): Deleted. (WebCore::RenderThemeIOS::animationDurationForProgressBar const): Deleted. Drive-by fix: remove some unnecessary overridden method implementations on RenderThemeIOS. * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintProgressBar): (WebCore::RenderThemeMac::animationDurationForProgressBar const): Deleted. Stop overriding this method, and remove the `progressAnimationNumFrames` constant declared in this file. 2020-07-05 Said Abou-Hallawa [macOS] Allow selecting HEIF images if the 'accept' attribute includes an image MIME type that the platform can transcode the HEIF to https://bugs.webkit.org/show_bug.cgi?id=212489 Reviewed by Darin Adler. Add some utility functions to MIMETypeRegistry. These new functions will deal with a list of MIME types combined with a list of file extensions. They are going to be used the FileChooserSettings which reflects the 'accept' attribute of the file element. * platform/MIMETypeRegistry.cpp: (WebCore::trimmedExtension): (WebCore::MIMETypeRegistry::preferredImageMIMETypeForEncoding): (WebCore::MIMETypeRegistry::containsImageMIMETypeForEncoding): (WebCore::MIMETypeRegistry::allowedMIMETypes): It returns the set of mime types which is stated by a list of mime types and a list of file extensions. (WebCore::MIMETypeRegistry::allowedFileExtensions): It returns the set of extensions which is stated by a list of mime types and a list of file extensions. * platform/MIMETypeRegistry.h: 2020-07-04 Darin Adler [Cocoa] Remove all features from FeatureDefines.xcconfig that are already mentioned in PlatformEnableCocoa.h https://bugs.webkit.org/show_bug.cgi?id=213962 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: Removed all features that were mentioned in PlatformEnableCocoa.h; the rules in that file now define whether they are enabled. 2020-07-04 Zalan Bujtas [LFC][BFC] Move PositiveAndNegativeVerticalMargin to UsedVerticalMargin https://bugs.webkit.org/show_bug.cgi?id=213963 Reviewed by Antti Koivisto. Now that UsedVerticalMargin is not used in Display::Box, we can merged these 2 layout structures. * layout/MarginTypes.h: (WebCore::Layout::UsedVerticalMargin::PositiveAndNegativePair::Values::isNonZero const): (WebCore::Layout::PositiveAndNegativeVerticalMargin::Values::isNonZero const): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingState.h: (WebCore::Layout::BlockFormattingState::hasUsedVerticalMargin const): (WebCore::Layout::BlockFormattingState::setPositiveAndNegativeVerticalMargin): Deleted. (WebCore::Layout::BlockFormattingState::hasPositiveAndNegativeVerticalMargin const): Deleted. (WebCore::Layout::BlockFormattingState::positiveAndNegativeVerticalMargin const): Deleted. * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedPositiveAndNegativeMargin const): (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginValue const): (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling): (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues const): (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore const): (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter const): (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues): * layout/blockformatting/PrecomputedBlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedPositiveNegativeValues const): (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedPositiveNegativeMarginBefore const): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox): 2020-07-04 Zalan Bujtas [LFC][BFC] Remove redundant out-of-flow height-and-margin handling https://bugs.webkit.org/show_bug.cgi?id=213959 Reviewed by Antti Koivisto. We will never end up here with an out-of-flow box. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): 2020-07-04 Zalan Bujtas [LFC][BFC] Store used vertical margin values in the formatting state https://bugs.webkit.org/show_bug.cgi?id=213958 Reviewed by Antti Koivisto. Layout related vertical margin values (collapsed vs. non-collapsed) should all go to the FormattingState, while Display::Box should only have the final values. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const): * layout/MarginTypes.h: (WebCore::Layout::marginBefore): (WebCore::Layout::marginAfter): (WebCore::Layout::UsedVerticalMargin::before const): Deleted. (WebCore::Layout::UsedVerticalMargin::after const): Deleted. (WebCore::Layout::UsedVerticalMargin::isCollapsedThrough const): Deleted. (WebCore::Layout::UsedVerticalMargin::nonCollapsedValues const): Deleted. (WebCore::Layout::UsedVerticalMargin::collapsedValues const): Deleted. (WebCore::Layout::UsedVerticalMargin::hasCollapsedValues const): Deleted. (WebCore::Layout::UsedVerticalMargin::setCollapsedValues): Deleted. (WebCore::Layout::UsedVerticalMargin::UsedVerticalMargin): Deleted. * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): (WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/blockformatting/BlockFormattingState.h: (WebCore::Layout::BlockFormattingState::setUsedVerticalMargin): (WebCore::Layout::BlockFormattingState::usedVerticalMargin const): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox): * layout/displaytree/DisplayBox.cpp: (WebCore::Display::Box::Box): (WebCore::Display::Box::nonCollapsedMarginBox const): Deleted. * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::rectWithMargin const): (WebCore::Display::Box::setHasValidVerticalMargin): (WebCore::Display::Box::setVerticalMargin): (WebCore::Display::Box::marginBefore const): (WebCore::Display::Box::marginAfter const): (WebCore::Display::Box::VerticalMargin::before const): Deleted. (WebCore::Display::Box::VerticalMargin::after const): Deleted. (WebCore::Display::Box::VerticalMargin::isCollapsedThrough const): Deleted. (WebCore::Display::Box::VerticalMargin::nonCollapsedValues const): Deleted. (WebCore::Display::Box::VerticalMargin::collapsedValues const): Deleted. (WebCore::Display::Box::VerticalMargin::hasCollapsedValues const): Deleted. (WebCore::Display::Box::VerticalMargin::setCollapsedValues): Deleted. (WebCore::Display::Box::hasCollapsedThroughMargin const): Deleted. (WebCore::Display::Box::setHasValidVerticalNonCollapsedMargin): Deleted. (WebCore::Display::Box::VerticalMargin::VerticalMargin): Deleted. (WebCore::Display::Box::VerticalMargin::NonCollapsedValues::NonCollapsedValues): Deleted. (WebCore::Display::Box::VerticalMargin::CollapsedValues::CollapsedValues): Deleted. (WebCore::Display::Box::nonCollapsedMarginBefore const): Deleted. (WebCore::Display::Box::nonCollapsedMarginAfter const): Deleted. * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutInFlowContent): (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows): (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): (WebCore::Layout::TableFormattingContext::layoutCell): 2020-07-04 Darin Adler [Cocoa] Remove unconditional features from FeatureDefines.xcconfig, making sure they are covered in PlatformEnableCocoa.h https://bugs.webkit.org/show_bug.cgi?id=212418 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: Removed features that are either unconditionally not enabled, or unconditionally enabled. Double checked that all the enabled ones are either in PlatformEnable.h or PlatformEnableCocoa.h. 2020-07-04 Sam Weinig Part 1 of SimpleColor and SRGBA are essentially the same - let's converge them https://bugs.webkit.org/show_bug.cgi?id=213948 Reviewed by Darin Adler. Begin converging SimpleColor and SRGBA, starting with removing usages that were getting SimpleColors to access or operate on the color's components. - Replace toSRGBASimpleColorLossy() with toSRGBALossy - Replace toSRGBALossy() with toSRGBALossy(). - Remove direct color component accessors from SimpleColor. - Add new ARGB type to support explicit conversion from packed ARGB bits to a color type. - Update premulitplication functions to operate on SRGBA and rename them to match existing function operating on SRGBA. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Removes SimpleColor.cpp * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::colorValue const): Replace toSRGBASimpleColorLossy() with toSRGBALossy. * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (getAttributeSetForAccessibilityObject): Replace toSRGBASimpleColorLossy() with toSRGBALossy. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::colorValue const): Replace toSRGBASimpleColorLossy() with toSRGBALossy. * css/DeprecatedCSSOMRGBColor.h: Replace toSRGBASimpleColorLossy() with toSRGBALossy. * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::detectContentInRange): Replace toSRGBALossy() with toSRGBALossy(). * platform/graphics/Color.cpp: (WebCore::Color::lightened const): (WebCore::Color::darkened const): (WebCore::Color::lightness const): (WebCore::Color::luminance const): (WebCore::Color::semanticColor const): (WebCore::Color::toSRGBASimpleColorLossy const): Deleted. (WebCore::Color::toSRGBALossy const): Deleted. * platform/graphics/Color.h: Remove toSRGBASimpleColorLossy() and templatize toSRGBALossy() to support both lossy conversion to byte based components as well. * platform/graphics/ColorBlending.cpp: (WebCore::blendSourceOver): (WebCore::blendWithWhite): Replace toSRGBASimpleColorLossy() with toSRGBALossy. (WebCore::blend): (WebCore::blendWithoutPremultiply): Replace toSRGBASimpleColorLossy() with toSRGBALossy. Adopt new premultipliedCeiling and unpremultiplied functions that operate on SRGBA (rather than SimpleColor) and clamping conversion to SRGBA via convertToComponentBytes. premultipliedCeiling now works correctly for 0 alpha, so no workaround is needed anymore. * platform/graphics/ColorTypes.h: (WebCore::asARGB): (WebCore::asSRGBA): Add new type of color struct representing a format packing. The initial one is ARGB to support the few places using SimpleColor to manipulate ARGB pixel data. * platform/graphics/ColorUtilities.cpp: (WebCore::unpremultiplied): (WebCore::premultipliedFlooring): (WebCore::premultipliedCeiling): (WebCore::unpremultipliedComponentByte): * platform/graphics/ColorUtilities.h: (WebCore::convertToComponentBytes): (WebCore::convertToComponentFloats): Move remaining premultiplication functions here (from SimpleColor.h/cpp) and reimplement to operate on SRGBA. Also slightly rename, premultiply -> premultiplied, to match existing premultiplied functions. While moving them, also fix the premultiplied functions to better support 0 alpha to avoid workarounds in callers. Additional, this adds convertToComponentBytes/convertToComponentFloats helper functions which convert to/from uint8_t/float based color types, and support creating color types from values potentially outside of their supported value range. Right now, that value range is always considerer to be 0-255 for uint8_t and 0-1 for float, but that can be chnaged in the future by allowing color type structs to indicate their supported ranges. * platform/graphics/ExtendedColor.cpp: (WebCore::ExtendedColor::toSRGBAFloatComponentsLossy const): (WebCore::ExtendedColor::toSRGBALossy const): Deleted. * platform/graphics/ExtendedColor.h: (WebCore::ExtendedColor::toSRGBALossy const): Rename existing toSRGBALossy() to toSRGBAFloatComponentsLossy() and replace templatize toSRGBALossy(), with the uint8_t case just down converting via new convertToComponentBytes. * platform/graphics/ImageBackingStore.h: (WebCore::ImageBackingStore::fillRect): (WebCore::ImageBackingStore::setPixel): (WebCore::ImageBackingStore::blendPixel): (WebCore::ImageBackingStore::pixelValue const): Replace usage of SimpleColor with new ARGB type for conversion from ARGB to SRGBA. Update to use new premulitplication functions. Also, update the interface to take pixel components as uint8_t, rather than unsigned, as that is what the callers are passing anyway, and it avoids us having to clamp/cast manually all over the case. * platform/graphics/SimpleColor.cpp: Removed. * platform/graphics/SimpleColor.h: (WebCore::SimpleColor::alphaComponent const): (WebCore::SimpleColor::asSRGBA const): (WebCore::SimpleColor::redComponent const): (WebCore::SimpleColor::greenComponent const): (WebCore::SimpleColor::blueComponent const): (WebCore::operator==): (WebCore::makeSimpleColor): Simplify interface, making red, green and blue component accessors private and having callers all use SRGBA directly. Remove premultiplication functions in favor of new ones in ColorUtilities. * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm: (WebCore::PlatformCAAnimationCocoa::setFromValue): (WebCore::PlatformCAAnimationCocoa::setToValue): (WebCore::PlatformCAAnimationCocoa::setValues): Replace toSRGBASimpleColorLossy() with toSRGBALossy. * platform/graphics/ca/win/PlatformCAAnimationWin.cpp: (PlatformCAAnimationWin::setFromValue): (PlatformCAAnimationWin::setToValue): (PlatformCAAnimationWin::setValues): Replace toSRGBASimpleColorLossy() with toSRGBALossy. * platform/graphics/cairo/CairoUtilities.cpp: (WebCore::setSourceRGBAFromColor): Replace toSRGBALossy() with toSRGBALossy(). * platform/graphics/cairo/GradientCairo.cpp: (WebCore::addColorStopRGBA): (WebCore::setCornerColorRGBA): (WebCore::interpolateColorStop): Replace toSRGBALossy() with toSRGBALossy(). * platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp: (WebCore::ImageBufferCairoImageSurfaceBackend::platformTransformColorSpace): Replace usage of SimpleColor with new ARGB type for conversion from ARGB to SRGBA. Update to use new premulitplication functions. * platform/graphics/cairo/NativeImageCairo.cpp: (WebCore::nativeImageSinglePixelSolidColor): Replace usage of SimpleColor with new ARGB type for conversion from ARGB to SRGBA. Update to use new premulitplication functions. * platform/graphics/cpu/arm/filters/FELightingNEON.h: (WebCore::FELighting::platformApplyNeon): Replace toSRGBASimpleColorLossy() with toSRGBALossy. * platform/graphics/filters/FELighting.cpp: (WebCore::FELighting::drawLighting): Replace toSRGBALossy() with toSRGBALossy(). * platform/graphics/filters/FilterOperations.cpp: (WebCore::FilterOperations::transformColor const): (WebCore::FilterOperations::inverseTransformColor const): Replace toSRGBALossy() with toSRGBALossy(). * platform/graphics/gtk/ColorGtk.cpp: (WebCore::Color::operator GdkRGBA const): Replace toSRGBALossy() with toSRGBALossy(). * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGL::drawBorder): (WebCore::TextureMapperGL::drawNumber): (WebCore::prepareFilterProgram): (WebCore::TextureMapperGL::drawSolidColor): (WebCore::TextureMapperGL::clearColor): Replace toSRGBALossy() with toSRGBALossy(). * platform/graphics/win/ColorDirect2D.cpp: (WebCore::Color::operator D2D1_COLOR_F const): (WebCore::Color::operator D2D1_VECTOR_4F const): Replace toSRGBALossy() with toSRGBALossy(). * platform/graphics/win/GradientDirect2D.cpp: (WebCore::Gradient::generateGradient): Replace toSRGBALossy() with toSRGBALossy(). * platform/graphics/win/GraphicsContextCGWin.cpp: (WebCore::GraphicsContext::drawDotsForDocumentMarker): Replace direct usage component access from SimpleColor with usage of accessed SRGBA. * platform/graphics/win/GraphicsContextDirect2D.cpp: (WebCore::GraphicsContext::colorWithGlobalAlpha const): Replace toSRGBALossy() with toSRGBALossy(). * rendering/RenderTheme.cpp: (WebCore::RenderTheme::disabledTextColor const): Replace toSRGBALossy() with toSRGBALossy(). * rendering/RenderThemeIOS.mm: (WebCore::shouldUseConvexGradient): Replace toSRGBALossy() with toSRGBALossy(). * rendering/TextPaintStyle.cpp: (WebCore::textColorIsLegibleAgainstBackgroundColor): Replace toSRGBALossy() with toSRGBALossy(). * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: (WebCore::SVGAnimationColorFunction::animate): Replace toSRGBASimpleColorLossy() with toSRGBALossy. 2020-07-04 Zalan Bujtas [LFC] Remove redundant Display::Box::HorizontalMargin c'tors https://bugs.webkit.org/show_bug.cgi?id=213957 Reviewed by Antti Koivisto. Let's just have a very simple Display::Box:HorizontalMargin struct. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::HorizontalMargin::HorizontalMargin): Deleted. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin): 2020-07-04 Zalan Bujtas [LFC] Do not cache computed horizontal margin values https://bugs.webkit.org/show_bug.cgi?id=213956 Reviewed by Antti Koivisto. Outside of the width + margin computation, computed horizontal margin values are only required by float positioning. Let's just re-computed them on demand (which is basically just a style.marginStart/end resolve). * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layout): * layout/LayoutUnits.h: * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats): (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): * layout/displaytree/DisplayBox.cpp: (WebCore::Display::Box::Box): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::setHasValidVerticalNonCollapsedMargin): (WebCore::Display::Box::setHasValidHorizontalComputedMargin): Deleted. (WebCore::Display::Box::ComputedHorizontalMargin::ComputedHorizontalMargin): Deleted. (WebCore::Display::Box::setHorizontalComputedMargin): Deleted. (WebCore::Display::Box::computedMarginStart const): Deleted. (WebCore::Display::Box::computedMarginEnd const): Deleted. * layout/floats/FloatingContext.cpp: (WebCore::Layout::computedHorizontalMargin): (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const): * layout/floats/FloatingContext.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin): (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows): (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): (WebCore::Layout::TableFormattingContext::layoutCell): 2020-07-04 Darin Adler Make generate-unified-sources.sh not depend on features being listed in FEATURE_DEFINES environment variable https://bugs.webkit.org/show_bug.cgi?id=212420 Reviewed by Don Olmstead. * Scripts/generate-unified-sources.sh: Added code to include sources from SourcesCocoaInternalSDK.txt, only if USE_INTERNAL_SDK is YES. Removed --feature-flags argument from invocation of generate-unified-source-bundles.rb. Removed many unnecessary quotes. * SourcesCocoa.txt: Removed the names of the files from the internal SDK. * SourcesCocoaInternalSDK.txt: Added. Moved those names here. * html/MediaElementSession.cpp: Added some includes, apparently needed because of different groupings of unified sources. 2020-07-04 Zalan Bujtas [LFC] Used dedicated paint margin structures https://bugs.webkit.org/show_bug.cgi?id=213955 Reviewed by Antti Koivisto. This is in preparation for having only final margin values in Display::Box. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::VerticalMargin::before const): (WebCore::Display::Box::VerticalMargin::after const): (WebCore::Display::Box::VerticalMargin::isCollapsedThrough const): (WebCore::Display::Box::VerticalMargin::nonCollapsedValues const): (WebCore::Display::Box::VerticalMargin::collapsedValues const): (WebCore::Display::Box::VerticalMargin::hasCollapsedValues const): (WebCore::Display::Box::VerticalMargin::setCollapsedValues): (WebCore::Display::Box::VerticalMargin::VerticalMargin): (WebCore::Display::Box::VerticalMargin::NonCollapsedValues::NonCollapsedValues): (WebCore::Display::Box::VerticalMargin::CollapsedValues::CollapsedValues): (WebCore::Display::Box::ComputedHorizontalMargin::ComputedHorizontalMargin): (WebCore::Display::Box::HorizontalMargin::HorizontalMargin): (WebCore::Display::Box::setHorizontalMargin): (WebCore::Display::Box::setVerticalMargin): (WebCore::Display::Box::setHorizontalComputedMargin): (WebCore::Display::Box::verticalMargin const): (WebCore::Display::Box::horizontalMargin const): * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::FloatItem::horizontalMargin const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin): (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin): 2020-07-04 Darin Adler Update comment in FeatureDefines.xcconfig since PlatformEnableCocoa.h should be used instead https://bugs.webkit.org/show_bug.cgi?id=213952 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: Updated comment. 2020-07-04 Youenn Fablet Enable VTB required low latency code path https://bugs.webkit.org/show_bug.cgi?id=210609 Reviewed by Darin Adler. Add new runtime flag for the low latency code path. Call webrtc newly introduced setter whenever creating a new encoder factory. Manually tested. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCH264LowLatencyEncoderEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCH264LowLatencyEncoderEnabled): * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): 2020-07-03 Youenn Fablet MediaRecorder should support peer connection remote video tracks https://bugs.webkit.org/show_bug.cgi?id=213924 Reviewed by Darin Adler. Previsouly we were checking whether width and height are given for a video track. This is not always available, for instance for remote tracks. And this can change over time. Instead, pass a simple boolean (whether there is a video track or not). Minor simplifications to stop storing unneeded members. Tests: imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-bitrate.https.html imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-creation.https.html imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-detached-context.html imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-disabled-tracks.https.html imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-events-and-exceptions.html imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-mimetype.html imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-no-sink.https.html imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-pause-resume.html imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-peerconnection.https.html imported/w3c/web-platform-tests/mediacapture-record/passthrough/MediaRecorder-passthrough.https.html * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::create): (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::create): 2020-07-03 Darin Adler WebCore/Sources.txt: Remove all remaining #if (ENABLE_WEBGL and ENABLE_WEBXR) https://bugs.webkit.org/show_bug.cgi?id=213946 Reviewed by Sam Weinig. * CMakeLists.txt: Move IDL-related ENABLE_WEBGL and ENABLE_WEBXR items out of if blocks. Longer term, I think our direction should be to remove most feature conditionals from CMakeLists.txt too, just like I am doing for Sources.txt. But for now, doing just enough of this to keep the build working. Someone can tidy this later as desired. * Sources.txt: Remove all remaining #if, and sort files, getting rid of paragraphing per directory to just turn this into three sorted lists of filenames (separate ones for derived sources and generated bindings at the end). The source files themselves have the appropriate conditionals and soon we will not need to support #if in Sources.txt files. 2020-07-03 Fujii Hironori [Win] Unreviewed stack-overflow crash fix for r263890 https://bugs.webkit.org/show_bug.cgi?id=213912 Renamed mimeTypeForExtension to mimeTypeForExtensionFromRegistry. * platform/win/MIMETypeRegistryWin.cpp: (WebCore::mimeTypeForExtensionFromRegistry): (WebCore::MIMETypeRegistry::mimeTypeForExtension): (WebCore::mimeTypeForExtension): Deleted. 2020-07-03 Fujii Hironori [Win] Unreviewed build fix for r263913 https://bugs.webkit.org/show_bug.cgi?id=213939 * CMakeLists.txt: Process encrypted media IDL files even if ENABLE_ENCRYPTED_MEDIA is off. 2020-07-03 Darin Adler WebCore/Sources.txt: Remove #if ENABLE_WIRELESS_PLAYBACK_TARGET https://bugs.webkit.org/show_bug.cgi?id=213945 Reviewed by Sam Weinig. * CMakeLists.txt: Moved items from the pictureinpicture and remoteplayback module here from PlatformMac.cmake. Even if these are currently only implemented on Mac, they are not intrinsically Mac-specific, so they belong here. * PlatformMac.cmake: Ditto. * Sources.txt: Remove #if ENABLE_WIRELESS_PLAYBACK_TARGET and sort files in with the others. The source files themselves have conditionals, we don't need conditionals in Sources.txt, and we are moving towards removing the capability for #if ENABLE in the Sources.txt file. 2020-07-03 Sam Weinig Remove support for ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE https://bugs.webkit.org/show_bug.cgi?id=213932 Reviewed by Darin Adler. Removes support for non-standard , currently being guarded by the macro ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE. This macro, was added back in 2013 as a temporary measure to support some engines who shipped support for . It is currently not enabled for any ports so now seems like as good a time as any to remove it. * Configurations/FeatureDefines.xcconfig: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/html.css: (#endif): * html/DateTimeInputType.cpp: Removed. * html/DateTimeInputType.h: Removed. * html/InputType.cpp: (WebCore::createInputTypeFactoryMap): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::inputTypeDateTimeEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInputTypeDateTimeEnabled): Deleted. * platform/DateComponents.cpp: (WebCore::DateComponents::setMillisecondsSinceEpochForDateTimeLocal): (WebCore::DateComponents::millisecondsSinceEpoch const): (WebCore::DateComponents::toString const): (WebCore::DateComponents::fromParsingDateTime): Deleted. (WebCore::DateComponents::parseDateTime): Deleted. (WebCore::DateComponents::fromMillisecondsSinceEpochForDateTime): Deleted. (WebCore::DateComponents::setMillisecondsSinceEpochForDateTime): Deleted. * platform/DateComponents.h: * platform/text/PlatformLocale.cpp: (WebCore::Locale::formatDateTime): * platform/text/ios/LocalizedDateCache.mm: (WebCore::LocalizedDateCache::createFormatterForType): 2020-07-03 Darin Adler WebCore/Sources.txt: Remove #if ENABLE_USER_MESSAGE_HANDLERS https://bugs.webkit.org/show_bug.cgi?id=213944 Reviewed by Sam Weinig. * CMakeLists.txt: Move IDL-related ENABLE_USER_MESSAGE_HANDLERS items out of if blocks. Longer term, I think our direction should be to remove most feature conditionals from CMakeLists.txt too, just like I am doing for Sources.txt. But for now, doing just enough of this to keep the build working. Someone can tidy this later as desired. * Sources.txt: Remove #if ENABLE_USER_MESSAGE_HANDLERS and sort files in with the others. The source files themselves have conditionals, we don't need conditionals in Sources.txt, and we are moving towards removing the capability for #if ENABLE in the Sources.txt file. 2020-07-03 Darin Adler WebCore/SourcesCocoa.txt: Remove #if ENABLE_APPLE_PAY https://bugs.webkit.org/show_bug.cgi?id=213943 Reviewed by Sam Weinig. * SourcesCocoa.txt: Remove #if ENABLE_APPLE_PAY and sort files in with the others. The source files themselves have conditionals, we don't need conditionals in Sources.txt, and we are moving towards removing the capability for #if ENABLE in the Sources.txt file. Also, sort the files and remove the separate per-directory paragraphs, making this closer to just a sorted list of filenames with less "editorial" content. Also added comments about the USE_INTERNAL_SDK part of the file. 2020-07-03 Darin Adler WebCore/Sources.txt: Remove #if ENABLE_ENCRYPTED_MEDIA https://bugs.webkit.org/show_bug.cgi?id=213939 Reviewed by Sam Weinig. * CMakeLists.txt: Move IDL-related ENABLE_ENCRYPTED_MEDIA items out of if blocks. Longer term, I think our direction should be to remove most feature conditionals from CMakeLists.txt too, just like I am doing for Sources.txt. But for now, doing just enough of this to keep the build working. Someone can tidy this later as desired. * Sources.txt: Remove #if ENABLE_LEGACY_ENCRYPTED_MEDIA and sort files in with the others. The IDL files themselves have conditionals, we don't need conditionals in Sources.txt, and we are moving towards removing the capability for #if ENABLE in the Sources.txt file. 2020-07-03 Darin Adler WebCore/Sources.txt: Remove #if ENABLE_LEGACY_ENCRYPTED_MEDIA https://bugs.webkit.org/show_bug.cgi?id=213937 Reviewed by Sam Weinig. * CMakeLists.txt: Move IDL-related ENABLE_LEGACY_ENCRYPTED_MEDIA items out of if blocks. Longer term, I think our direction should be to remove most feature conditionals from CMakeLists.txt too, just like I am doing for Sources.txt. But for now, doing just enough of this to keep the build working. Someone can tidy this later as desired. * Sources.txt: Remove #if ENABLE_LEGACY_ENCRYPTED_MEDIA and sort files in with the others. The IDL files themselves have conditionals, we don't need conditionals in Sources.txt, and we are moving towards removing the capability for #if ENABLE in the Sources.txt file. 2020-07-03 Darin Adler WebCore/Sources.txt: Remove #if ENABLE_QUOTA https://bugs.webkit.org/show_bug.cgi?id=213941 Reviewed by Sam Weinig. * CMakeLists.txt: Move IDL-related ENABLE_QUOTA items out of "if (ENABLE_QUOTA)". Longer term, I think our direction should be to remove most feature conditionals from CMakeLists.txt too, just like I am doing for Sources.txt. But for now, doing just enough of this to keep the build working. Someone can tidy this later as desired. * Sources.txt: Remove #if ENABLE_QUOTA and sort files in with the others. The source files themselves have conditionals, we don't need conditionals in Sources.txt, and we are moving towards removing the capability for #if ENABLE in the Sources.txt file. 2020-07-03 Darin Adler WebCore/Sources.txt: Remove #if ENABLE_GAMEPAD https://bugs.webkit.org/show_bug.cgi?id=213936 Reviewed by Sam Weinig. * CMakeLists.txt: Move IDL-related ENABLE_GAMEPAD items out of "if (ENABLE_GAMEPAD)". Longer term, I think our direction should be to remove most feature conditionals from CMakeLists.txt too, just like I am doing for Sources.txt. But for now, doing just enough of this to keep the build working. Someone can tidy this later as desired. * Sources.txt: Remove #if ENABLE_GAMEPAD and sort files in with the others. The IDL files themselves have conditionals, we don't need conditionals in Sources.txt, and we are moving towards removing the capability for #if ENABLE in the Sources.txt file. 2020-07-03 Darin Adler WebCore/Sources.txt: Remove #if ENABLE_MEDIA_SOURCE https://bugs.webkit.org/show_bug.cgi?id=213940 Reviewed by Sam Weinig. * Sources.txt: Remove #if ENABLE_MEDIA_SOURCE and sort files in with the others. The IDL files themselves have conditionals, we don't need conditionals in Sources.txt, and we are moving towards removing the capability for #if ENABLE in the Sources.txt file. 2020-07-03 Lauro Moura [WPE] Fix build with clang after r263898 https://bugs.webkit.org/show_bug.cgi?id=213942 Unreviewed build fix. * loader/appcache/ApplicationCacheManifestParser.cpp: 2020-07-03 Darin Adler WebCore/Sources.txt: Remove #if ENABLE_APPLICATION_MANIFEST https://bugs.webkit.org/show_bug.cgi?id=213935 Reviewed by Sam Weinig. * Sources.txt: Remove #if ENABLE_APPLICATION_MANIFEST and sort files in with the others. The source files themselves have conditionals, we don't need conditionals in Sources.txt, and we are moving towards removing the capability for #if ENABLE in the Sources.txt file. 2020-07-03 Sam Weinig Add "-Wliteral-conversion" warning to Xcode based builds and fix the issues it finds https://bugs.webkit.org/show_bug.cgi?id=213931 Reviewed by Darin Adler. * Configurations/Base.xcconfig: Add -Wliteral-conversion. * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::draw): Fix error due to passing a double when a uint8_t was expected. This probably means that the debug borders looked wrong for a little bit, but should now be back to their transparent splendor. 2020-07-03 Zalan Bujtas [LFC][TFC][Quirk] Inflow child box quirk vertical margins should collapse with table cell. https://bugs.webkit.org/show_bug.cgi?id=213926 Reviewed by Antti Koivisto. The BFC rootd (table cell box in this case) nornally do not collapse their margins with the first/last inflow child. However in quirks mode, cell boxes collapse their (non-existing)margins with inflow quirk margins.

text content

<-

box's top position is at 0px in quirks mode, while at 16px (1em) in strict mode. This patch ensures that we collapse the quirk margins and take them into account when computing the cell's content height. Test: fast/layoutformattingcontext/table-quirk-vertical-margin-simple.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::shouldCollapseMarginBeforeWithParentMarginBefore const): (WebCore::Layout::BlockFormattingContext::Quirks::shouldCollapseMarginAfterWithParentMarginAfter const): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore const): (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter const): (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues): * layout/tableformatting/TableFormattingContext.h: (WebCore::Layout::TableFormattingContext::Quirks::Quirks): * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::cellHeigh const): * layout/tableformatting/TableFormattingContextQuirks.cpp: Added. (WebCore::Layout::TableFormattingContext::Quirks::shouldIgnoreChildContentVerticalMargin const): 2020-07-03 Sam Weinig Split color conversion functions out of ColorUtilities.h/cpp into their own file. https://bugs.webkit.org/show_bug.cgi?id=213803 Reviewed by Simon Fraser. Moves color conversion functions (both between color spaces like toDisplayP3(const SRGBA&) and between different representations like toHSLA(const SRGBA&)) to their own files. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Add new files. * css/parser/CSSPropertyParserHelpers.cpp: * editing/cocoa/DataDetection.mm: * html/canvas/CanvasRenderingContext2DBase.cpp: * html/canvas/CanvasStyle.cpp: Add include of ColorConversion.h * platform/graphics/ColorConversion.cpp: Added. * platform/graphics/ColorConversion.h: Added. * platform/graphics/ColorUtilities.cpp: * platform/graphics/ColorUtilities.h: Move functions to the new files. * platform/graphics/ExtendedColor.cpp: * platform/graphics/cairo/ImageBufferCairoBackend.cpp: * platform/graphics/filters/FELighting.cpp: Add include of ColorConversion.h, remove unncessary include of ColorUtilities.h * platform/graphics/cairo/ImageBufferCairoSurfaceBackend.cpp: * platform/graphics/filters/FEDisplacementMap.cpp: * platform/graphics/filters/FEMorphology.cpp: * platform/graphics/filters/FilterOperations.cpp: Remove unncessary include of ColorUtilities.h * platform/graphics/filters/FilterOperation.cpp: Add include of ColorConversion.h and ColorTypes.h, remove unncessary include of ColorUtilities.h. * platform/graphics/gtk/ColorGtk.cpp: * platform/graphics/win/ColorDirect2D.cpp: Remove unncessary include of ColorUtilities.h. Update to use standard float -> SimpleColor idiom using SRGBA. 2020-07-03 Sam Weinig Convert DateComponents parsing code to use Optional based return values rather than out-parameters https://bugs.webkit.org/show_bug.cgi?id=213440 Reviewed by Darin Adler. Rework DateComponents and Date/Time related InputTypes to use Optional based programming for parsing results. Also take the opportunity to remove unicode upconversion from DateComponent parsing and instead separate UChar and LChar variants via templates. * html/BaseDateAndTimeInputType.cpp: * html/BaseDateAndTimeInputType.h: * html/DateInputType.cpp: * html/DateInputType.h: * html/DateTimeInputType.cpp: * html/DateTimeInputType.h: * html/DateTimeLocalInputType.cpp: * html/DateTimeLocalInputType.h: * html/HTMLInputElement.cpp: * html/HTMLInputElement.h: * html/InputType.cpp: * html/InputType.h: * html/MonthInputType.cpp: * html/MonthInputType.h: * html/TimeInputType.cpp: * html/TimeInputType.h: * html/WeekInputType.cpp: * html/WeekInputType.h: - Removes parseToDateComponentsInternal. No need it and parseToDateComponents. - Makes parseToDateComponents pure virtual. The old code had a default implementations down in InputType, but it had no callers. - Remove iOS vs. non-iOS difference for dateType(). It is now available on InputType on all platforms. - Make setMillisecondToDateComponents and parseToDateComponents return an Optional. * platform/DateComponents.cpp: * platform/DateComponents.h: - Replace member function based interfaces for parsing/setting explicit time offsets with new factory functions that return Optional. - These factories are implemented using the existing member functions, which are now private. - Make max/min constants constexpr. - Make parse* member functions templates to allow factory parse functions to call them without upconverting. - Replace header guard with #pragma once. 2020-07-03 Sam Weinig Cleanup ApplicationCacheManifestParser.h/cpp https://bugs.webkit.org/show_bug.cgi?id=213844 Reviewed by Alex Christensen. Address some post review comments. * loader/appcache/ApplicationCacheManifestParser.cpp: (WebCore::parseApplicationCacheManifest): Fix typos: manfest -> manifest. * loader/appcache/ApplicationCacheManifestParser.h: Stop including ApplicationCache.h, and only include / declare what's needed. 2020-07-03 Youenn Fablet Support MediaRecorder.onstart https://bugs.webkit.org/show_bug.cgi?id=213720 Reviewed by Darin Adler. Fire start event if MediaRecorder.start is successful. Do some WebIDL clean-up, in particular change timeSlice from long to unsigned long, as per spec. Covered by added test. * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::startRecording): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorder.idl: 2020-07-03 Youenn Fablet MediaRecorder.start() Method is Ignoring the "timeslice" Parameter https://bugs.webkit.org/show_bug.cgi?id=202233 Reviewed by Eric Carlson. Use a timer to implement timeSlice parameter. Schedule timer either when start is called or as part of requestData callback. This should ensure that, if requestData is called by the application, the timer will be rescheduled appropriately. Test: http/wpt/mediarecorder/MediaRecorder-start-timeSlice.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::startRecording): (WebCore::MediaRecorder::requestData): * Modules/mediarecorder/MediaRecorder.h: 2020-07-03 Youenn Fablet MediaRecorder stopRecorder() returns empty Blob after first use https://bugs.webkit.org/show_bug.cgi?id=212274 Reviewed by Eric Carlson. Refactor code to create/destroy MediaRecorderPrivate on MediaRecorder start/stop. This allows reusing a MediaRecorder after a stop and restarting with a clean state. We introduce MediaRecorderPrivate::startRecording to do the initialization, which allows to fix a potential ref cycle as part of the error callback handling. Make some improvements to the platform implementation, in particular add default initialization to all fields. Align the code using AudioConverterRef to what is done in AudioSampleDataSource. Also call VTCompressionSessionInvalidate when destroying the VideoSampleBufferCompressor. Test: http/wpt/mediarecorder/MediaRecorder-multiple-start-stop.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::startRecording): (WebCore::MediaRecorder::stopRecording): (WebCore::MediaRecorder::requestData): * Modules/mediarecorder/MediaRecorder.h: * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::fetchData): * platform/mediarecorder/MediaRecorderPrivate.h: (WebCore::MediaRecorderPrivate::startRecording): * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: (WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor): (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription): (WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded): (WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount): (WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets): (WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime): * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::stopRecording): * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: (WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor): 2020-07-03 Said Abou-Hallawa Change the names of MIMETypeRegistry methods to comply with webkit naming style https://bugs.webkit.org/show_bug.cgi?id=213912 Reviewed by Youenn Fablet. Remove the verb 'get' from the name of some of the methods of MIMETypeRegistry. * editing/cocoa/WebArchiveResourceFromNSAttributedString.mm: (WebCore::if): * fileapi/File.cpp: (WebCore::File::computeNameAndContentType): * html/HTMLPlugInElement.cpp: (WebCore::pluginReplacementForType): * loader/mac/LoaderNSURLExtras.mm: (suggestedFilenameWithMIMEType): * platform/MIMETypeRegistry.cpp: (WebCore::commonMimeTypesMap): (WebCore::MIMETypeRegistry::mediaMIMETypeForExtension): (WebCore::MIMETypeRegistry::mimeTypeForPath): (WebCore::MIMETypeRegistry::isSupportedImageMIMEType): (WebCore::MIMETypeRegistry::normalizedMIMEType): (WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary): (WebCore::MIMETypeRegistry::getMediaMIMETypeForExtension): Deleted. (WebCore::MIMETypeRegistry::getMediaMIMETypesForExtension): Deleted. Delete this function since it is not used. (WebCore::MIMETypeRegistry::getMIMETypeForPath): Deleted. (WebCore::MIMETypeRegistry::getNormalizedMIMEType): Deleted. * platform/MIMETypeRegistry.h: * platform/cocoa/MIMETypeRegistryCocoa.mm: (WebCore::MIMETypeRegistry::mimeTypeForExtension): (WebCore::MIMETypeRegistry::extensionsForMIMEType): (WebCore::MIMETypeRegistry::preferredExtensionForMIMEType): (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Deleted. (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): Deleted. (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): Deleted. * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::load): * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (WebCore::ImageDecoderAVFObjC::filenameExtension const): * platform/graphics/gstreamer/ImageDecoderGStreamer.h: * platform/network/curl/CurlRequest.cpp: (WebCore::CurlRequest::invokeDidReceiveResponseForFile): * platform/playstation/MIMETypeRegistryPlayStation.cpp: (WebCore::MIMETypeRegistry::mimeTypeForExtension): (WebCore::MIMETypeRegistry::preferredExtensionForMIMEType): (WebCore::MIMETypeRegistry::extensionsForMIMEType): (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Deleted. (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): Deleted. (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): Deleted. * platform/win/MIMETypeRegistryWin.cpp: (WebCore::MIMETypeRegistry::preferredExtensionForMIMEType): (WebCore::MIMETypeRegistry::mimeTypeForExtension): (WebCore::MIMETypeRegistry::extensionsForMIMEType): (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): Deleted. (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Deleted. (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): Deleted. * platform/xdg/MIMETypeRegistryXdg.cpp: (WebCore::MIMETypeRegistry::mimeTypeForExtension): (WebCore::MIMETypeRegistry::preferredExtensionForMIMEType): (WebCore::MIMETypeRegistry::extensionsForMIMEType): (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Deleted. (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): Deleted. (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): Deleted. 2020-07-03 Carlos Garcia Campos [GTK4] Enable threaded rendering by default https://bugs.webkit.org/show_bug.cgi?id=213883 Reviewed by Adrian Perez de Castro. When building with GTK4 we no longer use the cairo context to render directly, so we can always enable the threaded rendering. In WPE port threaded rendering is only enabled when env var WEBKIT_NICOSIA_PAINTING_THREADS is present. This patch changes a bit the meaning of the env var, so that when 0 is passed the feature is disabled too, instead of setting the number of threads to 4. * platform/graphics/nicosia/NicosiaPaintingEngine.cpp: (Nicosia::PaintingEngine::create): 2020-07-02 Mark Lam ReadableStream::create() should handle any exceptions that may be thrown during construction. https://bugs.webkit.org/show_bug.cgi?id=213819 Reviewed by Youenn Fablet and Yusuke Suzuki. Win EWS detected that ReadableStream::create() can throw exceptions, and we were failing to handle it. This patch fixes that. * Modules/cache/DOMCache.cpp: (WebCore::DOMCache::put): * Modules/fetch/FetchBodyOwner.cpp: (WebCore::FetchBodyOwner::readableStream): (WebCore::FetchBodyOwner::createReadableStream): * Modules/fetch/FetchBodyOwner.h: * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::clone): * bindings/js/ReadableStream.cpp: (WebCore::ReadableStream::create): * bindings/js/ReadableStream.h: 2020-07-02 Alex Christensen Update Mac CMake build * PlatformMac.cmake: 2020-07-02 Said Abou-Hallawa MIMETypeRegistry::getExtensionsForMIMEType() needs to handle wildcard MIME types https://bugs.webkit.org/show_bug.cgi?id=213826 Reviewed by Darin Adler. Addressing post commit review comments for r263832. * platform/cocoa/MIMETypeRegistryCocoa.mm: (WebCore::extensionsForMIMETypeMap): 2020-07-02 Brady Eidson GameController.framework soft linking refactoring https://bugs.webkit.org/show_bug.cgi?id=213909 Reviewed by Tim Horton. No new tests (No behavior changes) * WebCore.xcodeproj/project.pbxproj: * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::startMonitoringGamepads): * platform/gamepad/cocoa/GameControllerSPI.h: Added. * platform/gamepad/cocoa/GameControllerSoftLink.h: Added. * platform/gamepad/cocoa/GameControllerSoftLink.mm: Added. 2020-07-02 Simon Fraser REGRESSION(r260276): menu items in footer of https://salo.ai are invisible until you hover or resize https://bugs.webkit.org/show_bug.cgi?id=213712 Reviewed by Zalan Bujtas. A negative z-index child triggers a foreground layer inside overflow scroll. This foreground layer gets the PaintingOverflowContents flag but not the PaintingCompositingScrollingPhase flag, but we still need to avoid the clip check that happens in RenderBlock::paint(), so change RenderLayer::paintLayerContents() to just check for isPaintingOverflowContents. Test: compositing/scrolling/async-overflow-scrolling/foreground-layer-paint-phase.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayerContents): 2020-07-02 Antoine Quint visualViewport.addEventListener("scroll"*** fires permanently after zoom or orientation change https://bugs.webkit.org/show_bug.cgi?id=211522 Reviewed by Simon Fraser. Correctly set the flag indicating that a scroll event has been dispatched on the visual viewport. Test: fast/visual-viewport/scroll-event-fired-during-scroll-alone.html * dom/Document.cpp: (WebCore::Document::runScrollSteps): 2020-07-02 Zalan Bujtas Overlapping content on earny.co https://bugs.webkit.org/show_bug.cgi?id=213864 Reviewed by Simon Fraser. Do not use a 1px value for initial min/max content width. * rendering/AutoTableLayout.cpp: (WebCore::AutoTableLayout::recalcColumn): (WebCore::AutoTableLayout::calcEffectiveLogicalWidth): (WebCore::AutoTableLayout::layout): I found 2 places where we rely on the initial 1px value for min/max width. This might cause some "regression". 2020-07-02 Ryan Haddad Unreviewed, reverting r263633, r263651, and r263671. Still seeing MediaRecorder test crashes after re-landing r263633 Reverted changesets: "MediaRecorder stopRecorder() returns empty Blob after first use" https://bugs.webkit.org/show_bug.cgi?id=212274 https://trac.webkit.org/changeset/263633 "MediaRecorder.start() Method is Ignoring the "timeslice" Parameter" https://bugs.webkit.org/show_bug.cgi?id=202233 https://trac.webkit.org/changeset/263651 "Support MediaRecorder.onstart" https://bugs.webkit.org/show_bug.cgi?id=213720 https://trac.webkit.org/changeset/263671 2020-07-02 Antti Koivisto REGRESSION: Comments section at dpreview has overlapping names with comment on phone https://bugs.webkit.org/show_bug.cgi?id=213890 Reviewed by Simon Fraser. Test: fast/text-autosizing/ios/float-miscomputed-line-height.html * rendering/TextAutoSizing.cpp: (WebCore::TextAutoSizingValue::adjustTextNodeSizes): Negative value is used to indicate unset line-height. We shouldn't make adjustments in this case. This matches Style::BuilderCustom code. 2020-07-02 Zalan Bujtas [LFC][BFC] Remove redundant margin-border-padding when computing the intrinsic width https://bugs.webkit.org/show_bug.cgi?id=213882 Reviewed by Antti Koivisto. The child intrinsic width already includes the margin-border-padding values. Test: fast/layoutformattingcontext/table-with-margin-content-simple.html * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): 2020-07-02 Zalan Bujtas [LFC][IFC] Use computed height as minimum height for the row https://bugs.webkit.org/show_bug.cgi?id=213880 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/table-fixed-row-height-simple.html * layout/tableformatting/TableLayout.cpp: (WebCore::Layout::TableFormattingContext::TableLayout::distributedVerticalSpace): 2020-07-02 Youenn Fablet getUserMedia returns OverConstrained on Jitsi https://bugs.webkit.org/show_bug.cgi?id=210932 Reviewed by Philippe Normand. We compute the max width, max height and max frame rate across all presets. In case a preset for the max resolution is different from the preset for the max frame rate, we were selecting capture parameters that no preset can match. To fix the issue, in case the frame rate constraint is not mandatory, and we do not find a preset when starting to capture, we remove the frame rate constraint, pick the preset and choose the max frame rate from that preset. Update mock sources to have a high resolution preset with low frame rate to enable writing a test. Test: fast/mediastream/get-user-media-ideal-constraints.html * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate): * platform/mediastream/RealtimeVideoCaptureSource.cpp: (WebCore::RealtimeVideoCaptureSource::bestSupportedSizeAndFrameRate): (WebCore::RealtimeVideoCaptureSource::setSizeAndFrameRate): * platform/mediastream/VideoPreset.h: (WebCore::VideoPreset::maxFrameRate const): * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::defaultDevices): 2020-07-02 Carlos Garcia Campos Unreviewed. Fix GTK4 build * platform/gtk/GtkVersioning.h: (gtk_scrolled_window_new): 2020-07-02 Rob Buis Fragment navigation involving fragment identifiers does not match specification https://bugs.webkit.org/show_bug.cgi?id=83930 Reviewed by Darin Adler. Implement step 5 and 6 of [1] to allow fragment identifier lookup using percent-decoding, after normal lookup failed. Behavior matches Chrome and Firefox. [1] https://html.spec.whatwg.org/multipage/browsing-the-web.html#the-indicated-part-of-the-document Tests: imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name.html imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding-2.html imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding.html imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-non-utf8-encoded-document.html * page/FrameView.cpp: (WebCore::FrameView::scrollToFragmentInternal): 2020-07-02 Alexander Mikhaylenko [GTK] Kinetic scrolling is still triggered if you wait before lifting fingers https://bugs.webkit.org/show_bug.cgi?id=213789 Reviewed by Carlos Garcia Campos. The intended behavior for kinetic scrolling is that it's possible to not trigger it by stopping moving fingers before lifting them, as opposed to doing a fling/swipe. However, right now it's broken and trying to do this triggers kinetic scrolling as well. Currently, the last scroll event with (0, 0) deltas isn't added to the scroll history for kinetic scrolling. However, this is wrong, because the last event, or rather the timespan between it and the previous scroll event, actually determines the kinetic scrolling velocity: if this event follows the previous one quickly, the velocity is large, but if there was a long pause, the velocity would be close to 0. See https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1902 and https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1903 for the equivalent GTK fixes. * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent): * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::handleWheelEvent): * platform/generic/ScrollAnimatorGeneric.cpp: (WebCore::ScrollAnimatorGeneric::handleWheelEvent): 2020-07-02 Philippe Normand [GStreamer] Rewrite mediastreamsrc element https://bugs.webkit.org/show_bug.cgi?id=213777 Reviewed by Xabier Rodriguez-Calvar. The underlying functionality remains the same, design-wise. This is mostly a refactoring switching to smart pointers as much as possible and trying to comply with WebKit code style guidelines. The previous version of this element was leaking pad templates and sticky stream-start events (in webkitMediaStreamSrcTrackEnded). The LIBWEBRTC ifdef guards were removed as well, because there's no actual libwebrtc dependency involved in this code. No new tests, existing webrtc and fast/mediastream tests cover this patch. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (mediaStreamTrackPrivateGetTags): (webkitMediaStreamNew): (WebKitMediaStreamTrackObserver::WebKitMediaStreamTrackObserver): (WebKitMediaStreamObserver::WebKitMediaStreamObserver): (InternalSource::InternalSource): (InternalSource::~InternalSource): (InternalSource::src const): (InternalSource::pushSample): (webkitMediaStreamSrcUriGetType): (webkitMediaStreamSrcUriGetProtocols): (webkitMediaStreamSrcUriGetUri): (webkitMediaStreamSrcUriSetUri): (webkitMediaStreamSrcUriHandlerInit): (webkitMediaStreamSrcSetProperty): (webkitMediaStreamSrcGetProperty): (webkitMediaStreamSrcConstructed): (stopObservingTracks): (webkitMediaStreamSrcFinalize): (webkitMediaStreamSrcChangeState): (webkit_media_stream_src_class_init): (webkitMediaStreamSrcChain): (webkitMediaStreamSrcAddPad): (ProbeData::ProbeData): (webkitMediaStreamSrcPadProbeCb): (webkitMediaStreamSrcSetupSrc): (webkitMediaStreamSrcPostStreamCollection): (webkitMediaStreamSrcAddTrack): (webkitMediaStreamSrcRemoveTrackByType): (webkitMediaStreamSrcSetStream): (webkitMediaStreamSrcPushVideoSample): (webkitMediaStreamSrcPushAudioSample): (webkitMediaStreamSrcTrackEnded): (webkitMediaStreamSrcNew): * platform/mediastream/gstreamer/GStreamerMediaStreamSource.h: 2020-07-01 Said Abou-Hallawa MIMETypeRegistry::getExtensionsForMIMEType() needs to handle wildcard MIME types https://bugs.webkit.org/show_bug.cgi?id=213826 Reviewed by Darin Adler. Working towards webkit.org/b/213347, it needs to be possible for WebCore to get the file extensions for wildcard MIME types, e.g. "image/*" or "video/*". For Cocoa platforms, we will enumerate the UTIs of the system. Get the MIMEType and the extensions of each UTI. Add the following pairs to a singleton HashMap: { MIMEType, extension } { Type(MIMEType)/*, extension } Change MIMETypeRegistry::getExtensionsForMIMEType() such that it calls extensionsForWildcardMIMEType() if the MIMEType ends with "*". * platform/MIMETypeRegistry.h: * platform/cocoa/MIMETypeRegistryCocoa.mm: (WebCore::extensionsForMIMETypeMap): (WebCore::extensionsForWildcardMIMEType): (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): * platform/playstation/MIMETypeRegistryPlayStation.cpp: (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): * platform/win/MIMETypeRegistryWin.cpp: (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): * platform/xdg/MIMETypeRegistryXdg.cpp: (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): 2020-07-01 Said Abou-Hallawa Allow the File object to be created with a replacement file https://bugs.webkit.org/show_bug.cgi?id=213825 Reviewed by Darin Adler. Working towards webkit.org/b/213347, it needs to be possible to create the File object with an optional replacement file. Only the registered BlobDataFileReference will be created with both the original file path and the replacement file path. So it can delete the replacement file when it is destroyed. Otherwise BlobDataFileReference will be created with the replacement file path. It is important to create the File object with the replacement file because it needs to get the meta-data and the bytes of the replacement file not the original file. * fileapi/File.cpp: (WebCore::File::create): * fileapi/File.h: * fileapi/ThreadableBlobRegistry.cpp: (WebCore::ThreadableBlobRegistry::registerFileBlobURL): * fileapi/ThreadableBlobRegistry.h: * html/DirectoryFileListCreator.cpp: (WebCore::createFileList): * html/FileInputType.cpp: (WebCore::FileInputType::filesFromFormControlState): When the Files are created from a FormControlState, they will be created without replacement files since they might have been deleted. (WebCore::FileInputType::filesChosen): (WebCore::FileInputType::receiveDroppedFiles): * platform/FileChooser.cpp: (WebCore::FileChooser::chooseFiles): (WebCore::FileChooser::chooseMediaFiles): * platform/FileChooser.h: (WebCore::FileChooserFileInfo::isolatedCopy const): (WebCore::FileChooser::chooseFiles): (WebCore::FileChooserFileInfo::FileChooserFileInfo): Deleted. * platform/network/BlobDataFileReference.cpp: (WebCore::BlobDataFileReference::BlobDataFileReference): (WebCore::BlobDataFileReference::~BlobDataFileReference): (WebCore::BlobDataFileReference::path): (WebCore::BlobDataFileReference::startTrackingModifications): * platform/network/BlobDataFileReference.h: * platform/network/BlobRegistry.h: 2020-07-01 Don Olmstead [CMake] Add WOFF2 targets https://bugs.webkit.org/show_bug.cgi?id=213865 Reviewed by Fujii Hironori. Use the WOFF:: targets when USE_WOFF2 is set. * CMakeLists.txt: 2020-07-01 Chris Fleizach AX: Implement relevant simulated key presses for custom ARIA widgets for increment/decrement https://bugs.webkit.org/show_bug.cgi?id=213744 Reviewed by Darin Adler. In order to allow custom ARIA widgets to work, we can post keyboard events for specific ax actions that are not handled natively. Spec: https://github.com/WICG/aom/blob/gh-pages/explainer.md#user-action-events-from-assistive-technology Test: accessibility/keyevents-posted-for-increment-actions.html accessibility/keyevents-for-increment-actions-with-node-removal.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::postKeyboardKeysForValueChange): (WebCore::AccessibilityNodeObject::setNodeValue): (WebCore::AccessibilityNodeObject::changeValueByStep): (WebCore::AccessibilityNodeObject::changeValueByPercent): * accessibility/AccessibilityNodeObject.h: * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::setValue): * accessibility/AccessibilityRenderObject.h: * accessibility/AccessibilityScrollbar.cpp: (WebCore::AccessibilityScrollbar::setValue): * accessibility/AccessibilityScrollbar.h: * accessibility/AccessibilitySlider.cpp: (WebCore::AccessibilitySlider::setValue): * accessibility/AccessibilitySlider.h: * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::setValue): * accessibility/isolatedtree/AXIsolatedObject.h: 2020-07-01 Wenson Hsieh Fix the WebKit build after https://bugs.webkit.org/show_bug.cgi?id=213832 Reviewed by Tim Horton. Upcoming changes to will cause the WebKit build to break, due to conflicting declarations of WKObject in both WebCore (WAK) code and the WebKit API. Avoid this by renaming the WAK version to WAKObject, rather than WKObject. Additionally, fix some minor style issues along the way. * platform/ios/wak/WKTypes.h: * platform/ios/wak/WKUtilities.c: (WKRetain): (WKRelease): (_WAKObjectDealloc): (WKGetClassInfo): (_WKObjectDealloc): Deleted. * platform/ios/wak/WKUtilities.h: * platform/ios/wak/WKView.h: * platform/ios/wak/WKView.mm: (_WKViewDealloc): 2020-07-01 Zalan Bujtas [LFC][TFC] Add support for non-baseline aligned cell height https://bugs.webkit.org/show_bug.cgi?id=213845 Reviewed by Antti Koivisto. Adjust max ascent/descent only when the cell is basline aligned. Test: fast/layoutformattingcontext/table-cell-height-middle-align-simple.html * layout/tableformatting/TableLayout.cpp: (WebCore::Layout::TableFormattingContext::TableLayout::distributedVerticalSpace): 2020-07-01 Antoine Quint [Media Controls] Tracks panel can show text tracks with mode "hidden" as selected https://bugs.webkit.org/show_bug.cgi?id=213839 Reviewed by Jer Noble. We only considered text tracks that had their "mode" set to "disabled" as tracks that weren't selected, but there is also the "hidden" mode which should share the same UI state. We now check for "mode" to be set to "showing" to consider a text track as selected in the tracks panel. Test: media/modern-media-controls/tracks-support/tracks-support-hidden-tracks.html * Modules/modern-media-controls/media/tracks-support.js: (TracksSupport.prototype.tracksPanelIsTrackInSectionSelected): 2020-07-01 Sam Weinig Regression (r263788): Windows build broken: nameForRenderTreeAsText is not a member of WebCore::Color https://bugs.webkit.org/show_bug.cgi?id=213841 Fix Windows build. * platform/graphics/ca/win/PlatformCALayerWin.cpp: (printColor): 2020-07-01 Youenn Fablet Make NetworkSendQueue use CString instead of String for UTF-8 data https://bugs.webkit.org/show_bug.cgi?id=213714 Reviewed by Darin Adler. Use CString instead of String in NetworkSendQueue as all data is to be encoded as UTF-8. This allows converting and allocating the UTF-8 string only once. Covered by existing tests. * Modules/mediastream/RTCDataChannel.cpp: (WebCore::RTCDataChannel::createMessageQueue): (WebCore::RTCDataChannel::send): * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp: (WebCore::LibWebRTCDataChannelHandler::sendStringData): (WebCore::LibWebRTCDataChannelHandler::sendRawData): * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h: * fileapi/NetworkSendQueue.cpp: (WebCore::NetworkSendQueue::enqueue): (WebCore::NetworkSendQueue::processMessages): * fileapi/NetworkSendQueue.h: * platform/mediastream/RTCDataChannelHandler.h: * platform/mock/RTCDataChannelHandlerMock.cpp: (WebCore::RTCDataChannelHandlerMock::sendStringData): * platform/mock/RTCDataChannelHandlerMock.h: 2020-07-01 Alexey Shvayka Use more efficient makeString() instead of StringBuilder https://bugs.webkit.org/show_bug.cgi?id=213708 Reviewed by Sam Weinig. This patch refactors throwRequiredMemberTypeError() and throwArgument*Error() methods, replacing all StringBuilder usages with more efficient makeString(). Extracts makeArgumentTypeErrorMessage(), similiar to existing helpers, which can be reused if neccessary. No new tests, no behavior change. * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::makeArgumentTypeErrorMessage): (WebCore::throwArgumentMustBeEnumError): (WebCore::throwArgumentMustBeFunctionError): (WebCore::throwArgumentMustBeObjectError): (WebCore::throwArgumentTypeError): (WebCore::throwRequiredMemberTypeError): (WebCore::appendArgumentMustBe): Deleted. 2020-06-29 Sergio Villar Senin [css-flexbox] Don't include scrollbar extents when computing sizes for percentage resolution https://bugs.webkit.org/show_bug.cgi?id=213739 Reviewed by Javier Fernandez. Content override sizes do include scrollbars so they must be substracted when using the override size to compute percentages. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::crossSizeForPercentageResolution): Remove scrollbars. (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): Ditto. 2020-06-30 Sergio Villar Senin [css-flex] Remove death code paths when evaluating percentage resolution https://bugs.webkit.org/show_bug.cgi?id=213809 Reviewed by Manuel Rego Casasnovas. Both crossSizeForPercentageResolution() and mainSizeForPercentageResolution() are only called from childLogicalHeightForPercentageResolution(). The former is called whenever hasOrthogonalFlow(child) is false and the latter when it's true. However crossSizeForPercentageResolution() has a path for hasOrthogonalFlow(child)==true which is impossible to reach. The same happens to mainSizeForPercentageResolution() which has a path for hasOrthogonalFlow(child)==false which is also impossible to reach. Remove both death code paths and replace them by assertions. We're also making both methods private since are not meant to be used from the outside. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::crossSizeForPercentageResolution): Remove death code path. (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): Ditto. * rendering/RenderFlexibleBox.h: Make both calls private. 2020-06-30 Sam Weinig Split Color serialization out of Color classes https://bugs.webkit.org/show_bug.cgi?id=213820 Reviewed by Darin Adler. Move all color serialization related functions out of the Color family of classes, and into a standalone ColorSerialization.h Now all color serialization calls one of the following three functions, depending on need: - serializationForCSS(...) - serializationForHTML(...) - serializationForRenderTreeAsText(...) These are overload for all three Color classes (Color, SimpleColor and ExtendedColor) to allow easy use without necessarily needing to construct another type. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Add new files. * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const): * editing/EditingStyle.cpp: (WebCore::EditingStyle::inverseTransformColorIfNeeded): (WebCore::StyleChange::extractTextStyles): * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::detectContentInRange): * html/ColorInputType.cpp: (WebCore::ColorInputType::didChooseColor): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::shadowColor const): * html/canvas/CanvasStyle.h: (WebCore::CanvasStyle::color const): * html/track/TextTrackCueGeneric.cpp: (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties): (WebCore::TextTrackCueGeneric::toJSON const): * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildArrayForCanvasGradient): * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::colorPropertyCSS const): * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): (WebCore::DragController::insertDroppedImagePlaceholdersAtCaret): * platform/graphics/Color.cpp: (WebCore::operator<<): (WebCore::Color::serialized const): Deleted. (WebCore::Color::cssText const): Deleted. (WebCore::Color::nameForRenderTreeAsText const): Deleted. * platform/graphics/Color.h: * platform/graphics/ColorSerialization.cpp: Added. (WebCore::decimalDigit): (WebCore::fractionDigitsForFractionalAlphaValue): (WebCore::serializationForCSS): (WebCore::serializationForHTML): (WebCore::serializationForRenderTreeAsText): (WebCore::serialization): * platform/graphics/ColorSerialization.h: Added. * platform/graphics/ExtendedColor.cpp: (WebCore::ExtendedColor::cssText const): Deleted. * platform/graphics/ExtendedColor.h: * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::dumpProperties const): * platform/graphics/InbandGenericCue.cpp: (WebCore::InbandGenericCue::toJSONString const): * platform/graphics/SimpleColor.cpp: (WebCore::SimpleColor::serializationForHTML const): Deleted. (WebCore::decimalDigit): Deleted. (WebCore::fractionDigitsForFractionalAlphaValue): Deleted. (WebCore::SimpleColor::serializationForCSS const): Deleted. (WebCore::SimpleColor::serializationForRenderTreeAsText const): Deleted. * platform/graphics/SimpleColor.h: * platform/graphics/filters/FEDropShadow.cpp: (WebCore::FEDropShadow::externalRepresentation const): * platform/graphics/filters/FEFlood.cpp: (WebCore::FEFlood::externalRepresentation const): * rendering/RenderTreeAsText.cpp: (WebCore::RenderTreeAsText::writeRenderObject): * rendering/svg/SVGRenderTreeAsText.cpp: (WebCore::writeRenderSVGTextBox): * svg/properties/SVGPropertyTraits.h: (WebCore::SVGPropertyTraits::toString): * testing/Internals.cpp: (WebCore::Internals::viewBaseBackgroundColor): (WebCore::Internals::highlightPseudoElementColor): (WebCore::Internals::systemColorForCSSValue): (WebCore::Internals::focusRingColor): Adopt new serialization functions. 2020-06-30 Fujii Hironori [WinCairo] Unreviewed build fix after r263776 > WebCore\platform\graphics\ColorUtilities.h(67): error C2039: 'lround': is not a member of 'std' * platform/graphics/ColorUtilities.h: Include for std::lround. 2020-06-30 Andres Gonzalez Code cleanup in AccessibilityMenuList.cpp and AXIsolatedTree.h. https://bugs.webkit.org/show_bug.cgi?id=213806 Reviewed by Darin Adler. No change in functionality. Minor code cleanup pointed out by Darin Adler in reviews for bug 209169 and bug 213575. * accessibility/AccessibilityMenuList.cpp: (WebCore::AccessibilityMenuList::isCollapsed const): * accessibility/isolatedtree/AXIsolatedTree.h: 2020-06-30 Sam Weinig Move Color blending related functions to their own files https://bugs.webkit.org/show_bug.cgi?id=213742 Reviewed by Dean Jackson. - Moves Color::blend(const Color&), Color::blendWithWhite(), blend(const Color&, const Color&, double) and blendWithoutPremultiply(const Color&, const Color&, double) to their own files: ColorBlending.h/cpp - Renames Color::blend(const Color&) to blendSourceOver(const Color&, const Color&) - Renames Color::blendWithWhite() to blendWithWhite(const Color&). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Add new files. * platform/graphics/Color.cpp: (WebCore::Color::blend const): Deleted. (WebCore::Color::blendWithWhite const): Deleted. (WebCore::blend): Deleted. (WebCore::blendWithoutPremultiply): Deleted. * platform/graphics/Color.h: * platform/graphics/ColorBlending.cpp: Copied from Source/WebCore/platform/graphics/Color.cpp. * platform/graphics/ColorBlending.h: Added. Move declarations / implementations from Color.h/cpp to ColorBlending.h/cpp. * css/CSSGradientValue.cpp: * editing/FrameSelection.cpp: (WebCore::CaretBase::computeCaretColor): * page/FrameView.cpp: (WebCore::FrameView::documentBackgroundColor const): * page/TextIndicator.cpp: (WebCore::estimatedBackgroundColorForRange): * page/animation/CSSPropertyAnimation.cpp: * platform/graphics/filters/FilterOperation.cpp: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintFillLayerExtended): * rendering/RenderMenuList.cpp: (RenderMenuList::getItemBackgroundColor const): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::transformSelectionBackgroundColor const): Update for new signatures and #include ColorBlending.h as neeeded. 2020-06-30 Sam Weinig Rename ManifestParser.h/cpp to ApplicationCacheManifestParser.h/cpp to make it clear its not the ApplicationManifestParser (a different thing entirely) https://bugs.webkit.org/show_bug.cgi?id=213815 Reviewed by Darin Adler. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * loader/appcache/ApplicationCacheGroup.cpp: * loader/appcache/ApplicationCacheManifestParser.cpp: Copied from Source/WebCore/loader/appcache/ManifestParser.cpp. * loader/appcache/ApplicationCacheManifestParser.h: Copied from Source/WebCore/loader/appcache/ManifestParser.h. * loader/appcache/ManifestParser.cpp: Removed. * loader/appcache/ManifestParser.h: Removed. 2020-06-30 Brady Eidson App-bound JavaScript and Navigation failures should have specific error codes. and https://bugs.webkit.org/show_bug.cgi?id=213808 Reviewed by Tim Hatcher. (Informally by Kate Cheney) Covered by API tests. * bindings/js/ExceptionDetails.h: 2020-06-30 Mark Lam Add handling for a case of OOME in CSSTokenizer and CSSParser. https://bugs.webkit.org/show_bug.cgi?id=213702 Reviewed by Darin Adler. We add a bool* constructionSuccess feedback argument to the private CSSTokenizer constructor. If construction fails and constructionSuccess is provided, the constructor will set *constructionSuccess to false. If construction fails and constructionSuccess is not provided, the constructor will crash with a failed RELEASE_ASSERT. In other words, the client may opt in to handle the failure to construct if it doesn't want the default behavior of crashing on failure. We also provide 2 convenience factory methods for CSSTokenizer which will return a null std::unique_ptr if construction fails. This is currently only used by CSSParserImpl, and ensures that its m_tokenizer is null if we fail to construct. This ensures that there isn't a pointer to a partially constructed tokenizer that some code may unknowingly use. The reason we don't force all clients of CSSTokenizer to use the factory methods instead is because there are clients that currently use on-stack instantiations of CSSTokenizer to do their work. We don't want to force them to switch to using a malloc instance. Currently, the constructors used by those clients do not provide a constructionSuccess argument to the underlying private constructor. Hence, for them, the CSSTokenizer constructor will crash if construction fails, which is how things work in pre-existing code. The only difference is that the crash is deferred till the client attempts to use the tokenizer instead of at construction time. As of this patch, only CSSParser::parseSupportsCondition() makes use of the new feedback mechanism, and handles OOME during CSSTokenizer construction by interpreting it as CSS not supporting the passed in condition string. Test: css3/out-of-memory-in-css-tokenizer.html * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseSupportsCondition): * css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::CSSParserImpl): (WebCore::CSSParserImpl::failed const): * css/parser/CSSParserImpl.h: * css/parser/CSSTokenizer.cpp: (WebCore::CSSTokenizer::CSSTokenizer): * css/parser/CSSTokenizer.h: (WebCore::CSSTokenizer::failed const): 2020-06-30 Peng Liu Enable the support of FULLSCREEN_API in WebKitTestRunner https://bugs.webkit.org/show_bug.cgi?id=213774 Reviewed by Youenn Fablet. Replace the definition of ENABLE_FULLSCREEN_API in FeatureDefines.xcconfig with the one in PlatformEnableCocoa.h. We have to do that because WebKitTestRunner does not have a FeatureDefines.xcconfig but it uses "ENABLE(FULLSCREEN_API)" to conditionally compile code to test the element fullscreen API. WebKitTestRunner can use the macro defined in PlatformEnableCocoa.h. * Configurations/FeatureDefines.xcconfig: 2020-06-30 Daniel Bates [iOS] Editable regions causes ~1% slowdown in PLT5 https://bugs.webkit.org/show_bug.cgi?id=213659 Reviewed by Simon Fraser. Fix the slowdown by only enabling editable region when Page::editableElementsInRect is called. There are two parts that make computing the editable region expensive: 1. Requires traversing descendents during painting when a normal paint may be able to avoid this. 2. Can cause more event region invalidations because it extends the invalidation criterion to include changes to element editability. Tests: editing/editable-region/hit-test-basic-without-editable-region.html editing/editable-region/iframe-without-editable-region.html editing/editable-region/text-field-basic-without-editable-region.html Tests: editing/editable-region/hit-test-basic-without-editable-region.html editing/editable-region/iframe-without-editable-region.html editing/editable-region/text-field-basic-without-editable-region.html * page/Frame.cpp: (WebCore::Frame::invalidateContentEventRegionsIfNeeded): Check if editable region is enabled. If it is then do what we do now. Otherwise, don't invalidate the region unless we were going to do so anyway. * page/Page.cpp: (WebCore::Page::setEditableRegionEnabled): Added. Update state and then invalidate the event region in all layers. (WebCore::Page::shouldBuildEditableRegion const): Added. Returns whether to build the editable region: either when Page::isEditableRegionEnabled() is true or the editable region debug overlay is enabled. (WebCore::Page::didFinishLoad): Turn off editable region as it may not be needed on the new page. * page/Page.h: (WebCore::Page::isEditableRegionEnabled const): Added. * rendering/EventRegion.cpp: (WebCore::EventRegion::unite): (WebCore::EventRegion::translate): (WebCore::EventRegion::containsEditableElementsInRect const): (WebCore::EventRegion::dump const): * rendering/EventRegion.h: (WebCore::EventRegion::hasEditableRegion const): (WebCore::EventRegion::rectsForEditableElements const): (WebCore::EventRegion::decode): (WebCore::EventRegion::ensureEditableRegion): The editable region is now an Optional<>. There will only be one if ensureEditableRegion was called, which is only when Page::isEditableRegionEnabled() returns true. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::paintObject): * rendering/RenderElement.cpp: (WebCore::RenderElement::styleWillChange): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::maintainsEventRegion const): Only do what we do now if Page::shouldBuildEditableRegion() returns true. (WebCore::RenderLayerBacking::updateEventRegion): Instantiate the editable region, if needed. Painting will then populate it. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::applyToCompositedLayerIncludingDescendants): Added. (WebCore::RenderLayerCompositor::invalidateEventRegionForAllLayers): Added. (WebCore::RenderLayerCompositor::clearBackingForAllLayers): Wrote in terms of applyToCompositedLayerIncludingDescendants. (WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants): Deleted. * rendering/RenderLayerCompositor.h: * testing/InternalSettings.cpp: (WebCore::InternalSettings::setEditableRegionEnabled): * testing/InternalSettings.h: * testing/InternalSettings.idl: Add a new internal setting for testing purposes to toggle enabling/disabling editable region. 2020-06-30 Peng Liu Scrunching a video to PiP can result in broken animation and leave Safari in a bad state https://bugs.webkit.org/show_bug.cgi?id=213175 Reviewed by Jer Noble. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::setVideoFullscreenStandby): (WebCore::HTMLMediaElement::setVideoFullscreenStandby): The "standby" state is relevant to a video element only when its presentation mode is VideoFullscreenModeNone. * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::exitFullscreen): (VideoFullscreenInterfaceAVKit::cleanupFullscreen): Add a flag m_enteringPictureInPicture. Function exitFullscreen() and cleanupFullscreen() will check m_enteringPictureInPicture and they will abort the process to exit fullscreen/picture-in-picture if the flag is true. However, VideoFullscreenManager will retry to exit fullscreen/picture-in-picture after it confirms that the previous starting picture-in-picture process is completed. (VideoFullscreenInterfaceAVKit::willStartPictureInPicture): Set the flag m_enteringPictureInPicture. (VideoFullscreenInterfaceAVKit::didStartPictureInPicture): Call m_fullscreenChangeObserver->didEnterFullscreen() if the entering picture-in-picture process is started by the UI process (e.g., swipe-up gesture). Clear m_standby and m_enteringPictureInPicture after the video element enters picture-in-picture. 2020-06-30 Alex Christensen Remove WTF::MD5 https://bugs.webkit.org/show_bug.cgi?id=213766 Reviewed by Youenn Fablet. * Modules/websockets/WebSocketHandshake.cpp: * platform/network/curl/CurlCacheEntry.cpp: (WebCore::CurlCacheEntry::generateBaseFilename): 2020-06-30 Youenn Fablet Set runtime flag m_isWebRTCPlatformCodecsInGPUProcessEnabled to false by default https://bugs.webkit.org/show_bug.cgi?id=213779 Reviewed by Alex Christensen. No change of behavior since this flag is WebKit 2 only and off by default. Move off by default WebRTC flags at the end of the section. * page/RuntimeEnabledFeatures.h: 2020-06-30 Jason Lawrence Unreviewed, reverting r263753. This commit caused build failures across multiple platforms. Reverted changeset: "Move Color blending related functions to their own files" https://bugs.webkit.org/show_bug.cgi?id=213742 https://trac.webkit.org/changeset/263753 2020-06-30 Sam Weinig Move Color blending related functions to their own files https://bugs.webkit.org/show_bug.cgi?id=213742 Reviewed by Dean Jackson. - Moves Color::blend(const Color&), Color::blendWithWhite(), blend(const Color&, const Color&, double) and blendWithoutPremultiply(const Color&, const Color&, double) to their own files: ColorBlending.h/cpp - Renames Color::blend(const Color&) to blendSourceOver(const Color&, const Color&) - Renames Color::blendWithWhite() to blendWithWhite(const Color&). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Add new files. * platform/graphics/Color.cpp: (WebCore::Color::blend const): Deleted. (WebCore::Color::blendWithWhite const): Deleted. (WebCore::blend): Deleted. (WebCore::blendWithoutPremultiply): Deleted. * platform/graphics/Color.h: * platform/graphics/ColorBlending.cpp: Copied from Source/WebCore/platform/graphics/Color.cpp. * platform/graphics/ColorBlending.h: Added. Move declarations / implementations from Color.h/cpp to ColorBlending.h/cpp. * css/CSSGradientValue.cpp: * editing/FrameSelection.cpp: (WebCore::CaretBase::computeCaretColor): * page/FrameView.cpp: (WebCore::FrameView::documentBackgroundColor const): * page/TextIndicator.cpp: (WebCore::estimatedBackgroundColorForRange): * page/animation/CSSPropertyAnimation.cpp: * platform/graphics/filters/FilterOperation.cpp: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintFillLayerExtended): * rendering/RenderMenuList.cpp: (RenderMenuList::getItemBackgroundColor const): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::transformSelectionBackgroundColor const): Update for new signatures and #include ColorBlending.h as neeeded. 2020-06-30 Andy Estes [Xcode] Enable the "My Mac (Mac Catalyst)" destination in WebKit Xcode projects https://bugs.webkit.org/show_bug.cgi?id=213740 Reviewed by Darin Adler. * Configurations/Base.xcconfig: Set SUPPORTS_MACCATALYST to YES to tell Xcode that this project supports building for Mac Catalyst. 2020-06-30 Michael Catanzaro [WPE][GTK] Update stale comment in UserAgentGLib.cpp https://bugs.webkit.org/show_bug.cgi?id=213749 Reviewed by Adrian Perez de Castro. Remove outdated comment. * platform/glib/UserAgentGLib.cpp: (WebCore::platformVersionForUAString): 2020-06-30 Youenn Fablet Add VP9 WebRTC codec runtime flag https://bugs.webkit.org/show_bug.cgi?id=213724 Reviewed by Eric Carlson. Add binding code to switch on/off VP9 in WebRTC factories based on runtime flag. Test: webrtc/vp9.html * page/Page.cpp: (WebCore::m_shouldRelaxThirdPartyCookieBlocking): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP9CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9CodecEnabled): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::setWebRTCH265Support): (WebCore::Internals::setWebRTCVP9Support): * testing/Internals.h: * testing/Internals.idl: 2020-06-29 Antoine Quint [Web Animations] REGRESSION: Bootstrap Carousel component v4.1 regressed with Web Animations https://bugs.webkit.org/show_bug.cgi?id=213376 Reviewed by Dean Jackson. An older version of the Bootstrap CSS and JS library had a rather odd way to implement a completion callback for a transition: it would register a "transitionend" event but also set a timeout of the transition's duration and use whichever came first as a callback to run completion tasks for the transition. Additionally, in that callback, it would set the transitioned value to the same computed value but using a different specified value, for instance setting the "transform" CSS property to "translateX(0)" instead of "translateY(0)". In our implementation this would make the completed transition repeat. Indeed, we would first incorrectly assume that the transition was still "running" and not "finished", per the CSS Transitions spec terminology as we only update that status when we update animations under Page::updateRendering(). We now update an existing transition's status first in AnimationTimeline::updateCSSTransitionsForElementAndProperty(). Another issue is that when we considered the existing transition to be running, even though it was finished, we would use the "timeline time at creation" to compute its current progress, which would yield situations where we computed the before-change style to be the existing transition's current computed value, except that transition's progress was 0 since the "timeline time at creation" happens before the transition's resolved start time. We now only use the "timeline time at creation" in the situations it was designed to be used: either when the transition has not yet had a resolved start time, or its resolved start time is the current timeline time (ie. it was just set). To be able to compare the transition's resolved start time and the current timeline time, we also updated the internal start time getter and setter methods to use Seconds instead of double which is only needed for the JS bindings. Test: webanimations/css-transition-retargeting-to-same-value-upon-completion-with-timeout.html * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::updateCSSTransitionsForElementAndProperty): * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::bindingsStartTime const): (WebCore::DeclarativeAnimation::setBindingsStartTime): * animation/WebAnimation.cpp: (WebCore::WebAnimation::bindingsStartTime const): (WebCore::WebAnimation::setBindingsStartTime): (WebCore::WebAnimation::setStartTime): (WebCore::WebAnimation::startTime const): Deleted. * animation/WebAnimation.h: (WebCore::WebAnimation::startTime const): (WebCore::WebAnimation::bindingsStartTime const): Deleted. 2020-06-29 Brady Eidson JavaScript cannot be injected into iframes and https://bugs.webkit.org/show_bug.cgi?id=213556 Reviewed by Geoff Garen. Covered by API tests. * bindings/js/ExceptionDetails.h: Start a collection of "exception types" that will grow quickly, beginning with the specialized "missing frame" type. 2020-06-29 Sam Weinig Convert AppCache manifest parser over to using StringParsingBuffer https://bugs.webkit.org/show_bug.cgi?id=213680 Reviewed by Darin Adler. - Renames parseManifest to parseApplicationCacheManifest to differentiate between the manifest for the application cache and the "application manifest", which is a different thing entirely. Also renames the container struct from being called Manifest to ApplicationCacheManifest. (The file should be renamed as well, but will do that in a seperate pass). - Update parser to return an Optional rather than using bool + out parameter. - Adopt readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). - Adopt StringParsingBuffer and ParsingUtilities along with some refinements to the code to make the intent more clear. * html/parser/ParsingUtilities.h: (WebCore::skipUntil): Fix formatting, putting the whole signature on one line. * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): Update for new parser function name and Optional return type. * loader/appcache/ManifestParser.cpp: (WebCore::isManifestWhitespace): (WebCore::isManifestNewline): (WebCore::isManifestWhitespaceOrNewline): (WebCore::makeManifestURL): (WebCore::parseApplicationCacheManifest): * loader/appcache/ManifestParser.h: Update parsing logic to use readCharactersForParsing (to avoid upconvesion) and rework using StringParsingBuffer/ParsingUtilities to make things more clear. 2020-06-29 Zalan Bujtas [LFC][TFC] Adjust baseline when the table cell itself establishes an IFC https://bugs.webkit.org/show_bug.cgi?id=213735 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/table-cell-baseline-offset-simple2.html * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell): 2020-06-29 Zalan Bujtas [LFC][TFC] Adjust baseline offset for continuation https://bugs.webkit.org/show_bug.cgi?id=213732 Reviewed by Antti Koivisto. Skip empty IFC generated for the "pre" part of the continuation (e.g.

text content
). Test: fast/layoutformattingcontext/table-cell-baseline-offset-simple.html * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell): 2020-06-29 Guowei Yang Adding Experimental Feature Flags for CoreImage backed SVG/CSS Filters https://bugs.webkit.org/show_bug.cgi?id=213578 Reviewed by Darin Adler, Simon Fraser, Myles C. Maxfield. Preparing to implement CoreImage backed filter rendering Needs Compiler guards and experimental feature guard. No tests are required because this is just a feature flag set up * page/Settings.yaml: added default settings for the feature flag. Default value of the feature switch is off 2020-06-29 Stephan Szabo Fix build when !ENABLE(ACCESSIBILITY) after r263673 https://bugs.webkit.org/show_bug.cgi?id=213759 Reviewed by Chris Fleizach. No new tests, build fix. * accessibility/AXObjectCache.h: 2020-06-29 Sam Weinig Simplify Color's interface by removing isDark() https://bugs.webkit.org/show_bug.cgi?id=213707 Reviewed by Darin Adler. - Move Color::isDark to RenderThemeIOS.mm, its one client and rename it to useConvexGradient() to indicate what it is actually determining. * platform/graphics/Color.cpp: (WebCore::Color::isDark const): Deleted. * platform/graphics/Color.h: * rendering/RenderThemeIOS.mm: (WebCore::useConvexGradient): (WebCore::RenderThemeIOS::paintPushButtonDecorations): (WebCore::RenderThemeIOS::paintFileUploadIconDecorations): 2020-06-29 Peng Liu Video spills over PiP screen a little when using Picture in Picture https://bugs.webkit.org/show_bug.cgi?id=213658 Reviewed by Eric Carlson. We need to provide video content dimensions instead of video element sizes to AVPlayerController to make sure that the Picture-in-Picture window will have the correct aspect ratio. Test: media/picture-in-picture/picture-in-picture-window-aspect-ratio.html * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::setupFullscreen): * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::setUpFullscreen): 2020-06-29 Tetsuharu Ohzeki Remove ENABLE_STREAMS_API compilation flag https://bugs.webkit.org/show_bug.cgi?id=213728 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: * Modules/fetch/FetchBody.cpp: * Modules/fetch/FetchBody.h: * Modules/fetch/FetchBodyOwner.cpp: (WebCore::FetchBodyOwner::isDisturbed const): (WebCore::FetchBodyOwner::isDisturbedOrLocked const): (WebCore::FetchBodyOwner::blobLoadingSucceeded): (WebCore::FetchBodyOwner::blobLoadingFailed): (WebCore::FetchBodyOwner::blobChunk): * Modules/fetch/FetchBodyOwner.h: (WebCore::FetchBodyOwner::cancel): * Modules/fetch/FetchBodySource.cpp: * Modules/fetch/FetchBodySource.h: * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::BodyLoader::didSucceed): (WebCore::FetchResponse::BodyLoader::didFail): (WebCore::FetchResponse::BodyLoader::didReceiveData): * Modules/fetch/FetchResponse.h: * Modules/streams/ByteLengthQueuingStrategy.idl: * Modules/streams/ByteLengthQueuingStrategy.js: * Modules/streams/CountQueuingStrategy.idl: * Modules/streams/CountQueuingStrategy.js: * Modules/streams/ReadableByteStreamController.idl: * Modules/streams/ReadableByteStreamController.js: * Modules/streams/ReadableByteStreamInternals.js: * Modules/streams/ReadableStream.idl: * Modules/streams/ReadableStream.js: * Modules/streams/ReadableStreamBYOBReader.idl: * Modules/streams/ReadableStreamBYOBReader.js: * Modules/streams/ReadableStreamBYOBRequest.idl: * Modules/streams/ReadableStreamBYOBRequest.js: * Modules/streams/ReadableStreamDefaultController.idl: * Modules/streams/ReadableStreamDefaultController.js: * Modules/streams/ReadableStreamDefaultReader.idl: * Modules/streams/ReadableStreamDefaultReader.js: * Modules/streams/ReadableStreamInternals.js: * Modules/streams/ReadableStreamSink.cpp: * Modules/streams/ReadableStreamSink.h: * Modules/streams/ReadableStreamSink.idl: * Modules/streams/ReadableStreamSource.cpp: * 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/JSReadableStreamSourceCustom.cpp: * bindings/js/ReadableStreamDefaultController.cpp: * bindings/js/ReadableStreamDefaultController.h: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::writableStreamAPIEnabled const): * testing/Internals.cpp: * testing/Internals.h: * testing/Internals.idl: 2020-06-29 Sam Weinig Remove remaining makeSimpleColorFrom* variants https://bugs.webkit.org/show_bug.cgi?id=213706 Reviewed by Darin Adler. Removed makeSimpleColorFromFloats and makeSimpleColorFromCMYKA. - Updated callers that need to pass floats to use makeSimpleColor(SRGBA { ... }); - Updated callers that don't need to pass floats, mostly compile time constant SimpleColors to use makeSimpleColor(...), passing in 0-255 based component values. - Updated callers of makeSimpleColorFromCMYKA to use makeSimpleColor(toSRGBA(CMYKA { ... })). This required adding CMYKA type to ColorTypes.h and moving conversion SRGBA to ColorUtilities with the other color conversion code. - Added deduction guides for color types to allow component type deduction. This allows us to write: function(SRGBA { redFloat, greenFloat, blueFloat, alphaFloat }) reather than the more cumbersome: function(SRGBA { redFloat, greenFloat, blueFloat, alphaFloat }) - Added operator==/operator!= for each color type. Only used by CMYKA at the moment, but generally useful, so added for all of them. For all types convertable to ColorComponents, the implementation uses the conversion to ColorComponents to avoid redundancy. * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::setStrokeColor): (WebCore::CanvasRenderingContext2DBase::setFillColor): Update to call new typed color based CanvasStyle functions. (WebCore::CanvasRenderingContext2DBase::setShadow): Use makeSimpleColor rather than makeSimpleColorFromFloats/makeSimpleColorFromCMYKA. * html/canvas/CanvasStyle.cpp: (WebCore::CanvasStyle::CanvasStyle): Replace constructors taking raw floats with ones taking typed colors (SRGBA/CMYKA) to make it more clear what the parameters mean. (WebCore::CanvasStyle::isEquivalentColor const): Compare the cmyka components using new operator== implementation for CMYKA. (WebCore::CanvasStyle::isEquivalent const): (WebCore::CanvasStyle::isEquivalentRGBA const): Deleted. (WebCore::CanvasStyle::isEquivalentCMYKA const): Deleted. Replace isEquivalentRGBA/isEquivalentCMYKA with overloaded isEquivalent. (WebCore::CanvasStyle::applyStrokeColor const): (WebCore::CanvasStyle::applyFillColor const): Update for new names of CMYKA members. * html/canvas/CanvasStyle.h: Use SRGBA and CMYKA to simplify interfaces * page/DebugPageOverlays.cpp: * page/linux/ResourceUsageOverlayLinux.cpp: (WebCore::ResourceUsageOverlay::platformInitialize): Use makeSimpleColor rather than makeSimpleColorFromFloats, allowing for constant expression creation of SimpleColors. * platform/graphics/Color.cpp: (WebCore::Color::lightened const): (WebCore::Color::darkened const): Use makeSimpleColor(SRGBA { ... }) rather than makeSimpleColorFromFloats. (WebCore::Color::luminance const): Fix comment. (WebCore::blendWithoutPremultiply): Use makeSimpleColor(...) rather than makeSimpleColorFromFloats. * platform/graphics/ColorTypes.h: (WebCore::operator==): (WebCore::operator!=): - Add deduction guides and operator==/operator!= for each color type. - Add CMYKA type. No conversion to ColorComponents yet, as ColorComponents only works with 4 component colors, not ones with 5 like CMYKA. * platform/graphics/ColorUtilities.cpp: (WebCore::toSRGBA): Move conversion from CMYKA to SRGBA from makeSimpleColorFromCMYKA to here. * platform/graphics/ColorUtilities.h: (WebCore::convertPrescaledToComponentByte): (WebCore::convertToComponentByte): Use std::round rather than std::lroundf, since it will have the same result and it reads nicer. * platform/graphics/SimpleColor.cpp: (WebCore::makeSimpleColorFromCMYKA): Deleted. * platform/graphics/SimpleColor.h: (WebCore::makeSimpleColor): (WebCore::makeSimpleColorFromFloats): Deleted. - Removed makeSimpleColorFromFloats and makeSimpleColorFromCMYKA. - Added constexpr overload of makeSimpleColor taking a const SRGBA&. - Fixed forward declaration of makeSimpleColor that was taking ColorComponents to actually take an SRGBA, which is what the inline implementation actually takes. * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::makeSimpleColorFromARGBCFArray): * platform/graphics/cairo/GradientCairo.cpp: (WebCore::interpolateColorStop): * platform/graphics/cg/ColorCG.cpp: (WebCore::makeSimpleColorFromCGColor): * platform/graphics/win/PlatformContextDirect2D.cpp: (WebCore::PlatformContextDirect2D::brushWithColor): Use makeSimpleColor(SRGBA { ... }) rather than makeSimpleColorFromFloats. * platform/graphics/mac/ColorMac.mm: (WebCore::makeSimpleColorFromNSColor): * platform/ios/ColorIOS.mm: (WebCore::colorFromUIColor): Use makeSimpleColor(SRGBA { ... }) rather than makeSimpleColorFromFloats. Casting to float is needed, as the input types are CGFloat which is double in 64-bit environments and won't automatically narrow with the new types. * platform/ios/LegacyTileCache.mm: (WebCore::LegacyTileCache::colorForGridTileBorder const): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::beginTransparencyLayers): Use makeSimpleColor rather than makeSimpleColorFromFloats, allowing for constant expression creation of SimpleColors. * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintCheckboxDecorations): (WebCore::RenderThemeIOS::paintRadioDecorations): (WebCore::RenderThemeIOS::paintMenuListButtonDecorations): (WebCore::RenderThemeIOS::paintSystemPreviewBadge): Use Color::black/Color::white.colorWithAlpha(...) rather than makeSimpleColorFromFloats, allowing for constant expression creation of SimpleColors. 2020-06-29 Chris Fleizach AX: aria-modal nodes wrapped in aria-hidden are not honored https://bugs.webkit.org/show_bug.cgi?id=212849 Reviewed by Zalan Bujtas. Test: accessibility/aria-modal-in-aria-hidden.html If aria-modal was wrapped inside aria-hidden, we were still processing that as the modal node. Fixing that uncovered a host of very finicky issues related to aria-modal. 1. We were processing modal status immediately instead of after a delay, so visibility requirements were not correct. 2. In handleModalChange: We were processing multiple modal nodes perhaps incorrectly (the spec doesn't account for multiple modal nodes). - had to update a test to turn off modal status before adding a new modal node 3. Changed the modal node to a WeakPtr 4. In isNodeAriaVisible: We stopped processing for visibile with aria-hidden as soon as we hit a renderable block, but that means it won't account for nodes higher in the tree with aria-hidden. 5. In handleAttributeChange: if aria-hidden changes, we should update modal status if needed. 6. In focusModalNodeTimerFired: we need to verify the element is still live, otherwise it can lead to a crash. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::AXObjectCache): (WebCore::AXObjectCache::findModalNodes): (WebCore::AXObjectCache::currentModalNode): (WebCore::AXObjectCache::modalNode): (WebCore::AXObjectCache::remove): (WebCore::AXObjectCache::deferModalChange): (WebCore::AXObjectCache::focusModalNodeTimerFired): (WebCore::AXObjectCache::handleAttributeChange): (WebCore::AXObjectCache::handleModalChange): (WebCore::AXObjectCache::prepareForDocumentDestruction): (WebCore::AXObjectCache::performDeferredCacheUpdate): (WebCore::isNodeAriaVisible): * accessibility/AXObjectCache.h: (WebCore::AXObjectCache::handleModalChange): (WebCore::AXObjectCache::deferModalChange): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::firstChild const): (WebCore::AccessibilityRenderObject::lastChild const): 2020-06-29 Youenn Fablet Support MediaRecorder.onstart https://bugs.webkit.org/show_bug.cgi?id=213720 Reviewed by Darin Adler. Fire start event if MediaRecorder.start is successful. Do some WebIDL clean-up, in particular change timeSlice from long to unsigned long, as per spec. Covered by added test. * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::startRecording): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorder.idl: 2020-06-29 Chris Dumez On load from back/forward cache, call checkCompleted() for ALL frames inside FrameLoader::commitProvisionalLoad() https://bugs.webkit.org/show_bug.cgi?id=213657 Reviewed by Youenn Fablet. On load from back/forward cache, call checkCompleted() for ALL frames inside FrameLoader::commitProvisionalLoad(). Previously, we were doing it for the main frame in FrameLoader::commitProvisionalLoad() and for subframes in FrameLoader::open(). Doing it all in one place results in more understandable code and is less error-prone. Note that calling checkCompleted() for subframes was new in r262221 and is covered by: fast/history/multiple-back-forward-navigations.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::commitProvisionalLoad): (WebCore::FrameLoader::open): 2020-06-09 Sergio Villar Senin [css-flexbox] WebKit mistakenly lets pointer events (click/hover/etc) pass through flex items, if they have negative margin https://bugs.webkit.org/show_bug.cgi?id=185771 Reviewed by Javier Fernandez. When multiple child elements of a flexbox overlap (for example, due to negative margins), the element drawn in the foreground may not actually capture the hit if the element underneath it is hit-tested despite being occluded. This is because painting of flexbox children is done in order modified document order instead of raw document order. In order to achieve this we should inspect flex items in reverse order modified document order. As the OrderIterator cannot go backwards, we cache the reverse order of items when doing the layout in order to have fast hit testing in flexbox containers. As this behaviour is different to the one implemented in RenderBlock a new virtual method to perform hit testing of children was extracted from RenderBlock:nodeAtPoint() to a new method called RenderBlock::hitTestChildren. The RenderBlock implementation is identical to the current one but flexbox containers overwrite it. Two WPT flexbox hittests are passing now thanks to this patch. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::hitTestChildren): Implementation of the new virtual method extracted from nodeAtPoint. (WebCore::RenderBlock::nodeAtPoint): Moved code to hit test children to hitTestChildren() * rendering/RenderBlock.h: Added hitTestChildren new virtual method. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::hitTestChildren): Implemented. (WebCore::RenderFlexibleBox::layoutFlexItems): Cache the reverse of the order iterator to be used by hit testing. * rendering/RenderFlexibleBox.h: Added hitTestChildren. 2020-06-29 Xabier Rodriguez Calvar [GStreamer] imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-immediately.https.html is a flaky crash https://bugs.webkit.org/show_bug.cgi?id=213385 Reviewed by Philippe Normand. Add a way to release the decryption resources when the player private is destroyed. That way we can release the secure memory allocated by libgcrypt and allow for more tests to get, which caused the crash. Tests: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-immediately.https.html. * platform/encryptedmedia/CDMProxy.h: (WebCore::CDMProxy::releaseDecryptionResources): (WebCore::CDMInstanceSessionProxy::releaseDecryptionResources): (WebCore::CDMInstanceProxy::releaseDecryptionResources): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): * platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp: (WebCore::CDMProxyClearKey::~CDMProxyClearKey): (WebCore::CDMProxyClearKey::releaseDecryptionResources): (WebCore::CDMProxyClearKey::closeGCryptHandle): * platform/graphics/gstreamer/eme/CDMProxyClearKey.h: 2020-06-29 Alicia Boya García [MSE][GStreamer] Rename MediaSourceGStreamer to MediaSourcePrivateGStreamer https://bugs.webkit.org/show_bug.cgi?id=213722 Reviewed by Xabier Rodriguez-Calvar. It's about time to remove this FIXME: // FIXME: Should this be called MediaSourcePrivateGStreamer? Yes, it should. Because it's a MediaSourcePrivate, and that is an important fact. The MSE class diagram is confusing enough already, let's fix this. To rebase commits after this change use `git format-patch` first to get them in a patch format and then run: sed -i 's|\|MediaSourcePrivateGStreamer|g' *.patch This patch is a refactor that produces no behavior changes. * platform/GStreamer.cmake: * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::sourceSetup): * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h: * platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp. (WebCore::MediaSourcePrivateGStreamer::open): (WebCore::MediaSourcePrivateGStreamer::MediaSourcePrivateGStreamer): (WebCore::MediaSourcePrivateGStreamer::~MediaSourcePrivateGStreamer): (WebCore::MediaSourcePrivateGStreamer::addSourceBuffer): (WebCore::MediaSourcePrivateGStreamer::removeSourceBuffer): (WebCore::MediaSourcePrivateGStreamer::durationChanged): (WebCore::MediaSourcePrivateGStreamer::markEndOfStream): (WebCore::MediaSourcePrivateGStreamer::unmarkEndOfStream): (WebCore::MediaSourcePrivateGStreamer::readyState const): (WebCore::MediaSourcePrivateGStreamer::setReadyState): (WebCore::MediaSourcePrivateGStreamer::waitForSeekCompleted): (WebCore::MediaSourcePrivateGStreamer::seekCompleted): (WebCore::MediaSourcePrivateGStreamer::sourceBufferPrivateDidChangeActiveState): (WebCore::MediaSourcePrivateGStreamer::buffered): (WebCore::MediaSourcePrivateGStreamer::logChannel const): * platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h: Renamed from Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceGStreamer.h. * platform/graphics/gstreamer/mse/PlaybackPipeline.h: * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::create): (WebCore::SourceBufferPrivateGStreamer::SourceBufferPrivateGStreamer): * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: 2020-06-29 Youenn Fablet RTCDataChannel.bufferedAmount should stay the same even if channel is closed https://bugs.webkit.org/show_bug.cgi?id=213698 Reviewed by Darin Adler. bufferedAmount was set back to zero when closing. Instead, we should keep the value in RTCDataChannel and update it either when sending data or being notified or some data getting sent. Test: webrtc/datachannel/bufferedAmount-afterClose.html * Modules/mediastream/RTCDataChannel.cpp: (WebCore::RTCDataChannel::bufferedAmountIsDecreasing): * platform/mock/RTCDataChannelHandlerMock.h: 2020-06-29 Antti Koivisto checked overflow in WebCore::findClosestFont https://bugs.webkit.org/show_bug.cgi?id=213719 Reviewed by David Kilzer. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::findClosestFont): If indexOfBestCapabilities doesn't find anything it returns notFound and indexing to the vector overflows. 2020-06-29 David Kilzer REGRESSION (r262776): Leak of NSMutableURLRequest in -[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:] Reviewed by Anders Carlsson. * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]): - Use RetainPtr<> for the mutable copy and autorelease the return value. 2020-06-29 Youenn Fablet MediaRecorder.start() Method is Ignoring the "timeslice" Parameter https://bugs.webkit.org/show_bug.cgi?id=202233 Reviewed by Eric Carlson. Use a timer to implement timeSlice parameter. Schedule timer either when start is called or as part of requestData callback. This should ensure that, if requestData is called by the application, the timer will be rescheduled appropriately. Test: http/wpt/mediarecorder/MediaRecorder-start-timeSlice.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::startRecording): (WebCore::MediaRecorder::requestData): * Modules/mediarecorder/MediaRecorder.h: 2020-06-29 Rob Buis window.location.replace with invalid urls should throw https://bugs.webkit.org/show_bug.cgi?id=153121 Reviewed by Darin Adler. Throw SyntaxError if the url resulting from the location.replace operation is not valid. Behavior matches Firefox and Chrome. Tests: imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_replace.html [1] https://html.spec.whatwg.org/multipage/history.html#dom-location-replace * page/Location.cpp: (WebCore::Location::replace): * page/Location.h: * page/Location.idl: 2020-06-28 Zalan Bujtas [LFC][TFC] Adjust table content vertical position to match vertical-align https://bugs.webkit.org/show_bug.cgi?id=213692 Reviewed by Antti Koivisto. Child boxes (and runs) are always in the coordinate system of the containing block's border box. The content box (where the child content lives) is inside the padding box, which is inside the border box. In order to compute the child box top/left position, we need to know both the padding and the border offsets.
The inner div's top left position is at [12px, 2px] (let's ignore margin collapsing for now). Normally by the time we start positioning the child content, we already have computed borders and paddings for the containing block. This is different with table cells where the final padding offset depends on the content height as we use the padding box to vertically align the table cell content. Let's adjust the child boxes and runs to match the new content box position. Test: fast/layoutformattingcontext/table-cell-vertical-alignment-simple.html * layout/displaytree/DisplayLineBox.h: (WebCore::Display::LineBox::moveVertically): * layout/displaytree/DisplayRun.h: (WebCore::Display::Run::moveVertically): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): 2020-06-28 Zalan Bujtas [LFC][Painting] Use the table section as the paint container for table cells https://bugs.webkit.org/show_bug.cgi?id=213693 Reviewed by Antti Koivisto. The cell's containing block is the table box (skipping both the row and the section), but it's positioned relative to the table section. Let's skip the row and go right to the section box when painting the cells. * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::absoluteDisplayBox): 2020-06-28 Alexey Shvayka Improve error message for primitive callback interfaces https://bugs.webkit.org/show_bug.cgi?id=213684 Reviewed by Darin Adler. This patch rewords TypeError message for non-object callback interfaces because apart from function, an object with certain method is also allowed. New error message matches Chrome and Firefox. Tests: fast/dom/createNodeIterator-parameters.html fast/dom/createTreeWalker-parameters.html * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::throwArgumentMustBeObjectError): * bindings/js/JSDOMExceptionHandling.h: * bindings/scripts/CodeGeneratorJS.pm: (GetArgumentExceptionFunction): * bindings/scripts/test/*: Updated. 2020-06-28 Rob Buis Setting url.search="??" (two questionmarks) has incorrect behavior https://bugs.webkit.org/show_bug.cgi?id=170452 Reviewed by Darin Adler. There is no need to strip leading "?" character since URLParser expects it to be there. This differs from the specification algorithm [1], which relies on state override, which URLParser does not support. Behavior matches Firefox and Chrome. Test: imported/w3c/web-platform-tests/url/url-setters.html [1] https://url.spec.whatwg.org/#dom-url-search * html/URLDecomposition.cpp: (WebCore::URLDecomposition::setSearch): 2020-06-28 Geoffrey Garen Rename initializeThreading to initialize https://bugs.webkit.org/show_bug.cgi?id=213674 Reviewed by Mark Lam. * Modules/webdatabase/DatabaseManager.cpp: (WebCore::DatabaseManager::openDatabase): * WebCore.order: * bindings/js/CommonVM.cpp: (WebCore::commonVMSlow): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::initializeMainThread): (WebCore::ScriptController::initializeThreading): Deleted. * bindings/js/ScriptController.h: * bridge/objc/WebScriptObject.mm: (+[WebScriptObject initialize]): * platform/cocoa/SharedBufferCocoa.mm: (+[WebCoreSharedBufferData initialize]): * platform/ios/wak/WebCoreThread.mm: (RunWebThread): 2020-06-28 Youenn Fablet MediaRecorder stopRecorder() returns empty Blob after first use https://bugs.webkit.org/show_bug.cgi?id=212274 Reviewed by Eric Carlson. Refactor code to create/destroy MediaRecorderPrivate on MediaRecorder start/stop. This allows reusing a MediaRecorder after a stop and restarting with a clean state. We introduce MediaRecorderPrivate::startRecording to do the initialization, which allows to fix a potential ref cycle as part of the error callback handling. Make some improvements to the platform implementation, in particular add default initialization to all fields. Align the code using AudioConverterRef to what is done in AudioSampleDataSource. Also call VTCompressionSessionInvalidate when destroying the VideoSampleBufferCompressor. Test: http/wpt/mediarecorder/MediaRecorder-multiple-start-stop.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::startRecording): (WebCore::MediaRecorder::stopRecording): (WebCore::MediaRecorder::requestData): * Modules/mediarecorder/MediaRecorder.h: * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::fetchData): * platform/mediarecorder/MediaRecorderPrivate.h: (WebCore::MediaRecorderPrivate::startRecording): * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: (WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor): (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription): (WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded): (WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount): (WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets): (WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime): * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::stopRecording): * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: (WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor): 2020-06-27 Zalan Bujtas [LFC][IFC] Replaced inline boxes sit on the baseline with their margins https://bugs.webkit.org/show_bug.cgi?id=213679 Reviewed by Antti Koivisto. Take the margin box into account when computing the top position of a baseline aligned replaced inline box. Test: fast/layoutformattingcontext/replaced-box-with-margin-on-baseline.html * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::alignContentVertically): 2020-06-27 Mark Lam Fix missing exception check in createIDBKeyFromValue(). https://bugs.webkit.org/show_bug.cgi?id=213681 Reviewed by Chris Dumez. Test: storage/indexeddb/missing-exception-check-in-IDBKey.html Also fixed up miscellaneous other exception check related code to enable the new test to run with exception check validation. * bindings/js/IDBBindingUtilities.cpp: (WebCore::createIDBKeyFromValue): * bindings/js/JSDOMBindingSecurity.cpp: (WebCore::BindingSecurity::shouldAllowAccessToDOMWindow): * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::updateDocument): * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::put): (WebCore::JSDOMWindow::defineOwnProperty): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::initScriptForWindowProxy): * bindings/scripts/CodeGeneratorJS.pm: (GenerateAttributeGetterBodyDefinition): (GenerateAttributeSetterBodyDefinition): (GenerateOperationBodyDefinition): * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: (WebCore::jsTestActiveDOMObjectExcitingAttrGetter): (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunctionBody): (WebCore::jsTestActiveDOMObjectPrototypeFunctionOverloadedMethodOverloadDispatcher): * bridge/objc/WebScriptObject.mm: (-[WebScriptObject _isSafeScript]): * testing/js/WebCoreTestSupport.cpp: (WebCoreTestSupport::injectInternalsObject): 2020-06-27 Jer Noble iOS Safari incorrectly reports "AppleCoreMedia" as UA string https://bugs.webkit.org/show_bug.cgi?id=213245 Reviewed by Youenn Fablet. Tests: TestWebKitAPI.MediaLoading.UserAgentStringCRABS TestWebKitAPI.MediaLoading.UserAgentStringHLS * platform/network/cocoa/WebCoreNSURLSession.mm: (-[WebCoreNSURLSessionDataTask initWithSession:identifier:request:]): 2020-06-27 Rob Buis Require
to be connected https://bugs.webkit.org/show_bug.cgi?id=177356 Reviewed by Sam Weinig. Implement step 1 of [1], i.e. do not submit form if it is not connected. Test: imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/submission-checks.html [1] https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-form-submit * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::submit): 2020-06-27 Youenn Fablet Log capture device information in case of getUserMedia failing to select a device https://bugs.webkit.org/show_bug.cgi?id=213643 Reviewed by Eric Carlson. Log constraints and device in case of a failing getUserMedia call. No obserable change, logging addition. * platform/mediastream/mac/CoreAudioCaptureDevice.cpp: (WebCore::getDeviceInfo): (WebCore::CoreAudioCaptureDevice::deviceClock): * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp: (WebCore::isValidCaptureDevice): * platform/mediastream/MediaConstraints.cpp: (WebCore::MediaConstraint::log const): (WebCore::BooleanConstraint::logAsBoolean const): (WebCore::DoubleConstraint::logAsDouble const): (WebCore::IntConstraint::logAsInt const): * platform/mediastream/MediaConstraints.h: * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate): (WebCore::RealtimeMediaSource::selectSettings): * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): * platform/mediastream/RealtimeVideoCaptureSource.cpp: (WebCore::RealtimeVideoCaptureSource::bestSupportedSizeAndFrameRate): * platform/mediastream/VideoPreset.h: (WebCore::VideoPreset::log const): 2020-06-27 Youenn Fablet Protect SWServer::claim from a registration without active worker https://bugs.webkit.org/show_bug.cgi?id=213597 Reviewed by Chris Dumez. SWServerWorker might be active while being terminated. If terminated as part of SWServerRegistration::clear, the registration no longer has a service worker. SWServer::claim should therefore check for registration active worker. This is difficult to test as one needs to claim at the time the service worker is being terminated but not yet terminated. * workers/service/server/SWServer.cpp: (WebCore::SWServer::claim): 2020-06-27 Sam Weinig Convert SVG related parsers over to using StringParsingBuffer https://bugs.webkit.org/show_bug.cgi?id=213635 Reviewed by Darin Adler. - Adopt StringParsingBuffer across SVG code. - Remove UTF-16 upconversions in SVGAnimationElement, SVGFitToViewBox, SVGLengthList, SVGLengthValue, SVGNumberList, SVGParserUtilities, SVGPointList, SVGPreserveAspectRatioValue, SVGStringList, SVGTransformList, SVGTransformable and SVGViewSpec. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: Export ParsingUtilities.h, which is now included by SVGParserUtilities.h * Sources.txt: Add implementation files for SVGLengthList, SVGNumberList, SVGPointList, SVGStringList and SVGTransformList to hold large functions are unlikely to benefit from inlining. * html/parser/ParsingUtilities.h: (WebCore::skipCharactersExactly): Add new skipCharactersExactly, which takes a c-array (NOT null-terminated) of characters to compare against. * svg/SVGAngleValue.cpp: (WebCore::parseAngleType): (WebCore::SVGAngleValue::setValueAsString): Adopt StringParsingBuffer. * svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::parseAttribute): Adapt to new shared parseTransformType, which now returns an Optional and default to SVG_TRANSFORM_UNKNOWN on parse failure as the old parseTransformType did. * svg/SVGAnimationElement.cpp: (WebCore::parseKeySplines): Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters() * svg/SVGFitToViewBox.cpp: (WebCore::SVGFitToViewBox::parseViewBox): (WebCore::SVGFitToViewBox::parseViewBoxGeneric): * svg/SVGFitToViewBox.h: Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters() * svg/SVGLengthList.cpp: Added. (WebCore::SVGLengthList::parse): (WebCore::SVGLengthList::valueAsString const): * svg/SVGLengthList.h: Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). Move parse and valueAsString out of line. * svg/SVGLengthValue.cpp: (WebCore::parseLengthType): (WebCore::SVGLengthValue::construct): (WebCore::SVGLengthValue::setValueAsString): * svg/SVGLengthValue.h: Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters() * svg/SVGNumberList.cpp: Added. (WebCore::SVGNumberList::parse): (WebCore::SVGNumberList::valueAsString const): * svg/SVGNumberList.h: Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). Move parse and valueAsString out of line. * svg/SVGParserUtilities.cpp: (WebCore::genericParseNumber): (WebCore::parseNumber): (WebCore::genericParseArcFlag): (WebCore::parseArcFlag): (WebCore::parseNumberOptionalNumber): (WebCore::parsePoint): (WebCore::parseRect): (WebCore::parseGlyphName): (WebCore::parseUnicodeRange): (WebCore::parseKerningUnicodeString): (WebCore::genericParseFloatPoint): (WebCore::parseFloatPoint): * svg/SVGParserUtilities.h: (WebCore::isSVGSpaceOrComma): (WebCore::skipOptionalSVGSpaces): (WebCore::skipOptionalSVGSpacesOrDelimiter): (WebCore::skipString): Deleted. Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). Move parse and valueAsString out of line. * svg/SVGPathSource.h: Add missing include, which is now needed do to removing unncessary includes in other files. * svg/SVGPathStringSource.cpp: (WebCore::SVGPathStringSource::SVGPathStringSource): (WebCore::SVGPathStringSource::hasMoreData const): (WebCore::SVGPathStringSource::moveToNextToken): (WebCore::nextCommandHelper): (WebCore::SVGPathStringSource::nextCommand): (WebCore::SVGPathStringSource::parse): (WebCore::SVGPathStringSource::parseSVGSegmentType): (WebCore::SVGPathStringSource::parseMoveToSegment): (WebCore::SVGPathStringSource::parseLineToSegment): (WebCore::SVGPathStringSource::parseLineToHorizontalSegment): (WebCore::SVGPathStringSource::parseLineToVerticalSegment): (WebCore::SVGPathStringSource::parseCurveToCubicSegment): (WebCore::SVGPathStringSource::parseCurveToCubicSmoothSegment): (WebCore::SVGPathStringSource::parseCurveToQuadraticSegment): (WebCore::SVGPathStringSource::parseCurveToQuadraticSmoothSegment): (WebCore::SVGPathStringSource::parseArcToSegment): (WebCore::parseSVGSegmentTypeHelper): Deleted. * svg/SVGPathStringSource.h: Adopt StringParsingBuffer. Replace existing set of unions with a single union of StringParsingBuffers. * svg/SVGPointList.cpp: Added. (WebCore::SVGPointList::parse): (WebCore::SVGPointList::valueAsString const): * svg/SVGPointList.h: Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). Move parse and valueAsString out of line. * svg/SVGPreserveAspectRatioValue.cpp: (WebCore::SVGPreserveAspectRatioValue::SVGPreserveAspectRatioValue): (WebCore::SVGPreserveAspectRatioValue::parse): (WebCore::SVGPreserveAspectRatioValue::parseInternal): (WebCore::SVGPreserveAspectRatioValue::valueAsString const): * svg/SVGPreserveAspectRatioValue.h: Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). * svg/SVGStringList.cpp: Added. (WebCore::SVGStringList::parse): (WebCore::SVGStringList::valueAsString const): * svg/SVGStringList.h: Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). Move parse and valueAsString out of line. * svg/SVGTransformList.cpp: Added. (WebCore::SVGTransformList::consolidate): (WebCore::SVGTransformList::concatenate const): (WebCore::SVGTransformList::parseGeneric): (WebCore::SVGTransformList::parse): (WebCore::SVGTransformList::valueAsString const): * svg/SVGTransformList.h: Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). Move parse, valueAsString, consolidate and concatenate out of line. * svg/SVGTransformable.cpp: (WebCore::parseTransformParamList): (WebCore::parseTransformValueGeneric): (WebCore::SVGTransformable::parseTransformValue): (WebCore::parseTransformTypeGeneric): (WebCore::SVGTransformable::parseTransformType): (WebCore::SVGTransformable::parseAndSkipType): Deleted. * svg/SVGTransformable.h: Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). Unify parseTransformType implementations to all use a single implementation and return an Optional. * svg/SVGViewSpec.cpp: (WebCore::SVGViewSpec::parseViewSpec): * svg/SVGViewSpec.h: Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). * svg/SVGZoomAndPan.cpp: (WebCore::parseZoomAndPanGeneric): (WebCore::SVGZoomAndPan::parseZoomAndPan): * svg/SVGZoomAndPan.h: Adopt StringParsingBuffer. 2020-06-26 Jer Noble CRASH: incompatible downcast<> operation in SourceBufferPrivateAVFObjC::setCDMInstance() https://bugs.webkit.org/show_bug.cgi?id=213660 Reviewed by Eric Carlson. Test: platform/mac/media/encrypted-media/fps-clearkey-crash.html * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance): 2020-06-26 Zalan Bujtas [LFC][BFC] Add support for
https://bugs.webkit.org/show_bug.cgi?id=213649 Reviewed by Antti Koivisto. Adjust the margin box to center the block content (this is very similar to [style="margin-left: auto; margin-right: auto;"]). Test: fast/layoutformattingcontext/center-alignment-with-block-content-simple.html * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): 2020-06-26 Jason Lawrence Unreviewed, reverting r263511, r263514, and r263565. r263511 caused MediaRecorder test crashes on internal testers. Reverted changesets: "MediaRecorder stopRecorder() returns empty Blob after first use" https://bugs.webkit.org/show_bug.cgi?id=212274 https://trac.webkit.org/changeset/263511 "Unreviewed iOS build fix after r263511." https://trac.webkit.org/changeset/263514 "MediaRecorder.start() Method is Ignoring the "timeslice" Parameter" https://bugs.webkit.org/show_bug.cgi?id=202233 https://trac.webkit.org/changeset/263565 2020-06-26 Sam Weinig Convert ContentSecurityPolicy related parsers over to using StringParsingBuffer https://bugs.webkit.org/show_bug.cgi?id=213631 Reviewed by Darin Adler. - Adopt StringParsingBuffer across CSP code. - Remove UTF-16 upconversions in ContentSecurityPolicy, ContentSecurityPolicyDirectiveList, ContentSecurityPolicyMediaListDirective and ContentSecurityPolicySourceList. * html/parser/ParsingUtilities.h: (WebCore::isNotASCIISpace): (WebCore::skipExactly): (WebCore::characterPredicate): (WebCore::skipUntil): (WebCore::skipExactlyIgnoringASCIICase): Add overloads for each helper that take a StringParsingBuffer. * loader/ResourceCryptographicDigest.cpp: (WebCore::parseHashAlgorithmAdvancingPosition): Convert to use an Optional return value rather than outparameter + bool. (WebCore::parseCryptographicDigestImpl): (WebCore::parseCryptographicDigest): (WebCore::parseEncodedCryptographicDigestImpl): (WebCore::parseEncodedCryptographicDigest): * loader/ResourceCryptographicDigest.h: Use StringParsingBuffer rather than raw pointers for parsing. * loader/SubresourceIntegrity.cpp: (WebCore::splitOnSpaces): (WebCore::parseIntegrityMetadata): Use StringParsingBuffer and readCharactersForParsing rather than raw pointers for parsing. * page/csp/ContentSecurityPolicy.cpp: (WebCore::ContentSecurityPolicy::didReceiveHeader): Use StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). * page/csp/ContentSecurityPolicyDirectiveList.cpp: (WebCore::isDirectiveNameCharacter): (WebCore::isDirectiveValueCharacter): (WebCore::ContentSecurityPolicyDirectiveList::parse): (WebCore::ContentSecurityPolicyDirectiveList::parseDirective): (WebCore::ContentSecurityPolicyDirectiveList::parseReportURI): (WebCore::ContentSecurityPolicyDirectiveList::setCSPDirective): (WebCore::ContentSecurityPolicyDirectiveList::applySandboxPolicy): (WebCore::ContentSecurityPolicyDirectiveList::setUpgradeInsecureRequests): (WebCore::ContentSecurityPolicyDirectiveList::setBlockAllMixedContentEnabled): (WebCore::ContentSecurityPolicyDirectiveList::addDirective): * page/csp/ContentSecurityPolicyDirectiveList.h: Use StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). Also switch to using Optional for return values rather than outparameter + bool. To make things read more cleanly, package up name and value pair into a new ParsedDirective struct that can be passed around more easily. * page/csp/ContentSecurityPolicyMediaListDirective.cpp: (WebCore::isMediaTypeCharacter): (WebCore::ContentSecurityPolicyMediaListDirective::parse): Use StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::isSourceCharacter): (WebCore::isHostCharacter): (WebCore::isPathComponentCharacter): (WebCore::isSchemeContinuationCharacter): (WebCore::isNotColonOrSlash): (WebCore::isSourceListNone): (WebCore::ContentSecurityPolicySourceList::parse): (WebCore::ContentSecurityPolicySourceList::parseSource): (WebCore::ContentSecurityPolicySourceList::parseScheme): (WebCore::ContentSecurityPolicySourceList::parseHost): (WebCore::ContentSecurityPolicySourceList::parsePath): (WebCore::ContentSecurityPolicySourceList::parsePort): (WebCore::isNonceCharacter): (WebCore::ContentSecurityPolicySourceList::parseNonceSource): (WebCore::ContentSecurityPolicySourceList::parseHashSource): * page/csp/ContentSecurityPolicySourceList.h: Use StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). Also switch to using Optional for return values rather than outparameter + bool. To make things read more cleanly, package up source return values into structs that can be more easily returned / passed around. 2020-06-26 Simon Fraser Content sometimes missing in nested scrollers with border-radius https://bugs.webkit.org/show_bug.cgi?id=213580 Reviewed by Zalan Bujtas. RenderLayer::clipToRect() has a special case for clips involving border-radius, involving an ancestor tree walk which applies the rounded clips. When inside composited overflow, don't include the border-radius from the scroller since that does its own clipping. Test: compositing/clipping/nested-overflow-with-border-radius.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::clipToRect): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: 2020-06-26 Geoffrey Garen Initializing the main thread should initialize the main run loop https://bugs.webkit.org/show_bug.cgi?id=213637 Reviewed by Anders Carlsson. * platform/ios/wak/WebCoreThread.mm: (RunWebThread): Removed call to initializeMainThread() because the main thread calls it before starting the web thread, so it's a no-op. (And if it were an op, it would be broken.) (StartWebThread): Merged RunLoop::initializeMain and initializeThreading into initializeMainThread. 2020-06-26 Andres Gonzalez Fix for crash in AXIsolatedObject::relativeFrame. https://bugs.webkit.org/show_bug.cgi?id=213363 Reviewed by Chris Fleizach. Covered by existing testss. Between the time an isolated object dispatches the method to the main thread and the time the lambda is executed, the isolated object is detached and hence its object ID becomes invalid. Thus, trying to get the associated AX object results in an assert/crash. * accessibility/isolatedtree/AXIsolatedObject.h: 2020-06-26 Andres Gonzalez Access to AXIsolatedTree:m_readerThreadNodeMap should happen only on the secondary AX thread. https://bugs.webkit.org/show_bug.cgi?id=213575 Reviewed by Chris Fleizach. After calling AXObjectCache::initializeSecondaryAXThread, there may still be some client requests coming in on the main thread. Thus AXIsolatedTree::applyPendingchanges and nodeForID can be called on the main thread. Since these two methods access the member variable m_readerThreadNodeMap which should be accessed only on the secondary AX thread, we now check for this condition and bail out if needed. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::applyPendingChanges): * accessibility/isolatedtree/AXIsolatedTree.h: Reordered private methods above member variables to comply with WebKit coding conventions, pointed out by Darin Adler in review for https://bugs.webkit.org/show_bug.cgi?id=213435. 2020-06-26 Andres Gonzalez Fix for crash in accessibility/roles-exposed.html in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=213648 Reviewed by Chris Fleizach. LayoutTest: accessibility/roles-exposed.html. - In layout tests, when AXObjectCache::notificationPostTimerFired is triggered, and we try to update the isolated tree, some of the underlying objects may already be gone. So this change ensure we don't try to update an isolated object that corresponds to an already detached live object. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::cacheAndInitializeWrapper): Sanity check. * accessibility/AccessibilityListBox.cpp: (WebCore::AccessibilityListBox::addChildren): m_renderer can be null when trying to update the isolated tree. * accessibility/AccessibilityListBoxOption.cpp: (WebCore::AccessibilityListBoxOption::computeAccessibilityIsIgnored const): Parent object may be gone when trying to update the isolated tree. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateChildrenIDs): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::updateChildren): 2020-06-26 Youenn Fablet MediaRecorder.start() Method is Ignoring the "timeslice" Parameter https://bugs.webkit.org/show_bug.cgi?id=202233 Reviewed by Eric Carlson. Use a timer to implement timeSlice parameter. Schedule timer either when start is called or as part of requestData callback. This should ensure that, if requestData is called by the application, the timer will be rescheduled appropriately. Test: http/wpt/mediarecorder/MediaRecorder-start-timeSlice.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::startRecording): (WebCore::MediaRecorder::requestData): * Modules/mediarecorder/MediaRecorder.h: 2020-06-26 Jack Lee ASSERTION FAILED: (it != m_map.end()) in TreeScopeOrderedMap::remove https://bugs.webkit.org/show_bug.cgi?id=213611 Reviewed by Geoffrey Garen. In function HTMLImageElement::parseAttribute(), empty name attribute is considered valid which makes the function skip handling of subsequent name changes. Modified the check of name attribute so only non-empty name is considered valid. This code change is to match . Test: fast/images/img-change-name-assert.html * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::parseAttribute): 2020-06-26 Sihui Liu Text manipulation should observe adjacent elements with new renderer together https://bugs.webkit.org/show_bug.cgi?id=213333 Reviewed by Geoffrey Garen. TextManipulationController only keeps track of manipulated Elements. For other types of Node, like Text, TextManipulationController does not mark them as manipulated and may manipulate it again. r263132 tried to solve the problem by marking Element with only manipulated children as manipulated, but it did not iterate all children of Element. So, if one Element has children in different paragraphs, it may fail to mark the Element manipulated. See updated test. To fix this issue completely, TextManipulationController now tracks all manipulated Nodes, so it can skip the manipulated Nodes during observation. For elements with new renderer, TextManipulationController observes them one by one. However, adjacent elements can be in the same paragraph, if there is no delimiter in their text, and should be observed together. To solve this problem, TextManipulationController now starts observing from the common ancestor of these elements. If a Node in range is manipulated, split the paragrph there. This makes sure content in paragraph is not manipulated. Relevant test is updated for this new behavior. Tests: TextManipulation.StartTextManipulationFindNewlyDisplayedParagraph TextManipulation.CompleteTextManipulationAvoidExtractingManipulatedTextAfterManipulation * dom/Node.cpp: (WebCore::Node::~Node): * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::observeParagraphs): (WebCore::TextManipulationController::didCreateRendererForElement): (WebCore::TextManipulationController::scheduleObservationUpdate): (WebCore::TextManipulationController::updateInsertions): (WebCore::TextManipulationController::replace): (WebCore::TextManipulationController::removeNode): (WebCore::makePositionTuple): Deleted. (WebCore::makeHashablePositionRange): Deleted. * editing/TextManipulationController.h: 2020-06-26 Simon Fraser Clean up some PaintBehavior-related code in RenderLayer https://bugs.webkit.org/show_bug.cgi?id=213634 Reviewed by Sam Weinig. Move the computation of paintBehavior into a lambda, and share the flags between normal painting and mask painting. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: 2020-06-26 Alicia Boya García [GStreamer] Initialize m_currentState and m_oldState https://bugs.webkit.org/show_bug.cgi?id=213604 Reviewed by Eric Carlson. MediaPlayerPrivateGStreamer was not initializing m_currentState and m_oldState, causing them to be checked e.g. updateStates() while they still contain garbage. Because the biggest uninitialized usage is a != comparison, in practice things still worked, but that's still a bug. I detected the bug after seeing this in the logs: playbin3SendSelectStreamsIfAppropriate: Checking if to send SELECT_STREAMS, m_waitingForStreamsSelectedEvent = false, haveDifferentStreamIds = false, m_currentState = UNKNOWN!(-8421505)... shouldSendSelectStreams = false This patch fixes a slight memory error which doesn't alter TestExpectations. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: 2020-06-25 Commit Queue Unreviewed, reverting r263537. https://bugs.webkit.org/show_bug.cgi?id=213640 Broke watchOS and tvOS builds Reverted changeset: "iOS Safari incorrectly reports "AppleCoreMedia" as UA string" https://bugs.webkit.org/show_bug.cgi?id=213245 https://trac.webkit.org/changeset/263537 2020-06-25 Zalan Bujtas [Inline] Overlapping content when margin-right is present https://bugs.webkit.org/show_bug.cgi?id=213629 Reviewed by Simon Fraser. 1. computeInlineDirectionPositionsForSegment loops through the Bidi runs and computes their logical widths. 2. Text measuring needs the current logical left position in order to compute the run width properly (e.g tab size) 3. The current logical left includes margins, boders and paddings (e.g text content 'text content' starts at 100px -ignore the line offset for now) 4. The BiDi loop jumps over empty inline containers (e.g. textcontent) and it lacks the information to be able to resolve nested inline containers. This patch pre-computes the spacing offset for each InlineTextBox so that we could use it later to compute the logical left position for the text measuring. [1][2][3][4] [1] -> 0px offset [2] -> 2px offset [3] -> 4px offset [4] -> 5px offset Test: fast/inline/incorrect-tab-position.html * rendering/ComplexLineLayout.cpp: (WebCore::ComplexLineLayout::computeInlineDirectionPositionsForSegment): 2020-06-25 Alex Christensen REGRESSION(r256166, r260596) WKNavigationAction.request.allHTTPHeaderFields needs to contain User-Agent and Accept https://bugs.webkit.org/show_bug.cgi?id=213626 Reviewed by Darin Adler. Those two revisions seemed to just subtly move things around, but they caused API-breaking changes that caused real problems. This effectively reverts the parts of those changes that caused the breakages. * loader/FrameLoader.cpp: (WebCore::FrameLoader::addExtraFieldsToRequest): * loader/cache/CachedResourceRequest.cpp: (WebCore::CachedResourceRequest::acceptHeaderValueFromType): (WebCore::acceptHeaderValueFromType): Deleted. * loader/cache/CachedResourceRequest.h: 2020-06-25 Simon Fraser Convert the PaintLayerFlag enum to an enum class https://bugs.webkit.org/show_bug.cgi?id=213624 Reviewed by Zalan Bujtas. Convert enum PaintLayerFlag to an enum class. * html/shadow/MediaControlTextTrackContainerElement.cpp: (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paint): (WebCore::RenderLayer::paintOverlayScrollbars): (WebCore::paintForFixedRootBackground): (WebCore::RenderLayer::paintLayer): (WebCore::RenderLayer::paintLayerWithEffects): (WebCore::RenderLayer::paintLayerContentsAndReflection): (WebCore::RenderLayer::filtersForPainting const): (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::updatePaintingInfoForFragments): (WebCore::RenderLayer::paintTransformedLayerIntoFragments): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer): (WebCore::RenderLayerBacking::paintFlagsForLayer const): * rendering/RenderReplica.cpp: (WebCore::RenderReplica::paint): 2020-06-25 Daniel Bates [iOS] Event region briefly missing editable element after typing second character in question field on discussions.apple.com https://bugs.webkit.org/show_bug.cgi?id=213618 Reviewed by Simon Fraser. Ensure the event region is updated for the foreground layer, if there is one. The foreground layer paints into a different backing and so will not be included in normal layer paint (i.e. RenderLayer::paintLayer() will bail out). A "z-index: -1" can create such a layer. An element with "z-index: -1" is above the background, but below other content. Although the original reported bug was only concerned about the editable region the fix is applicable to all regions tracked by EventRegion. I included a test for touch-action region too. Tests: editing/editable-region/text-field-inside-composited-negative-z-index-layer.html pointerevents/ios/touch-action-none-relative-inside-composited-negative-z-index-layer.html * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateEventRegion): 2020-06-25 Jer Noble iOS Safari incorrectly reports "AppleCoreMedia" as UA string https://bugs.webkit.org/show_bug.cgi?id=213245 Reviewed by Youenn Fablet. Tests: TestWebKitAPI.MediaLoading.UserAgentStringCRABS TestWebKitAPI.MediaLoading.UserAgentStringHLS * platform/network/cocoa/WebCoreNSURLSession.mm: (-[WebCoreNSURLSessionDataTask initWithSession:identifier:request:]): 2020-06-25 Megan Gardner Unreviewed. Fixing misspellings of 'position'. * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::smartDeleteParagraphSpacers): * platform/ScrollAnimator.cpp: (WebCore::ScrollAnimator::scrollToOffsetWithoutAnimation): * rendering/line/BreakingContext.h: (WebCore::BreakingContext::handleText): 2020-06-25 Daniel Bates [iOS] -_requestTextInputContextsInRect cannot find empty Quip spreadsheet title https://bugs.webkit.org/show_bug.cgi?id=213564 Reviewed by Simon Fraser. Special case for a focused editable inline element that has no line box, which is what the Quip spreadsheet title can become if its contents are deleted. The engine optimizes to avoid creating lines and line boxes for empty inlines, hit testing, and painting them. It's complicated to patch all this up with a 100% correct solution without forcing more line box creation. So, just add a special case. * page/Page.cpp: (WebCore::Page::editableElementsInRect const): Add the root editable element of the focused element to the result set if its rect intersects the search rect. Note that its rect can be empty e.g. . So, I use a new function on FloatRect to perform the intersection test. I also updated the ASSERT() to also use this new function. This was not necessary, but I did it to future the proof this code should hit testing one day return empty inlines. * platform/graphics/FloatRect.cpp: (WebCore::FloatRect::inclusivelyIntersects const): Added. (WebCore::FloatRect::intersects const): While I was in this file I fixed up a comment in this function to be more precise. * platform/graphics/FloatRect.h: 2020-06-25 Wenson Hsieh Unreviewed, fix the macOS 11 build after r263519 * rendering/RenderThemeMac.mm: (WebCore::createAttachmentPlaceholderImage): 2020-06-25 Megan Gardner Cannot delete last line of Mail Message https://bugs.webkit.org/show_bug.cgi?id=213536 Reviewed by Wenson Hsieh. LayoutTests/editing/deleting/smart-delete-paragraph-005.html The smart paragraph deletion code did not take into account that the previous blank line could be the start of editable content without a paragraph before it. If this was the case, the deletion code backed up too far, and the delete command failed. This case should be handled in the same way that the deleting the last paragraph in editable content is handled, by checking if we are already at the beginning of the editable content when expanding the selection for smart paragraph deletion. * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::smartDeleteParagraphSpacers): 2020-06-25 Wenson Hsieh Text manipulation should exclude text rendered using icon-only fonts https://bugs.webkit.org/show_bug.cgi?id=213446 Reviewed by Myles Maxfield. See below for more details. Test: TextManipulation.StartTextManipulationExcludesTextRenderedAsIcons * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::shouldExcludeNodeBasedOnStyle): (WebCore::TextManipulationController::parse): Augment token exclusion rules so that we're able to exclude certain text nodes from text manipulation, based on their style (more specifically, based on their font family). Ask the text node's primary font if it is likely to be used only for rendering icons, and cache the result in TextManipulationController to avoid running the heuristic an excessive number of times for each font that appears in the document. We currently only run this for the node's primary font when initiating translation, though we may want to change this in the future so that node exclusion is recomputed when the primary font of a node changes. Note that in the case where an icon font fails to load, we won't exclude the text node from translation, since the primary font will be a fallback. This is intentional, since the node would appear in the document as normally rendered text (rather than icons), which should be translated. * editing/TextManipulationController.h: * platform/graphics/Font.cpp: (WebCore::Font::isProbablyOnlyUsedToRenderIcons const): * platform/graphics/Font.h: * platform/graphics/FontPlatformData.cpp: (WebCore::FontPlatformData::familyName const): * platform/graphics/FontPlatformData.h: * platform/graphics/cocoa/FontCocoa.mm: (WebCore::Font::isProbablyOnlyUsedToRenderIcons const): Add a heuristic to detect whether a platform font should be excluded from text manipulation. For now, we only return true if we suspect that this font is an "icon-only" font (for instance, the "Material Icons" font). We guess that a font is *probably* an icon-only font if the font supports only characters from the basic or PUA unicode planes, and the glyph bounds for the set of supported non-control basic latin characters are all empty. * platform/graphics/cocoa/FontPlatformDataCocoa.mm: (WebCore::FontPlatformData::familyName const): Add a platform `familyName()` helper method on `FontPlatformData`. On Cocoa platforms, this wraps a call to `CTFontCopyFamilyName`. 2020-06-25 Kate Cheney App-bound domain service worker registrations should be limited https://bugs.webkit.org/show_bug.cgi?id=213601 Reviewed by Brent Fulgham. Limit number of service worker registrations for app-bound domains. The current proposal is 3, but this could be changed in the future. No new tests, currently TestWebKitAPI is unable to test failed service worker registration (test will timeout). Confirmed behavior manually. * workers/service/server/SWServer.cpp: (WebCore::SWServer::validateRegistrationDomain): 2020-06-25 Wenson Hsieh Upstream macOS 11 additions to RenderThemeMac.mm and ThemeMac.mm https://bugs.webkit.org/show_bug.cgi?id=213608 Reviewed by Darin Adler. Replace WebKitAdditions imports with the imported code. No change in behavior. * css/html.css: (input::-webkit-contacts-auto-fill-button): * platform/mac/ThemeMac.mm: (WebCore::ThemeMac::supportsLargeFormControls): * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::createAttachmentPlaceholderImage): (WebCore::RenderThemeMac::extraDefaultStyleSheet): Deleted. Remove the override for extraDefaultStyleSheet altogether, since this was only used to temporarily hide the new contact AutoFill button appearance from open source WebKit. 2020-06-25 Sergio Villar Senin Unreviewed build fix for WebXR enabled non-OpenXR builds. * platform/xr/openxr/PlatformXROpenXR.cpp: (PlatformXR::Instance::Impl::enumerateApiLayerProperties const): Guard method with USE_OPENXR. (PlatformXR::Instance::Impl::enumerateInstanceExtensionProperties const): Ditto. (PlatformXR::Instance::Impl::Impl): Guard method body with USE_OPENXR. (PlatformXR::Instance::Impl::~Impl): Ditto. 2020-06-25 Chris Dumez Unreviewed iOS build fix after r263511. * platform/mediastream/MediaStreamPrivate.h: 2020-06-25 Youenn Fablet MediaRecorder stopRecorder() returns empty Blob after first use https://bugs.webkit.org/show_bug.cgi?id=212274 Reviewed by Eric Carlson. Refactor code to create/destroy MediaRecorderPrivate on MediaRecorder start/stop. This allows reusing a MediaRecorder after a stop and restarting with a clean state. We introduce MediaRecorderPrivate::startRecording to do the initialization, which allows to fix a potential ref cycle as part of the error callback handling. Make some improvements to the platform implementation, in particular add default initialization to all fields. Align the code using AudioConverterRef to what is done in AudioSampleDataSource. Also call VTCompressionSessionInvalidate when destroying the VideoSampleBufferCompressor. Test: http/wpt/mediarecorder/MediaRecorder-multiple-start-stop.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::startRecording): (WebCore::MediaRecorder::stopRecording): (WebCore::MediaRecorder::requestData): * Modules/mediarecorder/MediaRecorder.h: * platform/mediarecorder/MediaRecorderPrivate.h: (WebCore::MediaRecorderPrivate::startRecording): * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: (WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor): (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription): (WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded): (WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount): (WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets): (WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime): * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::stopRecording): * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: (WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor): 2020-06-25 Zalan Bujtas [LFC][TFC] Use the flexing value as the base for the available horizontal space distribution https://bugs.webkit.org/show_bug.cgi?id=213599 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/table-min-max-flex-distribution-simple.html * layout/tableformatting/TableLayout.cpp: (WebCore::Layout::TableFormattingContext::TableLayout::distributedHorizontalSpace): 2020-06-25 Antoine Quint REGRESSION (r260360): easing curves are broken on JS-originated animations https://bugs.webkit.org/show_bug.cgi?id=213495 Reviewed by Darin Adler. Prior to Web Animations, there was no way for an animation to set an animation-wide timing function while also setting a per-keyframe timing function. As such GraphicsLayerCA would sometimes decide to set the timing function on keyframes or on the entire CAAnimation. However, we can no longer do this with Web Animations where an animation can set an animation-wide timing function and also keyframe-specific timing functions. In this patch we create CAKeyframeAnimation objects for any animation that has at least two keyframes if Web Animations are enabled, whereas the legacy code path requires at least three keyframes. We allow PlatformCAAnimation::setTimingFunction() to be called in the Web Animations code path only under GraphicsLayerCA::setupAnimation() while leaving the only call sites in place only for the legacy code path. Finally, we modify GraphicsLayerCA::timingFunctionForAnimationValue() to only ever return a keyframe- specific timing function or fall back to a default linear timing function in the Web Animations code path, leaving the function to behave the same way as it used to in the legacy code path. Test: webanimations/accelerated-animation-with-easing.html * platform/animation/TimingFunction.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::isKeyframe): (WebCore::GraphicsLayerCA::createAnimationFromKeyframes): (WebCore::GraphicsLayerCA::appendToUncommittedAnimations): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): 2020-06-25 Sergio Villar Senin Unreviewed, WPE Debug build fix after r263503. * platform/xr/openxr/PlatformXROpenXR.cpp: (PlatformXR::OpenXRDevice::OpenXRDevice): Use m_instance instead of m_impl->xrInstance(). 2020-06-25 Alicia Boya García [GStreamer] Don't invalidate MainThreadNotifier until the streaming threads are joined https://bugs.webkit.org/show_bug.cgi?id=213197 Reviewed by Xabier Rodriguez-Calvar. ~MediaPlayerPrivateGStreamer() used to call m_notifier->invalidate() before setting the pipeline to NULL state. This caused a race where the streaming threads could post a task to the MainThreadNotifier between these two events and cause a crash in ASSERT(m_isValid.load()) -- that is, the notifier was used while invalidated. Fixing this is actually easy. ~MediaPlayerPrivateGStreamer() is always run from the main thread, so no MainThreadNotifier tasks will be run before the destructor is complete. By moving the m_notifier->invalidate() call to after the pipeline has been set to NULL (and therefore all streaming threads torn down) we are ensuring no more taks will be posted, and since the MainThreadNotifier is invalidated by that point, already posted tasks will not be run. The race fixed by this patch is rare and wide-arching, so this patch doesn't introduce TestExpectations changes, but it should avoid further crashes like the ones reported in the Bugzilla issue attached. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): 2020-06-23 Sergio Villar Senin [WebXR] Check device orientation support when requesting a reference space https://bugs.webkit.org/show_bug.cgi?id=213519 Reviewed by Carlos Garcia Campos. When requesting a local reference space the specs mandate us to check whether or not the device supports orientation tracking. This was not implemented in the OpenXR backend, so we were unconditionally returning true. The OpenXR devices now properly check whether or not orientation tracking is initialized. We took the chance to refactor a bit the OpenXR backend moving all the device initialization code to the OpenXRDevice class. The current tests already check this functionality. * Modules/webxr/WebXRSession.cpp: (WebCore::WebXRSession::referenceSpaceIsSupported const): Call supportsOrientationTracking() on device. * platform/xr/PlatformXR.h: (PlatformXR::Device::supportsOrientationTracking const): Added. * platform/xr/openxr/PlatformXROpenXR.cpp: (PlatformXR::Instance::enumerateImmersiveXRDevices): Just create the OpenXR device, it will automatically initialize itself. (PlatformXR::OpenXRDevice::OpenXRDevice): Get XrSystem and XrInstance as parametters. (PlatformXR::OpenXRDevice::collectSupportedSessionModes): Moved from Instance::Impl. (PlatformXR::Instance::Impl::collectSupportedSessionModes): Deleted. * platform/xr/openxr/PlatformXROpenXR.h: * testing/WebFakeXRDevice.h: Mark the SimulatedXRDevice as supporting orientation tracking. 2020-06-24 James Savage Upstream iPadOS 13.0 multi-window support https://bugs.webkit.org/show_bug.cgi?id=213590 Reviewed by Alexey Proskuryakov. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::doSetup): Always construct a UIWindow using the expected UIWindowScene. (makeWindowFromView): Deleted. 2020-06-24 Wenson Hsieh Running spellcheck on https://developer.apple.com/forums/thread/650317 hangs the web process https://bugs.webkit.org/show_bug.cgi?id=213585 Reviewed by Simon Fraser. In `TextCheckingHelper::findFirstMisspellingOrBadGrammar`, we attempt to find the first misspelled piece of text by iterating over the current paragraph range; when we exhaust the current paragraph range, we try to move on to the next paragraph range by setting the current paragraph range to the start and end of the next paragraph, using `startOfNextParagraph`. However, `startOfNextParagraph` may return the null position in some cases (as seen in this bug, and the associated layout test). This logic isn't robust against this possibility, and will end up looping infinitely in the while loop, since `setStart` and `setEnd` are no-ops when given a null position, and so the current paragraph remains the same. Make this logic for finding the next misspelled word more robust by allowing us to bail out of the while loop in the case where setStart or setEnd failed to advance the paragraph range (e.g. due to a null position, or DOM exception). Test: editing/mac/spelling/advance-to-next-misspelling.html * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): * testing/Internals.cpp: (WebCore::Internals::advanceToNextMisspelling): Add an internal testing hook to advance to the next misspelling. * testing/Internals.h: * testing/Internals.idl: 2020-06-24 David Kilzer Use ObjectIdentifier<>instead of WebCore::nextPlaybackTargetClientContextId() in Document.cpp Reviewed by Youenn Fablet. Switch from uint64_t to WebCore::PlaybackTargetClientContextIdentifier for contextId values. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: - Add PlaybackTargetClientContextIdentifier.h to the project. * Modules/mediasession/PlaybackTargetClientContextIdentifier.h: Add. * Modules/mediasession/WebMediaSessionManager.cpp: (WebCore::ClientState::ClientState): (WebCore::WebMediaSessionLogger::logAlways const): (WebCore::WebMediaSessionManager::addPlaybackTargetPickerClient): (WebCore::WebMediaSessionManager::removePlaybackTargetPickerClient): (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): (WebCore::WebMediaSessionManager::clientStateDidChange): (WebCore::WebMediaSessionManager::find): * Modules/mediasession/WebMediaSessionManager.h: * Modules/mediasession/WebMediaSessionManagerClient.h: * dom/Document.cpp: (WebCore::Document::addPlaybackTargetPickerClient): (WebCore::Document::removePlaybackTargetPickerClient): (WebCore::Document::playbackTargetAvailabilityDidChange): (WebCore::Document::setPlaybackTarget): (WebCore::Document::setShouldPlayToPlaybackTarget): (WebCore::Document::playbackTargetPickerWasDismissed): (WebCore::nextPlaybackTargetClientContextId): Delete. - Replace with PlaybackTargetClientContextIdentifier::generate(). * dom/Document.h: * page/ChromeClient.h: (WebCore::ChromeClient::addPlaybackTargetPickerClient): (WebCore::ChromeClient::removePlaybackTargetPickerClient): (WebCore::ChromeClient::showPlaybackTargetPicker): (WebCore::ChromeClient::playbackTargetPickerClientStateDidChange): * page/Page.cpp: (WebCore::Page::addPlaybackTargetPickerClient): (WebCore::Page::removePlaybackTargetPickerClient): (WebCore::Page::showPlaybackTargetPicker): (WebCore::Page::playbackTargetPickerClientStateDidChange): (WebCore::Page::setPlaybackTarget): (WebCore::Page::playbackTargetAvailabilityDidChange): (WebCore::Page::setShouldPlayToPlaybackTarget): (WebCore::Page::playbackTargetPickerWasDismissed): * page/Page.h: 2020-06-24 Clark Wang Removed unrestricted keyword from attributes in PannerNode https://bugs.webkit.org/show_bug.cgi?id=213523 Updated refDistance, maxDistance, rolloffFactor, coneOuterGain, coneInnerAngle, coneOuterAngle attributes according to spec: https://www.w3.org/TR/webaudio/#PannerNode-attributes. Reviewed by Darin Adler. Test: webaudio/prefixed-pannernode-basic.html * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::setRefDistance): (WebCore::PannerNode::setMaxDistance): (WebCore::PannerNode::setRolloffFactor): (WebCore::PannerNode::setConeOuterGain): * Modules/webaudio/PannerNode.h: * Modules/webaudio/PannerNode.idl: 2020-06-24 Peng Liu Black rectangle appears when closing PIP on iPhone https://bugs.webkit.org/show_bug.cgi?id=213570 Reviewed by Eric Carlson. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::willStopPictureInPicture): Don't unhide the window and view of WebAVPlayerViewController before exiting Picture-in-Picture. 2020-06-24 Simon Fraser REGRESSION (r260276): Scrolling through shelves on music.apple.com is not smooth https://bugs.webkit.org/show_bug.cgi?id=213572 Reviewed by Wenson Hsieh. The scroll position for an overflow:scroll element with scroll-snap could jump around during scrolling, if layout triggered a call to ScrollableArea::updateScrollSnapState(). The crux of the issue is that isScrollSnapInProgress() returned false for overflow:scrollers which are scrolling asynchronously. Fix by extending the existing ScrollingTree::isScrollSnapInProgress() to track all scrolling nodes by storing a HashSet rather than just a flag for the main frame. RenderLayer::isScrollSnapInProgress() then consults the ScrollingCoordinator, which consults the scrolling tree for this state. Add the ability to test via internals.isScrollSnapInProgress(). Test: fast/scrolling/mac/scroll-snapping-in-progress.html * dom/Document.h: * page/FrameView.cpp: (WebCore::FrameView::isScrollSnapInProgress const): The main thread can run snapping logic even for async-scrollable frames, so consult the ScrollingCoordinator and FrameView's ScrollAnimator. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::isScrollSnapInProgress const): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::isScrollSnapInProgress const): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::isScrollSnapInProgressForNode): (WebCore::ScrollingTree::setNodeScrollSnapInProgress): (WebCore::ScrollingTree::isScrollSnapInProgress): Deleted. (WebCore::ScrollingTree::setMainFrameIsScrollSnapping): Deleted. * page/scrolling/ScrollingTree.h: * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::setScrollSnapInProgress): (WebCore::ScrollingTreeScrollingNode::isScrollSnapInProgress const): * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::willStartScrollSnapAnimation): (WebCore::ScrollingTreeScrollingNodeDelegateMac::didStopScrollSnapAnimation): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::requestScrollPositionUpdate): (WebCore::RenderLayer::isScrollSnapInProgress const): (WebCore::RenderLayer::setupFontSubpixelQuantization): * testing/Internals.cpp: (WebCore:: const): (WebCore::Internals::scrollSnapOffsets): (WebCore::Internals::isScrollSnapInProgress): * testing/Internals.h: * testing/Internals.idl: 2020-06-24 Jason Lawrence Unreviewed, reverting r263466. This commit caused 50+ crashes on multiple queues internally. Reverted changeset: "REGRESSION (r260360): easing curves are broken on JS- originated animations" https://bugs.webkit.org/show_bug.cgi?id=213495 https://trac.webkit.org/changeset/263466 2020-06-24 Wenson Hsieh Allow the async clipboard API to write data when copying via menu action or key binding https://bugs.webkit.org/show_bug.cgi?id=213568 Reviewed by Darin Adler. Makes a couple of minor adjustments to allow `clipboard.write` and `clipboard.writeText` to work during a user- triggered copy event (that is, from menu or key binding). See below for more details. Test: editing/async-clipboard/clipboard-write-in-copy-event-handler.html * Modules/async-clipboard/Clipboard.cpp: (WebCore::shouldProceedWithClipboardWrite): Add a mechanism to keep track of when Editor is handling a copy or cut event that is the result of interacting with a key binding or menu action. Use this mechanism to grant write access via the async clipboard API. * editing/Editor.cpp: (WebCore::dispatchClipboardEvent): Only attempt to commit the static pasteboard to the platform pasteboard during a copy event when preventing default if the StaticPasteboard-backed DataTransfer actually contains data. This fixes a race condition when writing to the pasteboard using the async clipboard API during the "copy" event, where the changeCount when beginning to write is incremented due to the pasteboard getting cleared. This change will also make it so that calling `preventDefault()` on the copy event will result in no change to the system pasteboard, instead of clearing out any existing content on the pasteboard. (WebCore::Editor::cut): (WebCore::Editor::copy): * editing/Editor.h: (WebCore::Editor::isCopyingFromMenuOrKeyBinding const): * editing/EditorCommand.cpp: (WebCore::executeCopy): (WebCore::executeCut): 2020-06-24 Umar Iqbal We should resurrect the older patch that collects some statistics of web API calls https://bugs.webkit.org/show_bug.cgi?id=213319 Reviewed by Brent Fulgham. No new tests. Enabled existing tests. Enabled http/tests/webAPIStatistics that test the functionality behind WEB_API_STATISTICS flag. + Brought back WebCore::encodeHashSet(KeyedEncoder& encoder, const String& label, const String& key, const HashSet& hashSet) because it was needed by WebCore::encodeFontHashSet(KeyedEncoder& encoder, const String& label, const HashSet& hashSet) + Changed the type of HashCountedSet to HashSet because of earlier patch (https://bugs.webkit.org/attachment.cgi?id=363033) updated other HashCountedSet to HashSet, stating that the counted statistics were never used (see change log in the mentioned patch). + Also changed the type of topFrameRegistrableDomainsWhichAccessedWebAPIs HashSet from String to RegistrableDomain. See the earlier bug (https://bugs.webkit.org/show_bug.cgi?id=194791) that explains the switch from String to RegistrableDomain for eTLD+1's + Enabled WEB_API_STATISTICS flag in FeatureDefines.xcconfig and PlatformEnableCocoa.h + Added WTF::EnumTraits<> for OptionSet<> enum in ResourceLoadStatistics.h due to an earlier change. * loader/ResourceLoadStatistics.h: * Configurations/FeatureDefines.xcconfig: * loader/CanvasActivityRecord.h: * loader/ResourceLoadStatistics.cpp: (WebCore::encodeHashSet): (WebCore::ResourceLoadStatistics::encode const): (WebCore::decodeHashSet): (WebCore::decodeCanvasActivityRecord): (WebCore::ResourceLoadStatistics::decode): (WebCore::appendHashSet): (WebCore::ResourceLoadStatistics::toString const): 2020-06-24 Pinki Gyanchandani Null Ptr Deref READ @ WTF::Optional::clear https://bugs.webkit.org/show_bug.cgi?id=213543 Reviewed by Geoffrey Garen. While performing an animation request, the callback functions modifies the iframe's srcdoc attribute, leading to domWindow being null during rendering, and resulting into crash. Test: fast/rendering/iframe-window-animation-modifies-iframe-srcdoc-crash.html * page/Page.cpp: (WebCore::Page::updateRendering): 2020-06-24 Fujii Hironori [WinCairo] -webkit-font-smoothing:antialiased makes fonts blurry https://bugs.webkit.org/show_bug.cgi?id=206573 Reviewed by Alex Christensen. After -webkit-font-smoothing support was added to Cairo port in r254506 (Bug 54763), fonts looks jaggy and faint in WinCairo port in some web sites using -webkit-font-smoothing:antialiased, for example Google News, GMail, https://apple.com. 'antialiased' of -webkit-font-smoothing was mapped to CAIRO_ANTIALIAS_GRAY. And, CAIRO_ANTIALIAS_GRAY is mapped to ANTIALIASED_QUALITY in cairo-win32-font.c. ANTIALIASED_QUALITY makes fonts jaggy and faint. Use CAIRO_ANTIALIAS_SUBPIXEL instead of CAIRO_ANTIALIAS_GRAY for 'antialiased' as well as 'subpixel-antialiased' does. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::drawGlyphsToContext): Don't use CAIRO_ANTIALIAS_GRAY for Win32 Cairo. 2020-06-24 Antoine Quint REGRESSION (r260360): easing curves are broken on JS-originated animations https://bugs.webkit.org/show_bug.cgi?id=213495 Reviewed by Darin Adler. Prior to Web Animations, there was no way for an animation to set an animation-wide timing function while also setting a per-keyframe timing function. As such GraphicsLayerCA would sometimes decide to set the timing function on keyframes or on the entire CAAnimation. However, we can no longer do this with Web Animations where an animation can set an animation-wide timing function and also keyframe-specific timing functions. In this patch we create CAKeyframeAnimation objects for any animation that has at least two keyframes if Web Animations are enabled, whereas the legacy code path requires at least three keyframes. We allow PlatformCAAnimation::setTimingFunction() to be called in the Web Animations code path only under GraphicsLayerCA::setupAnimation() while leaving the only call sites in place only for the legacy code path. Finally, we modify GraphicsLayerCA::timingFunctionForAnimationValue() to only ever return a keyframe- specific timing function or fall back to a default linear timing function in the Web Animations code path, leaving the function to behave the same way as it used to in the legacy code path. Test: webanimations/accelerated-animation-with-easing.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::isKeyframe): (WebCore::GraphicsLayerCA::createAnimationFromKeyframes): (WebCore::GraphicsLayerCA::appendToUncommittedAnimations): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): 2020-06-24 Antoine Quint REGRESSION: Delayed updating of the parallax images on pacificvoyages.net/posts https://bugs.webkit.org/show_bug.cgi?id=212213 Reviewed by Simon Fraser. Test: webanimations/css-transition-retargeting-during-ready-promise.html When a transition's ready promise is resolved, its start time is the same as the timeline's current time. This means that retargeting a transition at that moment will yield a progress of zero even though the transition was started before the current animation frame. This means that retargeting a property on each page rendering may start a new transition with the same from value, which can have an undesirable effect such as on the website reported in this bug. We now keep track of the timeline time when a transition is created and use this time as a start time override when applying the animation to compute the before-change style in AnimationTimeline::updateCSSTransitionsForElementAndProperty(). To do so, we pass an optional start time all the way from WebAnimation::resolve() through to WebAnimation::currentTime() and via the animation effect timing computation. * animation/AnimationEffect.cpp: (WebCore::AnimationEffect::getBasicTiming const): (WebCore::AnimationEffect::getComputedTiming const): * animation/AnimationEffect.h: * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::updateCSSTransitionsForElementAndProperty): * animation/CSSTransition.cpp: (WebCore::CSSTransition::CSSTransition): (WebCore::CSSTransition::resolve): * animation/CSSTransition.h: * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::apply): * animation/KeyframeEffect.h: * animation/WebAnimation.cpp: (WebCore::WebAnimation::currentTime const): (WebCore::WebAnimation::resolve): * animation/WebAnimation.h: 2020-06-24 Eric Carlson Don't claim to support fullscreen mode unless fullScreenEnabled setting is enabled https://bugs.webkit.org/show_bug.cgi?id=213142 Reviewed by Jer Noble. Test: media/video-supports-fullscreen.html * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::supportsFullscreen const): Check settings.fullScreenEnabled. 2020-06-24 Philippe Normand [GStreamer] webrtc/disable-encryption.html is a crashing flaky https://bugs.webkit.org/show_bug.cgi?id=211166 Reviewed by Xabier Rodriguez-Calvar. Simplify the process to create internal appsrc elements. I suspect something bad was ongoing with these moves of GRefPtr. * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (WebCore::_WebKitMediaStreamSrc::SourceData::ensureAppSrc): (WebCore::webkitMediaStreamSrcSetupAppSrc): (WebCore::_WebKitMediaStreamSrc::SourceData::setSrc): Deleted. 2020-06-24 Antti Koivisto Style resolution sometimes fails to create all style resolvers for shadow trees. https://bugs.webkit.org/show_bug.cgi?id=212946 > Reviewed by Anders Carlsson. This can cause problems later. * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::Scope::Scope): Ensure all style resolvers are constructed before traversing. 2020-06-24 Youenn Fablet Add logging to WebRTC video pipeline to check for frame rate stability https://bugs.webkit.org/show_bug.cgi?id=213369 Reviewed by Eric Carlson. Add a FrameRateMonitor class to compute frame stability. Use this class at end of the video pipeline (LocalSampleBufferDisplayLayer). Log messages in case a frame gets frozen at LocalSampleBufferDisplayLayer time. We compute that a frame takes too long by checking whether it is delayed by more than three expected frames. This logging is complemented with encoded frame reception logging (at the beginning of the video pipeline) and WebRTC stats logging (freezeCount, totalFreezeDuration, shortly after decoding the frames). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/FrameRateMonitor.cpp: Added. (WebCore::FrameRateMonitor::newFrame): * platform/FrameRateMonitor.h: Added. (WebCore::FrameRateMonitor::frameRate const): (WebCore::FrameRateMonitor::frameCount const): (WebCore::FrameRateMonitor::FrameRateMonitor): * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.h: * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm: (WebCore::LocalSampleBufferDisplayLayer::LocalSampleBufferDisplayLayer): (WebCore::LocalSampleBufferDisplayLayer::enqueueSample): (WebCore::LocalSampleBufferDisplayLayer::enqueueSampleBuffer): (WebCore::LocalSampleBufferDisplayLayer::onFrameRateNotification): * platform/mediastream/mac/AudioMediaStreamTrackRendererUnit.h: Unified build fix. 2020-06-24 Alexey Shvayka Remove [CallbackNeedsOperatorEqual] extended attribute https://bugs.webkit.org/show_bug.cgi?id=213538 Reviewed by Chris Dumez. This change removes now unused [CallbackNeedsOperatorEqual] extended attribute. It was added to accommodate MediaQueryListListener, which was removed in r260243. We are safe to remove [CallbackNeedsOperatorEqual] since its implementation expects certain constructor signature, and callback interfaces are considered legacy by spec authors anyway. Also, this patch removes 2 resolved FIXMEs: 1. OrdinaryDefineOwnProperty() is performed correctly, no dynamic dispatch there. 2. Set() is performed correctly, with `false` as last argument. (changed in https://github.com/heycam/webidl/pull/832, covered by WPT) No new tests, no behavior change. * bindings/scripts/CodeGeneratorJS.pm: (GenerateDefineOwnProperty): (GenerateAttributeSetterBodyDefinition): (GenerateCallbackHeaderContent): (GenerateCallbackImplementationContent): * bindings/scripts/IDLAttributes.json: 2020-06-23 Sergio Villar Senin [WebXR] Fix PlatformXR initialization/destruction https://bugs.webkit.org/show_bug.cgi?id=213509 Reviewed by Youenn Fablet. There were two different issues, one at creation time and the other one at destruction. At creation time we were not calling construct() for the LazyNeverDestroyed object. That was making the WebProcess crash in Debug builds. At destruction time we were calling xrDestroyInstance() without checking that the passed instance was a valid one, although OpenXR implementations deal with it the spec is pretty clear. * platform/xr/PlatformXR.h: Mark LazyNeverDestroyed as friend and default constructor&destructor. * platform/xr/openxr/PlatformXROpenXR.cpp: (PlatformXR::Instance::Impl::~Impl): Check that instance is not XR_NULL_HANDLE before destroying. (PlatformXR::Instance::singleton): Call construct() on the Lazy instance. 2020-06-24 Youenn Fablet Use signalling thread as worker thread instead of network thread https://bugs.webkit.org/show_bug.cgi?id=213512 Reviewed by Eric Carlson. This is probably better since network thread is always busy while the siganlling thread is mostly busy at negotiation time. This also aligns with Chromium current setup. No change of behavior. * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::LibWebRTCProvider::createPeerConnectionFactory): 2020-06-24 Rob Buis Add referrerpolicy attribute support for https://bugs.webkit.org/show_bug.cgi?id=213342 Reviewed by Darin Adler. Give the referrer policy member a clear default. * loader/LinkLoader.h: 2020-06-23 Zalan Bujtas [Multicol] Reset the childrenInline state on the RenderBlockFlow when destroying the multicolumn context https://bugs.webkit.org/show_bug.cgi?id=213535 Reviewed by Simon Fraser. The "childrenInline" flags tells the tree builder whether a newly inserted inline content needs an anonymous block wrapper or not. RenderBlockFlows with multicolumn content have this flag set to false as the RenderMultiColumnFlowThread is a block renderer. As part of the mulicolumn context destruction, we move all the descendants from RenderMultiColumnFlowThread back to the original parent (the parent of the RenderMultiColumnFlowThread renderer). This patch sets this flag back to the initial value of true so that we don't end up constructing redundant wrappers for the incoming inline content. * rendering/updating/RenderTreeBuilderMultiColumn.cpp: (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow): 2020-06-23 Geoffrey Garen Remove WTF::setMainThreadCallbacksPaused https://bugs.webkit.org/show_bug.cgi?id=213112 Reviewed by Tim Horton. * inspector/PageScriptDebugServer.cpp: (WebCore::PageScriptDebugServer::setJavaScriptPaused): 2020-06-23 Chris Dumez Unreviewed, update xcfilelist files after some recent WebXR changes. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: 2020-06-23 Chris Dumez Remove a lot of unnecessary calls to Ref::copyRef() https://bugs.webkit.org/show_bug.cgi?id=213533 Reviewed by Darin Adler. Remove a lot of unnecessary calls to Ref::copyRef() now that Ref is copyable. * Modules/cache/DOMCache.cpp: (WebCore::DOMCache::addAll): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::doRequestOpenCursor): (WebCore::IDBTransaction::requestGetAllObjectStoreRecords): (WebCore::IDBTransaction::requestGetAllIndexRecords): (WebCore::IDBTransaction::requestGetRecord): (WebCore::IDBTransaction::requestIndexRecord): (WebCore::IDBTransaction::requestCount): (WebCore::IDBTransaction::requestDeleteRecord): (WebCore::IDBTransaction::requestClearObjectStore): (WebCore::IDBTransaction::requestPutOrAdd): * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp: (WebCore::CanvasCaptureMediaStreamTrack::Source::create): * Modules/webdatabase/Database.cpp: (WebCore::Database::scheduleTransactionCallback): * Modules/websockets/WorkerThreadableWebSocketChannel.cpp: (WebCore::WorkerThreadableWebSocketChannel::Peer::send): (WebCore::WorkerThreadableWebSocketChannel::Peer::bufferedAmount): (WebCore::WorkerThreadableWebSocketChannel::Peer::didConnect): (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessage): (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData): (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpdateBufferedAmount): (WebCore::WorkerThreadableWebSocketChannel::Peer::didStartClosingHandshake): (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose): (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError): (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpgradeURL): (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize): (WebCore::WorkerThreadableWebSocketChannel::Bridge::initialize): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::executeAsynchronousUserAgentScriptInWorld): * crypto/SubtleCrypto.cpp: (WebCore::SubtleCrypto::wrapKey): * loader/DocumentWriter.cpp: (WebCore::DocumentWriter::begin): * loader/NetscapePlugInStreamLoader.cpp: (WebCore::NetscapePlugInStreamLoader::create): * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::create): * platform/graphics/ImageSource.cpp: (WebCore::ImageSource::startAsyncDecodingQueue): * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequests): * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp: (WebCore::AudioMediaStreamTrackRendererCocoa::pushSamples): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::wrapCryptoKey): (WebCore::WorkerGlobalScope::unwrapCryptoKey): * workers/service/WorkerSWClientConnection.cpp: (WebCore::WorkerSWClientConnection::matchRegistration): (WebCore::WorkerSWClientConnection::getRegistrations): (WebCore::WorkerSWClientConnection::whenRegistrationReady): (WebCore::WorkerSWClientConnection::scheduleUnregisterJobInServer): * workers/service/context/ServiceWorkerFetch.cpp: (WebCore::ServiceWorkerFetch::dispatchFetchEvent): * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::queueTaskToFireFetchEvent): (WebCore::ServiceWorkerThread::queueTaskToPostMessage): (WebCore::ServiceWorkerThread::queueTaskToFireInstallEvent): (WebCore::ServiceWorkerThread::queueTaskToFireActivateEvent): 2020-06-23 Chris Dumez Drop AudioContextBase class https://bugs.webkit.org/show_bug.cgi?id=213522 Reviewed by Geoffrey Garen. Drop AudioContextBase class and have WebKitAudioContext subclass the new BaseAudioContext class instead. We recently introduced BaseAudioContext to match the specification and keeping AudioContextBase is now confusing. No new tests, this simplifies our code but there is no Web-facing behavior change. * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::AnalyserNode): * Modules/webaudio/AnalyserNode.h: * Modules/webaudio/AudioBasicInspectorNode.cpp: (WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode): * Modules/webaudio/AudioBasicInspectorNode.h: * Modules/webaudio/AudioBasicProcessorNode.cpp: (WebCore::AudioBasicProcessorNode::AudioBasicProcessorNode): * Modules/webaudio/AudioBasicProcessorNode.h: * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::create): (WebCore::AudioBufferSourceNode::AudioBufferSourceNode): (WebCore::AudioBufferSourceNode::setBuffer): * Modules/webaudio/AudioBufferSourceNode.h: * Modules/webaudio/AudioContext.cpp: * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::AudioDestinationNode): * Modules/webaudio/AudioDestinationNode.h: * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::AudioNode): (WebCore::AudioNode::connect): (WebCore::AudioNode::disconnect): (WebCore::AudioNode::setChannelCount): (WebCore::AudioNode::setChannelCountMode): (WebCore::AudioNode::setChannelInterpretation): (WebCore::AudioNode::enableOutputsIfNecessary): * Modules/webaudio/AudioNode.h: (WebCore::AudioNode::context): (WebCore::AudioNode::context const): * Modules/webaudio/AudioNode.idl: * Modules/webaudio/AudioNodeOutput.h: (WebCore::AudioNodeOutput::context): * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::AudioParam): * Modules/webaudio/AudioParam.h: * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::valueForContextTime): * Modules/webaudio/AudioParamTimeline.h: * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode): * Modules/webaudio/AudioScheduledSourceNode.h: * Modules/webaudio/AudioSummingJunction.cpp: (WebCore::AudioSummingJunction::AudioSummingJunction): * Modules/webaudio/AudioSummingJunction.h: (WebCore::AudioSummingJunction::context): * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::BaseAudioContext): (WebCore::BaseAudioContext::document const): (WebCore::BaseAudioContext::scriptExecutionContext const): * Modules/webaudio/BaseAudioContext.h: (WebCore::BaseAudioContext::isOfflineContext const): (WebCore::BaseAudioContext::isWebKitAudioContext const): (WebCore::BaseAudioContext::currentSampleFrame const): (WebCore::BaseAudioContext::currentTime const): (WebCore::BaseAudioContext::sampleRate const): (WebCore::BaseAudioContext::incrementConnectionCount): (WebCore::BaseAudioContext::setAudioThread): (WebCore::BaseAudioContext::isAudioThreadFinished): (WebCore::BaseAudioContext::behaviorRestrictions const): (WebCore::BaseAudioContext::addBehaviorRestriction): (WebCore::BaseAudioContext::removeBehaviorRestriction): (WebCore::BaseAudioContext::nextAudioNodeLogIdentifier): (WebCore::BaseAudioContext::nextAudioParameterLogIdentifier): (WebCore::BaseAudioContext::isStopped const): (WebCore::BaseAudioContext::AutoLocker::AutoLocker): (WebCore::BaseAudioContext::AutoLocker::~AutoLocker): * Modules/webaudio/BiquadFilterNode.cpp: (WebCore::BiquadFilterNode::BiquadFilterNode): * Modules/webaudio/BiquadFilterNode.h: * Modules/webaudio/BiquadProcessor.cpp: (WebCore::BiquadProcessor::BiquadProcessor): * Modules/webaudio/BiquadProcessor.h: * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::create): (WebCore::ChannelMergerNode::ChannelMergerNode): * Modules/webaudio/ChannelMergerNode.h: * Modules/webaudio/ChannelSplitterNode.cpp: (WebCore::ChannelSplitterNode::create): (WebCore::ChannelSplitterNode::ChannelSplitterNode): * Modules/webaudio/ChannelSplitterNode.h: * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::ConvolverNode): * Modules/webaudio/ConvolverNode.h: * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::DefaultAudioDestinationNode): * Modules/webaudio/DefaultAudioDestinationNode.h: * Modules/webaudio/DelayNode.cpp: (WebCore::DelayNode::DelayNode): (WebCore::DelayNode::create): * Modules/webaudio/DelayNode.h: * Modules/webaudio/DelayProcessor.cpp: (WebCore::DelayProcessor::DelayProcessor): * Modules/webaudio/DelayProcessor.h: * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::DynamicsCompressorNode): * Modules/webaudio/DynamicsCompressorNode.h: * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::GainNode): * Modules/webaudio/GainNode.h: * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::create): (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode): (WebCore::MediaElementAudioSourceNode::setFormat): * Modules/webaudio/MediaElementAudioSourceNode.h: * Modules/webaudio/MediaStreamAudioDestinationNode.cpp: (WebCore::MediaStreamAudioDestinationNode::create): (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode): * Modules/webaudio/MediaStreamAudioDestinationNode.h: * Modules/webaudio/MediaStreamAudioSourceNode.cpp: (WebCore::MediaStreamAudioSourceNode::create): (WebCore::MediaStreamAudioSourceNode::MediaStreamAudioSourceNode): * Modules/webaudio/MediaStreamAudioSourceNode.h: * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::OfflineAudioDestinationNode): * Modules/webaudio/OfflineAudioDestinationNode.h: * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::create): (WebCore::OscillatorNode::OscillatorNode): * Modules/webaudio/OscillatorNode.h: * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNodeBase::PannerNodeBase): * Modules/webaudio/PannerNode.h: * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::create): (WebCore::ScriptProcessorNode::ScriptProcessorNode): * Modules/webaudio/ScriptProcessorNode.h: * Modules/webaudio/WaveShaperNode.cpp: (WebCore::WaveShaperNode::WaveShaperNode): * Modules/webaudio/WaveShaperNode.h: * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::WebKitAudioContext): (WebCore::WebKitAudioContext::createMediaElementSource): (WebCore::WebKitAudioContext::createMediaStreamSource): (WebCore::WebKitAudioContext::createMediaStreamDestination): (WebCore::WebKitAudioContext::createWebKitPanner): (WebCore::WebKitAudioContext::close): * Modules/webaudio/WebKitAudioContext.h: (isType): * Modules/webaudio/WebKitAudioContext.idl: * dom/EventTargetFactory.in: * testing/Internals.cpp: (WebCore::Internals::setAudioContextRestrictions): * testing/Internals.h: * testing/Internals.idl: 2020-06-22 Sergio Villar Senin [WebXR] Introducing XRLayer https://bugs.webkit.org/show_bug.cgi?id=213462 Reviewed by Youenn Fablet. The most recent drafts of the WebXR spec have added a new object called XRLayer which is the base class of the already known XRWebGLLayer. The spec only defines the latter but future extensions might define some other layer subclasses. This patch fixes several checks in the IDL tests. * CMakeLists.txt: Added new files. * DerivedSources.make: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * Modules/webxr/WebXRLayer.cpp: Added. (WebCore::WebXRLayer::WebXRLayer): * Modules/webxr/WebXRLayer.h: Ditto. * Modules/webxr/WebXRLayer.idl: Ditto. * Modules/webxr/WebXRSession.h: Export scriptExecutionContext() so it could be used from the outside. * Modules/webxr/WebXRWebGLLayer.cpp: (WebCore::WebXRWebGLLayer::WebXRWebGLLayer): Call the superclass. * Modules/webxr/WebXRWebGLLayer.h: Inherit from WebXRLayer. * Modules/webxr/WebXRWebGLLayer.idl: Ditto. * Sources.txt: Added new files. * bindings/js/WebCoreBuiltinNames.h: Added XRLayer. * dom/EventTargetFactory.in: Ditto. 2020-06-23 Devin Rousso Keyframe animation doesn't 't show up in the Animations timeline https://bugs.webkit.org/show_bug.cgi?id=213441 Reviewed by Brian Burg. Test: inspector/animation/lifecycle-css-animation.html * inspector/agents/InspectorAnimationAgent.cpp: (WebCore::buildObjectForEffect): 2020-06-23 Sergio Villar Senin [css-flex] Allow indefinite size flex items to be definite wrt resolving percentages inside them https://bugs.webkit.org/show_bug.cgi?id=212264 Reviewed by Manuel Rego Casasnovas. Implement https://github.com/w3c/csswg-drafts/commit/5b5db39d21f3658ae2f4d7992daaf822aca178d8 which modified the way percentages were resolved in flexible items with indefinite sizes. From now on we can pretend that they're really definite. This allows us to mark 3 tests which were testing percentages in flex items as correct. Based on Blink's crrev.com/1247184 by This is a reland of r262124 which got reverted due to the bug fixed in r263389. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): Do only check flex container main size definiteness when computing the main size for percentage resolution, no need to check flex basis at all. 2020-06-18 Sergio Villar Senin REGRESSION (r262124): Twitter videos go blank after exiting fullscreen https://bugs.webkit.org/show_bug.cgi?id=213110 Reviewed by Darin Adler. Test: fullscreen/video-inside-flex-item.html Setting/unsetting position:absolute on a flex/grid item can potentially create/remove flex/grid items because absolutely positioned children of those containers are out-of-flow and thus, do not generate flex/grid items. Flex/grid items are potentially stretched by their containers so the style recalculation is not enough to get a correct layout because the override size set by flex/grid containers is not reset. In the particular case of this bug we had this hierarchy (highly simplified from twitter page): Flexbox container |___DIV (absolutelly positioned) |___